VTK  9.4.20241217
vtkDataObjectToDataSetFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
75#ifndef vtkDataObjectToDataSetFilter_h
76#define vtkDataObjectToDataSetFilter_h
77
78#include "vtkDataSetAlgorithm.h"
79#include "vtkFiltersCoreModule.h" // For export macro
80
81VTK_ABI_NAMESPACE_BEGIN
82class vtkCellArray;
83class vtkDataArray;
84class vtkDataSet;
85class vtkPointSet;
86class vtkPolyData;
91
92class VTKFILTERSCORE_EXPORT vtkDataObjectToDataSetFilter : public vtkDataSetAlgorithm
93{
94public:
97 void PrintSelf(ostream& os, vtkIndent indent) override;
98
103
105
108 void SetDataSetType(int);
109 vtkGetMacro(DataSetType, int);
110 void SetDataSetTypeToPolyData() { this->SetDataSetType(VTK_POLY_DATA); }
112 void SetDataSetTypeToStructuredGrid() { this->SetDataSetType(VTK_STRUCTURED_GRID); }
116
118
133
135
148 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
149 void SetPointComponent(int comp, const char* arrayName, int arrayComp)
150 {
151 this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
152 }
153 const char* GetPointComponentArrayName(int comp);
159
161
170 void SetVertsComponent(const char* arrayName, int arrayComp, int min, int max);
171 void SetVertsComponent(const char* arrayName, int arrayComp)
172 {
173 this->SetVertsComponent(arrayName, arrayComp, -1, -1);
174 }
179 void SetLinesComponent(const char* arrayName, int arrayComp, int min, int max);
180 void SetLinesComponent(const char* arrayName, int arrayComp)
181 {
182 this->SetLinesComponent(arrayName, arrayComp, -1, -1);
183 }
188 void SetPolysComponent(const char* arrayName, int arrayComp, int min, int max);
189 void SetPolysComponent(const char* arrayName, int arrayComp)
190 {
191 this->SetPolysComponent(arrayName, arrayComp, -1, -1);
192 }
197 void SetStripsComponent(const char* arrayName, int arrayComp, int min, int max);
198 void SetStripsComponent(const char* arrayName, int arrayComp)
199 {
200 this->SetStripsComponent(arrayName, arrayComp, -1, -1);
201 }
207
209
218 void SetCellTypeComponent(const char* arrayName, int arrayComp, int min, int max);
219 void SetCellTypeComponent(const char* arrayName, int arrayComp)
220 {
221 this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);
222 }
227 void SetCellConnectivityComponent(const char* arrayName, int arrayComp, int min, int max);
228 void SetCellConnectivityComponent(const char* arrayName, int arrayComp)
229 {
230 this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);
231 }
237
239
243 vtkSetMacro(DefaultNormalize, vtkTypeBool);
244 vtkGetMacro(DefaultNormalize, vtkTypeBool);
245 vtkBooleanMacro(DefaultNormalize, vtkTypeBool);
247
249
254 vtkSetVector3Macro(Dimensions, int);
255 vtkGetVectorMacro(Dimensions, int, 3);
257
259
263 vtkSetVector3Macro(Origin, double);
264 vtkGetVectorMacro(Origin, double, 3);
266
268
272 vtkSetVector3Macro(Spacing, double);
273 vtkGetVectorMacro(Spacing, double, 3);
275
277
283 void SetDimensionsComponent(const char* arrayName, int arrayComp, int min, int max);
284 void SetDimensionsComponent(const char* arrayName, int arrayComp)
285 {
286 this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);
287 }
288 void SetSpacingComponent(const char* arrayName, int arrayComp, int min, int max);
289 void SetSpacingComponent(const char* arrayName, int arrayComp)
290 {
291 this->SetSpacingComponent(arrayName, arrayComp, -1, -1);
292 }
293 void SetOriginComponent(const char* arrayName, int arrayComp, int min, int max);
294 void SetOriginComponent(const char* arrayName, int arrayComp)
295 {
296 this->SetOriginComponent(arrayName, arrayComp, -1, -1);
297 }
299
300protected:
303
305 vtkInformationVector*) override; // generate output data
308 int FillInputPortInformation(int port, vtkInformation* info) override;
310
312
313 // control flags used to generate the output dataset
314 int DataSetType; // the type of dataset to generate
315
316 // Support definition of points
317 char* PointArrays[3]; // the name of the arrays
318 int PointArrayComponents[3]; // the array components used for x-y-z
319 vtkIdType PointComponentRange[3][2]; // the range of the components to use
320 int PointNormalize[3]; // flags control normalization
321
322 // These define cells for vtkPolyData
323 char* VertsArray; // the name of the array
324 int VertsArrayComponent; // the array component
325 vtkIdType VertsComponentRange[2]; // the range of the components to use
326
327 char* LinesArray; // the name of the array
328 int LinesArrayComponent; // the array component used for cell types
329 vtkIdType LinesComponentRange[2]; // the range of the components to use
330
331 char* PolysArray; // the name of the array
332 int PolysArrayComponent; // the array component
333 vtkIdType PolysComponentRange[2]; // the range of the components to use
334
335 char* StripsArray; // the name of the array
336 int StripsArrayComponent; // the array component
337 vtkIdType StripsComponentRange[2]; // the range of the components to use
338
339 // Used to define vtkUnstructuredGrid datasets
340 char* CellTypeArray; // the name of the array
341 int CellTypeArrayComponent; // the array component used for cell types
342 vtkIdType CellTypeComponentRange[2]; // the range of the components to use
343
344 char* CellConnectivityArray; // the name of the array
345 int CellConnectivityArrayComponent; // the array components used for cell connectivity
346 vtkIdType CellConnectivityComponentRange[2]; // the range of the components to use
347
348 // helper methods (and attributes) to construct datasets
349 void SetArrayName(char*& name, char* newName);
355
356 // Default value for normalization
358
359 // Couple of different ways to specify dimensions, spacing, and origin.
360 int Dimensions[3];
361 double Origin[3];
362 double Spacing[3];
363
364 char* DimensionsArray; // the name of the array
365 int DimensionsArrayComponent; // the component of the array used for dimensions
366 vtkIdType DimensionsComponentRange[2]; // the ComponentRange of the array for the dimensions
367
368 char* OriginArray; // the name of the array
369 int OriginArrayComponent; // the component of the array used for Origins
370 vtkIdType OriginComponentRange[2]; // the ComponentRange of the array for the Origins
371
372 char* SpacingArray; // the name of the array
373 int SpacingArrayComponent; // the component of the array used for Spacings
374 vtkIdType SpacingComponentRange[2]; // the ComponentRange of the array for the Spacings
375
379
380private:
382 void operator=(const vtkDataObjectToDataSetFilter&) = delete;
383};
384
385VTK_ABI_NAMESPACE_END
386#endif
object to represent cell connectivity
abstract superclass for arrays of numeric data
map field data to concrete dataset
void SetCellTypeComponent(const char *arrayName, int arrayComp, int min, int max)
Define cell types and cell connectivity when creating unstructured grid data.
int GetPointComponentMaxRange(int comp)
Define the component of the field to be used for the x, y, and z values of the points.
void SetLinesComponent(const char *arrayName, int arrayComp)
Define cell connectivity when creating vtkPolyData.
void SetStripsComponent(const char *arrayName, int arrayComp)
Define cell connectivity when creating vtkPolyData.
void SetArrayName(char *&name, char *newName)
void SetCellConnectivityComponent(const char *arrayName, int arrayComp)
Define cell types and cell connectivity when creating unstructured grid data.
int GetCellConnectivityComponentMinRange()
Define cell types and cell connectivity when creating unstructured grid data.
const char * GetVertsComponentArrayName()
Define cell connectivity when creating vtkPolyData.
void SetPointComponent(int comp, const char *arrayName, int arrayComp, int min, int max, int normalize)
Define the component of the field to be used for the x, y, and z values of the points.
int GetLinesComponentArrayComponent()
Define cell connectivity when creating vtkPolyData.
int GetPointComponentNormailzeFlag(int comp)
Define the component of the field to be used for the x, y, and z values of the points.
int GetCellConnectivityComponentMaxRange()
Define cell types and cell connectivity when creating unstructured grid data.
void SetOriginComponent(const char *arrayName, int arrayComp, int min, int max)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
void SetDataSetTypeToRectilinearGrid()
Control what type of data is generated for output.
const char * GetPointComponentArrayName(int comp)
Define the component of the field to be used for the x, y, and z values of the points.
int GetStripsComponentMinRange()
Define cell connectivity when creating vtkPolyData.
int GetStripsComponentArrayComponent()
Define cell connectivity when creating vtkPolyData.
int GetPointComponentArrayComponent(int comp)
Define the component of the field to be used for the x, y, and z values of the points.
vtkCellArray * ConstructCellArray(vtkDataArray *da, int comp, vtkIdType compRange[2])
int ConstructCells(vtkDataObject *input, vtkPolyData *pd)
static vtkDataObjectToDataSetFilter * New()
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to create empty output data ob...
void SetSpacingComponent(const char *arrayName, int arrayComp)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
void SetStripsComponent(const char *arrayName, int arrayComp, int min, int max)
Define cell connectivity when creating vtkPolyData.
const char * GetCellTypeComponentArrayName()
Define cell types and cell connectivity when creating unstructured grid data.
int GetStripsComponentMaxRange()
Define cell connectivity when creating vtkPolyData.
int GetLinesComponentMinRange()
Define cell connectivity when creating vtkPolyData.
void SetDimensionsComponent(const char *arrayName, int arrayComp, int min, int max)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
void SetSpacingComponent(const char *arrayName, int arrayComp, int min, int max)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
void SetDataSetTypeToUnstructuredGrid()
Control what type of data is generated for output.
void SetDataSetTypeToStructuredGrid()
Control what type of data is generated for output.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
~vtkDataObjectToDataSetFilter() override
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
void SetDataSetTypeToStructuredPoints()
Control what type of data is generated for output.
void SetPointComponent(int comp, const char *arrayName, int arrayComp)
Define the component of the field to be used for the x, y, and z values of the points.
int GetPolysComponentArrayComponent()
Define cell connectivity when creating vtkPolyData.
vtkRectilinearGrid * GetRectilinearGridOutput()
Get the output in different forms.
vtkDataSet * GetOutput()
Get the output in different forms.
vtkIdType ConstructPoints(vtkDataObject *input, vtkPointSet *ps)
void SetCellConnectivityComponent(const char *arrayName, int arrayComp, int min, int max)
Define cell types and cell connectivity when creating unstructured grid data.
void SetCellTypeComponent(const char *arrayName, int arrayComp)
Define cell types and cell connectivity when creating unstructured grid data.
int GetPointComponentMinRange(int comp)
Define the component of the field to be used for the x, y, and z values of the points.
vtkStructuredGrid * GetStructuredGridOutput()
Get the output in different forms.
void ConstructOrigin(vtkDataObject *input)
void ConstructSpacing(vtkDataObject *input)
int GetCellTypeComponentArrayComponent()
Define cell types and cell connectivity when creating unstructured grid data.
int GetVertsComponentMinRange()
Define cell connectivity when creating vtkPolyData.
int GetCellTypeComponentMinRange()
Define cell types and cell connectivity when creating unstructured grid data.
const char * GetStripsComponentArrayName()
Define cell connectivity when creating vtkPolyData.
void SetLinesComponent(const char *arrayName, int arrayComp, int min, int max)
Define cell connectivity when creating vtkPolyData.
int GetPolysComponentMaxRange()
Define cell connectivity when creating vtkPolyData.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkUnstructuredGrid * GetUnstructuredGridOutput()
Get the output in different forms.
const char * GetPolysComponentArrayName()
Define cell connectivity when creating vtkPolyData.
void SetDataSetTypeToPolyData()
Control what type of data is generated for output.
void SetVertsComponent(const char *arrayName, int arrayComp)
Define cell connectivity when creating vtkPolyData.
int ConstructCells(vtkDataObject *input, vtkUnstructuredGrid *ug)
int GetLinesComponentMaxRange()
Define cell connectivity when creating vtkPolyData.
vtkDataSet * GetOutput(int idx)
Get the output in different forms.
vtkDataObject * GetInput()
Get the input to the filter.
void SetPolysComponent(const char *arrayName, int arrayComp, int min, int max)
Define cell connectivity when creating vtkPolyData.
vtkPolyData * GetPolyDataOutput()
Get the output in different forms.
int GetPolysComponentMinRange()
Define cell connectivity when creating vtkPolyData.
void SetPolysComponent(const char *arrayName, int arrayComp)
Define cell connectivity when creating vtkPolyData.
void ConstructDimensions(vtkDataObject *input)
int GetCellTypeComponentMaxRange()
Define cell types and cell connectivity when creating unstructured grid data.
vtkStructuredPoints * GetStructuredPointsOutput()
Get the output in different forms.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType ConstructPoints(vtkDataObject *input, vtkRectilinearGrid *rg)
void SetOriginComponent(const char *arrayName, int arrayComp)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
void SetVertsComponent(const char *arrayName, int arrayComp, int min, int max)
Define cell connectivity when creating vtkPolyData.
void SetDataSetType(int)
Control what type of data is generated for output.
int GetVertsComponentMaxRange()
Define cell connectivity when creating vtkPolyData.
int GetVertsComponentArrayComponent()
Define cell connectivity when creating vtkPolyData.
void SetDimensionsComponent(const char *arrayName, int arrayComp)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
const char * GetLinesComponentArrayName()
Define cell connectivity when creating vtkPolyData.
const char * GetCellConnectivityComponentArrayName()
Define cell types and cell connectivity when creating unstructured grid data.
int GetCellConnectivityComponentArrayComponent()
Define cell types and cell connectivity when creating unstructured grid data.
general representation of visualization data
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition vtkPointSet.h:98
concrete dataset represents vertices, lines, polygons, and triangle strips
a dataset that is topologically regular with variable spacing in the three coordinate directions
topologically regular array of data
A subclass of ImageData.
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315
#define VTK_RECTILINEAR_GRID
Definition vtkType.h:68
#define VTK_UNSTRUCTURED_GRID
Definition vtkType.h:69
#define VTK_STRUCTURED_GRID
Definition vtkType.h:67
#define VTK_POLY_DATA
Definition vtkType.h:65
#define VTK_STRUCTURED_POINTS
Definition vtkType.h:66
#define max(a, b)