VTK  9.4.20250114
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor.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
11#ifndef vtkHyperTreeGridNonOrientedUnlimitedSuperCursor_h
12#define vtkHyperTreeGridNonOrientedUnlimitedSuperCursor_h
13
14#include "vtkCommonDataModelModule.h" // For export macro
15#include "vtkObject.h"
16#include "vtkSmartPointer.h" // Used internally
17
18#include "vtkHyperTreeGridGeometryUnlimitedLevelEntry.h" // Used Internally
19
20#include <vector> // For std::vector
21
22VTK_ABI_NAMESPACE_BEGIN
23class vtkHyperTree;
28
29class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedUnlimitedSuperCursor : public vtkObject
30{
31public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
40
45 virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
46
48
53
55
58 bool HasTree();
60
64 bool HasTree(unsigned int icursor);
65
67
71 vtkHyperTree* GetTree(unsigned int icursor);
73
75
79 vtkIdType GetVertexId(unsigned int icursor);
81
87
92 vtkIdType GetGlobalNodeIndex(unsigned int icursor);
93
95 unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
96
101 unsigned char GetDimension();
102
107 unsigned char GetNumberOfChildren();
108
110
112
113 double* GetOrigin();
114 double* GetSize();
115
120 void SetMask(bool state);
121 void SetMask(unsigned int icursor, bool state);
122
126 bool IsMasked();
127 bool IsMasked(unsigned int icursor);
128
132 void GetBounds(double bounds[6]);
133 void GetBounds(unsigned int icursor, double bounds[6]);
134
138 void GetPoint(double point[3]);
139 void GetPoint(unsigned int icursor, double point[3]);
140
142
145 bool IsLeaf();
146 bool IsLeaf(unsigned int icursor);
148 bool IsRealLeaf(unsigned int icursor);
150
152
156 bool IsVirtualLeaf(unsigned int icursor);
158
160
170
174 bool IsRoot();
175
177
180 unsigned int GetLevel();
181 unsigned int GetLevel(unsigned int icursor);
182 unsigned int GetLastRealLevel();
183 unsigned int GetLastRealLevel(unsigned int icursor);
185
193 void ToChild(unsigned char ichild);
194
200 void ToRoot();
201
207 void ToParent();
208
209 unsigned int GetNumberOfCursors() { return this->NumberOfCursors; }
210
217 unsigned int icursor);
218
225 unsigned int icursor);
226
227protected:
232
237
241 vtkHyperTreeGrid* Grid = nullptr;
242
244
248 unsigned int CurrentFirstNonValidEntryByLevel = 0;
249 std::vector<unsigned int> FirstNonValidEntryByLevel;
250 std::vector<vtkHyperTreeGridGeometryUnlimitedLevelEntry> Entries;
251
256 unsigned int FirstCurrentNeighboorReferenceEntry = 0;
257 std::vector<unsigned int> ReferenceEntries;
258
259 unsigned int GetIndiceEntry(unsigned int icursor);
260
264 unsigned int GetIndicePreviousEntry(unsigned int icursor);
265
266 unsigned int IndiceCentralCursor = 0;
267
268 // Number of cursors in supercursor
269 unsigned int NumberOfCursors = 0;
270
271 // Super cursor traversal table to go retrieve the parent index for each cursor
272 // of the child node. There are f^d * NumberOfCursors entries in the table.
273 const unsigned int* ChildCursorToParentCursorTable = nullptr;
274
275 // Super cursor traversal table to go retrieve the child index for each cursor
276 // of the child node. There are f^d * NumberOfCursors entries in the table.
277 const unsigned int* ChildCursorToChildTable = nullptr;
278
279private:
282 void operator=(const vtkHyperTreeGridNonOrientedUnlimitedSuperCursor&) = delete;
283};
284
285VTK_ABI_NAMESPACE_END
286#endif
void GetPoint(double point[3])
Mesh center coordinates.
void SetMask(unsigned int icursor, bool state)
unsigned int GetIndicePreviousEntry(unsigned int icursor)
The previous value.
std::vector< vtkHyperTreeGridGeometryUnlimitedLevelEntry > Entries
unsigned int GetLastRealLevel(unsigned int icursor)
Get the level of the tree vertex pointed by the cursor.
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
double GetExtensivePropertyRatio(vtkIdType index)
returns the value of the ratio to be applied to extensive value for the current cursor,...
virtual vtkHyperTreeGridNonOrientedUnlimitedSuperCursor * Clone()
Create a copy of ‘this’.
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
bool IsMasked()
Determine whether blanking mask is empty or not.
bool HasTree(unsigned int icursor)
Return if a Tree pointing exist.
vtkHyperTree * GetTree(unsigned int icursor)
Set the hyper tree to which the cursor is pointing.
unsigned int GetIndiceEntry(unsigned int icursor)
virtual void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)=0
Initialize cursor at root of given tree index in grid.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned char GetDimension()
Return the dimension of the tree.
void GetBounds(double bounds[6])
Bounding box coordinates.
bool IsLeaf(unsigned int icursor)
Is the cursor pointing to a leaf?
~vtkHyperTreeGridNonOrientedUnlimitedSuperCursor() override
Destructor.
vtkIdType GetGlobalNodeIndex(unsigned int icursor)
Return the global index (relative to the grid) of the neighbor icursor current vertex in the tree.
unsigned int GetLevel(unsigned int icursor)
Get the level of the tree vertex pointed by the cursor.
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
vtkSmartPointer< vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor > CentralCursor
bool IsRealLeaf(unsigned int icursor)
Is the cursor pointing to a leaf?
bool IsVirtualLeaf(unsigned int icursor)
Is the cursor pointing to a real node in the tree.
vtkIdType GetVertexId(unsigned int icursor)
Return the index of the current vertex in the tree.
double GetExtensivePropertyRatio()
returns the value of the ratio to be applied to extensive value for the current cursor,...
void SetMask(bool state)
Set the blanking mask is empty or not.
bool IsRealLeaf()
Is the cursor pointing to a leaf?
bool IsRoot()
Is the cursor at tree root?
void GetBounds(unsigned int icursor, double bounds[6])
bool IsLeaf()
Is the cursor pointing to a leaf?
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetNonOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
bool IsVirtualLeaf()
Is the cursor pointing to a real node in the tree.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
bool HasTree()
Return if a Tree pointing exist.
unsigned int GetLastRealLevel()
Get the level of the tree vertex pointed by the cursor.
void ToParent()
Move the cursor to the parent of the current vertex.
void GetPoint(unsigned int icursor, double point[3])
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition vtkType.h:315