VTK  9.1.0
vtkDataObjectToDataSetFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDataObjectToDataSetFilter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
74#ifndef vtkDataObjectToDataSetFilter_h
75#define vtkDataObjectToDataSetFilter_h
76
77#include "vtkDataSetAlgorithm.h"
78#include "vtkFiltersCoreModule.h" // For export macro
79
80class vtkCellArray;
81class vtkDataArray;
82class vtkDataSet;
83class vtkPointSet;
84class vtkPolyData;
89
90class VTKFILTERSCORE_EXPORT vtkDataObjectToDataSetFilter : public vtkDataSetAlgorithm
91{
92public:
95 void PrintSelf(ostream& os, vtkIndent indent) override;
96
101
103
106 void SetDataSetType(int);
107 vtkGetMacro(DataSetType, int);
108 void SetDataSetTypeToPolyData() { this->SetDataSetType(VTK_POLY_DATA); }
110 void SetDataSetTypeToStructuredGrid() { this->SetDataSetType(VTK_STRUCTURED_GRID); }
114
116
131
133
146 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
147 void SetPointComponent(int comp, const char* arrayName, int arrayComp)
148 {
149 this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
150 }
151 const char* GetPointComponentArrayName(int comp);
157
159
168 void SetVertsComponent(const char* arrayName, int arrayComp, int min, int max);
169 void SetVertsComponent(const char* arrayName, int arrayComp)
170 {
171 this->SetVertsComponent(arrayName, arrayComp, -1, -1);
172 }
177 void SetLinesComponent(const char* arrayName, int arrayComp, int min, int max);
178 void SetLinesComponent(const char* arrayName, int arrayComp)
179 {
180 this->SetLinesComponent(arrayName, arrayComp, -1, -1);
181 }
186 void SetPolysComponent(const char* arrayName, int arrayComp, int min, int max);
187 void SetPolysComponent(const char* arrayName, int arrayComp)
188 {
189 this->SetPolysComponent(arrayName, arrayComp, -1, -1);
190 }
195 void SetStripsComponent(const char* arrayName, int arrayComp, int min, int max);
196 void SetStripsComponent(const char* arrayName, int arrayComp)
197 {
198 this->SetStripsComponent(arrayName, arrayComp, -1, -1);
199 }
205
207
216 void SetCellTypeComponent(const char* arrayName, int arrayComp, int min, int max);
217 void SetCellTypeComponent(const char* arrayName, int arrayComp)
218 {
219 this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);
220 }
225 void SetCellConnectivityComponent(const char* arrayName, int arrayComp, int min, int max);
226 void SetCellConnectivityComponent(const char* arrayName, int arrayComp)
227 {
228 this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);
229 }
235
237
241 vtkSetMacro(DefaultNormalize, vtkTypeBool);
242 vtkGetMacro(DefaultNormalize, vtkTypeBool);
243 vtkBooleanMacro(DefaultNormalize, vtkTypeBool);
245
247
252 vtkSetVector3Macro(Dimensions, int);
253 vtkGetVectorMacro(Dimensions, int, 3);
255
257
261 vtkSetVector3Macro(Origin, double);
262 vtkGetVectorMacro(Origin, double, 3);
264
266
270 vtkSetVector3Macro(Spacing, double);
271 vtkGetVectorMacro(Spacing, double, 3);
273
275
281 void SetDimensionsComponent(const char* arrayName, int arrayComp, int min, int max);
282 void SetDimensionsComponent(const char* arrayName, int arrayComp)
283 {
284 this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);
285 }
286 void SetSpacingComponent(const char* arrayName, int arrayComp, int min, int max);
287 void SetSpacingComponent(const char* arrayName, int arrayComp)
288 {
289 this->SetSpacingComponent(arrayName, arrayComp, -1, -1);
290 }
291 void SetOriginComponent(const char* arrayName, int arrayComp, int min, int max);
292 void SetOriginComponent(const char* arrayName, int arrayComp)
293 {
294 this->SetOriginComponent(arrayName, arrayComp, -1, -1);
295 }
297
298protected:
301
303 vtkInformationVector*) override; // generate output data
308
310
311 // control flags used to generate the output dataset
312 int DataSetType; // the type of dataset to generate
313
314 // Support definition of points
315 char* PointArrays[3]; // the name of the arrays
316 int PointArrayComponents[3]; // the array components used for x-y-z
317 vtkIdType PointComponentRange[3][2]; // the range of the components to use
318 int PointNormalize[3]; // flags control normalization
319
320 // These define cells for vtkPolyData
321 char* VertsArray; // the name of the array
322 int VertsArrayComponent; // the array component
323 vtkIdType VertsComponentRange[2]; // the range of the components to use
324
325 char* LinesArray; // the name of the array
326 int LinesArrayComponent; // the array component used for cell types
327 vtkIdType LinesComponentRange[2]; // the range of the components to use
328
329 char* PolysArray; // the name of the array
330 int PolysArrayComponent; // the array component
331 vtkIdType PolysComponentRange[2]; // the range of the components to use
332
333 char* StripsArray; // the name of the array
334 int StripsArrayComponent; // the array component
335 vtkIdType StripsComponentRange[2]; // the range of the components to use
336
337 // Used to define vtkUnstructuredGrid datasets
338 char* CellTypeArray; // the name of the array
339 int CellTypeArrayComponent; // the array component used for cell types
340 vtkIdType CellTypeComponentRange[2]; // the range of the components to use
341
342 char* CellConnectivityArray; // the name of the array
343 int CellConnectivityArrayComponent; // the array components used for cell connectivity
344 vtkIdType CellConnectivityComponentRange[2]; // the range of the components to use
345
346 // helper methods (and attributes) to construct datasets
347 void SetArrayName(char*& name, char* newName);
353
354 // Default value for normalization
356
357 // Couple of different ways to specify dimensions, spacing, and origin.
358 int Dimensions[3];
359 double Origin[3];
360 double Spacing[3];
361
362 char* DimensionsArray; // the name of the array
363 int DimensionsArrayComponent; // the component of the array used for dimensions
364 vtkIdType DimensionsComponentRange[2]; // the ComponentRange of the array for the dimensions
365
366 char* OriginArray; // the name of the array
367 int OriginArrayComponent; // the component of the array used for Origins
368 vtkIdType OriginComponentRange[2]; // the ComponentRange of the array for the Origins
369
370 char* SpacingArray; // the name of the array
371 int SpacingArrayComponent; // the component of the array used for Spacings
372 vtkIdType SpacingComponentRange[2]; // the ComponentRange of the array for the Spacings
373
377
378private:
380 void operator=(const vtkDataObjectToDataSetFilter&) = delete;
381};
382
383#endif
object to represent cell connectivity
Definition: vtkCellArray.h:190
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
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
Definition: vtkDataObject.h:69
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:66
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition: vtkPointSet.h:76
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
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
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ name
Definition: vtkX3D.h:225
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
#define VTK_RECTILINEAR_GRID
Definition: vtkType.h:80
#define VTK_UNSTRUCTURED_GRID
Definition: vtkType.h:81
#define VTK_STRUCTURED_GRID
Definition: vtkType.h:79
#define VTK_POLY_DATA
Definition: vtkType.h:77
#define VTK_STRUCTURED_POINTS
Definition: vtkType.h:78
#define max(a, b)