VTK: Filters/Modeling/vtkSelectEnclosedPoints.h Source File

| VTK 9.3.1

vtkSelectEnclosedPoints.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
49 #ifndef vtkSelectEnclosedPoints_h
50 #define vtkSelectEnclosedPoints_h
51
52 #include "vtkDataSetAlgorithm.h"
53 #include "vtkFiltersModelingModule.h" // For export macro
54 #include "vtkIntersectionCounter.h" // to count intersections along ray
55
56 VTK_ABI_NAMESPACE_BEGIN
57 class vtkUnsignedCharArray;
58 class vtkAbstractCellLocator;
59 class vtkStaticCellLocator;
60 class vtkIdList;
61 class vtkGenericCell;
62 class vtkRandomPool;
63
64 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
65 {
66 public:
68
71 vtkTypeMacro(vtkSelectEnclosedPoints, vtkDataSetAlgorithm);
72 void PrintSelf(ostream& os, vtkIndent indent) override;
74
78 static vtkSelectEnclosedPoints* New();
79
81
86 void SetSurfaceData(vtkPolyData* pd);
87 void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
89
91
94 vtkPolyData* GetSurface();
95 vtkPolyData* GetSurface(vtkInformationVector* sourceInfo);
97
99
104 vtkSetMacro(InsideOut, vtkTypeBool);
105 vtkBooleanMacro(InsideOut, vtkTypeBool);
106 vtkGetMacro(InsideOut, vtkTypeBool);
108
110
114 vtkSetMacro(CheckSurface, vtkTypeBool);
115 vtkBooleanMacro(CheckSurface, vtkTypeBool);
116 vtkGetMacro(CheckSurface, vtkTypeBool);
118
123 int IsInside(vtkIdType inputPtId);
124
126
130 vtkSetClampMacro(Tolerance, double, 0.0, VTK_FLOAT_MAX);
131 vtkGetMacro(Tolerance, double);
133
135
141 void Initialize(vtkPolyData* surface);
142 int IsInsideSurface(double x[3]);
143 int IsInsideSurface(double x, double y, double z);
144 void Complete();
146
157 static int IsInsideSurface(double x[3], vtkPolyData* surface, double bds[6], double length,
158 double tol, vtkAbstractCellLocator* locator, vtkIdList* cellIds, vtkGenericCell* genCell,
159 vtkIntersectionCounter& counter, vtkRandomPool* poole = nullptr, vtkIdType seqIdx = 0);
160
165 static int IsSurfaceClosed(vtkPolyData* surface);
166
167 protected:
168 vtkSelectEnclosedPoints();
169 ~vtkSelectEnclosedPoints() override;
170
171 vtkTypeBool CheckSurface;
172 vtkTypeBool InsideOut;
173 double Tolerance;
174
175 vtkUnsignedCharArray* InsideOutsideArray;
176
177 // Internal structures for accelerating the intersection test
178 vtkStaticCellLocator* CellLocator;
179 vtkIdList* CellIds;
180 vtkGenericCell* Cell;
181 vtkPolyData* Surface;
182 double Bounds[6];
183 double Length;
184
185 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
186 int FillInputPortInformation(int, vtkInformation*) override;
187
188 void ReportReferences(vtkGarbageCollector*) override;
189
190 private:
191 vtkSelectEnclosedPoints(const vtkSelectEnclosedPoints&) = delete;
192 void operator=(const vtkSelectEnclosedPoints&) = delete;
193 };
194
195 VTK_ABI_NAMESPACE_END
196 #endif
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:46
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:41
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:38
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:80
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:38
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
vtkIntersectionCounter
Fast simple class for dealing with ray intersections.
Definition: vtkIntersectionCounter.h:33
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkRandomPool
convenience class to quickly generate a pool of random numbers
Definition: vtkRandomPool.h:41
vtkSelectEnclosedPoints
mark points as to whether they are inside a closed surface
Definition: vtkSelectEnclosedPoints.h:65
vtkSelectEnclosedPoints::Length
double Length
Definition: vtkSelectEnclosedPoints.h:183
vtkSelectEnclosedPoints::Surface
vtkPolyData * Surface
Definition: vtkSelectEnclosedPoints.h:181
vtkSelectEnclosedPoints::CheckSurface
vtkTypeBool CheckSurface
Definition: vtkSelectEnclosedPoints.h:171
vtkSelectEnclosedPoints::Complete
void Complete()
This is a backdoor that can be used to test many points for containment.
vtkSelectEnclosedPoints::vtkSelectEnclosedPoints
vtkSelectEnclosedPoints()
vtkSelectEnclosedPoints::IsInsideSurface
int IsInsideSurface(double x[3])
This is a backdoor that can be used to test many points for containment.
vtkSelectEnclosedPoints::New
static vtkSelectEnclosedPoints * New()
Instantiate this class.
vtkSelectEnclosedPoints::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkSelectEnclosedPoints::GetSurface
vtkPolyData * GetSurface(vtkInformationVector *sourceInfo)
Return a pointer to the enclosing surface.
vtkSelectEnclosedPoints::Initialize
void Initialize(vtkPolyData *surface)
This is a backdoor that can be used to test many points for containment.
vtkSelectEnclosedPoints::IsInsideSurface
static int IsInsideSurface(double x[3], vtkPolyData *surface, double bds[6], double length, double tol, vtkAbstractCellLocator *locator, vtkIdList *cellIds, vtkGenericCell *genCell, vtkIntersectionCounter &counter, vtkRandomPool *poole=nullptr, vtkIdType seqIdx=0)
A static method for determining whether a point is inside a surface.
vtkSelectEnclosedPoints::Tolerance
double Tolerance
Definition: vtkSelectEnclosedPoints.h:173
vtkSelectEnclosedPoints::IsInsideSurface
int IsInsideSurface(double x, double y, double z)
This is a backdoor that can be used to test many points for containment.
vtkSelectEnclosedPoints::CellLocator
vtkStaticCellLocator * CellLocator
Definition: vtkSelectEnclosedPoints.h:178
vtkSelectEnclosedPoints::Cell
vtkGenericCell * Cell
Definition: vtkSelectEnclosedPoints.h:180
vtkSelectEnclosedPoints::InsideOutsideArray
vtkUnsignedCharArray * InsideOutsideArray
Definition: vtkSelectEnclosedPoints.h:175
vtkSelectEnclosedPoints::SetSurfaceConnection
void SetSurfaceConnection(vtkAlgorithmOutput *algOutput)
Set the surface to be used to test for containment.
vtkSelectEnclosedPoints::~vtkSelectEnclosedPoints
~vtkSelectEnclosedPoints() override
vtkSelectEnclosedPoints::InsideOut
vtkTypeBool InsideOut
Definition: vtkSelectEnclosedPoints.h:172
vtkSelectEnclosedPoints::SetSurfaceData
void SetSurfaceData(vtkPolyData *pd)
Set the surface to be used to test for containment.
vtkSelectEnclosedPoints::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkSelectEnclosedPoints::CellIds
vtkIdList * CellIds
Definition: vtkSelectEnclosedPoints.h:179
vtkSelectEnclosedPoints::IsInside
int IsInside(vtkIdType inputPtId)
Query an input point id as to whether it is inside or outside.
vtkSelectEnclosedPoints::GetSurface
vtkPolyData * GetSurface()
Return a pointer to the enclosing surface.
vtkSelectEnclosedPoints::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
vtkSelectEnclosedPoints::IsSurfaceClosed
static int IsSurfaceClosed(vtkPolyData *surface)
A static method for determining whether a surface is closed.
vtkSelectEnclosedPoints::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkStaticCellLocator
perform fast cell location operations
Definition: vtkStaticCellLocator.h:53
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkDataSetAlgorithm.h
vtkIntersectionCounter.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:152