VTK  9.0.2
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 
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:
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
an abstract base class for locators which find cells
virtual int IntersectWithLine(const double p1[3], const double p2[3], vtkPoints *points, vtkIdList *cellIds)
Take the passed line segment and intersect it with the data set.
virtual vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkAbstractCellLocator() override
virtual vtkIdType FindCell(double x[3], double tol2, vtkGenericCell *GenCell, double pcoords[3], double *weights)
Find the cell containing a given point.
virtual bool StoreCellBounds()
This command is used internally by the locator to copy all cell Bounds into the internal CellBounds a...
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2)
Return the closest point within a specified radius and the cell which is closest to the point x.
virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells)
Return a list of unique cell ids inside of a given bounding box.
virtual void FindClosestPoint(const double x[3], double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point and the cell which is closest to the point x.
virtual void FindCellsAlongLine(const double p1[3], const double p2[3], double tolerance, vtkIdList *cells)
Given a finite line defined by the two points (p1,p2), return the list of unique cell ids in the buck...
virtual void FreeCellBounds()
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2, int &inside)
Return the closest point within a specified radius and the cell which is closest to the point x.
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point within a specified radius and the cell which is closest to the point x.
virtual bool InsideCellBounds(double x[3], vtkIdType cell_ID)
Quickly test if a point is inside the bounds of a particular cell.
virtual void FindClosestPoint(const double x[3], double closestPoint[3], vtkGenericCell *cell, vtkIdType &cellId, int &subId, double &dist2)
Return the closest point and the cell which is closest to the point x.
virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId)
Return intersection point (if any) AND the cell which was intersected by the finite line.
virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
Return intersection point (if any) of finite line with cells contained in cell locator.
virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId, vtkGenericCell *cell)
Return intersection point (if any) AND the cell which was intersected by the finite line.
object to represent cell connectivity
Definition: vtkCellArray.h:180
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:31
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:70
represent and manipulate 3D points
Definition: vtkPoints.h:34
@ points
Definition: vtkX3D.h:452
@ radius
Definition: vtkX3D.h:258
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:338
#define VTK_INT_MAX
Definition: vtkType.h:155