VTK  9.4.20241103
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
31#ifndef vtkHyperTreeGridNonOrientedCursor_h
32#define vtkHyperTreeGridNonOrientedCursor_h
33
34#include "vtkCommonDataModelModule.h" // For export macro
35#include "vtkObject.h"
36
37#include <vector> // For std::vector
38
39VTK_ABI_NAMESPACE_BEGIN
40class vtkHyperTree;
43
44class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedCursor : public vtkObject
45{
46public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
50
57
64
68 void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
69
74 vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkHyperTreeGridEntry& entry);
75
79 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index);
80
82
87
89
92 bool HasTree() const;
94
96
101
106
112
117 unsigned char GetDimension();
118
123 unsigned char GetNumberOfChildren();
124
126
128
133 void SetMask(bool state);
134
138 bool IsMasked();
139
143 bool IsLeaf();
144
146
150 bool IsRoot();
151
155 unsigned int GetLevel();
156
164 void ToChild(unsigned char ichild);
165
171 void ToRoot();
172
178 void ToParent();
179
180protected:
185
190
195
197 unsigned int Level;
199
203 std::vector<vtkHyperTreeGridEntry> Entries;
204
205private:
207 void operator=(const vtkHyperTreeGridNonOrientedCursor&) = delete;
208};
209VTK_ABI_NAMESPACE_END
210#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.
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
static vtkHyperTreeGridNonOrientedCursor * New()
~vtkHyperTreeGridNonOrientedCursor() override
Destructor.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGrid * Grid
Reference to the HTG currently processed.
void SetMask(bool state)
Set the blanking mask is empty or not.
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.
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.
vtkHyperTreeGridNonOrientedCursor * CloneFromCurrentEntry()
Create a copy of this, but discard history.
bool IsMasked()
Determine whether blanking mask is empty or not.
void SetGlobalIndexStart(vtkIdType index)
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)
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedCursor * Clone()
Create a copy of ‘this’.
std::vector< vtkHyperTreeGridEntry > Entries
Hyper tree grid to which the cursor is attached.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
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.
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
int vtkIdType
Definition vtkType.h:315