VTK  9.3.0
vtkHyperTreeGridGeometricLocator.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
26 #ifndef vtkHyperTreeGridGeometricLocator_h
27 #define vtkHyperTreeGridGeometricLocator_h
28 
29 #include "vtkCommonDataModelModule.h" //For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkGenericCell;
34 class vtkPoints;
35 class vtkIdList;
37 
38 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridGeometricLocator : public vtkHyperTreeGridLocator
39 {
40 public:
42 
44 
46 
50  void SetHTG(vtkHyperTreeGrid* candHTG) override;
51 
57  vtkIdType Search(const double point[3]) override;
58 
66 
77  vtkIdType FindCell(const double point[3], double tol, vtkGenericCell* cell, int& subId,
78  double pcoords[3], double* weights) override;
79 
93  int IntersectWithLine(const double p0[3], const double p1[3], double tol, double& t, double x[3],
94  double pcoords[3], int& subId, vtkIdType& cellId, vtkGenericCell* cell) override;
95 
106  int IntersectWithLine(const double p0[3], const double p1[3], double tol, vtkPoints* points,
107  vtkIdList* cellIds, vtkGenericCell* cell) override;
108 
109 protected:
111  ~vtkHyperTreeGridGeometricLocator() override = default;
112 
117 
121  vtkIdType RecurseSingleIntersectWithLine(const double p0[3], const double p1[3], double tol,
122  vtkHyperTreeGridNonOrientedGeometryCursor* cursor, vtkGenericCell* cell, double& t, int& subId,
123  double x[3], double pcoords[3]) const;
124 
128  void RecurseAllIntersectsWithLine(const double p0[3], const double p1[3], double tol,
129  vtkHyperTreeGridNonOrientedGeometryCursor* cursor, std::vector<double>* ts, vtkPoints* points,
130  vtkIdList* cellIds, vtkGenericCell* cell) const;
131 
132 private:
134  void operator=(const vtkHyperTreeGridGeometricLocator&) = delete;
135 
136  struct RecurseTreesFunctor;
137 
143  bool CheckLeafOrChildrenMasked(vtkHyperTreeGridNonOrientedGeometryCursor* cursor) const;
144 
148  vtkIdType FindChildIndex(unsigned int dim, unsigned int bf, const double normalizedPt[3]) const;
149 
156  bool ConstructCell(vtkHyperTreeGridNonOrientedGeometryCursor* cursor, vtkGenericCell* cell) const;
157 
165  bool ConstructCell(const double* origin, const double* size, vtkGenericCell* cell) const;
166 
172  void GetZeroLevelOriginAndSize(double* origin, double* sizes) const;
173 
177  std::vector<int> GetSortingMap(const std::vector<double>& other) const;
178 
182  std::vector<double> Bins1D;
183 
184 }; // vtkHyperTreeGridGeometricLocator
185 
186 VTK_ABI_NAMESPACE_END
187 
188 #endif // vtkHyperTreeGridGeometricLocator_h
provides thread-safe access to cells
class that implements accelerated searches through HyperTree Grids (HTGs) using geometric information
void SetHTG(vtkHyperTreeGrid *candHTG) override
Set the vtkHyperTreeGrid to use for locating.
vtkIdType Search(const double point[3], vtkHyperTreeGridNonOrientedGeometryCursor *cursor)
Basic search for cell holding a given point that also return a cursor.
~vtkHyperTreeGridGeometricLocator() override=default
int IntersectWithLine(const double p0[3], const double p1[3], double tol, double &t, double x[3], double pcoords[3], int &subId, vtkIdType &cellId, vtkGenericCell *cell) override
Find first intersection of the line defined by (p0, p1) with the HTG.
void RecurseAllIntersectsWithLine(const double p0[3], const double p1[3], double tol, vtkHyperTreeGridNonOrientedGeometryCursor *cursor, std::vector< double > *ts, vtkPoints *points, vtkIdList *cellIds, vtkGenericCell *cell) const
Recursive part of all line intersections search.
vtkIdType RecurseSingleIntersectWithLine(const double p0[3], const double p1[3], double tol, vtkHyperTreeGridNonOrientedGeometryCursor *cursor, vtkGenericCell *cell, double &t, int &subId, double x[3], double pcoords[3]) const
Recursive part of single line intersection search.
int IntersectWithLine(const double p0[3], const double p1[3], double tol, vtkPoints *points, vtkIdList *cellIds, vtkGenericCell *cell) override
Find all intersections of the line defined by (p0, p1) with the HTG.
vtkIdType FindCell(const double point[3], double tol, vtkGenericCell *cell, int &subId, double pcoords[3], double *weights) override
Find the cell where a given point lies.
vtkIdType Search(const double point[3]) override
Basic search for cell holding a given point.
static vtkHyperTreeGridGeometricLocator * New()
vtkIdType RecursiveSearch(vtkHyperTreeGridNonOrientedGeometryCursor *cursor, const double pt[3])
The recursive part of the point search.
abstract base class for objects that implement accelerated searches through HyperTree Grids (HTGs)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
list of point or cell ids
Definition: vtkIdList.h:32
represent and manipulate 3D points
Definition: vtkPoints.h:38
@ point
Definition: vtkX3D.h:236
@ points
Definition: vtkX3D.h:446
@ size
Definition: vtkX3D.h:253
int vtkIdType
Definition: vtkType.h:315