VTK  9.3.0
vtkHyperTreeGridNonOrientedCursor.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 vtkHyperTreeGridNonOrientedCursor_h
33 #define vtkHyperTreeGridNonOrientedCursor_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkObject.h"
37 
38 #include <vector> // For std::vector
39 
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkHyperTree;
42 class vtkHyperTreeGrid;
44 
45 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedCursor : public vtkObject
46 {
47 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
57 
61  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
62 
66  void Initialize(
67  vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkHyperTreeGridEntry& entry);
68 
72  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index);
73 
75 
80 
82 
85  bool HasTree() const;
87 
89 
94 
99 
105 
110  unsigned char GetDimension();
111 
116  unsigned char GetNumberOfChildren();
117 
122 
127 
132  void SetMask(bool state);
133 
137  bool IsMasked();
138 
142  bool IsLeaf();
143 
148 
152  bool IsRoot();
153 
157  unsigned int GetLevel();
158 
166  void ToChild(unsigned char ichild);
167 
173  void ToRoot();
174 
180  void ToParent();
181 
182 protected:
187 
192 
197 
202 
206  unsigned int Level;
207 
212 
216  std::vector<vtkHyperTreeGridEntry> Entries;
217 
218 private:
220  void operator=(const vtkHyperTreeGridNonOrientedCursor&) = delete;
221 };
222 VTK_ABI_NAMESPACE_END
223 #endif
Entries are cache data for cursors.
Objects for traversal a HyperTreeGrid.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index)
Initialize cursor at root of given tree index in grid.
~vtkHyperTreeGridNonOrientedCursor() override
Destructor.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
int LastValidEntry
JB Le dernier noeud valid enregistre.
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
bool IsRoot()
Is the cursor at tree root?
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
void ToRoot()
Move the cursor to the root vertex.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridEntry &entry)
Initialize cursor at root of given tree index in grid.
static vtkHyperTreeGridNonOrientedCursor * New()
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.
bool HasTree() const
Return if a Tree pointing exist.
bool IsMasked()
Determine whether blanking mask is empty or not.
void SetGlobalIndexStart(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridNonOrientedCursor()
Constructor.
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
std::vector< vtkHyperTreeGridEntry > Entries
JB Hyper tree grid to which the cursor is attached.
void ToParent()
Move the cursor to the parent of the current vertex.
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:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
@ level
Definition: vtkX3D.h:395
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315