VTK
dox/Common/DataModel/vtkHyperTreeCursor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkHyperTreeCursor.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00028 #ifndef __vtkHyperTreeCursor_h
00029 #define __vtkHyperTreeCursor_h
00030 
00031 #include "vtkCommonDataModelModule.h" // For export macro
00032 #include "vtkObject.h"
00033 
00034 enum
00035 {
00036   VTK_3TREE_CHILD_ZMIN_YMIN_XMIN=0,
00037   VTK_3TREE_CHILD_ZMIN_YMIN_XMAX,
00038   VTK_3TREE_CHILD_ZMIN_YMAX_XMIN,
00039   VTK_3TREE_CHILD_ZMIN_YMAX_XMAX,
00040   VTK_3TREE_CHILD_ZMAX_YMIN_XMIN,
00041   VTK_3TREE_CHILD_ZMAX_YMIN_XMAX,
00042   VTK_3TREE_CHILD_ZMAX_YMAX_XMIN,
00043   VTK_3TREE_CHILD_ZMAX_YMAX_XMAX
00044 };
00045 
00046 const int VTK_2TREE_CHILD_SW=VTK_3TREE_CHILD_ZMIN_YMIN_XMIN;
00047 const int VTK_2TREE_CHILD_SE=VTK_3TREE_CHILD_ZMIN_YMIN_XMAX;
00048 const int VTK_2TREE_CHILD_NW=VTK_3TREE_CHILD_ZMIN_YMAX_XMIN;
00049 const int VTK_2TREE_CHILD_NE=VTK_3TREE_CHILD_ZMIN_YMAX_XMAX;
00050 
00051 const int VTK_1TREE_TREE_CHILD_LEFT=VTK_2TREE_CHILD_SW;
00052 const int VTK_1TREE_TREE_CHILD_RIGHT=VTK_2TREE_CHILD_SE;
00053 
00054 class vtkHyperTree;
00055 
00056 class VTKCOMMONDATAMODEL_EXPORT vtkHyperTreeCursor : public vtkObject
00057 {
00058 public:
00059   vtkTypeMacro(vtkHyperTreeCursor,vtkObject);
00060   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00063   virtual vtkHyperTree* GetTree() = 0;
00064 
00067   virtual vtkIdType GetLeafId() = 0;
00068 
00070   virtual vtkIdType GetNodeId() = 0;
00071 
00073   virtual bool IsLeaf() = 0;
00074 
00075   // Are the children of the current node all leaves?
00076   // This query can be called also on a leaf node.
00077   // \post compatible: result implies !IsLeaf()
00078   virtual bool IsTerminalNode() = 0;
00079 
00081   virtual bool IsRoot() = 0;
00082 
00085   virtual int GetCurrentLevel() = 0;
00086 
00090   virtual int GetChildIndex() = 0;
00091 
00094   virtual void ToRoot() = 0;
00095 
00098   virtual void ToParent() = 0;
00099 
00103   virtual void ToChild( int child ) = 0;
00104 
00108   virtual void ToSameNode( vtkHyperTreeCursor* other ) = 0;
00109 
00112   virtual bool IsEqual( vtkHyperTreeCursor* other ) = 0;
00113 
00116   virtual vtkHyperTreeCursor* Clone() = 0;
00117 
00120   virtual int SameTree( vtkHyperTreeCursor* other ) = 0;
00121 
00126   virtual int GetIndex( int d ) = 0;
00127 
00130   virtual int GetNumberOfChildren() = 0;
00131 
00133   virtual int GetDimension() = 0;
00134 
00141   virtual void MoveToNode( int* indices, int level ) = 0;
00142 
00144   virtual bool Found() = 0;
00145 
00146 protected:
00147   // Constructor.
00148   vtkHyperTreeCursor();
00149   virtual ~vtkHyperTreeCursor();
00150 
00151 private:
00152   vtkHyperTreeCursor(const vtkHyperTreeCursor&);  // Not implemented.
00153   void operator=(const vtkHyperTreeCursor&);    // Not implemented.
00154 };
00155 #endif