VTK  9.3.0
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
37#ifndef vtkBooleanOperationPolyDataFilter_h
38#define vtkBooleanOperationPolyDataFilter_h
39
40#include "vtkFiltersGeneralModule.h" // For export macro
42
43#include "vtkDataSetAttributes.h" // Needed for CopyCells() method
44
45VTK_ABI_NAMESPACE_BEGIN
46class vtkIdList;
47
48class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
49{
50public:
55
57
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
61 {
62 VTK_UNION = 0,
64 VTK_DIFFERENCE
65 };
66
68
71 vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
72 vtkGetMacro(Operation, int);
73 void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
74 void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
75 void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
77
79
83 vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
84 vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
85 vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
87
89
93 vtkSetMacro(Tolerance, double);
94 vtkGetMacro(Tolerance, double);
96
97protected:
100
104 void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
105
108
109private:
111 void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
112
118 void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
120 vtkIdList* cellIds, bool reverseCells);
121
126 double Tolerance;
127
132 int Operation;
133
135
139 vtkTypeBool ReorientDifferenceCells;
141};
142
143VTK_ABI_NAMESPACE_END
144#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:32
a simple class to control print indentation
Definition vtkIndent.h:38
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:89
int vtkTypeBool
Definition vtkABI.h:64