VTK
vtkHyperTreeGridCursor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperTreeCursor.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 =========================================================================*/
35 #ifndef vtkHyperTreeGridCursor_h
36 #define vtkHyperTreeGridCursor_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkHyperTreeCursor.h"
40 
41 class vtkHyperTree;
42 class vtkHyperTreeGrid;
43 class vtkIdList;
44 
45 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeGridCursor : public vtkHyperTreeCursor
46 {
47 public:
49  void PrintSelf( ostream& os, vtkIndent indent ) override;
51 
57 
62 
64 
67  virtual void SetGrid( vtkHyperTreeGrid* );
68  vtkGetObjectMacro(Grid,vtkHyperTreeGrid);
70 
72 
75  void SetTree( vtkHyperTree* ) override;
76  vtkHyperTree* GetTree() override {return this->Tree;};
77  //vtkGetObjectMacro(Tree,vtkHyperTree);
79 
83  vtkIdType GetVertexId() override;
84 
90 
94  bool IsLeaf() override;
95 
99  bool IsRoot() override;
100 
104  unsigned int GetLevel() override {return this->Level;};
105 
111  int GetChildIndex() override;
112 
118  void ToRoot() override;
119 
124  void ToParent() override;
125 
131  void ToChild( int child ) override;
132 
140  void ToSameVertex( vtkHyperTreeCursor* vtkNotUsed(other) ) override { return; }
141 
148  bool IsEqual( vtkHyperTreeCursor* vtkNotUsed(other) ) override { return false; }
149 
155  int SameTree( vtkHyperTreeCursor* vtkNotUsed(other) ) override { return 0; }
156 
161  int GetNumberOfChildren() override;
162 
167  int GetDimension() override;
168 
173  virtual double* GetOrigin() { return nullptr; }
174 
179  virtual double* GetSize() { return nullptr; }
180 
185  virtual void GetBounds( double pt[6] )
186  { pt[0] = pt[1] = pt[2] = pt[3] = pt[4] = pt[5] = 0.; }
187 
192  virtual void GetPoint( double pt[3] ) { pt[0] = pt[1] = pt[2] = 0.; }
193 
199  virtual unsigned int GetNumberOfCursors() { return 0; }
200 
206  virtual vtkHyperTreeGridCursor* GetCursor( unsigned int )
207  { return nullptr; }
208 
215  virtual bool GetCornerCursors( unsigned int, unsigned int, vtkIdList* )
216  { return false; }
217 
218 protected:
223 
228 
229  // Hyper tree grid to which the cursor is attached
231 
232  // Hyper tree to which the cursor is attached
234 
235  // Level in the tree at which the cursor is positioned
236  unsigned int Level;
237 
238  // Index either in the nodes or parent (if leaf)
240 
241  // Is center of cursor at a leaf?
242  bool Leaf;
243 
244 private:
246  void operator=(const vtkHyperTreeGridCursor&) = delete;
247 };
248 #endif
vtkHyperTreeGridCursor::GetTree
vtkHyperTree * GetTree() override
Return the HyperTree to which the cursor is pointing.
Definition: vtkHyperTreeGridCursor.h:76
vtkHyperTreeGridCursor
Objects for depth-first traversal HyperTreeGrids.
Definition: vtkHyperTreeGridCursor.h:46
vtkHyperTreeCursor.h
vtkHyperTreeGridCursor::Leaf
bool Leaf
Definition: vtkHyperTreeGridCursor.h:242
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkHyperTreeGridCursor::GetSize
virtual double * GetSize()
Compute the size of the cursor.
Definition: vtkHyperTreeGridCursor.h:179
vtkHyperTreeGridCursor::IsRoot
bool IsRoot() override
Is the cursor at tree root?
vtkHyperTreeGridCursor::Initialize
virtual void Initialize(vtkHyperTreeGrid *, vtkIdType)
Initialize cursor at root of given tree index in grid.
vtkHyperTreeGridCursor::Tree
vtkHyperTree * Tree
Definition: vtkHyperTreeGridCursor.h:233
vtkHyperTreeGridCursor::GetDimension
int GetDimension() override
Return the dimension of the tree.
vtkHyperTreeGridCursor::ToParent
void ToParent() override
Move the cursor to the parent of the current vertex.
vtkHyperTreeGridCursor::Grid
vtkHyperTreeGrid * Grid
Definition: vtkHyperTreeGridCursor.h:230
vtkHyperTreeGridCursor::ToSameVertex
void ToSameVertex(vtkHyperTreeCursor *vtkNotUsed(other)) override
Move the cursor to the same vertex pointed by ‘other’.
Definition: vtkHyperTreeGridCursor.h:140
vtkHyperTreeCursor
Objects for depth-first traversal HyperTrees.
Definition: vtkHyperTreeCursor.h:43
vtkHyperTreeGridCursor::GetNumberOfChildren
int GetNumberOfChildren() override
Return the number of children for each node (non-vertex leaf) of the tree.
vtkHyperTreeGridCursor::SameTree
int SameTree(vtkHyperTreeCursor *vtkNotUsed(other)) override
Are ‘this’ and ‘other’ pointing on the same hypertree?
Definition: vtkHyperTreeGridCursor.h:155
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkHyperTreeGridCursor::GetNumberOfCursors
virtual unsigned int GetNumberOfCursors()
Return the number of neighborhood cursors The neighborhood definition depends on the type of cursor.
Definition: vtkHyperTreeGridCursor.h:199
vtkHyperTreeGridCursor::SetTree
void SetTree(vtkHyperTree *) override
Set the hyper tree to which the cursor is pointing.
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkHyperTree
An object structured as a tree where each node has exactly either 2^d or 3^d children.
Definition: vtkHyperTree.h:143
vtkHyperTreeGridCursor::IsEqual
bool IsEqual(vtkHyperTreeCursor *vtkNotUsed(other)) override
Is ‘this’ equal to ‘other’?
Definition: vtkHyperTreeGridCursor.h:148
vtkHyperTreeGridCursor::GetBounds
virtual void GetBounds(double pt[6])
Compute the bounds of the cursor.
Definition: vtkHyperTreeGridCursor.h:185
vtkHyperTreeGridCursor::ToRoot
void ToRoot() override
Move the cursor to the root vertex.
vtkHyperTreeGridCursor::New
static vtkHyperTreeGridCursor * New()
vtkHyperTreeGridCursor::IsLeaf
bool IsLeaf() override
Is the cursor pointing to a leaf?
vtkHyperTreeGridCursor::~vtkHyperTreeGridCursor
~vtkHyperTreeGridCursor() override
Destructor.
vtkHyperTreeGridCursor::SetGrid
virtual void SetGrid(vtkHyperTreeGrid *)
Set the hyper tree grid to which the cursor is pointing.
vtkHyperTreeGridCursor::GetLevel
unsigned int GetLevel() override
Get the level of the tree vertex pointed by the cursor.
Definition: vtkHyperTreeGridCursor.h:104
vtkHyperTreeGridCursor::Clone
vtkHyperTreeGridCursor * Clone() override
Create a copy of ‘this’.
vtkHyperTreeGridCursor::GetPoint
virtual void GetPoint(double pt[3])
Compute the center coordinates of the cursor.
Definition: vtkHyperTreeGridCursor.h:192
vtkHyperTreeGridCursor::GetGlobalNodeIndex
virtual vtkIdType GetGlobalNodeIndex()
Return the global index (relative to the grid) of the current vertex in the tree.
vtkHyperTreeGridCursor::GetChildIndex
int GetChildIndex() override
Return the child number of the current vertex relative to its parent.
vtkHyperTreeGridCursor::Index
vtkIdType Index
Definition: vtkHyperTreeGridCursor.h:239
vtkHyperTreeGridCursor::vtkHyperTreeGridCursor
vtkHyperTreeGridCursor()
Constructor.
vtkHyperTreeGridCursor::Level
unsigned int Level
Definition: vtkHyperTreeGridCursor.h:236
vtkHyperTreeGridCursor::GetOrigin
virtual double * GetOrigin()
Compute the origin of the cursor.
Definition: vtkHyperTreeGridCursor.h:173
vtkHyperTreeGridCursor::GetCornerCursors
virtual bool GetCornerCursors(unsigned int, unsigned int, vtkIdList *)
Return the list of cursors pointing to the leaves touching a given corner of the cell.
Definition: vtkHyperTreeGridCursor.h:215
vtkHyperTreeGridCursor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperTreeGridCursor::GetCursor
virtual vtkHyperTreeGridCursor * GetCursor(unsigned int)
Return the cursor pointing into i-th neighbor.
Definition: vtkHyperTreeGridCursor.h:206
vtkHyperTreeGridCursor::GetVertexId
vtkIdType GetVertexId() override
Return the index of the current vertex in the tree.
vtkHyperTreeGridCursor::ToChild
void ToChild(int child) override
Move the cursor to child ‘child’ of the current vertex.
vtkHyperTreeGrid
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Definition: vtkHyperTreeGrid.h:71