VTK  9.3.20240424
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
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{
170 {
171 VERTS = 0,
172 LINES = 1,
173 POLYS = 2,
174 STRIPS = 3,
175 OTHER_LINEAR_CELLS = 4,
176 NON_LINEAR_CELLS = 5,
177 NUM_CELL_TYPES
178 };
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
354 vtkSetMacro(PassThroughCellIds, vtkTypeBool);
355 vtkGetMacro(PassThroughCellIds, vtkTypeBool);
356 vtkBooleanMacro(PassThroughCellIds, vtkTypeBool);
358
360
367 vtkSetMacro(PassThroughPointIds, vtkTypeBool);
368 vtkGetMacro(PassThroughPointIds, vtkTypeBool);
369 vtkBooleanMacro(PassThroughPointIds, vtkTypeBool);
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 }
390
392
407
409
420 vtkSetMacro(NonlinearSubdivisionLevel, int);
421 vtkGetMacro(NonlinearSubdivisionLevel, int);
423
425
431 vtkSetMacro(MatchBoundariesIgnoringCellOrder, int);
432 vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
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 VTK_DEPRECATED_IN_9_3_0("Use the new version that has int* instead of vtkInformation*")
475 int StructuredExecute(vtkDataSet* input, vtkPolyData* output, vtkInformation* inInfo,
476 vtkPolyData* exc, bool* extractFace = nullptr);
477 int StructuredExecute(vtkDataSet* input, vtkPolyData* output, int* wholeExtent, vtkPolyData* exc,
478 bool* extractFace = nullptr);
479 VTK_DEPRECATED_IN_9_3_0("Use the new version that has int* instead of vtkInformation*")
480 virtual int StructuredExecute(
481 vtkDataSet* input, vtkPolyData* output, vtkInformation* inInfo, bool* extractFace = nullptr);
482 virtual int StructuredExecute(
483 vtkDataSet* input, vtkPolyData* output, int* wholeExt, bool* extractFace = nullptr);
484
485 int DataSetExecute(vtkDataSet* input, vtkPolyData* output, vtkPolyData* exc);
486 virtual int DataSetExecute(vtkDataSet* input, vtkPolyData* output);
488
489protected:
491 ~vtkGeometryFilter() override;
492
494 int FillInputPortInformation(int port, vtkInformation* info) override;
495
496 // special cases for performance
497 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
498
499 vtkIdType PointMaximum;
500 vtkIdType PointMinimum;
501 vtkIdType CellMinimum;
502 vtkIdType CellMaximum;
503 double Extent[6];
504 bool PointClipping;
505 bool CellClipping;
506 bool ExtentClipping;
507 int OutputPointsPrecision;
508 bool RemoveGhostInterfaces;
509
510 bool Merging;
512
513 bool FastMode;
514
515 // These methods support compatibility with vtkDataSetSurfaceFilter
516 int PieceInvariant;
517 vtkTypeBool PassThroughCellIds;
518 char* OriginalCellIdsName;
519
520 vtkTypeBool PassThroughPointIds;
521 char* OriginalPointIdsName;
522
523 int NonlinearSubdivisionLevel;
524 int MatchBoundariesIgnoringCellOrder;
525
526 vtkTypeBool Delegation;
527
528private:
529 vtkGeometryFilter(const vtkGeometryFilter&) = delete;
530 void operator=(const vtkGeometryFilter&) = delete;
531};
532
533VTK_ABI_NAMESPACE_END
534#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)
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:108
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
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(...)