VTK
vtkHyperTreeCursor.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=========================================================================*/
29#ifndef vtkHyperTreeCursor_h
30#define vtkHyperTreeCursor_h
31
32#include "vtkCommonDataModelModule.h" // For export macro
33#include "vtkObject.h"
34
35enum
36{
45};
46
51
54
55class vtkHyperTree;
56
57class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeCursor : public vtkObject
58{
59public:
61 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
62
66 virtual vtkHyperTree* GetTree() = 0;
67
72 virtual vtkIdType GetLeafId() = 0;
73
77 virtual vtkIdType GetNodeId() = 0;
78
82 virtual bool IsLeaf() = 0;
83
84 // Are the children of the current node all leaves?
85 // This query can be called also on a leaf node.
86 // \post compatible: result implies !IsLeaf()
87 virtual bool IsTerminalNode() = 0;
88
92 virtual bool IsRoot() = 0;
93
98 virtual int GetCurrentLevel() = 0;
99
105 virtual int GetChildIndex() = 0;
106
112 virtual void ToRoot() = 0;
113
118 virtual void ToParent() = 0;
119
125 virtual void ToChild( int child ) = 0;
126
133 virtual void ToSameNode( vtkHyperTreeCursor* other ) = 0;
134
140 virtual bool IsEqual( vtkHyperTreeCursor* other ) = 0;
141
147 virtual vtkHyperTreeCursor* Clone() = 0;
148
153 virtual int SameTree( vtkHyperTreeCursor* other ) = 0;
154
161 virtual int GetIndex( int d ) = 0;
162
167 virtual int GetNumberOfChildren() = 0;
168
173 virtual int GetDimension() = 0;
174
185 virtual void MoveToNode( int* indices, int level ) = 0;
186
190 virtual bool Found() = 0;
191
192protected:
193 // Constructor.
195 ~vtkHyperTreeCursor() VTK_OVERRIDE;
196
197private:
198 vtkHyperTreeCursor(const vtkHyperTreeCursor&) VTK_DELETE_FUNCTION;
199 void operator=(const vtkHyperTreeCursor&) VTK_DELETE_FUNCTION;
200};
201#endif
Objects that can traverse hypertree nodes.
virtual int SameTree(vtkHyperTreeCursor *other)=0
Are ‘this’ and ‘other’ pointing on the same hyper3TREE?
virtual void ToParent()=0
Move the cursor to the parent of the current node.
virtual bool IsRoot()=0
Is the node pointed by the cursor the root?
virtual vtkHyperTree * GetTree()=0
Return the HyperTree on which the cursor points to.
virtual vtkIdType GetLeafId()=0
Return the index of the current leaf in the data arrays.
~vtkHyperTreeCursor() override
virtual vtkHyperTreeCursor * Clone()=0
Create a copy of ‘this’.
virtual void ToChild(int child)=0
Move the cursor to child ‘child’ of the current node.
virtual void ToSameNode(vtkHyperTreeCursor *other)=0
Move the cursor to the same node pointed by ‘other’.
virtual int GetIndex(int d)=0
Return the index in dimension ‘d’, as if the node was a cell of a uniform grid of 1<<GetCurrentLevel(...
virtual int GetChildIndex()=0
Return the child number of the current node relative to its parent.
virtual bool IsEqual(vtkHyperTreeCursor *other)=0
Is ‘this’ equal to ‘other’?
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void MoveToNode(int *indices, int level)=0
Move to the node described by its indices in each dimension and at a given level.
virtual int GetDimension()=0
Return the dimension of the tree.
virtual void ToRoot()=0
Move the cursor to the root node.
virtual bool Found()=0
Did the last call to MoveToNode succeed?
virtual bool IsTerminalNode()=0
virtual int GetNumberOfChildren()=0
Return the number of children for each node of the tree.
virtual bool IsLeaf()=0
Is the node pointed by the cursor a leaf?
virtual vtkIdType GetNodeId()=0
Return the index of the current node in the data arrays.
virtual int GetCurrentLevel()=0
Return the level of the node pointed by the cursor.
An object structured as a tree where each node has exactly either 2^n or 3^n children.
Definition: vtkHyperTree.h:135
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
@ level
Definition: vtkX3D.h:395
const int VTK_2TREE_CHILD_NW
const int VTK_1TREE_TREE_CHILD_LEFT
@ VTK_3TREE_CHILD_ZMAX_YMIN_XMAX
@ VTK_3TREE_CHILD_ZMIN_YMAX_XMAX
@ VTK_3TREE_CHILD_ZMIN_YMAX_XMIN
@ VTK_3TREE_CHILD_ZMAX_YMIN_XMIN
@ VTK_3TREE_CHILD_ZMIN_YMIN_XMIN
@ VTK_3TREE_CHILD_ZMIN_YMIN_XMAX
@ VTK_3TREE_CHILD_ZMAX_YMAX_XMIN
@ VTK_3TREE_CHILD_ZMAX_YMAX_XMAX
const int VTK_2TREE_CHILD_SW
const int VTK_2TREE_CHILD_NE
const int VTK_1TREE_TREE_CHILD_RIGHT
const int VTK_2TREE_CHILD_SE
int vtkIdType
Definition: vtkType.h:287