VTK  9.7.0
vtkCellTreeLocator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
40
41#ifndef vtkCellTreeLocator_h
42#define vtkCellTreeLocator_h
43
45#include "vtkCommonDataModelModule.h" // For export macro
46
47namespace detail
48{
49VTK_ABI_NAMESPACE_BEGIN
50// Forward declarations for PIMPL
51struct vtkCellTree;
52template <typename T>
53struct CellTree;
54template <typename T>
56VTK_ABI_NAMESPACE_END
57}
58
59VTK_ABI_NAMESPACE_BEGIN
60class VTKCOMMONDATAMODEL_EXPORT vtkCellTreeLocator : public vtkAbstractCellLocator
61{
62 template <typename>
63 friend struct detail::CellTree;
64 template <typename>
66
67public:
69
73 void PrintSelf(ostream& os, vtkIndent indent) override;
75
81
83
88 vtkSetMacro(NumberOfBuckets, int);
89 vtkGetMacro(NumberOfBuckets, int);
91
99 bool GetLargeIds() { return this->LargeIds; }
100
101 // Reuse any superclass signatures that we don't override.
105
110 int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
111 double pcoords[3], int& subId, vtkIdType& cellId, vtkGenericCell* cell) override;
112
122 int IntersectWithLine(const double p1[3], const double p2[3], double tol, vtkPoints* points,
123 vtkIdList* cellIds, vtkGenericCell* cell) override;
124
129 void FindCellsWithinBounds(double* bbox, vtkIdList* cells) override;
130
136 vtkIdType FindCell(double pos[3], double tol2, vtkGenericCell* cell, int& subId,
137 double pcoords[3], double* weights) override;
138
140
143 void FreeSearchStructure() override;
144 void BuildLocator() override;
145 void ForceBuildLocator() override;
146 void GenerateRepresentation(int level, vtkPolyData* pd) override;
148
154 void ShallowCopy(vtkAbstractCellLocator* locator) override;
155
156protected:
159
160 void BuildLocatorInternal() override;
161
163 bool LargeIds = false;
164
165 detail::vtkCellTree* Tree;
166
167private:
168 vtkCellTreeLocator(const vtkCellTreeLocator&) = delete;
169 void operator=(const vtkCellTreeLocator&) = delete;
170};
171VTK_ABI_NAMESPACE_END
172
173#endif
vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
void FindCellsAlongLine(const double p1[3], const double p2[3], double tol, vtkIdList *cells)
Take the passed line segment and intersect it with the data set.
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.
vtkAbstractCellLocator()
Find the cell containing a given point.
void FindCellsWithinBounds(double *bbox, vtkIdList *cells) override
Return a list of unique cell ids inside of a given bounding box.
vtkIdType FindCell(double pos[3], double tol2, vtkGenericCell *cell, int &subId, double pcoords[3], double *weights) override
Find the cell containing a given point.
int IntersectWithLine(const double p1[3], const double p2[3], double tol, vtkPoints *points, vtkIdList *cellIds, vtkGenericCell *cell) override
Take the passed line segment and intersect it with the data set.
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) override
Return intersection point (if any) AND the cell which was intersected by the finite line.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods to print and obtain type-related information.
void BuildLocatorInternal() override
This function is not pure virtual to maintain backwards compatibility.
void ForceBuildLocator() override
Satisfy vtkLocator abstract interface.
bool GetLargeIds()
Inform the user as to whether large ids are being used.
~vtkCellTreeLocator() override
detail::vtkCellTree * Tree
void FreeSearchStructure() override
Satisfy vtkLocator abstract interface.
void ShallowCopy(vtkAbstractCellLocator *locator) override
Shallow copy of a vtkCellTreeLocator.
void GenerateRepresentation(int level, vtkPolyData *pd) override
Satisfy vtkLocator abstract interface.
void BuildLocator() override
Satisfy vtkLocator abstract interface.
static vtkCellTreeLocator * New()
Constructor sets the maximum number of cells in a leaf to 8 and number of buckets to 6.
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:26
a simple class to control print indentation
Definition vtkIndent.h:29
represent and manipulate 3D points
Definition vtkPoints.h:31
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
int vtkIdType
Definition vtkType.h:363