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
43class vtkCellArray;
44class vtkGenericCell;
45class vtkIdList;
46class vtkPoints;
47
48class VTKCOMMONDATAMODEL_EXPORT vtkAbstractCellLocator : public vtkLocator
49{
50public:
52 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
53
55
61 vtkSetClampMacro(NumberOfCellsPerNode,int,1,VTK_INT_MAX);
62 vtkGetMacro(NumberOfCellsPerNode,int);
64
66
73 vtkSetMacro(CacheCellBounds,int);
74 vtkGetMacro(CacheCellBounds,int);
75 vtkBooleanMacro(CacheCellBounds,int);
77
79
84 vtkSetMacro(RetainCellLists,int);
85 vtkGetMacro(RetainCellLists,int);
86 vtkBooleanMacro(RetainCellLists,int);
88
90
96 vtkSetMacro(LazyEvaluation,int);
97 vtkGetMacro(LazyEvaluation,int);
98 vtkBooleanMacro(LazyEvaluation,int);
100
102
109 vtkSetMacro(UseExistingSearchStructure,int);
110 vtkGetMacro(UseExistingSearchStructure,int);
111 vtkBooleanMacro(UseExistingSearchStructure,int);
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
134 virtual int IntersectWithLine(
135 double p1[3], double p2[3], double tol, double& t, double x[3],
136 double pcoords[3], int &subId, vtkIdType &cellId, vtkGenericCell *cell);
137
150 virtual int IntersectWithLine(
151 const double p1[3], const double p2[3],
152 vtkPoints *points, vtkIdList *cellIds);
153
159 virtual void FindClosestPoint(
160 double x[3], double closestPoint[3],
161 vtkIdType &cellId, int &subId, double& dist2);
162
174 virtual void FindClosestPoint(
175 double x[3], double closestPoint[3],
176 vtkGenericCell *cell, vtkIdType &cellId,
177 int &subId, double& dist2);
178
188 double x[3], double radius,
189 double closestPoint[3], vtkIdType &cellId,
190 int &subId, double& dist2);
191
207 double x[3], double radius,
208 double closestPoint[3],
209 vtkGenericCell *cell, vtkIdType &cellId,
210 int &subId, double& dist2);
211
229 double x[3], double radius,
230 double closestPoint[3],
231 vtkGenericCell *cell, vtkIdType &cellId,
232 int &subId, double& dist2, int &inside);
233
239 virtual void FindCellsWithinBounds(double *bbox, vtkIdList *cells);
240
248 virtual void FindCellsAlongLine(
249 double p1[3], double p2[3], double tolerance, vtkIdList *cells);
250
255 virtual vtkIdType FindCell(double x[3]);
256
263 double x[3], double tol2, vtkGenericCell *GenCell,
264 double pcoords[3], double *weights);
265
271 virtual bool InsideCellBounds(double x[3], vtkIdType cell_ID);
272
273protected:
276
278
285 virtual bool StoreCellBounds();
286 virtual void FreeCellBounds();
288
289 int NumberOfCellsPerNode;
290 int RetainCellLists;
291 int CacheCellBounds;
292 int LazyEvaluation;
293 int UseExistingSearchStructure;
294 vtkGenericCell *GenericCell;
295 double (*CellBounds)[6];
296
297private:
298 vtkAbstractCellLocator(const vtkAbstractCellLocator&) VTK_DELETE_FUNCTION;
299 void operator=(const vtkAbstractCellLocator&) VTK_DELETE_FUNCTION;
300};
301
302#endif
303
304
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.
virtual void FindClosestPoint(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.
~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 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 FindCellsAlongLine(double p1[3], 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 FindCellsWithinBounds(double *bbox, vtkIdList *cells)
Return a list of unique cell ids inside of a given bounding box.
virtual int IntersectWithLine(double p1[3], 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 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 int IntersectWithLine(double p1[3], 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 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 int IntersectWithLine(double p1[3], 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.
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(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.
object to represent cell connectivity
Definition: vtkCellArray.h:51
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:70
represent and manipulate 3D points
Definition: vtkPoints.h:40
@ points
Definition: vtkX3D.h:446
@ radius
Definition: vtkX3D.h:252
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
#define VTK_INT_MAX
Definition: vtkType.h:153