VTK
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 "vtkFiltersModelingModule.h" // For export macro
53 #include "vtkDataSetAlgorithm.h"
54 #include "vtkIntersectionCounter.h" // to count intersections along ray
55 
59 class vtkIdList;
60 class vtkGenericCell;
61 class vtkRandomPool;
62 
63 
64 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
65 {
66 public:
68 
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],
158  double length, double tol, vtkAbstractCellLocator *locator,
159  vtkIdList *cellIds, vtkGenericCell *genCell,
160  vtkIntersectionCounter &counter,
161  vtkRandomPool* poole=nullptr, vtkIdType seqIdx=0);
162 
167  static int IsSurfaceClosed(vtkPolyData *surface);
168 
169 protected:
171  ~vtkSelectEnclosedPoints() override;
172 
175  double Tolerance;
176 
178 
179  // Internal structures for accelerating the intersection test
184  double Bounds[6];
185  double Length;
186 
188  int FillInputPortInformation(int, vtkInformation *) override;
189 
190  void ReportReferences(vtkGarbageCollector*) override;
191 
192 private:
194  void operator=(const vtkSelectEnclosedPoints&) = delete;
195 };
196 
197 #endif
vtkSelectEnclosedPoints::CheckSurface
vtkTypeBool CheckSurface
Definition: vtkSelectEnclosedPoints.h:173
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkSelectEnclosedPoints::Tolerance
double Tolerance
Definition: vtkSelectEnclosedPoints.h:175
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:180
vtkX3D::length
Definition: vtkX3D.h:393
vtkSelectEnclosedPoints::InsideOutsideArray
vtkUnsignedCharArray * InsideOutsideArray
Definition: vtkSelectEnclosedPoints.h:177
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:182
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:183
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDataSetAlgorithm::New
static vtkDataSetAlgorithm * New()
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkSelectEnclosedPoints::CellLocator
vtkStaticCellLocator * CellLocator
Definition: vtkSelectEnclosedPoints.h:180
vtkSelectEnclosedPoints::Length
double Length
Definition: vtkSelectEnclosedPoints.h:185
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:48
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:99
vtkSelectEnclosedPoints::InsideOut
vtkTypeBool InsideOut
Definition: vtkSelectEnclosedPoints.h:174
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
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:39
vtkSelectEnclosedPoints
mark points as to whether they are inside a closed surface
Definition: vtkSelectEnclosedPoints.h:64
vtkSelectEnclosedPoints::CellIds
vtkIdList * CellIds
Definition: vtkSelectEnclosedPoints.h:181
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:39
vtkStaticCellLocator
perform fast cell location operations
Definition: vtkStaticCellLocator.h:52
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