VTK  9.3.20240423
vtkHyperTreeGridOrientedCursor.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 vtkHyperTreeGridOrientedCursor_h
32#define vtkHyperTreeGridOrientedCursor_h
33
34#include "vtkCommonDataModelModule.h" // For export macro
35#include "vtkHyperTreeGridEntry.h" // Used internally
36#include "vtkObject.h"
37
38VTK_ABI_NAMESPACE_BEGIN
39class vtkHyperTree;
41
42class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridOrientedCursor : public vtkObject
43{
44public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
48
54
56
59 void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
60 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index);
62 vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkHyperTreeGridEntry& entry);
64
66
71
73
76 bool HasTree() const;
78
80
85
90
96
101 unsigned char GetDimension();
102
107 unsigned char GetNumberOfChildren();
108
111
116 void SetMask(bool state);
117
121 bool IsMasked();
122
126 bool IsLeaf();
127
129
133 bool IsRoot();
134
138 unsigned int GetLevel();
139
147 void ToChild(unsigned char ichild);
148
149protected:
154
159
164
166 unsigned int Level;
167
168 // Hyper tree grid to which the cursor is attached
170
171private:
173 void operator=(const vtkHyperTreeGridOrientedCursor&) = delete;
174};
175VTK_ABI_NAMESPACE_END
176#endif
Entries are cache data for cursors.
Objects for traversal a HyperTreeGrid.
vtkHyperTreeGridOrientedCursor()
Constructor.
void SetGlobalIndexStart(vtkIdType index)
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
bool IsMasked()
Determine whether blanking mask is empty or not.
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridOrientedCursor * Clone()
Create a copy of ‘this’.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index)
Initialize cursor at root of given tree index in grid.
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
void SetGlobalIndexFromLocal(vtkIdType index)
vtkHyperTreeGrid * Grid
Reference to the HTG currently processed.
~vtkHyperTreeGridOrientedCursor() override
Destructor.
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
bool HasTree() const
Return if a Tree pointing exist.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
bool IsLeaf()
Is the cursor pointing to a leaf?
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridEntry &entry)
Initialize cursor at root of given tree index in grid.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
unsigned char GetDimension()
Return the dimension of the tree.
static vtkHyperTreeGridOrientedCursor * New()
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.
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