VTK  9.0.20200918
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,
119  double x[3], double pcoords[3], int& subId);
120 
125  virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t,
126  double x[3], double pcoords[3], int& subId, vtkIdType& cellId);
127 
133  virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t,
134  double x[3], double pcoords[3], int& subId, vtkIdType& cellId, vtkGenericCell* cell);
135 
148  virtual int IntersectWithLine(
149  const double p1[3], const double p2[3], vtkPoints* points, vtkIdList* cellIds);
150 
156  virtual void FindClosestPoint(
157  const double x[3], double closestPoint[3], vtkIdType& cellId, int& subId, double& dist2);
158 
170  virtual void FindClosestPoint(const double x[3], double closestPoint[3], vtkGenericCell* cell,
171  vtkIdType& cellId, int& subId, double& dist2);
172 
181  virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
182  vtkIdType& cellId, int& subId, double& dist2);
183 
198  virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
199  vtkGenericCell* cell, vtkIdType& cellId, int& subId, double& dist2);
200 
217  virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
218  vtkGenericCell* cell, vtkIdType& cellId, int& subId, double& dist2, int& inside);
219 
225  virtual void FindCellsWithinBounds(double* bbox, vtkIdList* cells);
226 
234  virtual void FindCellsAlongLine(
235  const double p1[3], const double p2[3], double tolerance, vtkIdList* cells);
236 
241  virtual vtkIdType FindCell(double x[3]);
242 
248  virtual vtkIdType FindCell(
249  double x[3], double tol2, vtkGenericCell* GenCell, double pcoords[3], double* weights);
250 
256  virtual bool InsideCellBounds(double x[3], vtkIdType cell_ID);
257 
258 protected:
260  ~vtkAbstractCellLocator() override;
261 
263 
270  virtual bool StoreCellBounds();
271  virtual void FreeCellBounds();
273 
280  double (*CellBounds)[6];
281 
282 private:
284  void operator=(const vtkAbstractCellLocator&) = delete;
285 };
286 
287 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:147
vtkAbstractCellLocator::CacheCellBounds
vtkTypeBool CacheCellBounds
Definition: vtkAbstractCellLocator.h:276
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkAbstractCellLocator::RetainCellLists
vtkTypeBool RetainCellLists
Definition: vtkAbstractCellLocator.h:275
vtkLocator.h
vtkLocator
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:69
vtkAbstractCellLocator::UseExistingSearchStructure
vtkTypeBool UseExistingSearchStructure
Definition: vtkAbstractCellLocator.h:278
vtkX3D::points
Definition: vtkX3D.h:452
vtkAbstractCellLocator::NumberOfCellsPerNode
int NumberOfCellsPerNode
Definition: vtkAbstractCellLocator.h:274
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkAbstractCellLocator::GenericCell
vtkGenericCell * GenericCell
Definition: vtkAbstractCellLocator.h:279
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:48
vtkLocator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkX3D::radius
Definition: vtkX3D.h:258
vtkAbstractCellLocator::LazyEvaluation
vtkTypeBool LazyEvaluation
Definition: vtkAbstractCellLocator.h:277
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69