VTK  9.1.0
vtkSelectEnclosedPoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSelectEnclosedPoints.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 =========================================================================*/
88 #ifndef vtkSelectEnclosedPoints_h
89 #define vtkSelectEnclosedPoints_h
90 
91 #include "vtkDataSetAlgorithm.h"
92 #include "vtkFiltersModelingModule.h" // For export macro
93 #include "vtkIntersectionCounter.h" // to count intersections along ray
94 
98 class vtkIdList;
99 class vtkGenericCell;
100 class vtkRandomPool;
101 
102 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
103 {
104 public:
106 
110  void PrintSelf(ostream& os, vtkIndent indent) override;
112 
117 
119 
127 
129 
135 
137 
142  vtkSetMacro(InsideOut, vtkTypeBool);
143  vtkBooleanMacro(InsideOut, vtkTypeBool);
144  vtkGetMacro(InsideOut, vtkTypeBool);
146 
148 
152  vtkSetMacro(CheckSurface, vtkTypeBool);
153  vtkBooleanMacro(CheckSurface, vtkTypeBool);
154  vtkGetMacro(CheckSurface, vtkTypeBool);
156 
161  int IsInside(vtkIdType inputPtId);
162 
164 
168  vtkSetClampMacro(Tolerance, double, 0.0, VTK_FLOAT_MAX);
169  vtkGetMacro(Tolerance, double);
171 
173 
179  void Initialize(vtkPolyData* surface);
180  int IsInsideSurface(double x[3]);
181  int IsInsideSurface(double x, double y, double z);
182  void Complete();
184 
195  static int IsInsideSurface(double x[3], vtkPolyData* surface, double bds[6], double length,
196  double tol, vtkAbstractCellLocator* locator, vtkIdList* cellIds, vtkGenericCell* genCell,
197  vtkIntersectionCounter& counter, vtkRandomPool* poole = nullptr, vtkIdType seqIdx = 0);
198 
203  static int IsSurfaceClosed(vtkPolyData* surface);
204 
205 protected:
208 
211  double Tolerance;
212 
214 
215  // Internal structures for accelerating the intersection test
220  double Bounds[6];
221  double Length;
222 
225 
227 
228 private:
230  void operator=(const vtkSelectEnclosedPoints&) = delete;
231 };
232 
233 #endif
vtkSelectEnclosedPoints::CheckSurface
vtkTypeBool CheckSurface
Definition: vtkSelectEnclosedPoints.h:209
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::IsSurfaceClosed
static int IsSurfaceClosed(vtkPolyData *surface)
A static method for determining whether a surface is closed.
vtkSelectEnclosedPoints::New
static vtkSelectEnclosedPoints * New()
Instantiate this class.
vtkSelectEnclosedPoints::IsInsideSurface
int IsInsideSurface(double x[3])
This is a backdoor that can be used to test many points for containment.
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkSelectEnclosedPoints::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkSelectEnclosedPoints::Complete
void Complete()
This is a backdoor that can be used to test many points for containment.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:145
vtkSelectEnclosedPoints::Tolerance
double Tolerance
Definition: vtkSelectEnclosedPoints.h:211
vtkX3D::length
@ length
Definition: vtkX3D.h:399
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::InsideOutsideArray
vtkUnsignedCharArray * InsideOutsideArray
Definition: vtkSelectEnclosedPoints.h:213
vtkIntersectionCounter.h
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:49
vtkSelectEnclosedPoints::Cell
vtkGenericCell * Cell
Definition: vtkSelectEnclosedPoints.h:218
vtkSelectEnclosedPoints::Surface
vtkPolyData * Surface
Definition: vtkSelectEnclosedPoints.h:219
vtkSelectEnclosedPoints::Initialize
void Initialize(vtkPolyData *surface)
This is a backdoor that can be used to test many points for containment.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkSelectEnclosedPoints::CellLocator
vtkStaticCellLocator * CellLocator
Definition: vtkSelectEnclosedPoints.h:216
vtkSelectEnclosedPoints::Length
double Length
Definition: vtkSelectEnclosedPoints.h:221
vtkSelectEnclosedPoints::GetSurface
vtkPolyData * GetSurface(vtkInformationVector *sourceInfo)
Return a pointer to the enclosing surface.
vtkSelectEnclosedPoints::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:49
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:95
vtkSelectEnclosedPoints::InsideOut
vtkTypeBool InsideOut
Definition: vtkSelectEnclosedPoints.h:210
vtkSelectEnclosedPoints::SetSurfaceData
void SetSurfaceData(vtkPolyData *pd)
Set the surface to be used to test for containment.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkSelectEnclosedPoints::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkDataSetAlgorithm.h
vtkSelectEnclosedPoints::vtkSelectEnclosedPoints
vtkSelectEnclosedPoints()
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:66
vtkSelectEnclosedPoints::GetSurface
vtkPolyData * GetSurface()
Return a pointer to the enclosing surface.
vtkSelectEnclosedPoints::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkSelectEnclosedPoints
mark points as to whether they are inside a closed surface
Definition: vtkSelectEnclosedPoints.h:103
vtkSelectEnclosedPoints::CellIds
vtkIdList * CellIds
Definition: vtkSelectEnclosedPoints.h:217
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:116
vtkSelectEnclosedPoints::~vtkSelectEnclosedPoints
~vtkSelectEnclosedPoints() override
vtkSelectEnclosedPoints::SetSurfaceConnection
void SetSurfaceConnection(vtkAlgorithmOutput *algOutput)
Set the surface to be used to test for containment.
vtkStaticCellLocator
perform fast cell location operations
Definition: vtkStaticCellLocator.h:51
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkSelectEnclosedPoints::IsInside
int IsInside(vtkIdType inputPtId)
Query an input point id as to whether it is inside or outside.
vtkRandomPool
convenience class to quickly generate a pool of random numbers
Definition: vtkRandomPool.h:49
vtkIntersectionCounter
Fast simple class for dealing with ray intersections.
Definition: vtkIntersectionCounter.h:30