VTK  9.2.20230320
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright Nonice for more information.
13 
14 =========================================================================*/
45 #ifndef vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor_h
46 #define vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor_h
47 
48 #include "vtkCommonDataModelModule.h" // For export macro
49 #include "vtkObject.h"
50 
51 #include "vtkHyperTreeGridGeometryUnlimitedLevelEntry.h" // cache for historic
52 #include "vtkHyperTreeGridTools.h" // for HasTree
53 #include "vtkSmartPointer.h" // Used internally
54 #include <memory> // std::shared_ptr
55 #include <vector> // std::vector
56 
57 VTK_ABI_NAMESPACE_BEGIN
58 class vtkHyperTree;
59 class vtkHyperTreeGrid;
63 
65  : public vtkObject
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
72  void Dump(ostream& os);
73 
74  // JB TODO 102018 On autorise le ToParent que jusqu'à ce que Level soit celui de la creation...
75  // mais sans toRoot ? Une variante... qui serait utile aussi au niveau des SC
76 
82 
86  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
87 
91  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
93 
97  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
98  double* origin);
99 
104 
106 
109  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
111 
113 
116  vtkHyperTree* GetTree() const { return this->Tree; }
118 
123 
129 
134  unsigned char GetDimension();
135 
140  unsigned char GetNumberOfChildren();
141 
146 
151 
155  double* GetOrigin();
156  double* GetSize();
157 
161  void GetBounds(double bounds[6]);
162  void GetPoint(double point[3]);
163 
168  void SetMask(bool state);
169 
173  bool IsMasked();
174 
179  bool IsLeaf();
180 
185  bool IsRealLeaf();
186 
192 
196  bool IsRoot();
197 
201  unsigned int GetLevel();
202  unsigned int GetLastRealLevel();
203 
211  void ToChild(unsigned char ichild);
212 
218  void ToRoot();
219 
225  void ToParent();
226 
232  vtkHyperTreeGrid* grid);
233 
240 
241 protected:
247 
253 
258 
263 
267  std::shared_ptr<vtkHyperTreeGridScales> Scales;
268 
272  unsigned int Level;
273 
278 
279  // Hyper tree grid to which the cursor is attached
280  std::vector<vtkHyperTreeGridGeometryUnlimitedLevelEntry> Entries;
281 
282 private:
285  void operator=(const vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor&) = delete;
286 };
287 VTK_ABI_NAMESPACE_END
288 #endif
Cursor cache data with coordinates and level info.
void SetMask(bool state)
Set the blanking mask is empty or not.
static vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor * New()
bool IsRoot()
Is the cursor at tree root?
virtual vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor * Clone()
Create a copy of ‘this’.
void Initialize(vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor *cursor)
JB.
vtkHyperTreeGrid * Grid
Reference sur l'hyper tree grid parcouru actuellement.
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
bool IsMasked()
Determine whether blanking mask is empty or not.
~vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor() override
Destructor Only for vtkHyperTreeGridNonOrientedVonNeumannSuperCursor & Moore.
void ToRoot()
Move the cursor to the root vertex.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetHyperTreeGridNonOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridNonOrientedGeometryCursor from input grid and current entry data.
bool IsVirtualLeaf()
Is the cursor pointing to a subdivided leaf ? Return false if the leaf is a real one.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridGeometryUnlimitedLevelEntry &entry)
Initialize cursor at root of given tree index in grid.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
bool IsRealLeaf()
Is the cursor pointing to a leaf in the original tree ? Return false if the leaf is virtual.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::vector< vtkHyperTreeGridGeometryUnlimitedLevelEntry > Entries
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
JB.
unsigned char GetDimension()
Return the dimension of the tree.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor()
Constructor Only for vtkHyperTreeGridNonOrientedVonNeumannSuperCursor & Moore.
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
std::shared_ptr< vtkHyperTreeGridScales > Scales
Storage of pre-computed per-level cell scales.
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridOrientedGeometryCursor from input grid and current entry data.
bool IsLeaf()
Is the cursor pointing to a leaf? only respect depth limited, otherwise return false.
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:181
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract base class for most VTK objects
Definition: vtkObject.h:83
Hold a reference to a vtkObjectBase instance.
@ point
Definition: vtkX3D.h:248
@ level
Definition: vtkX3D.h:407
@ index
Definition: vtkX3D.h:258
bool HasTree(const T &e)
int vtkIdType
Definition: vtkType.h:327