VTK  9.5.20250913
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
81
82VTK_ABI_NAMESPACE_BEGIN
83class vtkCellArray;
84class vtkDataArray;
85class vtkDataSet;
86class vtkPointSet;
87class vtkPolyData;
92
94 : public vtkDataSetAlgorithm
95{
96public:
99 void PrintSelf(ostream& os, vtkIndent indent) override;
100
105
107
110 void SetDataSetType(int);
111 vtkGetMacro(DataSetType, int);
112 void SetDataSetTypeToPolyData() { this->SetDataSetType(VTK_POLY_DATA); }
114 void SetDataSetTypeToStructuredGrid() { this->SetDataSetType(VTK_STRUCTURED_GRID); }
118
120
135
137
150 int comp, const char* arrayName, int arrayComp, int min, int max, int normalize);
151 void SetPointComponent(int comp, const char* arrayName, int arrayComp)
152 {
153 this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);
154 }
155 const char* GetPointComponentArrayName(int comp);
161
163
172 void SetVertsComponent(const char* arrayName, int arrayComp, int min, int max);
173 void SetVertsComponent(const char* arrayName, int arrayComp)
174 {
175 this->SetVertsComponent(arrayName, arrayComp, -1, -1);
176 }
181 void SetLinesComponent(const char* arrayName, int arrayComp, int min, int max);
182 void SetLinesComponent(const char* arrayName, int arrayComp)
183 {
184 this->SetLinesComponent(arrayName, arrayComp, -1, -1);
185 }
190 void SetPolysComponent(const char* arrayName, int arrayComp, int min, int max);
191 void SetPolysComponent(const char* arrayName, int arrayComp)
192 {
193 this->SetPolysComponent(arrayName, arrayComp, -1, -1);
194 }
199 void SetStripsComponent(const char* arrayName, int arrayComp, int min, int max);
200 void SetStripsComponent(const char* arrayName, int arrayComp)
201 {
202 this->SetStripsComponent(arrayName, arrayComp, -1, -1);
203 }
209
211
220 void SetCellTypeComponent(const char* arrayName, int arrayComp, int min, int max);
221 void SetCellTypeComponent(const char* arrayName, int arrayComp)
222 {
223 this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);
224 }
229 void SetCellConnectivityComponent(const char* arrayName, int arrayComp, int min, int max);
230 void SetCellConnectivityComponent(const char* arrayName, int arrayComp)
231 {
232 this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);
233 }
239
241
245 vtkSetMacro(DefaultNormalize, vtkTypeBool);
246 vtkGetMacro(DefaultNormalize, vtkTypeBool);
247 vtkBooleanMacro(DefaultNormalize, vtkTypeBool);
249
251
256 vtkSetVector3Macro(Dimensions, int);
257 vtkGetVectorMacro(Dimensions, int, 3);
259
261
265 vtkSetVector3Macro(Origin, double);
266 vtkGetVectorMacro(Origin, double, 3);
268
270
274 vtkSetVector3Macro(Spacing, double);
275 vtkGetVectorMacro(Spacing, double, 3);
277
279
285 void SetDimensionsComponent(const char* arrayName, int arrayComp, int min, int max);
286 void SetDimensionsComponent(const char* arrayName, int arrayComp)
287 {
288 this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);
289 }
290 void SetSpacingComponent(const char* arrayName, int arrayComp, int min, int max);
291 void SetSpacingComponent(const char* arrayName, int arrayComp)
292 {
293 this->SetSpacingComponent(arrayName, arrayComp, -1, -1);
294 }
295 void SetOriginComponent(const char* arrayName, int arrayComp, int min, int max);
296 void SetOriginComponent(const char* arrayName, int arrayComp)
297 {
298 this->SetOriginComponent(arrayName, arrayComp, -1, -1);
299 }
301
302protected:
305
307 vtkInformationVector*) override; // generate output data
310 int FillInputPortInformation(int port, vtkInformation* info) override;
312
314
315 // control flags used to generate the output dataset
316 int DataSetType; // the type of dataset to generate
317
318 // Support definition of points
319 char* PointArrays[3]; // the name of the arrays
320 int PointArrayComponents[3]; // the array components used for x-y-z
321 vtkIdType PointComponentRange[3][2]; // the range of the components to use
322 int PointNormalize[3]; // flags control normalization
323
324 // These define cells for vtkPolyData
325 char* VertsArray; // the name of the array
326 int VertsArrayComponent; // the array component
327 vtkIdType VertsComponentRange[2]; // the range of the components to use
328
329 char* LinesArray; // the name of the array
330 int LinesArrayComponent; // the array component used for cell types
331 vtkIdType LinesComponentRange[2]; // the range of the components to use
332
333 char* PolysArray; // the name of the array
334 int PolysArrayComponent; // the array component
335 vtkIdType PolysComponentRange[2]; // the range of the components to use
336
337 char* StripsArray; // the name of the array
338 int StripsArrayComponent; // the array component
339 vtkIdType StripsComponentRange[2]; // the range of the components to use
340
341 // Used to define vtkUnstructuredGrid datasets
342 char* CellTypeArray; // the name of the array
343 int CellTypeArrayComponent; // the array component used for cell types
344 vtkIdType CellTypeComponentRange[2]; // the range of the components to use
345
346 char* CellConnectivityArray; // the name of the array
347 int CellConnectivityArrayComponent; // the array components used for cell connectivity
348 vtkIdType CellConnectivityComponentRange[2]; // the range of the components to use
349
350 // helper methods (and attributes) to construct datasets
351 void SetArrayName(char*& name, char* newName);
357
358 // Default value for normalization
360
361 // Couple of different ways to specify dimensions, spacing, and origin.
362 int Dimensions[3];
363 double Origin[3];
364 double Spacing[3];
365
366 char* DimensionsArray; // the name of the array
367 int DimensionsArrayComponent; // the component of the array used for dimensions
368 vtkIdType DimensionsComponentRange[2]; // the ComponentRange of the array for the dimensions
369
370 char* OriginArray; // the name of the array
371 int OriginArrayComponent; // the component of the array used for Origins
372 vtkIdType OriginComponentRange[2]; // the ComponentRange of the array for the Origins
373
374 char* SpacingArray; // the name of the array
375 int SpacingArrayComponent; // the component of the array used for Spacings
376 vtkIdType SpacingComponentRange[2]; // the ComponentRange of the array for the Spacings
377
381
382private:
384 void operator=(const vtkDataObjectToDataSetFilter&) = delete;
385};
386
387VTK_ABI_NAMESPACE_END
388#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:333
@ VTK_RECTILINEAR_GRID
Definition vtkType.h:79
@ VTK_STRUCTURED_POINTS
Definition vtkType.h:77
@ VTK_UNSTRUCTURED_GRID
Definition vtkType.h:80
@ VTK_POLY_DATA
Definition vtkType.h:76
@ VTK_STRUCTURED_GRID
Definition vtkType.h:78
#define VTK_MARSHALAUTO
#define max(a, b)