VTK
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=========================================================================*/
71#ifndef vtkDataObjectToDataSetFilter_h
72#define vtkDataObjectToDataSetFilter_h
73
74#include "vtkFiltersCoreModule.h" // For export macro
75#include "vtkDataSetAlgorithm.h"
76
77class vtkCellArray;
78class vtkDataArray;
79class vtkDataSet;
80class vtkPointSet;
81class vtkPolyData;
86
87class VTKFILTERSCORE_EXPORT vtkDataObjectToDataSetFilter : public vtkDataSetAlgorithm
88{
89public:
92 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
93
98
100
103 void SetDataSetType(int);
104 vtkGetMacro(DataSetType,int);
106 this->SetDataSetType(VTK_POLY_DATA);};
108 this->SetDataSetType(VTK_STRUCTURED_POINTS);};
110 this->SetDataSetType(VTK_STRUCTURED_GRID);};
112 this->SetDataSetType(VTK_RECTILINEAR_GRID);};
114 this->SetDataSetType(VTK_UNSTRUCTURED_GRID);};
116
118
133
135
147 void SetPointComponent(int comp, char *arrayName, int arrayComp,
148 int min, int max, int normalize);
149 void SetPointComponent(int comp, char *arrayName, int arrayComp)
150 {this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
151 const char *GetPointComponentArrayName(int comp);
157
159
168 void SetVertsComponent(char *arrayName, int arrayComp, int min, int max);
169 void SetVertsComponent(char *arrayName, int arrayComp)
170 {this->SetVertsComponent(arrayName, arrayComp, -1, -1);};
175 void SetLinesComponent(char *arrayName, int arrayComp, int min, int max);
176 void SetLinesComponent(char *arrayName, int arrayComp)
177 {this->SetLinesComponent(arrayName, arrayComp, -1, -1);};
182 void SetPolysComponent(char *arrayName, int arrayComp, int min, int max);
183 void SetPolysComponent(char *arrayName, int arrayComp)
184 {this->SetPolysComponent(arrayName, arrayComp, -1, -1);};
189 void SetStripsComponent(char *arrayName, int arrayComp, int min, int max);
190 void SetStripsComponent(char *arrayName, int arrayComp)
191 {this->SetStripsComponent(arrayName, arrayComp, -1, -1);};
197
199
208 void SetCellTypeComponent(char *arrayName, int arrayComp,
209 int min, int max);
210 void SetCellTypeComponent(char *arrayName, int arrayComp)
211 {this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);};
216 void SetCellConnectivityComponent(char *arrayName, int arrayComp,
217 int min, int max);
218 void SetCellConnectivityComponent(char *arrayName, int arrayComp)
219 {this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);};
225
227
231 vtkSetMacro(DefaultNormalize,int);
232 vtkGetMacro(DefaultNormalize,int);
233 vtkBooleanMacro(DefaultNormalize,int);
235
237
242 vtkSetVector3Macro(Dimensions,int);
243 vtkGetVectorMacro(Dimensions,int,3);
245
247
251 vtkSetVector3Macro(Origin,double);
252 vtkGetVectorMacro(Origin,double,3);
254
256
260 vtkSetVector3Macro(Spacing,double);
261 vtkGetVectorMacro(Spacing,double,3);
263
265
271 void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max);
272 void SetDimensionsComponent(char *arrayName, int arrayComp)
273 {this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);};
274 void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max);
275 void SetSpacingComponent(char *arrayName, int arrayComp)
276 {this->SetSpacingComponent(arrayName, arrayComp, -1, -1);};
277 void SetOriginComponent(char *arrayName, int arrayComp, int min, int max);
278 void SetOriginComponent(char *arrayName, int arrayComp)
279 {this->SetOriginComponent(arrayName, arrayComp, -1, -1);};
281
282protected:
285
286 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE; //generate output data
287 int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
288 int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
289 int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
290 int RequestDataObject(vtkInformation *, vtkInformationVector **,
291 vtkInformationVector *) VTK_OVERRIDE;
292
293 char Updating;
294
295 // control flags used to generate the output dataset
296 int DataSetType; //the type of dataset to generate
297
298 // Support definition of points
299 char *PointArrays[3]; //the name of the arrays
300 int PointArrayComponents[3]; //the array components used for x-y-z
301 vtkIdType PointComponentRange[3][2]; //the range of the components to use
302 int PointNormalize[3]; //flags control normalization
303
304 // These define cells for vtkPolyData
305 char *VertsArray; //the name of the array
306 int VertsArrayComponent; //the array component
307 vtkIdType VertsComponentRange[2]; //the range of the components to use
308
309 char *LinesArray; //the name of the array
310 int LinesArrayComponent; //the array component used for cell types
311 vtkIdType LinesComponentRange[2]; //the range of the components to use
312
313 char *PolysArray; //the name of the array
314 int PolysArrayComponent; //the array component
315 vtkIdType PolysComponentRange[2]; //the range of the components to use
316
317 char *StripsArray; //the name of the array
318 int StripsArrayComponent; //the array component
319 vtkIdType StripsComponentRange[2]; //the range of the components to use
320
321 // Used to define vtkUnstructuredGrid datasets
322 char *CellTypeArray; //the name of the array
323 int CellTypeArrayComponent; //the array component used for cell types
324 vtkIdType CellTypeComponentRange[2]; //the range of the components to use
325
326 char *CellConnectivityArray; //the name of the array
327 int CellConnectivityArrayComponent; //the array components used for cell connectivity
328 vtkIdType CellConnectivityComponentRange[2]; //the range of the components to use
329
330 // helper methods (and attributes) to construct datasets
331 void SetArrayName(char* &name, char *newName);
332 vtkIdType ConstructPoints(vtkDataObject *input, vtkPointSet *ps);
333 vtkIdType ConstructPoints(vtkDataObject *input, vtkRectilinearGrid *rg);
334 int ConstructCells(vtkDataObject *input, vtkPolyData *pd);
335 int ConstructCells(vtkDataObject *input, vtkUnstructuredGrid *ug);
336 vtkCellArray *ConstructCellArray(vtkDataArray *da, int comp,
337 vtkIdType compRange[2]);
338
339 // Default value for normalization
340 int DefaultNormalize;
341
342 // Couple of different ways to specify dimensions, spacing, and origin.
343 int Dimensions[3];
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
359 void ConstructDimensions(vtkDataObject *input);
360 void ConstructSpacing(vtkDataObject *input);
361 void ConstructOrigin(vtkDataObject *input);
362
363private:
365 void operator=(const vtkDataObjectToDataSetFilter&) VTK_DELETE_FUNCTION;
366};
367
368#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
map field data to concrete dataset
int GetPointComponentMaxRange(int comp)
const char * GetVertsComponentArrayName()
int GetPointComponentNormailzeFlag(int comp)
void SetCellConnectivityComponent(char *arrayName, int arrayComp, int min, int max)
void SetPointComponent(int comp, 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.
const char * GetPointComponentArrayName(int comp)
int GetPointComponentArrayComponent(int comp)
void SetVertsComponent(char *arrayName, int arrayComp, int min, int max)
Define cell connectivity when creating vtkPolyData.
static vtkDataObjectToDataSetFilter * New()
const char * GetCellTypeComponentArrayName()
void SetCellConnectivityComponent(char *arrayName, int arrayComp)
~vtkDataObjectToDataSetFilter() override
vtkRectilinearGrid * GetRectilinearGridOutput()
vtkDataSet * GetOutput()
Get the output in different forms.
void SetOriginComponent(char *arrayName, int arrayComp)
void SetVertsComponent(char *arrayName, int arrayComp)
void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max)
int GetPointComponentMinRange(int comp)
vtkStructuredGrid * GetStructuredGridOutput()
void SetCellTypeComponent(char *arrayName, int arrayComp)
void SetDimensionsComponent(char *arrayName, int arrayComp)
void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max)
Alternative methods to specify the dimensions, spacing, and origin for those datasets requiring this ...
const char * GetStripsComponentArrayName()
void SetPolysComponent(char *arrayName, int arrayComp)
vtkUnstructuredGrid * GetUnstructuredGridOutput()
const char * GetPolysComponentArrayName()
vtkDataSet * GetOutput(int idx)
vtkDataObject * GetInput()
Get the input to the filter.
vtkPolyData * GetPolyDataOutput()
void SetLinesComponent(char *arrayName, int arrayComp)
vtkStructuredPoints * GetStructuredPointsOutput()
void SetLinesComponent(char *arrayName, int arrayComp, int min, int max)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetCellTypeComponent(char *arrayName, int arrayComp, int min, int max)
Define cell types and cell connectivity when creating unstructured grid data.
void SetDataSetType(int)
Control what type of data is generated for output.
void SetStripsComponent(char *arrayName, int arrayComp)
void SetPointComponent(int comp, char *arrayName, int arrayComp)
void SetOriginComponent(char *arrayName, int arrayComp, int min, int max)
void SetSpacingComponent(char *arrayName, int arrayComp)
void SetPolysComponent(char *arrayName, int arrayComp, int min, int max)
const char * GetLinesComponentArrayName()
const char * GetCellConnectivityComponentArrayName()
int GetCellConnectivityComponentArrayComponent()
void SetStripsComponent(char *arrayName, int arrayComp, int min, int max)
general representation of visualization data
Definition: vtkDataObject.h:65
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:43
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
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:376
@ port
Definition: vtkX3D.h:447
@ name
Definition: vtkX3D.h:219
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
#define VTK_RECTILINEAR_GRID
Definition: vtkType.h:90
#define VTK_UNSTRUCTURED_GRID
Definition: vtkType.h:91
#define VTK_STRUCTURED_GRID
Definition: vtkType.h:89
#define VTK_POLY_DATA
Definition: vtkType.h:87
#define VTK_STRUCTURED_POINTS
Definition: vtkType.h:88
#define max(a, b)