VTK  9.3.0
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
33#ifndef vtkHyperTreeGridNonOrientedGeometryCursor_h
34#define vtkHyperTreeGridNonOrientedGeometryCursor_h
35
36#include "vtkCommonDataModelModule.h" // For export macro
37#include "vtkObject.h"
38
39#include "vtkHyperTreeGridGeometryEntry.h" // Used internally
40#include "vtkHyperTreeGridTools.h" // for HasTree
41#include "vtkSmartPointer.h" // Used internally
42#include <memory> // std::shared_ptr
43#include <vector> // std::vector
44
45VTK_ABI_NAMESPACE_BEGIN
46class vtkHyperTree;
50
51class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedGeometryCursor : public vtkObject
52{
53public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
57
58 void Dump(ostream& os);
59
60 // JB TODO 102018 On autorise le ToParent que jusqu'à ce que Level soit celui de la creation...
61 // mais sans toRoot ? Une variante... qui serait utile aussi au niveau des SC
62
68
72 void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
73
77 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
79
83 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
84 double* origin);
85
90
92
95 bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
97
99
102 vtkHyperTree* GetTree() const { return this->Tree; }
104
109
115
120 unsigned char GetDimension();
121
126 unsigned char GetNumberOfChildren();
127
132
137
141 double* GetOrigin();
142 double* GetSize();
143
147 void GetBounds(double bounds[6]);
148 void GetPoint(double point[3]);
149
154 void SetMask(bool state);
155
159 bool IsMasked();
160
164 bool IsLeaf();
165
170
174 bool IsRoot();
175
179 unsigned int GetLevel();
180
188 void ToChild(unsigned char ichild);
189
195 void ToRoot();
196
202 void ToParent();
203
209 vtkHyperTreeGrid* grid);
210
211protected:
217
223
228
233
237 std::shared_ptr<vtkHyperTreeGridScales> Scales;
238
242 unsigned int Level;
243
248
249 // Hyper tree grid to which the cursor is attached
250 std::vector<vtkHyperTreeGridGeometryEntry> Entries;
251
252private:
255 void operator=(const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
256};
257VTK_ABI_NAMESPACE_END
258#endif
void ToParent()
Move the cursor to the parent of the current vertex.
static vtkHyperTreeGridNonOrientedGeometryCursor * New()
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
JB Create a vtkHyperTreeGridOrientedGeometryCursor from input grid and current entry data.
void SetMask(bool state)
Set the blanking mask is empty or not.
std::shared_ptr< vtkHyperTreeGridScales > Scales
JB Storage of pre-computed per-level cell scales.
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)
JB.
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor *cursor)
JB.
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
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()
Constructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
void GetBounds(double bounds[6])
JB.
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
Destructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
void SetGlobalIndexStart(vtkIdType index)
JB.
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
JB.
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:29
abstract base class for most VTK objects
Definition vtkObject.h:49
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition vtkType.h:315