VTK: Common/DataModel/vtkHyperTreeGridNonOrientedGeometryCursor.h Source File

| VTK 9.3.1

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
45 VTK_ABI_NAMESPACE_BEGIN
46 class vtkHyperTree;
47 class vtkHyperTreeGrid;
48 class vtkHyperTreeGridScales;
49 class vtkHyperTreeGridOrientedGeometryCursor;
50
51 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedGeometryCursor : public vtkObject
52 {
53 public:
54 vtkTypeMacro(vtkHyperTreeGridNonOrientedGeometryCursor, vtkObject);
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56 static vtkHyperTreeGridNonOrientedGeometryCursor* New();
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
67 virtual vtkHyperTreeGridNonOrientedGeometryCursor* Clone();
68
72 void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
73
77 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
78 vtkHyperTreeGridGeometryEntry& entry);
79
83 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
84 double* origin);
85
89 void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor* cursor);
90
92
95 bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
97
99
102 vtkHyperTree* GetTree() const { return this->Tree; }
104
108 vtkIdType GetVertexId();
109
114 vtkIdType GetGlobalNodeIndex();
115
120 unsigned char GetDimension();
121
126 unsigned char GetNumberOfChildren();
127
131 void SetGlobalIndexStart(vtkIdType index);
132
136 void SetGlobalIndexFromLocal(vtkIdType index);
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
169 void SubdivideLeaf();
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
208 vtkSmartPointer<vtkHyperTreeGridOrientedGeometryCursor> GetHyperTreeGridOrientedGeometryCursor(
209 vtkHyperTreeGrid* grid);
210
211 protected:
216 vtkHyperTreeGridNonOrientedGeometryCursor();
217
222 ~vtkHyperTreeGridNonOrientedGeometryCursor() override;
223
227 vtkHyperTreeGrid* Grid;
228
232 vtkHyperTree* Tree;
233
237 std::shared_ptr<vtkHyperTreeGridScales> Scales;
238
242 unsigned int Level;
243
247 int LastValidEntry;
248
249 // Hyper tree grid to which the cursor is attached
250 std::vector<vtkHyperTreeGridGeometryEntry> Entries;
251
252 private:
253 vtkHyperTreeGridNonOrientedGeometryCursor(
254 const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
255 void operator=(const vtkHyperTreeGridNonOrientedGeometryCursor&) = delete;
256 };
257 VTK_ABI_NAMESPACE_END
258 #endif
vtkHyperTreeGridGeometryEntry
JB.
Definition: vtkHyperTreeGridGeometryEntry.h:36
vtkHyperTreeGridNonOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:52
vtkHyperTreeGridNonOrientedGeometryCursor::ToParent
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTreeGridNonOrientedGeometryCursor::GetOrigin
double * GetOrigin()
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::SetMask
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGridNonOrientedGeometryCursor::Scales
std::shared_ptr< vtkHyperTreeGridScales > Scales
JB Storage of pre-computed per-level cell scales.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:237
vtkHyperTreeGridNonOrientedGeometryCursor::GetVertexId
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkHyperTreeGridNonOrientedGeometryCursor::ToChild
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridNonOrientedGeometryCursor::GetDimension
unsigned char GetDimension()
Return the dimension of the tree.
vtkHyperTreeGridNonOrientedGeometryCursor::IsRoot
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridNonOrientedGeometryCursor::Tree
vtkHyperTree * Tree
JB.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:232
vtkHyperTreeGridNonOrientedGeometryCursor::LastValidEntry
int LastValidEntry
JB La derniere entree valide.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:247
vtkHyperTreeGridNonOrientedGeometryCursor::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGridNonOrientedGeometryCursor *cursor)
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::HasTree
bool HasTree() const
Return if a Tree pointing exist.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:95
vtkHyperTreeGridNonOrientedGeometryCursor::Entries
std::vector< vtkHyperTreeGridGeometryEntry > Entries
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:250
vtkHyperTreeGridNonOrientedGeometryCursor::Clone
virtual vtkHyperTreeGridNonOrientedGeometryCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridNonOrientedGeometryCursor::Grid
vtkHyperTreeGrid * Grid
JB Reference sur l'hyper tree grid parcouru actuellement.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:227
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridGeometryEntry &entry)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedGeometryCursor::ToRoot
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTreeGridNonOrientedGeometryCursor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridNonOrientedGeometryCursor::GetTree
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:102
vtkHyperTreeGridNonOrientedGeometryCursor::vtkHyperTreeGridNonOrientedGeometryCursor
vtkHyperTreeGridNonOrientedGeometryCursor()
Constructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
vtkHyperTreeGridNonOrientedGeometryCursor::GetHyperTreeGridOrientedGeometryCursor
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
JB Create a vtkHyperTreeGridOrientedGeometryCursor from input grid and current entry data.
vtkHyperTreeGridNonOrientedGeometryCursor::Dump
void Dump(ostream &os)
vtkHyperTreeGridNonOrientedGeometryCursor::Level
unsigned int Level
JB.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:242
vtkHyperTreeGridNonOrientedGeometryCursor::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridNonOrientedGeometryCursor::GetBounds
void GetBounds(double bounds[6])
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::GetPoint
void GetPoint(double point[3])
vtkHyperTreeGridNonOrientedGeometryCursor::GetSize
double * GetSize()
vtkHyperTreeGridNonOrientedGeometryCursor::GetLevel
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
vtkHyperTreeGridNonOrientedGeometryCursor::IsMasked
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTreeGridNonOrientedGeometryCursor::~vtkHyperTreeGridNonOrientedGeometryCursor
~vtkHyperTreeGridNonOrientedGeometryCursor() override
Destructor JB Just pour vtkHyperTreeGridNonOrientedVonNeumannSuperCursor et Moore.
vtkHyperTreeGridNonOrientedGeometryCursor::SetGlobalIndexStart
void SetGlobalIndexStart(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::SubdivideLeaf
void SubdivideLeaf()
JB Fait chier normalement on devrait passer par GetEntry.
vtkHyperTreeGridNonOrientedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
JB.
vtkHyperTreeGridNonOrientedGeometryCursor::IsLeaf
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkHyperTreeGridNonOrientedGeometryCursor::New
static vtkHyperTreeGridNonOrientedGeometryCursor * New()
vtkHyperTreeGridNonOrientedGeometryCursor::GetNumberOfChildren
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
vtkHyperTreeGridOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridOrientedGeometryCursor.h:44
vtkHyperTreeGridScales
A specifalized type of vtkHyperTreeGrid for the case when root cells have uniform sizes in each direc...
Definition: vtkHyperTreeGridScales.h:27
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:91
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:169
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:41
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtk::hypertreegrid::HasTree
bool HasTree(const T &e)
Definition: vtkHyperTreeGridTools.h:16
vtkHyperTreeGridGeometryEntry.h
vtkHyperTreeGridTools.h
vtkObject.h
vtkSmartPointer.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315