VTK  9.3.20240329
vtkHyperTreeGridOrientedGeometryCursor.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
26 #ifndef vtkHyperTreeGridOrientedGeometryCursor_h
27 #define vtkHyperTreeGridOrientedGeometryCursor_h
28 
29 #include "vtkCommonDataModelModule.h" // For export macro
30 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
31 #include "vtkHyperTreeGridTools.h" // for HasTree
32 #include "vtkObject.h"
33 
34 #include <memory> // For std::shared_ptr
35 #include <vector> // For std::vector
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkHyperTree;
39 class vtkHyperTreeGrid;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridOrientedGeometryCursor : public vtkObject
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49  void Dump(ostream& os);
50 
56 
60  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
61 
63 
66  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
68  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
69  double* origin);
72 
74 
77  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
79 
81 
84  vtkHyperTree* GetTree() const { return this->Tree; }
86 
91 
97 
102  unsigned char GetDimension();
103 
108  unsigned char GetNumberOfChildren();
109 
112 
113  double* GetOrigin();
114  double* GetSize();
115 
116  void GetBounds(double bounds[6]);
117  void GetPoint(double point[3]);
118 
123  void SetMask(bool state);
124 
128  bool IsMasked();
129 
133  bool IsLeaf();
134 
136 
140  bool IsRoot();
141 
145  unsigned int GetLevel();
146 
154  void ToChild(unsigned char ichild);
155 
156 protected:
161 
166 
171 
173 
177  std::shared_ptr<vtkHyperTreeGridScales> Scales;
178 
179  unsigned int Level;
180 
181  // Hyper tree grid to which the cursor is attached
183 
184 private:
186  void operator=(const vtkHyperTreeGridOrientedGeometryCursor&) = delete;
187 };
188 VTK_ABI_NAMESPACE_END
189 #endif
GeometryEntry is a cache data for cursors requiring coordinates.
bool HasTree() const
Return if a Tree pointing exist.
void SetGlobalIndexFromLocal(vtkIdType index)
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
~vtkHyperTreeGridOrientedGeometryCursor() override
Used by vtkHyperTreeGridNonOrientedVonNeumannSuperCursor & Moore.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetGlobalIndexStart(vtkIdType index)
static vtkHyperTreeGridOrientedGeometryCursor * New()
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
unsigned char GetDimension()
Return the dimension of the tree.
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
bool IsLeaf()
Is the cursor pointing to a leaf?
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
Initialize cursor at root of given tree index in grid.
virtual vtkHyperTreeGridOrientedGeometryCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGrid * Grid
Reference to the HTG currently processed.
void SetMask(bool state)
Set the blanking mask is empty or not.
void Initialize(vtkHyperTreeGridOrientedGeometryCursor *cursor)
Initialize cursor at root of given tree index in grid.
bool IsMasked()
Determine whether blanking mask is empty or not.
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridOrientedGeometryCursor()
Used by vtkHyperTreeGridNonOrientedVonNeumannSuperCursor & Moore.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
std::shared_ptr< vtkHyperTreeGridScales > Scales
Storage of pre-computed per-level cell scales.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridGeometryEntry &entry)
Initialize cursor at root of given tree index in grid.
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.
Definition: vtkHyperTree.h:169
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
@ point
Definition: vtkX3D.h:236
@ level
Definition: vtkX3D.h:395
@ index
Definition: vtkX3D.h:246
bool HasTree(const T &e)
int vtkIdType
Definition: vtkType.h:315