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;
50  static vtkHyperTreeGridCursor* New();
51 
56  vtkHyperTreeGridCursor* Clone() override;
57 
61  virtual void Initialize( vtkHyperTreeGrid*, vtkIdType );
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 
89  virtual vtkIdType GetGlobalNodeIndex();
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 
227  ~vtkHyperTreeGridCursor() override;
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
unsigned int GetLevel() override
Get the level of the tree vertex pointed by the cursor.
virtual int GetNumberOfChildren()=0
Return the number of children for each node (non-vertex leaf) of the tree.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
virtual unsigned int GetNumberOfCursors()
Return the number of neighborhood cursors The neighborhood definition depends on the type of cursor...
virtual void ToParent()=0
Move the cursor to the parent of the current vertex.
vtkHyperTree * GetTree() override
Set the hyper tree to which the cursor is pointing.
virtual void GetPoint(double pt[3])
Compute the center coordinates of the cursor.
int vtkIdType
Definition: vtkType.h:347
void ToSameVertex(vtkHyperTreeCursor *vtkNotUsed(other)) override
Move the cursor to the same vertex pointed by `other'.
Objects for depth-first traversal HyperTrees.
virtual void SetTree(vtkHyperTree *)=0
Set the HyperTree to which the cursor is pointing.
virtual bool IsRoot()=0
Is the cursor at tree root?
Objects for depth-first traversal HyperTreeGrids.
virtual double * GetOrigin()
Compute the origin of the cursor.
virtual vtkHyperTreeCursor * Clone()=0
Create a copy of `this'.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ToRoot()=0
Move the cursor to the root vertex.
list of point or cell ids
Definition: vtkIdList.h:36
virtual vtkHyperTreeGridCursor * GetCursor(unsigned int)
Return the cursor pointing into i-th neighbor.
virtual int GetChildIndex()=0
Return the child number of the current vertex relative to its parent.
virtual int GetDimension()=0
Return the dimension of the tree.
virtual bool GetCornerCursors(unsigned int, unsigned int, vtkIdList *)
Return the list of cursors pointing to the leaves touching a given corner of the cell.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An object structured as a tree where each node has exactly either 2^d or 3^d children.
Definition: vtkHyperTree.h:142
virtual bool IsLeaf()=0
Is the cursor pointing to a leaf?
virtual vtkIdType GetVertexId()=0
Return the index of the current vertex in the tree.
int SameTree(vtkHyperTreeCursor *vtkNotUsed(other)) override
Are `this' and `other' pointing on the same hypertree?
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
bool IsEqual(vtkHyperTreeCursor *vtkNotUsed(other)) override
Is `this' equal to `other'?
virtual void ToChild(int child)=0
Move the cursor to child `child' of the current vertex.
virtual double * GetSize()
Compute the size of the cursor.
virtual void GetBounds(double pt[6])
Compute the bounds of the cursor.