VTK  9.0.1
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 #ifndef __VTK_WRAP__
68 
69 #include "vtkObject.h"
70 
71 class vtkHyperTree;
72 class vtkHyperTreeGrid;
73 
75 {
76 public:
80  void PrintSelf(ostream& os, vtkIndent indent);
81 
85  void Dump(ostream& os);
86 
90  vtkHyperTreeGridEntry() { this->Index = 0; }
91 
96 
100  ~vtkHyperTreeGridEntry() = default;
101 
105  vtkHyperTree* Initialize(vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create = false);
106 
110  void Initialize(vtkIdType index) { this->Index = index; }
111 
115  void Copy(const vtkHyperTreeGridEntry* entry) { this->Index = entry->Index; }
116 
120  vtkIdType GetVertexId() const { return this->Index; }
121 
126  vtkIdType GetGlobalNodeIndex(const vtkHyperTree* tree) const;
127 
133 
139 
144  void SetMask(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, bool state);
145 
150  bool IsMasked(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree) const;
151 
157  bool IsLeaf(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
158 
166  void SubdivideLeaf(const vtkHyperTreeGrid* grid, vtkHyperTree* tree, unsigned int level);
167 
172  bool IsTerminalNode(
173  const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level) const;
174 
178  bool IsRoot() const { return (this->Index == 0); }
179 
188  void ToChild(const vtkHyperTreeGrid* grid, const vtkHyperTree* tree, unsigned int level,
189  unsigned char ichild);
190 
191 protected:
196 };
197 
198 #endif // __VTK_WRAP__
199 
200 #endif // vtkHyperTreeGridEntry_h
201 // VTK-HeaderTest-Exclude: vtkHyperTreeGridEntry.h
vtkHyperTreeGridEntry::IsLeaf
bool IsLeaf(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level) const
Is the cursor pointing to a leaf?
vtkHyperTreeGridEntry::Index
vtkIdType Index
index of the current cell in the HyperTree.
Definition: vtkHyperTreeGridEntry.h:195
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkHyperTreeGridEntry::IsRoot
bool IsRoot() const
Is the cursor at HyperTree root?
Definition: vtkHyperTreeGridEntry.h:178
vtkHyperTreeGridEntry::IsMasked
bool IsMasked(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree) const
Determine whether blanking mask is empty or not.
vtkHyperTreeGridEntry::SetGlobalIndexStart
void SetGlobalIndexStart(vtkHyperTree *tree, vtkIdType index)
Set the global index for the root cell of the HyperTree.
vtkHyperTreeGridEntry::~vtkHyperTreeGridEntry
~vtkHyperTreeGridEntry()=default
Destructor.
vtkHyperTreeGridEntry::vtkHyperTreeGridEntry
vtkHyperTreeGridEntry(vtkIdType index)
Constructor.
Definition: vtkHyperTreeGridEntry.h:95
vtkX3D::level
@ level
Definition: vtkX3D.h:401
vtkHyperTreeGridEntry::Initialize
vtkHyperTree * Initialize(vtkHyperTreeGrid *grid, vtkIdType treeIndex, bool create=false)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridEntry::ToChild
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.
vtkHyperTreeGridEntry::Initialize
void Initialize(vtkIdType index)
Initialize cursor at root of given tree index in grid.
Definition: vtkHyperTreeGridEntry.h:110
vtkHyperTreeGridEntry::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Display info about the entry.
vtkHyperTreeGridEntry::SubdivideLeaf
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,...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkHyperTree
A data object structured as a tree.
Definition: vtkHyperTree.h:178
vtkHyperTreeGridEntry::GetGlobalNodeIndex
vtkIdType GetGlobalNodeIndex(const vtkHyperTree *tree) const
Return the global index for the current cell (cf.
vtkHyperTreeGridEntry::vtkHyperTreeGridEntry
vtkHyperTreeGridEntry()
Constructor.
Definition: vtkHyperTreeGridEntry.h:90
vtkHyperTreeGridEntry::Dump
void Dump(ostream &os)
Dump information.
vtkObject.h
vtkHyperTreeGridEntry
Entries are cache data for cursors.
Definition: vtkHyperTreeGridEntry.h:74
vtkHyperTreeGridEntry::Copy
void Copy(const vtkHyperTreeGridEntry *entry)
Copy function.
Definition: vtkHyperTreeGridEntry.h:115
vtkHyperTreeGridEntry::GetVertexId
vtkIdType GetVertexId() const
Return the index of the current vertex in the tree.
Definition: vtkHyperTreeGridEntry.h:120
vtkHyperTreeGridEntry::SetMask
void SetMask(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, bool state)
Set the blanking mask is empty or not.
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkHyperTreeGridEntry::IsTerminalNode
bool IsTerminalNode(const vtkHyperTreeGrid *grid, const vtkHyperTree *tree, unsigned int level) const
Is the cursor pointing to a coarse with all childrens being leaves?
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:96
vtkHyperTreeGridEntry::SetGlobalIndexFromLocal
void SetGlobalIndexFromLocal(vtkHyperTree *tree, vtkIdType index)
Set the global index for the current cell of the HyperTree.