1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkExtractSelectedArraysOverTime
* @brief extracts a selection over time.
*
* vtkExtractSelectedArraysOverTime extracts a selection over time.
* This is combination of two filters, an vtkExtractSelection filter followed by
* vtkExtractDataArraysOverTime, to do its work.
*
* The filter has two inputs - 0th input is the temporal data to extracted,
* while the second input is the selection (vtkSelection) to extract. Based on
* the type of the selection, this filter setups up properties on the internal
* vtkExtractDataArraysOverTime instance to produce a reasonable extract.
*
* The output is a vtkMultiBlockDataSet. See vtkExtractDataArraysOverTime for
* details on how the output is structured.
*/
#ifndef vtkExtractSelectedArraysOverTime_h
#define vtkExtractSelectedArraysOverTime_h
#include "vtkFiltersExtractionModule.h" // For export macro
#include "vtkMultiBlockDataSetAlgorithm.h"
#include "vtkSmartPointer.h" // for vtkSmartPointer.
VTK_ABI_NAMESPACE_BEGIN
class vtkDataSet;
class vtkDataSetAttributes;
class vtkExtractDataArraysOverTime;
class vtkExtractSelection;
class vtkSelection;
class vtkTable;
class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelectedArraysOverTime
: public vtkMultiBlockDataSetAlgorithm
{
public:
static vtkExtractSelectedArraysOverTime* New();
vtkTypeMacro(vtkExtractSelectedArraysOverTime, vtkMultiBlockDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;
///@{
/**
* Get the number of time steps
*/
vtkGetMacro(NumberOfTimeSteps, int);
///@}
/**
* Convenience method to specify the selection connection (2nd input
* port)
*/
void SetSelectionConnection(vtkAlgorithmOutput* algOutput)
{
this->SetInputConnection(1, algOutput);
}
///@{
/**
* Set/get the vtkExtractSelection instance used to obtain
* array values at each time step. By default, vtkExtractSelection is used.
*/
virtual void SetSelectionExtractor(vtkExtractSelection*);
vtkExtractSelection* GetSelectionExtractor();
///@}
///@{
/**
* Instead of breaking a selection into a separate time-history
* table for each (block,ID)-tuple, you may call
* ReportStatisticsOnlyOn(). Then a single table per
* block of the input dataset will report the minimum, maximum,
* quartiles, and (for numerical arrays) the average and standard
* deviation of the selection over time.
* The default is off to preserve backwards-compatibility.
*/
vtkSetMacro(ReportStatisticsOnly, bool);
vtkGetMacro(ReportStatisticsOnly, bool);
vtkBooleanMacro(ReportStatisticsOnly, bool);
///@}
protected:
vtkExtractSelectedArraysOverTime();
~vtkExtractSelectedArraysOverTime() override;
int FillInputPortInformation(int port, vtkInformation* info) override;
int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) override;
int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) override;
int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) override;
virtual void PostExecute(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
/**
* Determines the FieldType and ContentType for the selection. If the
* selection is a vtkSelection::SELECTIONS selection, then this method ensures
* that all child nodes have the same field type and content type otherwise,
* it returns 0.
*/
int DetermineSelectionType(vtkSelection*);
int NumberOfTimeSteps;
int FieldType;
int ContentType;
bool ReportStatisticsOnly;
int Error;
enum Errors
{
NoError,
MoreThan1Indices
};
vtkSmartPointer<vtkExtractSelection> SelectionExtractor;
vtkSmartPointer<vtkExtractDataArraysOverTime> ArraysExtractor;
private:
vtkExtractSelectedArraysOverTime(const vtkExtractSelectedArraysOverTime&) = delete;
void operator=(const vtkExtractSelectedArraysOverTime&) = delete;
/**
* Applies the `SelectionExtractor` to extract the dataset to track
* and return it. This should be called for each time iteration.
*/
vtkSmartPointer<vtkDataObject> Extract(vtkInformationVector** inputV, vtkInformation* outInfo);
bool IsExecuting;
};
VTK_ABI_NAMESPACE_END
#endif
|