VTK  9.3.0
vtkHyperTreeGridGeometryUnlimitedEntry.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
26#ifndef vtkHyperTreeGridGeometryUnlimitedEntry_h
27#define vtkHyperTreeGridGeometryUnlimitedEntry_h
28
29#include "vtkObject.h"
30
31VTK_ABI_NAMESPACE_BEGIN
32class vtkHyperTree;
34
36{
37public:
41 void PrintSelf(ostream& os, vtkIndent indent);
42
47
53
58
62 void Dump(ostream& os);
63
67 vtkHyperTree* Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
68
72 void Initialize(vtkIdType index, vtkIdType lastIndex, const double* origin)
73 {
74 this->Index = index;
75 this->LastRealIndex = lastIndex;
76 for (unsigned int d = 0; d < 3; ++d)
77 {
78 this->Origin[d] = origin[d];
79 }
80 }
81
86 {
87 this->Initialize(entry->Index, entry->LastRealIndex, entry->Origin);
88 }
89
93 vtkIdType GetVertexId() const { return this->LastRealIndex; }
94
101
107
113
118 void SetMask(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, bool state);
119
124 bool IsMasked(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree) const;
125
132 bool IsLeaf(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
133
140 bool IsRealLeaf(const vtkHyperTree* tree) const;
141
147 bool IsVirtualLeaf(const vtkHyperTree* tree) const;
148
154 const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
155
159 bool IsRoot() const { return (this->Index == 0); }
160
169 void ToChild(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level,
170 const double* sizeChild, unsigned char ichild);
171
175 double* GetOrigin() { return this->Origin; }
176 const double* GetOrigin() const { return this->Origin; }
177
181 void GetBounds(const double* sizeChild, double bounds[6]) const
182 {
183 // Compute bounds
184 bounds[0] = this->Origin[0];
185 bounds[1] = this->Origin[0] + sizeChild[0];
186 bounds[2] = this->Origin[1];
187 bounds[3] = this->Origin[1] + sizeChild[1];
188 bounds[4] = this->Origin[2];
189 bounds[5] = this->Origin[2] + sizeChild[2];
190 }
191
195 void GetPoint(const double* sizeChild, double point[3]) const
196 {
197 // Compute center point coordinates
198 point[0] = this->Origin[0] + sizeChild[0] / 2.;
199 point[1] = this->Origin[1] + sizeChild[1] / 2.;
200 point[2] = this->Origin[2] + sizeChild[2] / 2.;
201 }
202
203private:
207 vtkIdType Index = 0;
208
212 vtkIdType LastRealIndex = 0;
213
217 double Origin[3];
218};
219
220VTK_ABI_NAMESPACE_END
221#endif // vtkHyperTreeGridGeometryUnlimitedEntry_h
222// VTK-HeaderTest-Exclude: vtkHyperTreeGridGeometryUnlimitedEntry.h
bool IsMasked(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree) const
Determine whether blanking mask is empty or not.
void Copy(const vtkHyperTreeGridGeometryUnlimitedEntry *entry)
Copy function.
void SetMask(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, bool state)
Set the blanking mask is empty or not.
void Dump(ostream &os)
Dump information.
void SetGlobalIndexFromLocal(vtkHyperTree *tree, vtkIdType index)
Set the global index for the current cell of the HyperTree.
void SetGlobalIndexStart(vtkHyperTree *tree, vtkIdType index)
Set the global index for the root cell of the HyperTree.
bool IsVirtualLeaf(const vtkHyperTree *tree) const
Is the cursor pointing below a real leaf of the underlying tree ?
vtkIdType GetGlobalNodeIndex(const vtkHyperTree *tree) const
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridGeometryUnlimitedEntry(vtkIdType index, const double *origin)
Constructor assume construction from a real level.
vtkIdType GetVertexId() const
Return the index of the current vertex in the tree.
~vtkHyperTreeGridGeometryUnlimitedEntry()=default
Destructor.
void PrintSelf(ostream &os, vtkIndent indent)
Display info about the entry.
bool IsLeaf(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level) const
Is the cursor pointing to a leaf? Unlimited cursors allow to go deeper than a real leaf.
vtkHyperTreeGridGeometryUnlimitedEntry()
Constructor.
void ToChild(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level, const double *sizeChild, unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
double * GetOrigin()
Getter for origin coordinates of the current cell.
bool IsTerminalNode(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level) const
Is the cursor pointing to a coarse with all childrens leaves ?
void Initialize(vtkIdType index, vtkIdType lastIndex, const double *origin)
Initialize cursor from explicit required data.
bool IsRealLeaf(const vtkHyperTree *tree) const
Is the cursor pointing to a real leaf of the underlying tree ?
vtkHyperTree * Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
void GetBounds(const double *sizeChild, double bounds[6]) const
Getter for bounding box of the current cell.
void GetPoint(const double *sizeChild, double point[3]) const
Getter for center of the current cell.
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:29
int vtkIdType
Definition vtkType.h:315