VTK: Filters/General/vtkBooleanOperationPolyDataFilter.h Source File

| 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
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 VTK_ABI_NAMESPACE_BEGIN
46 class vtkIdList;
47
48 class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
49 {
50 public:
54 static vtkBooleanOperationPolyDataFilter* New();
55
56 vtkTypeMacro(vtkBooleanOperationPolyDataFilter, vtkPolyDataAlgorithm);
57
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
60 enum OperationType
61 {
62 VTK_UNION = 0,
63 VTK_INTERSECTION,
64 VTK_DIFFERENCE
65 };
66
68
71 vtkSetClampMacro(Operation, int, VTK_UNION, VTK_DIFFERENCE);
72 vtkGetMacro(Operation, int);
73 void SetOperationToUnion() { this->SetOperation(VTK_UNION); }
74 void SetOperationToIntersection() { this->SetOperation(VTK_INTERSECTION); }
75 void SetOperationToDifference() { this->SetOperation(VTK_DIFFERENCE); }
77
79
83 vtkSetMacro(ReorientDifferenceCells, vtkTypeBool);
84 vtkGetMacro(ReorientDifferenceCells, vtkTypeBool);
85 vtkBooleanMacro(ReorientDifferenceCells, vtkTypeBool);
87
89
93 vtkSetMacro(Tolerance, double);
94 vtkGetMacro(Tolerance, double);
96
97 protected:
98 vtkBooleanOperationPolyDataFilter();
99 ~vtkBooleanOperationPolyDataFilter() override;
100
104 void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, vtkIdList* unionList);
105
106 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
107 int FillInputPortInformation(int, vtkInformation*) override;
108
109 private:
110 vtkBooleanOperationPolyDataFilter(const vtkBooleanOperationPolyDataFilter&) = delete;
111 void operator=(const vtkBooleanOperationPolyDataFilter&) = delete;
112
118 void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
119 vtkDataSetAttributes::FieldList& pointFieldList, vtkDataSetAttributes::FieldList& cellFieldList,
120 vtkIdList* cellIds, bool reverseCells);
121
126 double Tolerance;
127
132 int Operation;
133
135
139 vtkTypeBool ReorientDifferenceCells;
141 };
142
143 VTK_ABI_NAMESPACE_END
144 #endif
vtkBooleanOperationPolyDataFilter
Computes the boundary of the union, intersection, or difference volume computed from the volumes defi...
Definition: vtkBooleanOperationPolyDataFilter.h:49
vtkBooleanOperationPolyDataFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBooleanOperationPolyDataFilter::New
static vtkBooleanOperationPolyDataFilter * New()
Construct object that computes the boolean surface.
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.
vtkBooleanOperationPolyDataFilter::SetOperationToIntersection
void SetOperationToIntersection()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:74
vtkBooleanOperationPolyDataFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkBooleanOperationPolyDataFilter::vtkBooleanOperationPolyDataFilter
vtkBooleanOperationPolyDataFilter()
vtkBooleanOperationPolyDataFilter::OperationType
OperationType
Definition: vtkBooleanOperationPolyDataFilter.h:61
vtkBooleanOperationPolyDataFilter::VTK_INTERSECTION
@ VTK_INTERSECTION
Definition: vtkBooleanOperationPolyDataFilter.h:63
vtkBooleanOperationPolyDataFilter::SetOperationToUnion
void SetOperationToUnion()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:73
vtkBooleanOperationPolyDataFilter::SetOperationToDifference
void SetOperationToDifference()
Set the boolean operation to perform.
Definition: vtkBooleanOperationPolyDataFilter.h:75
vtkBooleanOperationPolyDataFilter::~vtkBooleanOperationPolyDataFilter
~vtkBooleanOperationPolyDataFilter() override
vtkDataSetAttributesFieldList
helps manage arrays from multiple vtkDataSetAttributes.
Definition: vtkDataSetAttributesFieldList.h:59
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:32
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkDataSetAttributes.h
vtkPolyDataAlgorithm.h