VTK  9.3.1
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 
98  int FillInputPortInformation(int, vtkInformation*) override;
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
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
helps manage arrays from multiple vtkDataSetAttributes.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetOperationToIntersection()
Set the boolean operation to perform.
list of point or cell ids
Definition: vtkIdList.h:22
void SetOperationToUnion()
Set the boolean operation to perform.
Computes the boundary of the union, intersection, or difference volume computed from the volumes defi...
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
void SetOperationToDifference()
Set the boolean operation to perform.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.