VTK  9.1.0
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 =========================================================================*/
56 #ifndef vtkBooleanOperationPolyDataFilter_h
57 #define vtkBooleanOperationPolyDataFilter_h
58 
59 #include "vtkFiltersGeneralModule.h" // For export macro
60 #include "vtkPolyDataAlgorithm.h"
61 
62 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method
63 
64 class vtkIdList;
65 
66 class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
67 {
68 public:
73 
75 
76  void PrintSelf(ostream& os, vtkIndent indent) override;
77 
79  {
80  VTK_UNION = 0,
82  VTK_DIFFERENCE
83  };
84 
86 
89  vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
90  vtkGetMacro(Operation, int);
91  void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
92  void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
93  void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
95 
97 
101  vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
102  vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
103  vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
105 
107 
111  vtkSetMacro(Tolerance, double);
112  vtkGetMacro(Tolerance, double);
114 
115 protected:
118 
122  void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
123 
126 
127 private:
129  void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
130 
136  void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
138  vtkIdList* cellIds, bool reverseCells);
139 
144  double Tolerance;
145 
150  int Operation;
151 
153 
157  vtkTypeBool ReorientDifferenceCells;
159 };
160 
161 #endif
vtkBooleanOperationPolyDataFilter::VTK_INTERSECTION
@ VTK_INTERSECTION
Definition: vtkBooleanOperationPolyDataFilter.h:81
vtkBooleanOperationPolyDataFilter::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkBooleanOperationPolyDataFilter::SortPolyData
void SortPolyData(vtkPolyData *input, vtkIdList *intersectionList, vtkIdList *unionList)
Labels triangles in mesh as part of the intersection or union surface.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkBooleanOperationPolyDataFilter::New
static vtkBooleanOperationPolyDataFilter * New()
Construct object that computes the boolean surface.
vtkBooleanOperationPolyDataFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPolyDataAlgorithm.h
vtkBooleanOperationPolyDataFilter::SetOperationToDifference
void SetOperationToDifference()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:93
vtkDataSetAttributesFieldList
helps manage arrays from multiple vtkDataSetAttributes.
Definition: vtkDataSetAttributesFieldList.h:70
vtkBooleanOperationPolyDataFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkBooleanOperationPolyDataFilter::SetOperationToUnion
void SetOperationToUnion()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:91
vtkBooleanOperationPolyDataFilter::OperationType
OperationType
Definition: vtkBooleanOperationPolyDataFilter.h:79
vtkBooleanOperationPolyDataFilter::SetOperationToIntersection
void SetOperationToIntersection()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:92
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkBooleanOperationPolyDataFilter::vtkBooleanOperationPolyDataFilter
vtkBooleanOperationPolyDataFilter()
vtkBooleanOperationPolyDataFilter::~vtkBooleanOperationPolyDataFilter
~vtkBooleanOperationPolyDataFilter() override
vtkDataSetAttributes.h
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkBooleanOperationPolyDataFilter
Computes the boundary of the union, intersection, or difference volume computed from the volumes defi...
Definition: vtkBooleanOperationPolyDataFilter.h:67
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151