VTK  9.1.0
vtkHyperTreeGridLevelEntry.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeGridLevelEntry.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 =========================================================================*/
36 #ifndef vtkHyperTreeGridLevelEntry_h
37 #define vtkHyperTreeGridLevelEntry_h
38 
39 #ifndef __VTK_WRAP__
40 
41 #include "vtkObject.h"
42 #include "vtkSmartPointer.h" // Used internally
43 
44 class vtkHyperTree;
45 class vtkHyperTreeGrid;
47 
49 {
50 public:
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
59  void Dump(ostream& os);
60 
65  : Tree(nullptr)
66  , Level(0)
67  , Index(0)
68  {
69  }
70 
75  : Tree(entry->Tree)
76  , Level(entry->Level)
77  , Index(entry->Index)
78  {
79  }
80 
85  : Tree(tree)
86  , Level(level)
87  , Index(index)
88  {
89  }
90 
94  vtkHyperTreeGridLevelEntry(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
95 
100 
104  void Reset()
105  {
106  this->Tree = nullptr;
107  this->Level = 0;
108  this->Index = 0;
109  }
110 
114  void Initialize(vtkHyperTree* tree, unsigned int level, vtkIdType index)
115  {
116  this->Tree = tree;
117  this->Level = level;
118  this->Index = index;
119  }
120 
124  vtkHyperTree* Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
125 
129  void Copy(const vtkHyperTreeGridLevelEntry* entry)
130  {
131  this->Tree = entry->Tree;
132  this->Level = entry->Level;
133  this->Index = entry->Index;
134  }
135 
141  vtkHyperTreeGrid* grid);
142 
146  vtkIdType GetVertexId() const { return this->Index; }
147 
153 
159 
165 
170  void SetMask(const vtkHyperTreeGrid* grid, bool state);
171 
176  bool IsMasked(const vtkHyperTreeGrid* grid) const;
177 
183  bool IsLeaf(const vtkHyperTreeGrid* grid) const;
184 
192  void SubdivideLeaf(const vtkHyperTreeGrid* grid);
193 
198  bool IsTerminalNode(const vtkHyperTreeGrid* grid) const;
199 
203  bool IsRoot() const { return (this->Index == 0); }
204 
213  void ToChild(const vtkHyperTreeGrid* grid, unsigned char ichild);
214 
218  vtkHyperTree* GetTree() const { return this->Tree; }
219 
223  unsigned int GetLevel() const { return this->Level; }
224 
225 protected:
230 
234  unsigned int Level;
235 
240 };
241 
242 #endif // __VTK_WRAP__
243 
244 #endif // vtkHyperTreeGridLevelEntry_h
245 // VTK-HeaderTest-Exclude: vtkHyperTreeGridLevelEntry.h
vtkHyperTreeGridLevelEntry::vtkHyperTreeGridLevelEntry
vtkHyperTreeGridLevelEntry(vtkHyperTree *tree, unsigned int level, vtkIdType index)
Constructor.
Definition: vtkHyperTreeGridLevelEntry.h:84
vtkHyperTreeGridLevelEntry::Initialize
vtkHyperTree * Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkHyperTreeGridLevelEntry::Index
vtkIdType Index
index of the current cell in the HyperTree.
Definition: vtkHyperTreeGridLevelEntry.h:239
vtkHyperTreeGridLevelEntry::IsLeaf
bool IsLeaf(const vtkHyperTreeGrid *grid) const
Is the cursor pointing to a leaf?
vtkHyperTreeGridLevelEntry::~vtkHyperTreeGridLevelEntry
~vtkHyperTreeGridLevelEntry()=default
Destructor.
vtkHyperTreeGridLevelEntry::Tree
vtkHyperTree * Tree
pointer to the HyperTree containing the current cell.
Definition: vtkHyperTreeGridLevelEntry.h:229
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:145
vtkHyperTreeGridLevelEntry::vtkHyperTreeGridLevelEntry
vtkHyperTreeGridLevelEntry()
Constructor.
Definition: vtkHyperTreeGridLevelEntry.h:64
vtkHyperTreeGridNonOrientedCursor
Objects for traversal a HyperTreeGrid.
Definition: vtkHyperTreeGridNonOrientedCursor.h:51
vtkHyperTreeGridLevelEntry::SetGlobalIndexStart
void SetGlobalIndexStart(vtkIdType index)
Set the global index for the root cell of the HyperTree.
vtkHyperTreeGridLevelEntry
LevelEntry is a cache data for cursors requiring level info.
Definition: vtkHyperTreeGridLevelEntry.h:49
vtkX3D::level
@ level
Definition: vtkX3D.h:401
vtkHyperTreeGridLevelEntry::Level
unsigned int Level
level of the current cell in the HyperTree.
Definition: vtkHyperTreeGridLevelEntry.h:234
vtkHyperTreeGridLevelEntry::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex() const
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridLevelEntry::GetVertexId
vtkIdType GetVertexId() const
Return the index of the current vertex in the tree.
Definition: vtkHyperTreeGridLevelEntry.h:146
vtkHyperTreeGridLevelEntry::vtkHyperTreeGridLevelEntry
vtkHyperTreeGridLevelEntry(vtkHyperTreeGridLevelEntry *entry)
Constructor.
Definition: vtkHyperTreeGridLevelEntry.h:74
vtkHyperTreeGridLevelEntry::Copy
void Copy(const vtkHyperTreeGridLevelEntry *entry)
Copy function.
Definition: vtkHyperTreeGridLevelEntry.h:129
vtkHyperTreeGridLevelEntry::Initialize
void Initialize(vtkHyperTree *tree, unsigned int level, vtkIdType index)
Initialize cursor from explicit required data.
Definition: vtkHyperTreeGridLevelEntry.h:114
vtkHyperTreeGridLevelEntry::SubdivideLeaf
void SubdivideLeaf(const vtkHyperTreeGrid *grid)
Change the current cell's status: if leaf then becomes coarse and all its children are created,...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkHyperTreeGridLevelEntry::IsMasked
bool IsMasked(const vtkHyperTreeGrid *grid) const
Determine whether blanking mask is empty or not.
vtkHyperTreeGridLevelEntry::SetMask
void SetMask(const vtkHyperTreeGrid *grid, bool state)
Set the blanking mask is empty or not.
vtkSmartPointer.h
vtkHyperTreeGridLevelEntry::GetLevel
unsigned int GetLevel() const
Get level info from current cache entry.
Definition: vtkHyperTreeGridLevelEntry.h:223
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:177
vtkObject.h
vtkHyperTreeGridLevelEntry::vtkHyperTreeGridLevelEntry
vtkHyperTreeGridLevelEntry(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Constructor.
vtkHyperTreeGridLevelEntry::IsTerminalNode
bool IsTerminalNode(const vtkHyperTreeGrid *grid) const
Is the cursor pointing to a coarse with all childrens being leaves ?
vtkHyperTreeGridLevelEntry::GetHyperTreeGridNonOrientedCursor
vtkSmartPointer< vtkHyperTreeGridNonOrientedCursor > GetHyperTreeGridNonOrientedCursor(vtkHyperTreeGrid *grid)
Create a vtkHyperTreeGridNonOrientedCursor from input grid and current entry data.
vtkHyperTreeGridLevelEntry::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Display info about the entry.
vtkHyperTreeGridLevelEntry::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkIdType index)
Set the global index for the current cell of the HyperTree.
vtkHyperTreeGridLevelEntry::ToChild
void ToChild(const vtkHyperTreeGrid *grid, unsigned char ichild)
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGridLevelEntry::Dump
void Dump(ostream &os)
Dump information.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkHyperTreeGridLevelEntry::GetTree
vtkHyperTree * GetTree() const
Get HyperTree from current cache entry.
Definition: vtkHyperTreeGridLevelEntry.h:218
vtkHyperTreeGridLevelEntry::IsRoot
bool IsRoot() const
Is the cursor at tree root?
Definition: vtkHyperTreeGridLevelEntry.h:203
vtkHyperTreeGridLevelEntry::Reset
void Reset()
Reset function.
Definition: vtkHyperTreeGridLevelEntry.h:104
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:96