VTK
vtkAbstractCellLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAbstractCellLocator.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 =========================================================================*/
37 #ifndef vtkAbstractCellLocator_h
38 #define vtkAbstractCellLocator_h
39 
40 #include "vtkCommonDataModelModule.h" // For export macro
41 #include "vtkLocator.h"
42 
43 class vtkCellArray;
44 class vtkGenericCell;
45 class vtkIdList;
46 class vtkPoints;
47 
48 class VTKCOMMONDATAMODEL_EXPORT vtkAbstractCellLocator : public vtkLocator
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
61  vtkSetClampMacro(NumberOfCellsPerNode,int,1,VTK_INT_MAX);
62  vtkGetMacro(NumberOfCellsPerNode,int);
64 
66 
73  vtkSetMacro(CacheCellBounds,vtkTypeBool);
74  vtkGetMacro(CacheCellBounds,vtkTypeBool);
75  vtkBooleanMacro(CacheCellBounds,vtkTypeBool);
77 
79 
84  vtkSetMacro(RetainCellLists,vtkTypeBool);
85  vtkGetMacro(RetainCellLists,vtkTypeBool);
86  vtkBooleanMacro(RetainCellLists,vtkTypeBool);
88 
90 
96  vtkSetMacro(LazyEvaluation,vtkTypeBool);
97  vtkGetMacro(LazyEvaluation,vtkTypeBool);
98  vtkBooleanMacro(LazyEvaluation,vtkTypeBool);
100 
102 
109  vtkSetMacro(UseExistingSearchStructure,vtkTypeBool);
110  vtkGetMacro(UseExistingSearchStructure,vtkTypeBool);
111  vtkBooleanMacro(UseExistingSearchStructure,vtkTypeBool);
113 
118  virtual int IntersectWithLine(
119  double p1[3], double p2[3], double tol, double& t, double x[3],
120  double pcoords[3], int &subId);
121 
126  virtual int IntersectWithLine(
127  double p1[3], double p2[3], double tol, double& t, double x[3],
128  double pcoords[3], int &subId, vtkIdType &cellId);
129 
135  virtual int IntersectWithLine(
136  double p1[3], double p2[3], double tol, double& t, double x[3],
137  double pcoords[3], int &subId, vtkIdType &cellId, vtkGenericCell *cell);
138 
151  virtual int IntersectWithLine(
152  const double p1[3], const double p2[3],
153  vtkPoints *points, vtkIdList *cellIds);
154 
160  virtual void FindClosestPoint(
161  double x[3], double closestPoint[3],
162  vtkIdType &cellId, int &subId, double& dist2);
163 
175  virtual void FindClosestPoint(
176  double x[3], double closestPoint[3],
177  vtkGenericCell *cell, vtkIdType &cellId,
178  int &subId, double& dist2);
179 
188  virtual vtkIdType FindClosestPointWithinRadius(
189  double x[3], double radius,
190  double closestPoint[3], vtkIdType &cellId,
191  int &subId, double& dist2);
192 
207  virtual vtkIdType FindClosestPointWithinRadius(
208  double x[3], double radius,
209  double closestPoint[3],
210  vtkGenericCell *cell, vtkIdType &cellId,
211  int &subId, double& dist2);
212 
229  virtual vtkIdType FindClosestPointWithinRadius(
230  double x[3], double radius,
231  double closestPoint[3],
232  vtkGenericCell *cell, vtkIdType &cellId,
233  int &subId, double& dist2, int &inside);
234 
240  virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells);
241 
249  virtual void FindCellsAlongLine(
250  double p1[3], double p2[3], double tolerance, vtkIdList *cells);
251 
256  virtual vtkIdType FindCell(double x[3]);
257 
263  virtual vtkIdType FindCell(
264  double x[3], double tol2, vtkGenericCell *GenCell,
265  double pcoords[3], double *weights);
266 
272  virtual bool InsideCellBounds(double x[3], vtkIdType cell_ID);
273 
274 protected:
276  ~vtkAbstractCellLocator() override;
277 
279 
286  virtual bool StoreCellBounds();
287  virtual void FreeCellBounds();
289 
296  double (*CellBounds)[6];
297 
298 private:
300  void operator=(const vtkAbstractCellLocator&) = delete;
301 };
302 
303 #endif
#define VTK_INT_MAX
Definition: vtkType.h:157
an abstract base class for locators which find cells
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
int vtkIdType
Definition: vtkType.h:345
provides thread-safe access to cells
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
object to represent cell connectivity
Definition: vtkCellArray.h:44
represent and manipulate 3D points
Definition: vtkPoints.h:33