VTK: Common/DataModel/vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h Source File

| VTK 9.3.1

vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.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 vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor_h
34 #define vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor_h
35
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkObject.h"
38
39 #include "vtkHyperTreeGridGeometryUnlimitedLevelEntry.h" // cache for historic
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 class vtkHyperTreeGridNonOrientedGeometryCursor;
51
52 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor
53 : public vtkObject
54 {
55 public:
56 vtkTypeMacro(vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor, vtkObject);
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58 static vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor* New();
59
60 void Dump(ostream& os);
61
62 // JB TODO 102018 On autorise le ToParent que jusqu'à ce que Level soit celui de la creation...
63 // mais sans toRoot ? Une variante... qui serait utile aussi au niveau des SC
64
69 virtual vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor* Clone();
70
74 void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
75
79 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level,
80 vtkHyperTreeGridGeometryUnlimitedLevelEntry& entry);
81
85 void Initialize(vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level, vtkIdType index,
86 double* origin);
87
91 void Initialize(vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor* cursor);
92
94
97 bool HasTree() const { return vtk::hypertreegrid::HasTree(*this); }
99
101
104 vtkHyperTree* GetTree() const { return this->Tree; }
106
110 vtkIdType GetVertexId();
111
116 vtkIdType GetGlobalNodeIndex();
117
122 unsigned char GetDimension();
123
128 unsigned char GetNumberOfChildren();
129
133 void SetGlobalIndexStart(vtkIdType index);
134
138 void SetGlobalIndexFromLocal(vtkIdType index);
139
143 double* GetOrigin();
144 double* GetSize();
145
149 void GetBounds(double bounds[6]);
150 void GetPoint(double point[3]);
151
156 void SetMask(bool state);
157
161 bool IsMasked();
162
167 bool IsLeaf();
168
173 bool IsRealLeaf();
174
179 bool IsVirtualLeaf();
180
184 bool IsRoot();
185
189 unsigned int GetLevel();
190 unsigned int GetLastRealLevel();
191
199 void ToChild(unsigned char ichild);
200
206 void ToRoot();
207
213 void ToParent();
214
219 vtkSmartPointer<vtkHyperTreeGridOrientedGeometryCursor> GetHyperTreeGridOrientedGeometryCursor(
220 vtkHyperTreeGrid* grid);
221
226 vtkSmartPointer<vtkHyperTreeGridNonOrientedGeometryCursor>
227 GetHyperTreeGridNonOrientedGeometryCursor(vtkHyperTreeGrid* grid);
228
229 protected:
234 vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor();
235
240 ~vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor() override;
241
245 vtkHyperTreeGrid* Grid;
246
250 vtkHyperTree* Tree;
251
255 std::shared_ptr<vtkHyperTreeGridScales> Scales;
256
260 unsigned int Level;
261
265 int LastValidEntry;
266
267 // Hyper tree grid to which the cursor is attached
268 std::vector<vtkHyperTreeGridGeometryUnlimitedLevelEntry> Entries;
269
270 private:
271 vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor(
272 const vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor&) = delete;
273 void operator=(const vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor&) = delete;
274 };
275 VTK_ABI_NAMESPACE_END
276 #endif
vtkHyperTreeGridGeometryUnlimitedLevelEntry
Cursor cache data with coordinates and level info.
Definition: vtkHyperTreeGridGeometryUnlimitedLevelEntry.h:41
vtkHyperTreeGridNonOrientedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedGeometryCursor.h:52
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:54
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::SetMask
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::New
static vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor * New()
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::IsRoot
bool IsRoot()
Is the cursor at tree root?
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Clone
virtual vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor *cursor)
JB.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Grid
vtkHyperTreeGrid * Grid
Reference sur l'hyper tree grid parcouru actuellement.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:245
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetVertexId
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::IsMasked
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::~vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor
~vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor() override
Destructor Only for vtkHyperTreeGridNonOrientedVonNeumannSuperCursor & Moore.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::ToRoot
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Tree
vtkHyperTree * Tree
JB.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:250
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetOrigin
double * GetOrigin()
JB.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetHyperTreeGridNonOrientedGeometryCursor
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetHyperTreeGridNonOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridNonOrientedGeometryCursor from input grid and current entry data.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::IsVirtualLeaf
bool IsVirtualLeaf()
Is the cursor pointing to a subdivided leaf ? Return false if the leaf is a real one.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::HasTree
bool HasTree() const
Return if a Tree pointing exist.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:97
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetNumberOfChildren
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkHyperTreeGridGeometryUnlimitedLevelEntry &entry)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::ToChild
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::IsRealLeaf
bool IsRealLeaf()
Is the cursor pointing to a leaf in the original tree ? Return false if the leaf is virtual.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Entries
std::vector< vtkHyperTreeGridGeometryUnlimitedLevelEntry > Entries
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:268
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Level
unsigned int Level
JB.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:260
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Initialize
void Initialize(vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level, vtkIdType index, double *origin)
JB.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetDimension
unsigned char GetDimension()
Return the dimension of the tree.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor()
Constructor Only for vtkHyperTreeGridNonOrientedVonNeumannSuperCursor & Moore.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetLevel
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Scales
std::shared_ptr< vtkHyperTreeGridScales > Scales
Storage of pre-computed per-level cell scales.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:255
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::Dump
void Dump(ostream &os)
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetLastRealLevel
unsigned int GetLastRealLevel()
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetBounds
void GetBounds(double bounds[6])
JB.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::ToParent
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetSize
double * GetSize()
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::LastValidEntry
int LastValidEntry
Id of the last non-virtual entry.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:265
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::SetGlobalIndexStart
void SetGlobalIndexStart(vtkIdType index)
JB.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetTree
vtkHyperTree * GetTree() const
Set the hyper tree to which the cursor is pointing.
Definition: vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h:104
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetHyperTreeGridOrientedGeometryCursor
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridOrientedGeometryCursor from input grid and current entry data.
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::GetPoint
void GetPoint(double point[3])
vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor::IsLeaf
bool IsLeaf()
Is the cursor pointing to a leaf? only respect depth limited, otherwise return false.
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
vtkHyperTreeGridGeometryUnlimitedLevelEntry.h
vtkHyperTreeGridTools.h
vtkObject.h
vtkSmartPointer.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315