VTK  9.5.20251209
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
149
150#ifndef vtkGeometryFilter_h
151#define vtkGeometryFilter_h
152
153#include "vtkFiltersGeometryModule.h" // For export macro
154#include "vtkPolyDataAlgorithm.h"
155
156#include <array> // For std::array
157
158VTK_ABI_NAMESPACE_BEGIN
165
166// Used to coordinate delegation to vtkDataSetSurfaceFilter
167struct VTKFILTERSGEOMETRY_EXPORT vtkGeometryFilterHelper
168{
179 using CellTypesInformation = std::array<bool, NUM_CELL_TYPES>;
181 unsigned char IsLinear;
186 {
187 return this->CellTypesInfo[VERTS] && !this->CellTypesInfo[LINES] &&
188 !this->CellTypesInfo[POLYS] && !this->CellTypesInfo[STRIPS] &&
189 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
190 }
192 {
193 return !this->CellTypesInfo[VERTS] && this->CellTypesInfo[LINES] &&
194 !this->CellTypesInfo[POLYS] && !this->CellTypesInfo[STRIPS] &&
195 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
196 }
198 {
199 return !this->CellTypesInfo[VERTS] && !this->CellTypesInfo[LINES] &&
200 this->CellTypesInfo[POLYS] && !this->CellTypesInfo[STRIPS] &&
201 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
202 }
204 {
205 return !this->CellTypesInfo[VERTS] && !this->CellTypesInfo[LINES] &&
206 !this->CellTypesInfo[POLYS] && this->CellTypesInfo[STRIPS] &&
207 !this->CellTypesInfo[OTHER_LINEAR_CELLS] && !this->CellTypesInfo[NON_LINEAR_CELLS];
208 }
209};
210
211class VTKFILTERSGEOMETRY_EXPORT vtkGeometryFilter : public vtkPolyDataAlgorithm
212{
213public:
215
220 void PrintSelf(ostream& os, vtkIndent indent) override;
222
224
227 vtkSetMacro(PointClipping, bool);
228 vtkGetMacro(PointClipping, bool);
229 vtkBooleanMacro(PointClipping, bool);
231
233
236 vtkSetMacro(CellClipping, bool);
237 vtkGetMacro(CellClipping, bool);
238 vtkBooleanMacro(CellClipping, bool);
240
242
245 vtkSetMacro(ExtentClipping, bool);
246 vtkGetMacro(ExtentClipping, bool);
247 vtkBooleanMacro(ExtentClipping, bool);
249
251
254 vtkSetClampMacro(PointMinimum, vtkIdType, 0, VTK_ID_MAX);
255 vtkGetMacro(PointMinimum, vtkIdType);
257
259
262 vtkSetClampMacro(PointMaximum, vtkIdType, 0, VTK_ID_MAX);
263 vtkGetMacro(PointMaximum, vtkIdType);
265
267
270 vtkSetClampMacro(CellMinimum, vtkIdType, 0, VTK_ID_MAX);
271 vtkGetMacro(CellMinimum, vtkIdType);
273
275
278 vtkSetClampMacro(CellMaximum, vtkIdType, 0, VTK_ID_MAX);
279 vtkGetMacro(CellMaximum, vtkIdType);
281
285 void SetExtent(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
286
288
291 void SetExtent(double extent[6]);
292 double* GetExtent() VTK_SIZEHINT(6) { return this->Extent; }
294
296
304 vtkSetMacro(Merging, bool);
305 vtkGetMacro(Merging, bool);
306 vtkBooleanMacro(Merging, bool);
308
310
317 void SetOutputPointsPrecision(int precision);
320
322
329 vtkSetMacro(FastMode, bool);
330 vtkGetMacro(FastMode, bool);
331 vtkBooleanMacro(FastMode, bool);
333
334 // The following are methods compatible with vtkDataSetSurfaceFilter.
335
337
342 vtkSetMacro(PieceInvariant, int);
343 vtkGetMacro(PieceInvariant, int);
345
347
358
360
371
373
379 vtkSetStringMacro(OriginalCellIdsName);
380 virtual const char* GetOriginalCellIdsName()
381 {
382 return (this->OriginalCellIdsName ? this->OriginalCellIdsName : "vtkOriginalCellIds");
383 }
384 vtkSetStringMacro(OriginalPointIdsName);
385 virtual const char* GetOriginalPointIdsName()
386 {
387 return (this->OriginalPointIdsName ? this->OriginalPointIdsName : "vtkOriginalPointIds");
388 }
389
390
392
407
409
420 vtkSetMacro(NonlinearSubdivisionLevel, int);
421 vtkGetMacro(NonlinearSubdivisionLevel, int);
423
425
434
436
439 vtkSetMacro(Delegation, vtkTypeBool);
440 vtkGetMacro(Delegation, vtkTypeBool);
441 vtkBooleanMacro(Delegation, vtkTypeBool);
443
445
456 vtkSetMacro(RemoveGhostInterfaces, bool);
457 vtkBooleanMacro(RemoveGhostInterfaces, bool);
458 vtkGetMacro(RemoveGhostInterfaces, bool);
460
462
469
471 vtkDataSet* input, vtkPolyData* output, vtkGeometryFilterHelper* info, vtkPolyData* exc);
472 virtual int UnstructuredGridExecute(vtkDataSet* input, vtkPolyData* output);
473
474 int StructuredExecute(vtkDataSet* input, vtkPolyData* output, int* wholeExtent, vtkPolyData* exc,
475 bool* extractFace = nullptr);
476 virtual int StructuredExecute(
477 vtkDataSet* input, vtkPolyData* output, int* wholeExt, bool* extractFace = nullptr);
478
480 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
482
483protected:
486
488 int FillInputPortInformation(int port, vtkInformation* info) override;
489
490 // special cases for performance
492
497 double Extent[6];
503
506
508
509 // These methods support compatibility with vtkDataSetSurfaceFilter
513
516
519
521
522private:
523 vtkGeometryFilter(const vtkGeometryFilter&) = delete;
524 void operator=(const vtkGeometryFilter&) = delete;
525};
526
527VTK_ABI_NAMESPACE_END
528#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:166
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
Fill the input port information objects for this algorithm.
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
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:367
#define VTK_ID_MAX
Definition vtkType.h:371
#define VTK_SIZEHINT(...)