VTK  9.3.1
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor.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
11 #ifndef vtkHyperTreeGridNonOrientedUnlimitedSuperCursor_h
12 #define vtkHyperTreeGridNonOrientedUnlimitedSuperCursor_h
13 
14 #include "vtkCommonDataModelModule.h" // For export macro
15 #include "vtkObject.h"
16 #include "vtkSmartPointer.h" // Used internally
17 
18 #include "vtkHyperTreeGridGeometryUnlimitedLevelEntry.h" // Used Internally
19 
20 #include <vector> // For std::vector
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkHyperTree;
24 class vtkHyperTreeGrid;
28 
29 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedUnlimitedSuperCursor : public vtkObject
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
40 
45  virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
46 
48 
51  vtkHyperTreeGrid* GetGrid();
53 
55 
58  bool HasTree();
60 
64  bool HasTree(unsigned int icursor);
65 
67 
70  vtkHyperTree* GetTree();
71  vtkHyperTree* GetTree(unsigned int icursor);
73 
75 
78  vtkIdType GetVertexId();
79  vtkIdType GetVertexId(unsigned int icursor);
81 
86  vtkIdType GetGlobalNodeIndex();
87 
92  vtkIdType GetGlobalNodeIndex(unsigned int icursor);
93 
97  vtkHyperTree* GetInformation(
98  unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
99 
104  unsigned char GetDimension();
105 
110  unsigned char GetNumberOfChildren();
111 
115  void SetGlobalIndexStart(vtkIdType index);
116 
120  void SetGlobalIndexFromLocal(vtkIdType index);
121 
125  double* GetOrigin();
126  double* GetSize();
127 
132  void SetMask(bool state);
133  void SetMask(unsigned int icursor, bool state);
134 
138  bool IsMasked();
139  bool IsMasked(unsigned int icursor);
140 
144  void GetBounds(double bounds[6]);
145  void GetBounds(unsigned int icursor, double bounds[6]);
146 
150  void GetPoint(double point[3]);
151  void GetPoint(unsigned int icursor, double point[3]);
152 
154 
157  bool IsLeaf();
158  bool IsLeaf(unsigned int icursor);
159  bool IsRealLeaf();
160  bool IsRealLeaf(unsigned int icursor);
162 
164 
167  bool IsVirtualLeaf();
168  bool IsVirtualLeaf(unsigned int icursor);
170 
172 
179  double GetExtensivePropertyRatio();
180  double GetExtensivePropertyRatio(vtkIdType index);
182 
186  bool IsRoot();
187 
189 
192  unsigned int GetLevel();
193  unsigned int GetLevel(unsigned int icursor);
194  unsigned int GetLastRealLevel();
195  unsigned int GetLastRealLevel(unsigned int icursor);
197 
205  void ToChild(unsigned char ichild);
206 
212  void ToRoot();
213 
219  void ToParent();
220 
224  unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
225 
232  unsigned int icursor);
233 
240  unsigned int icursor);
241 
242 protected:
247 
252 
256  vtkHyperTreeGrid* Grid = nullptr;
257 
262 
266  unsigned int CurrentFirstNonValidEntryByLevel = 0;
267  std::vector<unsigned int> FirstNonValidEntryByLevel;
268  std::vector<vtkHyperTreeGridGeometryUnlimitedLevelEntry> Entries;
269 
274  unsigned int FirstCurrentNeighboorReferenceEntry = 0;
275  std::vector<unsigned int> ReferenceEntries;
276 
280  unsigned int GetIndiceEntry(unsigned int icursor);
281 
285  unsigned int GetIndicePreviousEntry(unsigned int icursor);
286 
290  unsigned int IndiceCentralCursor = 0;
291 
292  // Number of cursors in supercursor
293  unsigned int NumberOfCursors = 0;
294 
295  // Super cursor traversal table to go retrieve the parent index for each cursor
296  // of the child node. There are f^d * NumberOfCursors entries in the table.
297  const unsigned int* ChildCursorToParentCursorTable = nullptr;
298 
299  // Super cursor traversal table to go retrieve the child index for each cursor
300  // of the child node. There are f^d * NumberOfCursors entries in the table.
301  const unsigned int* ChildCursorToChildTable = nullptr;
302 
303 private:
306  void operator=(const vtkHyperTreeGridNonOrientedUnlimitedSuperCursor&) = delete;
307 };
308 
309 VTK_ABI_NAMESPACE_END
310 #endif
void GetBounds(T a, double bds[6])
abstract base class for most VTK objects
Definition: vtkObject.h:51
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.
vtkSmartPointer< vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor > CentralCursor
JB.
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:315
a simple class to control print indentation
Definition: vtkIndent.h:28
std::vector< vtkHyperTreeGridGeometryUnlimitedLevelEntry > Entries
void GetPoint(int i, int j, int k, double pnt[3])
A data object structured as a tree.
Definition: vtkHyperTree.h:168
bool HasTree(const T &e)