VTK  9.0.20210613
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 =========================================================================*/
37 #ifndef vtkBooleanOperationPolyDataFilter_h
38 #define vtkBooleanOperationPolyDataFilter_h
39 
40 #include "vtkFiltersGeneralModule.h" // For export macro
41 #include "vtkPolyDataAlgorithm.h"
42 
43 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method
44 
45 class vtkIdList;
46 
47 class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
48 {
49 public:
54 
56 
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60  {
61  VTK_UNION = 0,
63  VTK_DIFFERENCE
64  };
65 
67 
70  vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
71  vtkGetMacro(Operation, int);
72  void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
73  void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
74  void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
76 
78 
82  vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
83  vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
84  vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
86 
88 
92  vtkSetMacro(Tolerance, double);
93  vtkGetMacro(Tolerance, double);
95 
96 protected:
99 
103  void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
104 
107 
108 private:
110  void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
111 
117  void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
119  vtkIdList* cellIds, bool reverseCells);
120 
125  double Tolerance;
126 
131  int Operation;
132 
134 
138  vtkTypeBool ReorientDifferenceCells;
140 };
141 
142 #endif
vtkBooleanOperationPolyDataFilter::VTK_INTERSECTION
@ VTK_INTERSECTION
Definition: vtkBooleanOperationPolyDataFilter.h:62
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:36
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:74
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:34
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:31
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:74
vtkBooleanOperationPolyDataFilter::SetOperationToUnion
void SetOperationToUnion()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:72
vtkBooleanOperationPolyDataFilter::OperationType
OperationType
Definition: vtkBooleanOperationPolyDataFilter.h:60
vtkBooleanOperationPolyDataFilter::SetOperationToIntersection
void SetOperationToIntersection()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:73
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
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:48
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:42