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
40 #ifndef vtkSelectEnclosedPoints_h
41 #define vtkSelectEnclosedPoints_h
42 
43 #include "vtkDataSetAlgorithm.h"
44 #include "vtkFiltersModelingModule.h" // For export macro
45 #include "vtkIntersectionCounter.h" // to count intersections along ray
46 
47 VTK_ABI_NAMESPACE_BEGIN
51 class vtkIdList;
52 class vtkGenericCell;
53 class vtkRandomPool;
54 
55 class VTKFILTERSMODELING_EXPORT vtkSelectEnclosedPoints : public vtkDataSetAlgorithm
56 {
57 public:
59 
63  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
69  static vtkSelectEnclosedPoints* New();
70 
72 
77  void SetSurfaceData(vtkPolyData* pd);
78  void SetSurfaceConnection(vtkAlgorithmOutput* algOutput);
80 
82 
85  vtkPolyData* GetSurface();
86  vtkPolyData* GetSurface(vtkInformationVector* sourceInfo);
88 
90 
95  vtkSetMacro(InsideOut, vtkTypeBool);
96  vtkBooleanMacro(InsideOut, vtkTypeBool);
97  vtkGetMacro(InsideOut, vtkTypeBool);
99 
101 
105  vtkSetMacro(CheckSurface, vtkTypeBool);
106  vtkBooleanMacro(CheckSurface, vtkTypeBool);
107  vtkGetMacro(CheckSurface, vtkTypeBool);
109 
114  int IsInside(vtkIdType inputPtId);
115 
117 
121  vtkSetClampMacro(Tolerance, double, 0.0, VTK_FLOAT_MAX);
122  vtkGetMacro(Tolerance, double);
124 
126 
132  void Initialize(vtkPolyData* surface);
133  int IsInsideSurface(double x[3]);
134  int IsInsideSurface(double x, double y, double z);
135  void Complete();
137 
148  static int IsInsideSurface(double x[3], vtkPolyData* surface, double bds[6], double length,
149  double tol, vtkAbstractCellLocator* locator, vtkIdList* cellIds, vtkGenericCell* genCell,
150  vtkIntersectionCounter& counter, vtkRandomPool* poole = nullptr, vtkIdType seqIdx = 0);
151 
156  static int IsSurfaceClosed(vtkPolyData* surface);
157 
158 protected:
160  ~vtkSelectEnclosedPoints() override;
161 
164  double Tolerance;
165 
167 
168  // Internal structures for accelerating the intersection test
173  double Bounds[6];
174  double Length;
175 
177  int FillInputPortInformation(int, vtkInformation*) override;
178 
179  void ReportReferences(vtkGarbageCollector*) override;
180 
181 private:
183  void operator=(const vtkSelectEnclosedPoints&) = delete;
184 };
185 
186 VTK_ABI_NAMESPACE_END
187 #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:40
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:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Detect and break reference loops.
provides thread-safe access to cells
Proxy object to connect input/output ports.
int vtkTypeBool
Definition: vtkABI.h:64
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:152
Fast simple class for dealing with ray intersections.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
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.