VTK  9.7.1
vtkHyperTreeGridNonOrientedSuperCursor.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
29 #ifndef vtkHyperTreeGridNonOrientedSuperCursor_h
30 #define vtkHyperTreeGridNonOrientedSuperCursor_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
33 #include "vtkObject.h"
34 #include "vtkSmartPointer.h" // Used internally
35 
36 #include "vtkHyperTreeGridGeometryLevelEntry.h" // Used Internally
37 
38 #include <vector> // For std::vector
39 
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkHyperTree;
42 class vtkHyperTreeGrid;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursor : public vtkObject
47 {
48 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
57 
62  virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
63 
65 
68  vtkHyperTreeGrid* GetGrid();
70 
72 
75  bool HasTree();
77 
81  bool HasTree(unsigned int icursor);
82 
84 
87  vtkHyperTree* GetTree();
88  vtkHyperTree* GetTree(unsigned int icursor);
90 
94  vtkIdType GetVertexId();
95  vtkIdType GetVertexId(unsigned int icursor);
96 
101  vtkIdType GetGlobalNodeIndex();
102 
108  vtkIdType GetGlobalNodeIndex(unsigned int icursor);
109 
113  vtkHyperTree* GetInformation(
114  unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
115 
120  unsigned char GetDimension();
121 
126  unsigned char GetNumberOfChildren();
127 
133  void SetGlobalIndexStart(vtkIdType index);
134 
140  void SetGlobalIndexFromLocal(vtkIdType index);
141 
145  double* GetOrigin();
146  double* GetOrigin(unsigned int icursor);
147 
151  double* GetSize();
152 
157  void SetMask(bool state);
158  void SetMask(unsigned int icursor, bool state);
159 
163  bool IsMasked();
164  bool IsMasked(unsigned int icursor);
165 
167 
171  void GetBounds(double bounds[6]);
172  void GetBounds(unsigned int icursor, double bounds[6]);
174 
176 
179  void GetPoint(double point[3]);
180  void GetPoint(unsigned int icursor, double point[3]);
182 
186  bool IsLeaf();
187  bool IsLeaf(unsigned int icursor);
188 
192  void SubdivideLeaf();
193 
197  bool IsRoot();
198 
202  unsigned int GetLevel();
203  unsigned int GetLevel(unsigned int icursor);
204 
212  void ToChild(unsigned char ichild);
213 
219  void ToRoot();
220 
226  void ToParent();
227 
231  unsigned int GetNumberOfCursors() const { return this->NumberOfCursors; }
232 
236  unsigned int GetIndiceCentralCursor() const { return this->IndiceCentralCursor; }
237 
244  unsigned int icursor);
245 
252  unsigned int icursor);
253 
254 protected:
259 
264 
269 
275 
280  std::vector<unsigned int> FirstNonValidEntryByLevel;
281  std::vector<vtkHyperTreeGridGeometryLevelEntry> Entries;
282 
288  std::vector<unsigned int> ReferenceEntries;
289 
293  unsigned int GetIndiceEntry(unsigned int icursor);
294 
298  unsigned int GetIndicePreviousEntry(unsigned int icursor);
299 
303  unsigned int IndiceCentralCursor;
304 
305  /*
306  * Number of cursors in supercursor.
307  */
308  unsigned int NumberOfCursors;
309 
310  /*
311  * Super cursor traversal table to go retrieve the parent index for each cursor
312  * of the child node. There are f^d * NumberOfCursors entries in the table.
313  */
314  const unsigned int* ChildCursorToParentCursorTable;
315 
316  /*
317  * Super cursor traversal table to go retrieve the child index for each cursor
318  * of the child node. There are f^d * NumberOfCursors entries in the table.
319  */
320  const unsigned int* ChildCursorToChildTable;
321 
322 private:
324  void operator=(const vtkHyperTreeGridNonOrientedSuperCursor&) = delete;
325 };
326 
327 VTK_ABI_NAMESPACE_END
328 #endif
void GetBounds(T a, double bds[6])
vtkHyperTreeGrid * Grid
The pointer to the HyperTreeGrid instance during the crossing.
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.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
std::vector< vtkHyperTreeGridGeometryLevelEntry > Entries
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
unsigned int FirstCurrentNeighboorReferenceEntry
The last valid reference describing neighbors.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
Describes the central cursor necessary an instance of vtkHyperTreeGridNonOrientedGeometryCursor.
a simple class to control print indentation
Definition: vtkIndent.h:28
unsigned int GetIndiceCentralCursor() const
Get the indice of central cursor, the current cell.
unsigned int GetNumberOfCursors() const
Get the number of cursors to describe neighboring cells and the current cell.
void GetPoint(int i, int j, int k, double pnt[3])
A data object structured as a tree.
Definition: vtkHyperTree.h:170
bool HasTree(const T &e)
unsigned int CurrentFirstNonValidEntryByLevel
Hyper tree grid to which the cursor is attached.