VTK  9.3.0
vtkHyperTreeGridEntry.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
52 #ifndef vtkHyperTreeGridEntry_h
53 #define vtkHyperTreeGridEntry_h
54 
55 #include "vtkObject.h"
56 
57 VTK_ABI_NAMESPACE_BEGIN
58 class vtkHyperTree;
59 class vtkHyperTreeGrid;
60 
62 {
63 public:
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
72  void Dump(ostream& os);
73 
77  vtkHyperTreeGridEntry() { this->Index = 0; }
78 
83 
88 
92  vtkHyperTree* Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
93 
97  void Initialize(vtkIdType index) { this->Index = index; }
98 
102  void Copy(const vtkHyperTreeGridEntry* entry) { this->Index = entry->Index; }
103 
107  vtkIdType GetVertexId() const { return this->Index; }
108 
114 
120 
126 
131  void SetMask(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, bool state);
132 
137  bool IsMasked(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree) const;
138 
144  bool IsLeaf(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
145 
153  void SubdivideLeaf(const vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level);
154 
160  const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
161 
165  bool IsRoot() const { return (this->Index == 0); }
166 
175  void ToChild(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level,
176  unsigned char ichild);
177 
178 protected:
183 };
184 
185 VTK_ABI_NAMESPACE_END
186 #endif // vtkHyperTreeGridEntry_h
187 // VTK-HeaderTest-Exclude: vtkHyperTreeGridEntry.h
Entries are cache data for cursors.
vtkHyperTreeGridEntry(vtkIdType index)
Constructor.
void SetMask(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, bool state)
Set the blanking mask is empty or not.
vtkHyperTreeGridEntry()
Constructor.
void Initialize(vtkIdType index)
Initialize cursor at root of given tree index in grid.
void ToChild(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level, unsigned char ichild)
Move the cursor to i-th child of the current cell.
vtkIdType GetVertexId() const
Return the index of the current vertex in the tree.
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?
vtkIdType Index
index of the current cell in the HyperTree.
~vtkHyperTreeGridEntry()=default
Destructor.
void SetGlobalIndexFromLocal(vtkHyperTree *tree, vtkIdType index)
Set the global index for the current cell of the HyperTree.
bool IsRoot() const
Is the cursor at HyperTree root?
void SetGlobalIndexStart(vtkHyperTree *tree, vtkIdType index)
Set the global index for the root cell of the HyperTree.
void Copy(const vtkHyperTreeGridEntry *entry)
Copy function.
bool IsMasked(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree) const
Determine whether blanking mask is empty or not.
void Dump(ostream &os)
Dump information.
vtkIdType GetGlobalNodeIndex(const vtkHyperTree *tree) const
Return the global index for the current cell (cf.
void SubdivideLeaf(const vtkHyperTreeGrid *grid, vtkHyperTree *tree, unsigned int level)
Change the current cell's status: if leaf then becomes coarse and all its children are created,...
bool IsTerminalNode(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level) const
Is the cursor pointing to a coarse with all childrens being leaves?
vtkHyperTree * Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
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:38
@ level
Definition: vtkX3D.h:395
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315