VTK  9.3.20240420
vtkBooleanOperationPolyDataFilter.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
47#ifndef vtkBooleanOperationPolyDataFilter_h
48#define vtkBooleanOperationPolyDataFilter_h
49
50#include "vtkFiltersGeneralModule.h" // For export macro
52
53#include "vtkDataSetAttributes.h" // Needed for CopyCells() method
54
55VTK_ABI_NAMESPACE_BEGIN
56class vtkIdList;
57
58class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
59{
60public:
65
67
68 void PrintSelf(ostream& os, vtkIndent indent) override;
69
71 {
72 VTK_UNION = 0,
74 VTK_DIFFERENCE
75 };
76
78
81 vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
82 vtkGetMacro(Operation, int);
83 void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
84 void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
85 void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
87
89
93 vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
94 vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
95 vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
97
99
103 vtkSetMacro(Tolerance, double);
104 vtkGetMacro(Tolerance, double);
106
107protected:
110
114 void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
115
118
119private:
121 void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
122
128 void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
130 vtkIdList* cellIds, bool reverseCells);
131
136 double Tolerance;
137
142 int Operation;
143
145
149 vtkTypeBool ReorientDifferenceCells;
151};
152
153VTK_ABI_NAMESPACE_END
154#endif
Computes the boundary of the union, intersection, or difference volume computed from the volumes defi...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void SortPolyData(vtkPolyData *input, vtkIdList *intersectionList, vtkIdList *unionList)
Labels triangles in mesh as part of the intersection or union surface.
void SetOperationToIntersection()
Set the boolean operation to perform.
static vtkBooleanOperationPolyDataFilter * New()
Construct object that computes the boolean surface.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetOperationToUnion()
Set the boolean operation to perform.
void SetOperationToDifference()
Set the boolean operation to perform.
helps manage arrays from multiple vtkDataSetAttributes.
list of point or cell ids
Definition vtkIdList.h:133
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
int vtkTypeBool
Definition vtkABI.h:64