VTK  9.4.20250304
vtkHyperTreeGridNonOrientedSuperCursor.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
29#ifndef vtkHyperTreeGridNonOrientedSuperCursor_h
30#define vtkHyperTreeGridNonOrientedSuperCursor_h
31
32#include "vtkCommonDataModelModule.h" // For export macro
33#include "vtkObject.h"
34#include "vtkSmartPointer.h" // Used internally
35
36#include "vtkHyperTreeGridGeometryLevelEntry.h" // Used Internally
37
38#include <vector> // For std::vector
39
40VTK_ABI_NAMESPACE_BEGIN
41class vtkHyperTree;
45
46class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursor : public vtkObject
47{
48public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
57
62 virtual void Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false) = 0;
63
65
70
72
75 bool HasTree();
77
81 bool HasTree(unsigned int icursor);
82
84
88 vtkHyperTree* GetTree(unsigned int icursor);
90
95 vtkIdType GetVertexId(unsigned int icursor);
96
102
108 vtkIdType GetGlobalNodeIndex(unsigned int icursor);
109
114 unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id);
115
120 unsigned char GetDimension();
121
126 unsigned char GetNumberOfChildren();
127
134
141
145 double* GetOrigin();
146 double* GetOrigin(unsigned int icursor);
147
151 double* GetSize();
152
157 void SetMask(bool state);
158 void SetMask(unsigned int icursor, bool state);
159
163 bool IsMasked();
164 bool IsMasked(unsigned int icursor);
165
167
171 void GetBounds(double bounds[6]);
172 void GetBounds(unsigned int icursor, double bounds[6]);
174
176
179 void GetPoint(double point[3]);
180 void GetPoint(unsigned int icursor, double point[3]);
182
186 bool IsLeaf();
187 bool IsLeaf(unsigned int icursor);
188
193
197 bool IsRoot();
198
202 unsigned int GetLevel();
203 unsigned int GetLevel(unsigned int icursor);
204
212 void ToChild(unsigned char ichild);
213
219 void ToRoot();
220
226 void ToParent();
227
231 unsigned int GetNumberOfCursors() const { return this->NumberOfCursors; }
232
236 unsigned int GetIndiceCentralCursor() const { return this->IndiceCentralCursor; }
237
244 unsigned int icursor);
245
252 unsigned int icursor);
253
254protected:
259
264
269
275
280 std::vector<unsigned int> FirstNonValidEntryByLevel;
281 std::vector<vtkHyperTreeGridGeometryLevelEntry> Entries;
282
288 std::vector<unsigned int> ReferenceEntries;
289
293 unsigned int GetIndiceEntry(unsigned int icursor);
294
298 unsigned int GetIndicePreviousEntry(unsigned int icursor);
299
304
305 /*
306 * Number of cursors in supercursor.
307 */
308 unsigned int NumberOfCursors;
309
310 /*
311 * Super cursor traversal table to go retrieve the parent index for each cursor
312 * of the child node. There are f^d * NumberOfCursors entries in the table.
313 */
315
316 /*
317 * Super cursor traversal table to go retrieve the child index for each cursor
318 * of the child node. There are f^d * NumberOfCursors entries in the table.
319 */
320 const unsigned int* ChildCursorToChildTable;
321
322private:
324 void operator=(const vtkHyperTreeGridNonOrientedSuperCursor&) = delete;
325};
326
327VTK_ABI_NAMESPACE_END
328#endif
unsigned int GetNumberOfCursors() const
Get the number of cursors to describe neighboring cells and the current cell.
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
void GetBounds(double bounds[6])
Returns the coordinates of the bounding box : (xmin, xmax, ymin, ymax, zmin, zmax).
bool IsLeaf(unsigned int icursor)
void GetPoint(unsigned int icursor, double point[3])
Returns the coordinates cell center.
bool IsMasked()
Determine whether blanking mask is empty or not.
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
Combine three get information into one.
std::vector< vtkHyperTreeGridGeometryLevelEntry > Entries
bool IsLeaf()
Is the cursor pointing to a leaf?
~vtkHyperTreeGridNonOrientedSuperCursor() override
Destructor.
bool IsMasked(unsigned int icursor)
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
void GetPoint(double point[3])
Returns the coordinates cell center.
void ToParent()
Move the cursor to the parent of the current vertex.
vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the hypertree grid and defined by server) of the current vertex ...
unsigned int GetLevel()
Get the level of the tree vertex pointed by the cursor.
bool HasTree()
Return if a Tree pointing exist.
virtual vtkHyperTreeGridNonOrientedSuperCursor * Clone()
Create a copy of ‘this’.
vtkHyperTreeGridNonOrientedSuperCursor()
Constructor.
void ToRoot()
Move the cursor to the root vertex.
unsigned int CurrentFirstNonValidEntryByLevel
Hyper tree grid to which the cursor is attached.
unsigned int GetIndicePreviousEntry(unsigned int icursor)
The previous value.
bool IsRoot()
Answer if a cursor is root.
void ToChild(unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
unsigned int FirstCurrentNeighboorReferenceEntry
The last valid reference describing neighbors.
unsigned int GetLevel(unsigned int icursor)
void SetGlobalIndexFromLocal(vtkIdType index)
Calls this method for each cell in the HT to set the global index associated with them.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetNonOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
unsigned char GetDimension()
Return the dimension of the tree.
vtkHyperTree * GetTree(unsigned int icursor)
Set the hyper tree to which the cursor is pointing.
bool HasTree(unsigned int icursor)
Return if a HyperTree pointing exist.
unsigned int GetIndiceCentralCursor() const
Get the indice of central cursor, the current cell.
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
vtkIdType GetGlobalNodeIndex(unsigned int icursor)
Return the global index (relative to the hypertree grid and defined by server) of the neighbor icurso...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetSize()
Get the size cell.
double * GetOrigin(unsigned int icursor)
virtual void Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)=0
Initialize cursor at root of given tree index in grid.
void SetGlobalIndexStart(vtkIdType index)
Calls this method once per HyperTree to set the global index of the first cell.
unsigned int GetIndiceEntry(unsigned int icursor)
Get index entry of icursor.
void SetMask(unsigned int icursor, bool state)
vtkHyperTreeGrid * Grid
The pointer to the HyperTreeGrid instance during the crossing.
vtkIdType GetVertexId(unsigned int icursor)
void SetMask(bool state)
Set the blanking mask is empty or not.
vtkIdType GetVertexId()
Return the index of the current vertex in the tree.
unsigned char GetNumberOfChildren()
Return the number of children for each node (non-vertex leaf) of the tree.
double * GetOrigin()
Get the origin cell.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
Describes the central cursor necessary an instance of vtkHyperTreeGridNonOrientedGeometryCursor.
void GetBounds(unsigned int icursor, double bounds[6])
Returns the coordinates of the bounding box : (xmin, xmax, ymin, ymax, zmin, zmax).
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:332