VTK  9.3.20240914
vtkHyperTreeGridNonOrientedGeometryCursor.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 vtkHyperTreeGridNonOrientedGeometryCursor_h
33#define vtkHyperTreeGridNonOrientedGeometryCursor_h
34
35#include "vtkCommonDataModelModule.h" // For export macro
36#include "vtkObject.h"
37
38#include "vtkHyperTreeGridGeometryEntry.h" // Used internally
39#include "vtkHyperTreeGridTools.h" // for HasTree
40#include "vtkSmartPointer.h" // Used internally
41#include <memory> // std::shared_ptr
42#include <vector> // std::vector
43
44VTK_ABI_NAMESPACE_BEGIN
45class vtkHyperTree;
49
50class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedGeometryCursor : public vtkObject
51{
52public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
56
57 void Dump(ostream& os);
58
64
68 void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
69
73 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
75
76 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
77 double* origin);
78
80
82
85 bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
87
89
92 vtkHyperTree* GetTree() const { return this->Tree; }
94
99
105
110 unsigned char GetDimension();
111
116 unsigned char GetNumberOfChildren();
117
120
121 double* GetOrigin();
122 double* GetSize();
123
124 void GetBounds(double bounds[6]);
125 void GetPoint(double point[3]);
126
131 void SetMask(bool state);
132
136 bool IsMasked();
137
141 bool IsLeaf();
142
144
148 bool IsRoot();
149
153 unsigned int GetLevel();
154
162 void ToChild(unsigned char ichild);
163
169 void ToRoot();
170
176 void ToParent();
177
183 vtkHyperTreeGrid* grid);
184
185protected:
190
195
200
202 std::shared_ptr<vtkHyperTreeGridScales> Scales;
203 unsigned int Level;
205
206 // Hyper tree grid to which the cursor is attached
207 std::vector<vtkHyperTreeGridGeometryEntry> Entries;
208
209private:
212 void operator=(const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
213};
214VTK_ABI_NAMESPACE_END
215#endif
GeometryEntry is a cache data for cursors requiring coordinates.
void ToParent()
Move the cursor to the parent of the current vertex.
static vtkHyperTreeGridNonOrientedGeometryCursor * New()
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridOrientedGeometryCursor from input grid and current entry data.
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
unsigned char GetDimension()
Return the dimension of the tree.
bool IsRoot()
Is the cursor at tree root?
void SetGlobalIndexFromLocal(vtkIdType index)
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor *cursor)
vtkHyperTreeGrid * Grid
Reference to the HTG currently processed.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridGeometryEntry &entry)
Initialize cursor at root of given tree index in grid.
void ToRoot()
Move the cursor to the root vertex.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridNonOrientedGeometryCursor()
Used by vtkHyperTreeGridNonOrientedVonNeumannSuperCursor and Moore.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
virtual vtkHyperTreeGridNonOrientedGeometryCursor * Clone()
Create a copy of ‘this’.
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
~vtkHyperTreeGridNonOrientedGeometryCursor() override
Used by vtkHyperTreeGridNonOrientedVonNeumannSuperCursor and Moore.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
bool IsLeaf()
Is the cursor pointing to a leaf?
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
A specifalized type of vtkHyperTreeGrid for the case when root cells have uniform sizes in each direc...
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
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition vtkType.h:315