TTK
Loading...
Searching...
No Matches
ttkExtract.h
Go to the documentation of this file.
1
46#pragma once
47
48// VTK Module
49#include <ttkExtractModule.h>
50
51// TTK includes
52#include <ttkAlgorithm.h>
53#include <ttkMacros.h>
54
55class TTKEXTRACT_EXPORT ttkExtract : public ttkAlgorithm {
56
57public:
58 enum class EXTRACTION_MODE {
59 AUTO = -1,
60 BLOCKS = 0,
61 ROWS = 1,
62 GEOMETRY = 2,
63 ARRAY_VALUES = 3,
64 ARRAYS = 4,
65 BLOCK_TUPLES = 5
66 };
67
68 enum class VALIDATION_MODE {
69 LESS_THEN = 0,
70 LESS_EQUAL_THEN = 1,
71 EQUAL = 2,
72 UNEQUAL = 3,
73 GREATER_EQUAL_THEN = 4,
74 GREATER_THEN = 5
75 };
76
77 enum class CELL_MODE { ALL = 0, ANY = 1 };
78
79private:
80 EXTRACTION_MODE ExtractionMode{EXTRACTION_MODE::AUTO};
81 VALIDATION_MODE ValidationMode{VALIDATION_MODE::EQUAL};
82 CELL_MODE CellMode{CELL_MODE::ALL};
83
84 int OutputType{-1};
85 std::string ExpressionString{""};
86 int ArrayAttributeType{0};
87 bool ExtractUniqueValues{true};
88 std::string OutputArrayName{"Data"};
89 int ImageExtent[6]{0, 0, 0, 0, 0, 0};
90 bool MaskOnly{false};
91
92public:
94 vtkGetEnumMacro(ExtractionMode, EXTRACTION_MODE);
95
97 vtkGetEnumMacro(ValidationMode, VALIDATION_MODE);
98
100 vtkGetEnumMacro(CellMode, CELL_MODE);
101
102 vtkSetMacro(MaskOnly, bool);
103 vtkGetMacro(MaskOnly, bool);
104
105 vtkSetMacro(OutputType, int);
106 vtkGetMacro(OutputType, int);
107
108 vtkSetMacro(ExpressionString, const std::string &);
109 vtkGetMacro(ExpressionString, std::string);
110
111 vtkSetMacro(ExtractUniqueValues, bool);
112 vtkGetMacro(ExtractUniqueValues, bool);
113
114 vtkSetMacro(ArrayAttributeType, int);
115 vtkGetMacro(ArrayAttributeType, int);
116
117 vtkSetMacro(OutputArrayName, const std::string &);
118 vtkGetMacro(OutputArrayName, std::string);
119
120 vtkSetVector6Macro(ImageExtent, int);
121 vtkGetVector6Macro(ImageExtent, int);
122
123 std::string GetVtkDataTypeName(const int outputType) const;
124
125 int ExtractBlocks(vtkDataObject *output,
126 vtkDataObject *input,
127 const std::vector<double> &indices,
128 const bool &extractTuples) const;
129
130 int ExtractRows(vtkDataObject *output,
131 vtkDataObject *input,
132 const std::vector<double> &indices) const;
133
134 int AddMaskArray(vtkDataObject *output,
135 vtkDataObject *input,
136 const std::vector<double> &labels);
137
138 int ExtractGeometry(vtkDataObject *output,
139 vtkDataObject *input,
140 const std::vector<double> &labels);
141
142 int ExtractArrayValues(vtkDataObject *output,
143 vtkDataObject *input,
144 const std::vector<double> &indices);
145
146 int ExtractArray(vtkDataObject *output,
147 vtkDataObject *input,
148 const std::vector<double> &indices);
149
150 static ttkExtract *New();
151 vtkTypeMacro(ttkExtract, ttkAlgorithm);
152
153protected:
154 ttkExtract();
155 ~ttkExtract() override;
156
157 int FillInputPortInformation(int port, vtkInformation *info) override;
158 int FillOutputPortInformation(int port, vtkInformation *info) override;
159
160 int RequestInformation(vtkInformation *request,
161 vtkInformationVector **inputVector,
162 vtkInformationVector *outputVector) override;
163 int RequestData(vtkInformation *request,
164 vtkInformationVector **inputVector,
165 vtkInformationVector *outputVector) override;
166};
Baseclass of all VTK filters that wrap ttk modules.
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
virtual int RequestInformation(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
int FillInputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
TTK VTK-filter that provides multiple methods to extract subsets of an input data object based on a l...
Definition ttkExtract.h:55
static ttkExtract * New()
~ttkExtract() override
#define ttkSetEnumMacro(name, enumType)
Definition ttkMacros.h:38