VTK  9.7.1
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  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
49  void SetHTG(vtkHyperTreeGrid* candHTG) override;
50 
56  vtkIdType Search(const double point[3]) override;
57 
65 
76  vtkIdType FindCell(const double point[3], double tol, vtkGenericCell* cell, int& subId,
77  double pcoords[3], double* weights) override;
78 
92  int IntersectWithLine(const double p0[3], const double p1[3], double tol, double& t, double x[3],
93  double pcoords[3], int& subId, vtkIdType& cellId, vtkGenericCell* cell) override;
94 
105  int IntersectWithLine(const double p0[3], const double p1[3], double tol, vtkPoints* points,
106  vtkIdList* cellIds, vtkGenericCell* cell) override;
107 
108 protected:
110  ~vtkHyperTreeGridGeometricLocator() override = default;
111 
115  vtkIdType RecursiveSearch(vtkHyperTreeGridNonOrientedGeometryCursor* cursor, const double pt[3]);
116 
120  vtkIdType RecurseSingleIntersectWithLine(const double p0[3], const double p1[3], double tol,
121  vtkHyperTreeGridNonOrientedGeometryCursor* cursor, vtkGenericCell* cell, double& t, int& subId,
122  double x[3], double pcoords[3]) const;
123 
127  void RecurseAllIntersectsWithLine(const double p0[3], const double p1[3], double tol,
128  vtkHyperTreeGridNonOrientedGeometryCursor* cursor, std::vector<double>* ts, vtkPoints* points,
129  vtkIdList* cellIds, vtkGenericCell* cell) const;
130 
131 private:
133  void operator=(const vtkHyperTreeGridGeometricLocator&) = delete;
134 
135  struct RecurseTreesFunctor;
136 
142  bool CheckLeafOrChildrenMasked(vtkHyperTreeGridNonOrientedGeometryCursor* cursor) const;
143 
147  vtkIdType FindChildIndex(unsigned int dim, unsigned int bf, const double normalizedPt[3]) const;
148 
155  bool ConstructCell(vtkHyperTreeGridNonOrientedGeometryCursor* cursor, vtkGenericCell* cell) const;
156 
164  bool ConstructCell(const double* origin, const double* size, vtkGenericCell* cell) const;
165 
171  void GetZeroLevelOriginAndSize(double* origin, double* sizes) const;
172 
176  std::vector<int> GetSortingMap(const std::vector<double>& other) const;
177 
181  std::vector<double> Bins1D;
182 
183 }; // vtkHyperTreeGridGeometricLocator
184 
185 VTK_ABI_NAMESPACE_END
186 
187 #endif // vtkHyperTreeGridGeometricLocator_h
virtual vtkIdType FindCell(const double point[3], double tol, vtkGenericCell *cell, int &subId, double pcoords[3], double *weights)=0
Pure virtual.
class that implements accelerated searches through HyperTree Grids (HTGs) using geometric information...
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
virtual void SetHTG(vtkHyperTreeGrid *)
int vtkIdType
Definition: vtkType.h:363
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
provides thread-safe access to cells
virtual vtkIdType Search(const double point[3])=0
Basic search for cell holding a given point.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
abstract base class for objects that implement accelerated searches through HyperTree Grids (HTGs) ...
virtual 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)=0
Pure virtual.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:30