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
28 #ifndef vtkBooleanOperationPolyDataFilter_h
29 #define vtkBooleanOperationPolyDataFilter_h
30 
31 #include "vtkFiltersGeneralModule.h" // For export macro
32 #include "vtkPolyDataAlgorithm.h"
33 
34 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkIdList;
38 
39 class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
40 {
41 public:
46 
48 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52  {
53  VTK_UNION = 0,
55  VTK_DIFFERENCE
56  };
57 
59 
62  vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
63  vtkGetMacro(Operation, int);
64  void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
65  void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
66  void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
68 
70 
74  vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
75  vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
76  vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
78 
80 
84  vtkSetMacro(Tolerance, double);
85  vtkGetMacro(Tolerance, double);
87 
88 protected:
91 
95  void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
96 
99 
100 private:
102  void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
103 
109  void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
111  vtkIdList* cellIds, bool reverseCells);
112 
117  double Tolerance;
118 
123  int Operation;
124 
126 
130  vtkTypeBool ReorientDifferenceCells;
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #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.
static vtkBooleanOperationPolyDataFilter * New()
Construct object that computes the boolean surface.
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.
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:23
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:80
int vtkTypeBool
Definition: vtkABI.h:64