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
vtkUnsignedCharArray * InsideOutsideArray
Store vtkAlgorithm input/output information.
void ReportReferences(vtkGarbageCollector *) override
convenience class to quickly generate a pool of random numbers
Definition: vtkRandomPool.h:48
an abstract base class for locators which find cells
mark points as to whether they are inside a closed surface
perform fast cell location operations
int vtkIdType
Definition: vtkType.h:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
Detect and break reference loops.
provides thread-safe access to cells
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkStaticCellLocator * CellLocator
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
Fast simple class for dealing with ray intersections.
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
dynamic, self-adjusting array of unsigned char
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
static vtkDataSetAlgorithm * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.