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(const double p1[3], const double p2[3], double tol, double& t, double x[3],
119  double pcoords[3], int &subId);
120 
125  virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
126  double pcoords[3], int &subId, vtkIdType &cellId);
127 
133  virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
134  double pcoords[3], int &subId, vtkIdType &cellId, vtkGenericCell *cell);
135 
148  virtual int IntersectWithLine(
149  const double p1[3], const double p2[3],
150  vtkPoints *points, vtkIdList *cellIds);
151 
157  virtual void FindClosestPoint(
158  const double x[3], double closestPoint[3],
159  vtkIdType &cellId, int &subId, double& dist2);
160 
172  virtual void FindClosestPoint(
173  const double x[3], double closestPoint[3],
174  vtkGenericCell *cell, vtkIdType &cellId,
175  int &subId, double& dist2);
176 
185  virtual vtkIdType FindClosestPointWithinRadius(
186  double x[3], double radius,
187  double closestPoint[3], vtkIdType &cellId,
188  int &subId, double& dist2);
189 
204  virtual vtkIdType FindClosestPointWithinRadius(
205  double x[3], double radius,
206  double closestPoint[3],
207  vtkGenericCell *cell, vtkIdType &cellId,
208  int &subId, double& dist2);
209 
226  virtual vtkIdType FindClosestPointWithinRadius(
227  double x[3], double radius,
228  double closestPoint[3],
229  vtkGenericCell *cell, vtkIdType &cellId,
230  int &subId, double& dist2, int &inside);
231 
237  virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells);
238 
246  virtual void FindCellsAlongLine(const double p1[3], const double p2[3], double tolerance, vtkIdList *cells);
247 
252  virtual vtkIdType FindCell(double x[3]);
253 
259  virtual vtkIdType FindCell(
260  double x[3], double tol2, vtkGenericCell *GenCell,
261  double pcoords[3], double *weights);
262 
268  virtual bool InsideCellBounds(double x[3], vtkIdType cell_ID);
269 
270 protected:
272  ~vtkAbstractCellLocator() override;
273 
275 
282  virtual bool StoreCellBounds();
283  virtual void FreeCellBounds();
285 
292  double (*CellBounds)[6];
293 
294 private:
296  void operator=(const vtkAbstractCellLocator&) = delete;
297 };
298 
299 #endif
#define VTK_INT_MAX
Definition: vtkType.h:159
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:347
provides thread-safe access to cells
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
object to represent cell connectivity
Definition: vtkCellArray.h:50
represent and manipulate 3D points
Definition: vtkPoints.h:39