VTK  9.7.20260729
vtkHyperTreeGridGeometryUnlimitedLevelEntry.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
24
25#ifndef vtkHyperTreeGridGeometryUnlimitedLevelEntry_h
26#define vtkHyperTreeGridGeometryUnlimitedLevelEntry_h
27
28#include "assert.h"
29
30#include "vtkDeprecation.h" // Include the macros.
31#include "vtkObject.h"
32#include "vtkSmartPointer.h"
33
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkHyperTree;
40
42{
43public:
47 void PrintSelf(ostream& os, vtkIndent indent);
48
53 {
54 this->Tree = tree;
55 this->Level = 0;
56 this->Index = 0;
57 for (unsigned int d = 0; d < 3; ++d)
58 {
59 this->Origin[d] = 0.;
60 }
61 }
62
67
72
76 void Dump(ostream& os);
77
79 "Please use the 'Initialize' overload specifying lastRealLevel and lastRealIndex explicitly.")
80 void Initialize(vtkHyperTree* tree, unsigned int level, vtkIdType index, const double* origin);
81
85 void Initialize(vtkHyperTree* tree, unsigned int level, vtkIdType index, const double* origin,
86 unsigned int lastRealLevel, vtkIdType lastRealIndex);
87
91 vtkHyperTree* Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
92
96 void Reset()
97 {
98 this->Tree = nullptr;
99 this->Index = 0;
100 }
101
106 {
107 this->Initialize(entry->Tree, entry->Level, entry->Index, entry->Origin, entry->LastRealLevel,
108 entry->LastRealIndex);
109 }
110
123
130 {
131 assert("pre: level==0" && this->Level == 0);
134 cursor->Initialize(grid, this->Tree, this->Level, this->Index, this->Origin);
135 return cursor;
136 }
137
142 vtkIdType GetVertexId() const { return this->LastRealIndex; }
143
150
156
162
167 void SetMask(const vtkHyperTreeGrid* grid, bool state);
168
173 bool IsMasked(const vtkHyperTreeGrid* grid) const;
174
180 bool IsLeaf(const vtkHyperTreeGrid* grid) const;
181
186 bool IsRealLeaf(const vtkHyperTreeGrid* grid) const;
187
192 bool IsVirtualLeaf(const vtkHyperTreeGrid* grid) const;
193
198 bool IsTerminalNode(const vtkHyperTreeGrid* grid) const;
199
203 bool IsRoot() { return this->Index == 0 && this->Level == 0; }
204
213 void ToChild(const vtkHyperTreeGrid* grid, unsigned char ichild);
214
218 vtkHyperTree* GetTree() const { return this->Tree; }
219
221
224 unsigned int GetLevel() const { return this->Level; }
225 unsigned int GetLastRealLevel() const { return this->LastRealLevel; }
227
229
232 double* GetOrigin() { return this->Origin; }
233 const double* GetOrigin() const { return this->Origin; }
235
239 void GetBounds(double bounds[6]) const;
240
244 void GetPoint(double point[3]) const;
245
246private:
250 vtkHyperTree* Tree;
251
255 unsigned int Level = 0;
256
260 vtkIdType Index = 0;
261
265 vtkIdType LastRealIndex = 0;
266
270 vtkIdType LastRealLevel = 0;
271
275 double Origin[3];
276};
277
278VTK_ABI_NAMESPACE_END
279#endif // vtkHyperTreeGridGeometryUnlimitedLevelEntry
280// VTK-HeaderTest-Exclude: vtkHyperTreeGridGeometryUnlimitedLevelEntry.h
void Copy(const vtkHyperTreeGridGeometryUnlimitedLevelEntry *entry)
Copy function.
vtkHyperTreeGridGeometryUnlimitedLevelEntry & operator=(vtkHyperTreeGridGeometryUnlimitedLevelEntry const &)=default
bool IsVirtualLeaf(const vtkHyperTreeGrid *grid) const
Is the cursor pointing to a virtually subdivided leaf?
void PrintSelf(ostream &os, vtkIndent indent)
Display info about the entry.
void Dump(ostream &os)
Dump information.
void SetMask(const vtkHyperTreeGrid *grid, bool state)
Set the blanking mask is empty or not.
bool IsLeaf(const vtkHyperTreeGrid *grid) const
Is the cursor pointing to a leaf?
unsigned int GetLastRealLevel() const
Get level info from current cache entry.
unsigned int GetLevel() const
Get level info from current cache entry.
double * GetOrigin()
Getter for origin coordinates of the current cell.
vtkIdType GetVertexId() const
Return the index of the current vertex in the tree.
void Initialize(vtkHyperTree *tree, unsigned int level, vtkIdType index, const double *origin)
vtkSmartPointer< vtkHyperTreeGridOrientedGeometryCursor > GetHyperTreeGridOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridOrientedCursor from input grid and current entry data.
void GetPoint(double point[3]) const
Getter for center of the current cell.
vtkHyperTreeGridGeometryUnlimitedLevelEntry(vtkHyperTree *tree=nullptr)
Constructor.
~vtkHyperTreeGridGeometryUnlimitedLevelEntry()=default
Destructor.
void ToChild(const vtkHyperTreeGrid *grid, unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridGeometryUnlimitedLevelEntry(vtkHyperTreeGridGeometryUnlimitedLevelEntry const &)=default
const double * GetOrigin() const
Getter for origin coordinates of the current cell.
void SetGlobalIndexFromLocal(vtkIdType index)
Set the global index for the current cell of the HyperTree.
bool IsRealLeaf(const vtkHyperTreeGrid *grid) const
Is the cursor pointing to a leaf?
void GetBounds(double bounds[6]) const
Getter for bounding box of the current cell.
void SetGlobalIndexStart(vtkIdType index)
Set the global index for the root cell of the HyperTree.
bool IsTerminalNode(const vtkHyperTreeGrid *grid) const
Is the cursor pointing to a coarse with all children being leaves ?
vtkHyperTree * GetTree() const
Get HyperTree from current cache entry.
bool IsMasked(const vtkHyperTreeGrid *grid) const
Determine whether blanking mask is empty or not.
vtkIdType GetGlobalNodeIndex() const
Return the global index (relative to the grid) of the current vertex in the tree.
vtkSmartPointer< vtkHyperTreeGridNonOrientedGeometryCursor > GetHyperTreeGridNonOrientedGeometryCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridNonOrientedCursor from input grid and current entry data.
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
Hold a reference to a vtkObjectBase instance.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
#define VTK_DEPRECATED_IN_9_7_0(reason)
int vtkIdType
Definition vtkType.h:363