VTK  9.2.6
vtkHyperTreeGridEntry.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridEntry.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
64 #ifndef vtkHyperTreeGridEntry_h
65 #define vtkHyperTreeGridEntry_h
66 
67 #include "vtkObject.h"
68 
69 class vtkHyperTree;
70 class vtkHyperTreeGrid;
71 
73 {
74 public:
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
83  void Dump(ostream& os);
84 
88  vtkHyperTreeGridEntry() { this->Index = 0; }
89 
94 
98  ~vtkHyperTreeGridEntry() = default;
99 
103  vtkHyperTree* Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
104 
108  void Initialize(vtkIdType index) { this->Index = index; }
109 
113  void Copy(const vtkHyperTreeGridEntry* entry) { this->Index = entry->Index; }
114 
118  vtkIdType GetVertexId() const { return this->Index; }
119 
124  vtkIdType GetGlobalNodeIndex(const vtkHyperTree* tree) const;
125 
131 
137 
142  void SetMask(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, bool state);
143 
148  bool IsMasked(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree) const;
149 
155  bool IsLeaf(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
156 
164  void SubdivideLeaf(const vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level);
165 
170  bool IsTerminalNode(
171  const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
172 
176  bool IsRoot() const { return (this->Index == 0); }
177 
186  void ToChild(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level,
187  unsigned char ichild);
188 
189 protected:
194 };
195 
196 #endif // vtkHyperTreeGridEntry_h
197 // VTK-HeaderTest-Exclude: vtkHyperTreeGridEntry.h
void Initialize(vtkIdType index)
Initialize cursor at root of given tree index in grid.
vtkHyperTree * Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridEntry(vtkIdType index)
Constructor.
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.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
vtkIdType Index
index of the current cell in the HyperTree.
bool IsTerminalNode(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level) const
Is the cursor pointing to a coarse with all childrens being leaves?
vtkIdType GetVertexId() const
Return the index of the current vertex in the tree.
int vtkIdType
Definition: vtkType.h:332
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetGlobalIndexStart(vtkHyperTree *tree, vtkIdType index)
Set the global index for the root cell of the HyperTree.
vtkHyperTreeGridEntry()
Constructor.
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...
Entries are cache data for cursors.
bool IsMasked(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree) const
Determine whether blanking mask is empty or not.
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?
void Copy(const vtkHyperTreeGridEntry *entry)
Copy function.
A data object structured as a tree.
Definition: vtkHyperTree.h:179
void SetMask(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, bool state)
Set the blanking mask is empty or not.
bool IsRoot() const
Is the cursor at HyperTree root?
void Dump(ostream &os)
Dump information.
void SetGlobalIndexFromLocal(vtkHyperTree *tree, vtkIdType index)
Set the global index for the current cell of the HyperTree.
vtkIdType GetGlobalNodeIndex(const vtkHyperTree *tree) const
Return the global index for the current cell (cf.
~vtkHyperTreeGridEntry()=default
Destructor.