VTK  9.3.0
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
27 #ifndef vtkHyperTreeGridOrientedGeometryCursor_h
28 #define vtkHyperTreeGridOrientedGeometryCursor_h
29 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
32 #include "vtkHyperTreeGridTools.h" // for HasTree
33 #include "vtkObject.h"
34 
35 #include <memory> // For std::shared_ptr
36 #include <vector> // For std::vector
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkHyperTree;
40 class vtkHyperTreeGrid;
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridOrientedGeometryCursor : public vtkObject
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  void Dump(ostream& os);
51 
57 
61  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
62 
66  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
68 
72  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
73  double* origin);
74 
79 
81 
84  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
86 
88 
91  vtkHyperTree* GetTree() const { return this->Tree; }
93 
98 
104 
109  unsigned char GetDimension();
110 
115  unsigned char GetNumberOfChildren();
116 
121 
126 
130  double* GetOrigin();
131  double* GetSize();
132 
136  void GetBounds(double bounds[6]);
137  void GetPoint(double point[3]);
138 
143  void SetMask(bool state);
144 
148  bool IsMasked();
149 
153  bool IsLeaf();
154 
159 
163  bool IsRoot();
164 
168  unsigned int GetLevel();
169 
177  void ToChild(unsigned char ichild);
178 
179 protected:
185 
191 
196 
201 
205  std::shared_ptr<vtkHyperTreeGridScales> Scales;
206 
210  unsigned int Level;
211 
212  // Hyper tree grid to which the cursor is attached
214 
215 private:
217  void operator=(const vtkHyperTreeGridOrientedGeometryCursor&) = delete;
218 };
219 VTK_ABI_NAMESPACE_END
220 #endif
bool HasTree() const
Return if a Tree pointing exist.
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
void GetBounds(double bounds[6])
JB.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
~vtkHyperTreeGridOrientedGeometryCursor() override
Destructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetGlobalIndexStart(vtkIdType index)
JB.
static vtkHyperTreeGridOrientedGeometryCursor * New()
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
unsigned char GetDimension()
Return the dimension of the tree.
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
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)
JB.
virtual vtkHyperTreeGridOrientedGeometryCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
void SetMask(bool state)
Set the blanking mask is empty or not.
void Initialize(vtkHyperTreeGridOrientedGeometryCursor *cursor)
JB.
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()
Constructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
std::shared_ptr< vtkHyperTreeGridScales > Scales
JB 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:29
abstract base class for most VTK objects
Definition: vtkObject.h:52
@ 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