VTK  9.6.1
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
55
56#ifndef vtkDataObjectToDataSetFilter_h
57#define vtkDataObjectToDataSetFilter_h
58
59#include "vtkDataSetAlgorithm.h"
60#include "vtkFiltersCoreModule.h" // For export macro
61#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
62
63VTK_ABI_NAMESPACE_BEGIN
64class vtkCellArray;
65class vtkDataArray;
66class vtkDataSet;
67class vtkPointSet;
68class vtkPolyData;
73
75 : public vtkDataSetAlgorithm
76{
77public:
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
86
88
91 void SetDataSetType(int);
92 vtkGetMacro(DataSetType, int);
99
101
116
118
131 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
132 void SetPointComponent(int comp, const char* arrayName, int arrayComp)
133 {
134 this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
135 }
136 const char* GetPointComponentArrayName(int comp);
142
144
153 void SetVertsComponent(const char* arrayName, int arrayComp, int min, int max);
154 void SetVertsComponent(const char* arrayName, int arrayComp)
155 {
156 this->SetVertsComponent(arrayName, arrayComp, -1, -1);
157 }
162 void SetLinesComponent(const char* arrayName, int arrayComp, int min, int max);
163 void SetLinesComponent(const char* arrayName, int arrayComp)
164 {
165 this->SetLinesComponent(arrayName, arrayComp, -1, -1);
166 }
171 void SetPolysComponent(const char* arrayName, int arrayComp, int min, int max);
172 void SetPolysComponent(const char* arrayName, int arrayComp)
173 {
174 this->SetPolysComponent(arrayName, arrayComp, -1, -1);
175 }
180 void SetStripsComponent(const char* arrayName, int arrayComp, int min, int max);
181 void SetStripsComponent(const char* arrayName, int arrayComp)
182 {
183 this->SetStripsComponent(arrayName, arrayComp, -1, -1);
184 }
190
192
201 void SetCellTypeComponent(const char* arrayName, int arrayComp, int min, int max);
202 void SetCellTypeComponent(const char* arrayName, int arrayComp)
203 {
204 this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);
205 }
210 void SetCellConnectivityComponent(const char* arrayName, int arrayComp, int min, int max);
211 void SetCellConnectivityComponent(const char* arrayName, int arrayComp)
212 {
213 this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);
214 }
220
222
228 vtkBooleanMacro(DefaultNormalize, vtkTypeBool);
230
232
237 vtkSetVector3Macro(Dimensions, int);
238 vtkGetVectorMacro(Dimensions, int, 3);
240
242
246 vtkSetVector3Macro(Origin, double);
247 vtkGetVectorMacro(Origin, double, 3);
249
251
255 vtkSetVector3Macro(Spacing, double);
256 vtkGetVectorMacro(Spacing, double, 3);
258
260
266 void SetDimensionsComponent(const char* arrayName, int arrayComp, int min, int max);
267 void SetDimensionsComponent(const char* arrayName, int arrayComp)
268 {
269 this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);
270 }
271 void SetSpacingComponent(const char* arrayName, int arrayComp, int min, int max);
272 void SetSpacingComponent(const char* arrayName, int arrayComp)
273 {
274 this->SetSpacingComponent(arrayName, arrayComp, -1, -1);
275 }
276 void SetOriginComponent(const char* arrayName, int arrayComp, int min, int max);
277 void SetOriginComponent(const char* arrayName, int arrayComp)
278 {
279 this->SetOriginComponent(arrayName, arrayComp, -1, -1);
280 }
281
282
283protected:
286
288 vtkInformationVector*) override; // generate output data
291 int FillInputPortInformation(int port, vtkInformation* info) override;
293
295
296 // control flags used to generate the output dataset
297 int DataSetType; // the type of dataset to generate
298
299 // Support definition of points
300 char* PointArrays[3]; // the name of the arrays
301 int PointArrayComponents[3]; // the array components used for x-y-z
302 vtkIdType PointComponentRange[3][2]; // the range of the components to use
303 int PointNormalize[3]; // flags control normalization
304
305 // These define cells for vtkPolyData
306 char* VertsArray; // the name of the array
307 int VertsArrayComponent; // the array component
308 vtkIdType VertsComponentRange[2]; // the range of the components to use
309
310 char* LinesArray; // the name of the array
311 int LinesArrayComponent; // the array component used for cell types
312 vtkIdType LinesComponentRange[2]; // the range of the components to use
313
314 char* PolysArray; // the name of the array
315 int PolysArrayComponent; // the array component
316 vtkIdType PolysComponentRange[2]; // the range of the components to use
317
318 char* StripsArray; // the name of the array
319 int StripsArrayComponent; // the array component
320 vtkIdType StripsComponentRange[2]; // the range of the components to use
321
322 // Used to define vtkUnstructuredGrid datasets
323 char* CellTypeArray; // the name of the array
324 int CellTypeArrayComponent; // the array component used for cell types
325 vtkIdType CellTypeComponentRange[2]; // the range of the components to use
326
327 char* CellConnectivityArray; // the name of the array
328 int CellConnectivityArrayComponent; // the array components used for cell connectivity
329 vtkIdType CellConnectivityComponentRange[2]; // the range of the components to use
330
331 // helper methods (and attributes) to construct datasets
332 void SetArrayName(char*& name, char* newName);
338
339 // Default value for normalization
341
342 // Couple of different ways to specify dimensions, spacing, and origin.
344 double Origin[3];
345 double Spacing[3];
346
347 char* DimensionsArray; // the name of the array
348 int DimensionsArrayComponent; // the component of the array used for dimensions
349 vtkIdType DimensionsComponentRange[2]; // the ComponentRange of the array for the dimensions
350
351 char* OriginArray; // the name of the array
352 int OriginArrayComponent; // the component of the array used for Origins
353 vtkIdType OriginComponentRange[2]; // the ComponentRange of the array for the Origins
354
355 char* SpacingArray; // the name of the array
356 int SpacingArrayComponent; // the component of the array used for Spacings
357 vtkIdType SpacingComponentRange[2]; // the ComponentRange of the array for the Spacings
358
362
363private:
365 void operator=(const vtkDataObjectToDataSetFilter&) = delete;
366};
367
368VTK_ABI_NAMESPACE_END
369#endif
object to represent cell connectivity
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
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
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition vtkPointSet.h:59
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
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
#define vtkDataArray
int vtkIdType
Definition vtkType.h:368
@ VTK_RECTILINEAR_GRID
Definition vtkType.h:112
@ VTK_STRUCTURED_POINTS
Definition vtkType.h:110
@ VTK_UNSTRUCTURED_GRID
Definition vtkType.h:113
@ VTK_POLY_DATA
Definition vtkType.h:109
@ VTK_STRUCTURED_GRID
Definition vtkType.h:111
#define VTK_MARSHALAUTO
#define max(a, b)