VTK  9.3.0
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 
53 
55 
58  bool HasTree();
60 
64  bool HasTree(unsigned int icursor);
65 
67 
71  vtkHyperTree* GetTree(unsigned int icursor);
73 
75 
79  vtkIdType GetVertexId(unsigned int icursor);
81 
87 
92  vtkIdType GetGlobalNodeIndex(unsigned int icursor);
93 
98  unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
99 
104  unsigned char GetDimension();
105 
110  unsigned char GetNumberOfChildren();
111 
116 
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 
168  bool IsVirtualLeaf(unsigned int icursor);
170 
172 
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
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
JB.
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
void GetPoint(double point[3])
JB Coordonnees du centre de la maille.
void SetMask(unsigned int icursor, bool state)
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
unsigned int GetIndicePreviousEntry(unsigned int icursor)
JB La valeur precedente.
std::vector< vtkHyperTreeGridGeometryUnlimitedLevelEntry > Entries
unsigned int GetLastRealLevel(unsigned int icursor)
Get the level of the tree vertex pointed by the cursor.
double GetExtensivePropertyRatio(vtkIdType index)
returns the value of the ratio to be applied to extensive value for the current cursor,...
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
bool IsMasked()
Determine whether blanking mask is empty or not.
bool HasTree(unsigned int icursor)
JB Return if a Tree pointing exist.
unsigned int GetIndiceEntry(unsigned int icursor)
JB.
virtual void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)=0
Initialize cursor at root of given tree index in grid.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned char GetDimension()
Return the dimension of the tree.
void GetBounds(double bounds[6])
JB Coordonnees de la boite englobante.
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
bool IsLeaf(unsigned int icursor)
Is the cursor pointing to a leaf?
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetNonOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
~vtkHyperTreeGridNonOrientedUnlimitedSuperCursor() override
Destructor.
vtkIdType GetGlobalNodeIndex(unsigned int icursor)
JB Return the global index (relative to the grid) of the neighboor icursor current vertex in the tree...
unsigned int GetLevel(unsigned int icursor)
Get the level of the tree vertex pointed by the cursor.
vtkSmartPointer< vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor > CentralCursor
JB.
bool IsRealLeaf(unsigned int icursor)
Is the cursor pointing to a leaf?
bool IsVirtualLeaf(unsigned int icursor)
Is the cursor pointing to a real node in the tree.
vtkHyperTree * GetTree(unsigned int icursor)
Set the hyper tree to which the cursor is pointing.
vtkIdType GetVertexId(unsigned int icursor)
Return the index of the current vertex in the tree.
double GetExtensivePropertyRatio()
returns the value of the ratio to be applied to extensive value for the current cursor,...
void SetMask(bool state)
Set the blanking mask is empty or not.
bool IsRealLeaf()
Is the cursor pointing to a leaf?
virtual vtkHyperTreeGridNonOrientedUnlimitedSuperCursor * Clone()
Create a copy of ‘this’.
bool IsRoot()
Is the cursor at tree root?
void GetBounds(unsigned int icursor, double bounds[6])
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
void ToRoot()
Move the cursor to the root vertex.
bool IsVirtualLeaf()
Is the cursor pointing to a real node in the tree.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
bool HasTree()
Return if a Tree pointing exist.
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
unsigned int GetLastRealLevel()
Get the level of the tree vertex pointed by the cursor.
void ToParent()
Move the cursor to the parent of the current vertex.
void GetPoint(unsigned int icursor, double point[3])
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
A data object structured as a tree.
Definition: vtkHyperTree.h:169
a simple class to control print indentation
Definition: vtkIndent.h:29
abstract base class for most VTK objects
Definition: vtkObject.h:52
Hold a reference to a vtkObjectBase instance.
@ point
Definition: vtkX3D.h:236
@ level
Definition: vtkX3D.h:395
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315