VTK  9.0.1
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 =========================================================================*/
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 
59 class vtkIdList;
60 class vtkGenericCell;
61 class vtkRandomPool;
62 
63 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
64 {
65 public:
67 
71  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
77  static vtkSelectEnclosedPoints* New();
78 
80 
85  void SetSurfaceData(vtkPolyData* pd);
86  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
88 
90 
93  vtkPolyData* GetSurface();
94  vtkPolyData* GetSurface(vtkInformationVector* sourceInfo);
96 
98 
103  vtkSetMacro(InsideOut, vtkTypeBool);
104  vtkBooleanMacro(InsideOut, vtkTypeBool);
105  vtkGetMacro(InsideOut, vtkTypeBool);
107 
109 
113  vtkSetMacro(CheckSurface, vtkTypeBool);
114  vtkBooleanMacro(CheckSurface, vtkTypeBool);
115  vtkGetMacro(CheckSurface, vtkTypeBool);
117 
122  int IsInside(vtkIdType inputPtId);
123 
125 
129  vtkSetClampMacro(Tolerance, double, 0.0, VTK_FLOAT_MAX);
130  vtkGetMacro(Tolerance, double);
132 
134 
140  void Initialize(vtkPolyData* surface);
141  int IsInsideSurface(double x[3]);
142  int IsInsideSurface(double x, double y, double z);
143  void Complete();
145 
156  static int IsInsideSurface(double x[3], vtkPolyData* surface, double bds[6], double length,
157  double tol, vtkAbstractCellLocator* locator, vtkIdList* cellIds, vtkGenericCell* genCell,
158  vtkIntersectionCounter& counter, vtkRandomPool* poole = nullptr, vtkIdType seqIdx = 0);
159 
164  static int IsSurfaceClosed(vtkPolyData* surface);
165 
166 protected:
168  ~vtkSelectEnclosedPoints() override;
169 
172  double Tolerance;
173 
175 
176  // Internal structures for accelerating the intersection test
181  double Bounds[6];
182  double Length;
183 
185  int FillInputPortInformation(int, vtkInformation*) override;
186 
187  void ReportReferences(vtkGarbageCollector*) override;
188 
189 private:
191  void operator=(const vtkSelectEnclosedPoints&) = delete;
192 };
193 
194 #endif
vtkSelectEnclosedPoints::CheckSurface
vtkTypeBool CheckSurface
Definition: vtkSelectEnclosedPoints.h:170
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkSelectEnclosedPoints::Tolerance
double Tolerance
Definition: vtkSelectEnclosedPoints.h:172
vtkDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
Definition: vtkDataSetAlgorithm.h:176
vtkX3D::length
@ length
Definition: vtkX3D.h:399
vtkSelectEnclosedPoints::InsideOutsideArray
vtkUnsignedCharArray * InsideOutsideArray
Definition: vtkSelectEnclosedPoints.h:174
vtkIntersectionCounter.h
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:48
vtkSelectEnclosedPoints::Cell
vtkGenericCell * Cell
Definition: vtkSelectEnclosedPoints.h:179
vtkDataSetAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkSelectEnclosedPoints::Surface
vtkPolyData * Surface
Definition: vtkSelectEnclosedPoints.h:180
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDataSetAlgorithm::New
static vtkDataSetAlgorithm * New()
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkSelectEnclosedPoints::CellLocator
vtkStaticCellLocator * CellLocator
Definition: vtkSelectEnclosedPoints.h:177
vtkSelectEnclosedPoints::Length
double Length
Definition: vtkSelectEnclosedPoints.h:182
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:48
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:94
vtkSelectEnclosedPoints::InsideOut
vtkTypeBool InsideOut
Definition: vtkSelectEnclosedPoints.h:171
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkAlgorithm::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkDataSetAlgorithm.h
vtkDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkSelectEnclosedPoints
mark points as to whether they are inside a closed surface
Definition: vtkSelectEnclosedPoints.h:63
vtkSelectEnclosedPoints::CellIds
vtkIdList * CellIds
Definition: vtkSelectEnclosedPoints.h:178
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkStaticCellLocator
perform fast cell location operations
Definition: vtkStaticCellLocator.h:50
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkRandomPool
convenience class to quickly generate a pool of random numbers
Definition: vtkRandomPool.h:48
vtkIntersectionCounter
Fast simple class for dealing with ray intersections.
Definition: vtkIntersectionCounter.h:29