VTK  9.0.1
vtkHyperTreeGridNonOrientedGeometryCursor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridNonOrientedGeometryCursor.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 =========================================================================*/
39 #ifndef vtkHyperTreeGridNonOrientedGeometryCursor_h
40 #define vtkHyperTreeGridNonOrientedGeometryCursor_h
41 
42 #include "vtkCommonDataModelModule.h" // For export macro
43 #include "vtkObject.h"
44 
45 #include "vtkHyperTreeGridGeometryEntry.h" // Used internally
46 #include "vtkHyperTreeGridTools.h" // for HasTree
47 #include "vtkSmartPointer.h" // Used internally
48 #include <memory> // std::shared_ptr
49 #include <vector> // std::vector
50 
51 class vtkHyperTree;
52 class vtkHyperTreeGrid;
55 
56 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedGeometryCursor : public vtkObject
57 {
58 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
63  void Dump(ostream& os);
64 
65  // JB TODO 102018 On autorise le ToParent que jusqu'à ce que Level soit celui de la creation...
66  // mais sans toRoot ? Une variante... qui serait utile aussi au niveau des SC
67 
73 
77  void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
78 
82  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
84 
88  void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
89  double* origin);
90 
95 
97 
100  bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
102 
104 
107  vtkHyperTree* GetTree() const { return this->Tree; }
109 
114 
120 
125  unsigned char GetDimension();
126 
131  unsigned char GetNumberOfChildren();
132 
137 
142 
146  double* GetOrigin();
147  double* GetSize();
148 
152  void GetBounds(double bounds[6]);
153  void GetPoint(double point[3]);
154 
159  void SetMask(bool state);
160 
164  bool IsMasked();
165 
169  bool IsLeaf();
170 
175 
179  bool IsRoot();
180 
184  unsigned int GetLevel();
185 
193  void ToChild(unsigned char ichild);
194 
200  void ToRoot();
201 
207  void ToParent();
208 
214  vtkHyperTreeGrid* grid);
215 
216 protected:
222 
228 
233 
238 
242  std::shared_ptr<vtkHyperTreeGridScales> Scales;
243 
247  unsigned int Level;
248 
253 
254  // Hyper tree grid to which the cursor is attached
255  std::vector<vtkHyperTreeGridGeometryEntry> Entries;
256 
257 private:
260  void operator=(const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
261 };
262 #endif
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridGeometryEntry &entry)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:57
vtkHyperTreeGridNonOrientedGeometryCursor::Grid
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:232
vtkHyperTreeGridNonOrientedGeometryCursor::GetPoint
void GetPoint(double point[3])
vtkHyperTreeGridNonOrientedGeometryCursor::GetOrigin
double * GetOrigin()
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::ToRoot
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTreeGridNonOrientedGeometryCursor::HasTree
bool HasTree() const
Return if a Tree pointing exist.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:100
vtkHyperTreeGridNonOrientedGeometryCursor::ToChild
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridNonOrientedGeometryCursor::GetSize
double * GetSize()
vtkHyperTreeGridNonOrientedGeometryCursor::GetDimension
unsigned char GetDimension()
Return the dimension of the tree.
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkHyperTreeGridNonOrientedGeometryCursor::IsLeaf
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkHyperTreeGridNonOrientedGeometryCursor::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridNonOrientedGeometryCursor::Dump
void Dump(ostream &os)
vtkHyperTreeGridTools.h
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:36
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridGeometryEntry
JB.
Definition: vtkHyperTreeGridGeometryEntry.h:49
vtkHyperTreeGridNonOrientedGeometryCursor::Scales
std::shared_ptr< vtkHyperTreeGridScales > Scales
JB Storage of pre-computed per-level cell scales.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:242
vtkHyperTreeGridNonOrientedGeometryCursor::New
static vtkHyperTreeGridNonOrientedGeometryCursor * New()
vtkHyperTreeGridNonOrientedGeometryCursor::SetMask
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGridNonOrientedGeometryCursor::IsMasked
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTreeGridNonOrientedGeometryCursor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor *cursor)
JB.
vtk::hypertreegrid::HasTree
bool HasTree(const T &e)
Definition: vtkHyperTreeGridTools.h:25
vtkHyperTreeGridNonOrientedGeometryCursor::Clone
virtual vtkHyperTreeGridNonOrientedGeometryCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridScales
A specifalized type of vtkHyperTreeGrid for the case when root cells have uniform sizes in each direc...
Definition: vtkHyperTreeGridScales.h:35
vtkHyperTreeGridNonOrientedGeometryCursor::GetBounds
void GetBounds(double bounds[6])
JB.
vtkX3D::level
@ level
Definition: vtkX3D.h:401
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
JB.
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkHyperTreeGridNonOrientedGeometryCursor::vtkHyperTreeGridNonOrientedGeometryCursor
vtkHyperTreeGridNonOrientedGeometryCursor()
Constructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
vtkHyperTreeGridNonOrientedGeometryCursor::Level
unsigned int Level
JB.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:247
vtkHyperTreeGridOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridOrientedGeometryCursor.h:55
vtkHyperTreeGridNonOrientedGeometryCursor::GetLevel
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkHyperTreeGridNonOrientedGeometryCursor::GetNumberOfChildren
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
vtkSmartPointer.h
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:179
vtkHyperTreeGridNonOrientedGeometryCursor::IsRoot
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridNonOrientedGeometryCursor::GetTree
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:107
vtkHyperTreeGridNonOrientedGeometryCursor::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkObject.h
vtkHyperTreeGridNonOrientedGeometryCursor::Entries
std::vector< vtkHyperTreeGridGeometryEntry > Entries
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:255
vtkHyperTreeGridGeometryEntry.h
vtkHyperTreeGridNonOrientedGeometryCursor::Tree
vtkHyperTree * Tree
JB.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:237
vtkHyperTreeGridNonOrientedGeometryCursor::GetHyperTreeGridOrientedGeometryCursor
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
JB Create a vtkHyperTreeGridOrientedGeometryCursor from input grid and current entry data.
vtkHyperTreeGridNonOrientedGeometryCursor::SubdivideLeaf
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
vtkHyperTreeGridNonOrientedGeometryCursor::SetGlobalIndexStart
void SetGlobalIndexStart(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::ToParent
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTreeGridNonOrientedGeometryCursor::~vtkHyperTreeGridNonOrientedGeometryCursor
~vtkHyperTreeGridNonOrientedGeometryCursor() override
Destructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkHyperTreeGridNonOrientedGeometryCursor::GetVertexId
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkHyperTreeGridNonOrientedGeometryCursor::LastValidEntry
int LastValidEntry
JB La derniere entree valide.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:252
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:97