VTK  9.7.1
vtkHyperTreeGridNonOrientedGeometryCursor.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
32 #ifndef vtkHyperTreeGridNonOrientedGeometryCursor_h
33 #define vtkHyperTreeGridNonOrientedGeometryCursor_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkObject.h"
37 
38 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
39 #include "vtkHyperTreeGridTools.h" // for HasTree
40 #include "vtkSmartPointer.h" // Used internally
41 #include <memory> // std::shared_ptr
42 #include <vector> // std::vector
43 
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkHyperTree;
46 class vtkHyperTreeGrid;
49 
50 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedGeometryCursor : public vtkObject
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
57  void Dump(ostream& os);
58 
64 
68  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
69 
73  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
75 
76  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
77  double* origin);
78 
79  void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor* cursor);
80 
82 
85  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
87 
89 
92  vtkHyperTree* GetTree() const { return this->Tree; }
94 
98  vtkIdType GetVertexId();
99 
104  vtkIdType GetGlobalNodeIndex();
105 
110  unsigned char GetDimension();
111 
116  unsigned char GetNumberOfChildren();
117 
118  void SetGlobalIndexStart(vtkIdType index);
119  void SetGlobalIndexFromLocal(vtkIdType index);
120 
121  double* GetOrigin();
122  double* GetSize();
123 
124  void GetBounds(double bounds[6]);
125  void GetPoint(double point[3]);
126 
131  void SetMask(bool state);
132 
136  bool IsMasked();
137 
141  bool IsLeaf();
142 
143  void SubdivideLeaf();
144 
148  bool IsRoot();
149 
153  unsigned int GetLevel();
154 
162  void ToChild(unsigned char ichild);
163 
169  void ToRoot();
170 
176  void ToParent();
177 
182  vtkSmartPointer<vtkHyperTreeGridOrientedGeometryCursor> GetHyperTreeGridOrientedGeometryCursor(
183  vtkHyperTreeGrid* grid);
184 
185 protected:
190 
195 
200 
202  std::shared_ptr<vtkHyperTreeGridScales> Scales;
203  unsigned int Level;
205 
206  // Hyper tree grid to which the cursor is attached
207  std::vector<vtkHyperTreeGridGeometryEntry> Entries;
208 
209 private:
212  void operator=(const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
213 };
214 VTK_ABI_NAMESPACE_END
215 #endif
void GetBounds(T a, double bds[6])
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
GeometryEntry is a cache data for cursors requiring coordinates.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
bool HasTree() const
Return if a Tree pointing exist.
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
a simple class to control print indentation
Definition: vtkIndent.h:28
void GetPoint(int i, int j, int k, double pnt[3])
A data object structured as a tree.
Definition: vtkHyperTree.h:170
vtkHyperTreeGrid * Grid
Reference to the HTG currently processed.
Dynamic generation of scales for vtkHyperTree.
bool HasTree(const T &e)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...