VTK  9.5.2
vtkGeometryFilter.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
80
81#ifndef vtkGeometryFilter_h
82#define vtkGeometryFilter_h
83
84#include "vtkFiltersGeometryModule.h" // For export macro
86
87#include <array> // For std::array
88
89VTK_ABI_NAMESPACE_BEGIN
96
97// Used to coordinate delegation to vtkDataSetSurfaceFilter
98struct VTKFILTERSGEOMETRY_EXPORT vtkGeometryFilterHelper
99{
110 using CellTypesInformation = std::array<bool, NUM_CELL_TYPES>;
112 unsigned char IsLinear;
117 {
118 return this->CellTypesInfo[VERTS] && !this->CellTypesInfo[LINES] &&
119 !this->CellTypesInfo[POLYS] && !this->CellTypesInfo[STRIPS] &&
120 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
121 }
123 {
124 return !this->CellTypesInfo[VERTS] && this->CellTypesInfo[LINES] &&
125 !this->CellTypesInfo[POLYS] && !this->CellTypesInfo[STRIPS] &&
126 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
127 }
129 {
130 return !this->CellTypesInfo[VERTS] && !this->CellTypesInfo[LINES] &&
131 this->CellTypesInfo[POLYS] && !this->CellTypesInfo[STRIPS] &&
132 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
133 }
135 {
136 return !this->CellTypesInfo[VERTS] && !this->CellTypesInfo[LINES] &&
137 !this->CellTypesInfo[POLYS] && this->CellTypesInfo[STRIPS] &&
138 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
139 }
140};
141
142class VTKFILTERSGEOMETRY_EXPORT vtkGeometryFilter : public vtkPolyDataAlgorithm
143{
144public:
146
151 void PrintSelf(ostream& os, vtkIndent indent) override;
153
155
158 vtkSetMacro(PointClipping, bool);
159 vtkGetMacro(PointClipping, bool);
160 vtkBooleanMacro(PointClipping, bool);
162
164
167 vtkSetMacro(CellClipping, bool);
168 vtkGetMacro(CellClipping, bool);
169 vtkBooleanMacro(CellClipping, bool);
171
173
176 vtkSetMacro(ExtentClipping, bool);
177 vtkGetMacro(ExtentClipping, bool);
178 vtkBooleanMacro(ExtentClipping, bool);
180
182
185 vtkSetClampMacro(PointMinimum, vtkIdType, 0, VTK_ID_MAX);
186 vtkGetMacro(PointMinimum, vtkIdType);
188
190
193 vtkSetClampMacro(PointMaximum, vtkIdType, 0, VTK_ID_MAX);
194 vtkGetMacro(PointMaximum, vtkIdType);
196
198
201 vtkSetClampMacro(CellMinimum, vtkIdType, 0, VTK_ID_MAX);
202 vtkGetMacro(CellMinimum, vtkIdType);
204
206
209 vtkSetClampMacro(CellMaximum, vtkIdType, 0, VTK_ID_MAX);
210 vtkGetMacro(CellMaximum, vtkIdType);
212
216 void SetExtent(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
217
219
222 void SetExtent(double extent[6]);
223 double* GetExtent() VTK_SIZEHINT(6) { return this->Extent; }
225
227
235 vtkSetMacro(Merging, bool);
236 vtkGetMacro(Merging, bool);
237 vtkBooleanMacro(Merging, bool);
239
241
248 void SetOutputPointsPrecision(int precision);
251
253
260 vtkSetMacro(FastMode, bool);
261 vtkGetMacro(FastMode, bool);
262 vtkBooleanMacro(FastMode, bool);
264
265 // The following are methods compatible with vtkDataSetSurfaceFilter.
266
268
273 vtkSetMacro(PieceInvariant, int);
274 vtkGetMacro(PieceInvariant, int);
276
278
289
291
302
304
310 vtkSetStringMacro(OriginalCellIdsName);
311 virtual const char* GetOriginalCellIdsName()
312 {
313 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
314 }
315 vtkSetStringMacro(OriginalPointIdsName);
316 virtual const char* GetOriginalPointIdsName()
317 {
318 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
319 }
320
321
323
338
340
351 vtkSetMacro(NonlinearSubdivisionLevel, int);
352 vtkGetMacro(NonlinearSubdivisionLevel, int);
354
356
365
367
370 vtkSetMacro(Delegation, vtkTypeBool);
371 vtkGetMacro(Delegation, vtkTypeBool);
372 vtkBooleanMacro(Delegation, vtkTypeBool);
374
376
387 vtkSetMacro(RemoveGhostInterfaces, bool);
388 vtkBooleanMacro(RemoveGhostInterfaces, bool);
389 vtkGetMacro(RemoveGhostInterfaces, bool);
391
393
400
402 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info, vtkPolyData* exc);
403 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
404
405 int StructuredExecute(vtkDataSet* input, vtkPolyData* output, int* wholeExtent, vtkPolyData* exc,
406 bool* extractFace = nullptr);
407 virtual int StructuredExecute(
408 vtkDataSet* input, vtkPolyData* output, int* wholeExt, bool* extractFace = nullptr);
409
411 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
413
414protected:
417
419 int FillInputPortInformation(int port, vtkInformation* info) override;
420
421 // special cases for performance
423
428 double Extent[6];
434
437
439
440 // These methods support compatibility with vtkDataSetSurfaceFilter
444
447
450
452
453private:
454 vtkGeometryFilter(const vtkGeometryFilter&) = delete;
455 void operator=(const vtkGeometryFilter&) = delete;
456};
457
458VTK_ABI_NAMESPACE_END
459#endif
Proxy object to connect input/output ports.
Extracts outer surface (as vtkPolyData) of any dataset.
abstract class to specify dataset behavior
Definition vtkDataSet.h:56
extract boundary geometry from dataset (or convert data to polygonal type)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual const char * GetOriginalPointIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
vtkTypeBool PassThroughCellIds
virtual int PolyDataExecute(vtkDataSet *, vtkPolyData *)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
virtual const char * GetOriginalCellIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
vtkIncrementalPointLocator * Locator
vtkPolyData * GetExcludedFaces()
If a second, vtkPolyData input is provided, this second input specifies a list of faces to be exclude...
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkTypeBool PassThroughPointIds
int GetOutputPointsPrecision() const
Set/get the desired precision for the output types.
void SetOutputPointsPrecision(int precision)
Set/get the desired precision for the output types.
static vtkGeometryFilter * New()
Standard methods for instantiation, type information, and printing.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
int StructuredExecute(vtkDataSet *input, vtkPolyData *output, int *wholeExtent, vtkPolyData *exc, bool *extractFace=nullptr)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
virtual int StructuredExecute(vtkDataSet *input, vtkPolyData *output, int *wholeExt, bool *extractFace=nullptr)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
int UnstructuredGridExecute(vtkDataSet *input, vtkPolyData *output, vtkGeometryFilterHelper *info, vtkPolyData *exc)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
virtual int UnstructuredGridExecute(vtkDataSet *input, vtkPolyData *output)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
~vtkGeometryFilter() override
void SetExcludedFacesConnection(vtkAlgorithmOutput *algOutput)
If a second, vtkPolyData input is provided, this second input specifies a list of faces to be exclude...
int PolyDataExecute(vtkDataSet *input, vtkPolyData *output, vtkPolyData *exc)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
int DataSetExecute(vtkDataSet *input, vtkPolyData *output, vtkPolyData *exc)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
void SetExtent(double extent[6])
Set / get a (xmin,xmax, ymin,ymax, zmin,zmax) bounding box to clip data.
int FillInputPortInformation(int port, vtkInformation *info) override
void SetExcludedFacesData(vtkPolyData *)
If a second, vtkPolyData input is provided, this second input specifies a list of faces to be exclude...
void SetExtent(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
Specify a (xmin,xmax, ymin,ymax, zmin,zmax) bounding box to clip data.
double * GetExtent()
Set / get a (xmin,xmax, ymin,ymax, zmin,zmax) bounding box to clip data.
virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output)
Direct access methods so that this class can be used as an algorithm without using it as a filter (i....
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
topologically regular array of data
dataset represents arbitrary combinations of all possible cell types.
static vtkGeometryFilterHelper * CharacterizeUnstructuredGrid(vtkUnstructuredGridBase *)
CellTypesInformation CellTypesInfo
static void CopyFilterParams(vtkDataSetSurfaceFilter *dssf, vtkGeometryFilter *gf)
std::array< bool, NUM_CELL_TYPES > CellTypesInformation
static void CopyFilterParams(vtkGeometryFilter *gf, vtkDataSetSurfaceFilter *dssf)
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:332
#define VTK_ID_MAX
Definition vtkType.h:336
#define VTK_SIZEHINT(...)