VTK  9.2.6
vtkBooleanOperationPolyDataFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBooleanOperationPolyDataFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
40 #ifndef vtkBooleanOperationPolyDataFilter_h
41 #define vtkBooleanOperationPolyDataFilter_h
42 
43 #include "vtkFiltersGeneralModule.h" // For export macro
44 #include "vtkPolyDataAlgorithm.h"
45 
46 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method
47 
48 class vtkIdList;
49 
50 class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
51 {
52 public:
57 
59 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63  {
64  VTK_UNION = 0,
66  VTK_DIFFERENCE
67  };
68 
70 
73  vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
74  vtkGetMacro(Operation, int);
75  void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
76  void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
77  void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
79 
81 
85  vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
86  vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
87  vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
89 
91 
95  vtkSetMacro(Tolerance, double);
96  vtkGetMacro(Tolerance, double);
98 
99 protected:
102 
106  void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
107 
109  int FillInputPortInformation(int, vtkInformation*) override;
110 
111 private:
113  void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
114 
120  void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
122  vtkIdList* cellIds, bool reverseCells);
123 
128  double Tolerance;
129 
134  int Operation;
135 
137 
141  vtkTypeBool ReorientDifferenceCells;
143 };
144 
145 #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:90
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetOperationToIntersection()
Set the boolean operation to perform.
list of point or cell ids
Definition: vtkIdList.h:33
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.