VTK  9.4.20251203
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
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{
101 {
102 VERTS = 0,
103 LINES = 1,
104 POLYS = 2,
105 STRIPS = 3,
106 OTHER_LINEAR_CELLS = 4,
107 NON_LINEAR_CELLS = 5,
108 NUM_CELL_TYPES
109 };
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
285 vtkSetMacro(PassThroughCellIds, vtkTypeBool);
286 vtkGetMacro(PassThroughCellIds, vtkTypeBool);
287 vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
289
291
298 vtkSetMacro(PassThroughPointIds, vtkTypeBool);
299 vtkGetMacro(PassThroughPointIds, vtkTypeBool);
300 vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
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 }
321
323
338
340
351 vtkSetMacro(NonlinearSubdivisionLevel, int);
352 vtkGetMacro(NonlinearSubdivisionLevel, int);
354
356
362 vtkSetMacro(MatchBoundariesIgnoringCellOrder, int);
363 vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
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 VTK_DEPRECATED_IN_9_3_0("Use the new version that has int* instead of vtkInformation*")
406 int StructuredExecute(vtkDataSet* input, vtkPolyData* output, vtkInformation* inInfo,
407 vtkPolyData* exc, bool* extractFace = nullptr);
408 int StructuredExecute(vtkDataSet* input, vtkPolyData* output, int* wholeExtent, vtkPolyData* exc,
409 bool* extractFace = nullptr);
410 VTK_DEPRECATED_IN_9_3_0("Use the new version that has int* instead of vtkInformation*")
411 virtual int StructuredExecute(
412 vtkDataSet* input, vtkPolyData* output, vtkInformation* inInfo, bool* extractFace = nullptr);
413 virtual int StructuredExecute(
414 vtkDataSet* input, vtkPolyData* output, int* wholeExt, bool* extractFace = nullptr);
415
416 int DataSetExecute(vtkDataSet* input, vtkPolyData* output, vtkPolyData* exc);
417 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
419
420protected:
422 ~vtkGeometryFilter() override;
423
425 int FillInputPortInformation(int port, vtkInformation* info) override;
426
427 // special cases for performance
428 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
429
430 vtkIdType PointMaximum;
431 vtkIdType PointMinimum;
432 vtkIdType CellMinimum;
433 vtkIdType CellMaximum;
434 double Extent[6];
435 bool PointClipping;
436 bool CellClipping;
437 bool ExtentClipping;
438 int OutputPointsPrecision;
439 bool RemoveGhostInterfaces;
440
441 bool Merging;
443
444 bool FastMode;
445
446 // These methods support compatibility with vtkDataSetSurfaceFilter
447 int PieceInvariant;
448 vtkTypeBool PassThroughCellIds;
449 char* OriginalCellIdsName;
450
451 vtkTypeBool PassThroughPointIds;
452 char* OriginalPointIdsName;
453
454 int NonlinearSubdivisionLevel;
455 int MatchBoundariesIgnoringCellOrder;
456
457 vtkTypeBool Delegation;
458
459private:
460 vtkGeometryFilter(const vtkGeometryFilter&) = delete;
461 void operator=(const vtkGeometryFilter&) = delete;
462};
463
464VTK_ABI_NAMESPACE_END
465#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:57
extract boundary geometry from dataset (or convert data to polygonal type)
virtual const char * GetOriginalPointIdsName()
If PassThroughCellIds or PassThroughPointIds is on, then these ivars control the name given to the fi...
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...
vtkPolyData * GetExcludedFaces()
If a second, vtkPolyData input is provided, this second input specifies a list of faces to be exclude...
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 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....
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....
void SetExtent(double extent[6])
Set / get a (xmin,xmax, ymin,ymax, zmin,zmax) bounding box to clip data.
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.
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.
Superclass for algorithms that produce only polydata as output.
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
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition vtkType.h:315
#define VTK_ID_MAX
Definition vtkType.h:319
#define VTK_SIZEHINT(...)