VTK  9.3.20240419
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 
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkHyperTree;
42 class vtkHyperTreeGrid;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridNonOrientedSuperCursor : public vtkObject
47 {
48 public:
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 
254 protected:
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 
303  unsigned int IndiceCentralCursor;
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  */
314  const unsigned int* ChildCursorToParentCursorTable;
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 
322 private:
324  void operator=(const vtkHyperTreeGridNonOrientedSuperCursor&) = delete;
325 };
326 
327 VTK_ABI_NAMESPACE_END
328 #endif
unsigned int GetNumberOfCursors() const
Get the number of cursors to describe neighboring cells and the current cell.
vtkHyperTree * GetTree(unsigned int icursor)
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.
double * GetOrigin(unsigned int icursor)
std::vector< vtkHyperTreeGridGeometryLevelEntry > Entries
bool IsLeaf()
Is the cursor pointing to a leaf?
~vtkHyperTreeGridNonOrientedSuperCursor() override
Destructor.
bool IsMasked(unsigned int icursor)
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
void GetPoint(double point[3])
Returns the coordinates cell center.
void ToParent()
Move the cursor to the parent of the current vertex.
vtkHyperTree * GetInformation(unsigned int icursor, unsigned int &level, bool &leaf, vtkIdType &id)
Combine three get information into one.
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.
double * GetOrigin()
Get the origin cell.
bool HasTree()
Return if a Tree pointing exist.
vtkHyperTreeGridNonOrientedSuperCursor()
Constructor.
virtual vtkHyperTreeGridNonOrientedSuperCursor * Clone()
Create a copy of ‘this’.
void ToRoot()
Move the cursor to the root vertex.
vtkHyperTree * GetTree()
Set the hyper tree to which the cursor is pointing.
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.
unsigned char GetDimension()
Return the dimension of the tree.
bool HasTree(unsigned int icursor)
Return if a HyperTree pointing exist.
unsigned int GetIndiceCentralCursor() const
Get the indice of central cursor, the current cell.
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.
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)
double * GetSize()
Get the size cell.
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.
vtkHyperTreeGrid * GetGrid()
Set the hyper tree grid to which the cursor is pointing.
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.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > CentralCursor
Describes the central cursor necessary an instance of vtkHyperTreeGridNonOrientedGeometryCursor.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetNonOrientedGeometryCursor(unsigned int icursor)
Return the cursor pointing into i-th neighbor.
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.
Definition: vtkHyperTree.h:169
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.
@ point
Definition: vtkX3D.h:236
@ level
Definition: vtkX3D.h:395
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315