VTK  9.7.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 
94  vtkHyperTree* GetInformation(
95  unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
96 
101  unsigned char GetDimension();
102 
107  unsigned char GetNumberOfChildren();
108 
109  void SetGlobalIndexStart(vtkIdType index);
110 
111  void SetGlobalIndexFromLocal(vtkIdType index);
112 
113  double* GetOrigin();
114  double* GetSize();
115 
120  void SetMask(bool state);
121  void SetMask(unsigned int icursor, bool state);
122 
126  bool IsMasked();
127  bool IsMasked(unsigned int icursor);
128 
132  void GetBounds(double bounds[6]);
133  void GetBounds(unsigned int icursor, double bounds[6]);
134 
138  void GetPoint(double point[3]);
139  void GetPoint(unsigned int icursor, double point[3]);
140 
142 
145  bool IsLeaf();
146  bool IsLeaf(unsigned int icursor);
147  bool IsRealLeaf();
148  bool IsRealLeaf(unsigned int icursor);
150 
152 
155  bool IsVirtualLeaf();
156  bool IsVirtualLeaf(unsigned int icursor);
158 
160 
167  double GetExtensivePropertyRatio();
168  double GetExtensivePropertyRatio(vtkIdType index);
170 
174  bool IsRoot();
175 
177 
180  unsigned int GetLevel();
181  unsigned int GetLevel(unsigned int icursor);
182  unsigned int GetLastRealLevel();
183  unsigned int GetLastRealLevel(unsigned int icursor);
185 
193  void ToChild(unsigned char ichild);
194 
200  void ToRoot();
201 
207  void ToParent();
208 
209  unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
210 
217  unsigned int icursor);
218 
225  unsigned int icursor);
226 
227 protected:
232 
237 
241  vtkHyperTreeGrid* Grid = nullptr;
242 
244 
248  unsigned int CurrentFirstNonValidEntryByLevel = 0;
249  std::vector<unsigned int> FirstNonValidEntryByLevel;
250  std::vector<vtkHyperTreeGridGeometryUnlimitedLevelEntry> Entries;
251 
256  unsigned int FirstCurrentNeighboorReferenceEntry = 0;
257  std::vector<unsigned int> ReferenceEntries;
258 
259  unsigned int GetIndiceEntry(unsigned int icursor);
260 
264  unsigned int GetIndicePreviousEntry(unsigned int icursor);
265 
266  unsigned int IndiceCentralCursor = 0;
267 
268  // Number of cursors in supercursor
269  unsigned int NumberOfCursors = 0;
270 
271  // Super cursor traversal table to go retrieve the parent index for each cursor
272  // of the child node. There are f^d * NumberOfCursors entries in the table.
273  const unsigned int* ChildCursorToParentCursorTable = nullptr;
274 
275  // Super cursor traversal table to go retrieve the child index for each cursor
276  // of the child node. There are f^d * NumberOfCursors entries in the table.
277  const unsigned int* ChildCursorToChildTable = nullptr;
278 
279 private:
282  void operator=(const vtkHyperTreeGridNonOrientedUnlimitedSuperCursor&) = delete;
283 };
284 
285 VTK_ABI_NAMESPACE_END
286 #endif
void GetBounds(T a, double bds[6])
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.
vtkSmartPointer< vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor > CentralCursor
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
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:170
bool HasTree(const T &e)