VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Infovis/Layout/vtkCosmicTreeLayoutStrategy.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCosmicTreeLayoutStrategy.h
00005 
00006 =========================================================================*/
00007 /*----------------------------------------------------------------------------
00008  Copyright (c) Sandia Corporation
00009  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00010 ----------------------------------------------------------------------------*/
00032 #ifndef vtkCosmicTreeLayoutStrategy_h
00033 #define vtkCosmicTreeLayoutStrategy_h
00034 
00035 #include "vtkInfovisLayoutModule.h" // For export macro
00036 #include "vtkGraphLayoutStrategy.h"
00037 
00038 class vtkDoubleArray;
00039 class vtkDataArray;
00040 class vtkPoints;
00041 class vtkTree;
00042 
00043 class VTKINFOVISLAYOUT_EXPORT vtkCosmicTreeLayoutStrategy : public vtkGraphLayoutStrategy
00044 {
00045 public:
00046   static vtkCosmicTreeLayoutStrategy* New();
00047   virtual void PrintSelf( ostream& os, vtkIndent indent );
00048   vtkTypeMacro(vtkCosmicTreeLayoutStrategy,vtkGraphLayoutStrategy);
00049 
00051   virtual void Layout();
00052 
00054 
00059   vtkSetMacro(SizeLeafNodesOnly,int);
00060   vtkGetMacro(SizeLeafNodesOnly,int);
00061   vtkBooleanMacro(SizeLeafNodesOnly,int);
00063 
00065 
00070   vtkSetMacro(LayoutDepth,int);
00071   vtkGetMacro(LayoutDepth,int);
00073 
00075 
00081   vtkSetMacro(LayoutRoot,vtkIdType);
00082   vtkGetMacro(LayoutRoot,vtkIdType);
00084 
00086 
00089   vtkSetStringMacro(NodeSizeArrayName);
00090   vtkGetStringMacro(NodeSizeArrayName);
00092 
00093 protected:
00094 
00095   //BTX
00097   enum RadiusMode
00098     {
00099     NONE,     
00100     LEAVES,   
00101     ALL       
00102     };
00103   //ETX
00104 
00105   vtkCosmicTreeLayoutStrategy();
00106   virtual ~vtkCosmicTreeLayoutStrategy();
00107 
00108   //BTX
00110 
00111   void LayoutChildren(
00112     vtkTree* tree, vtkPoints* newPoints, vtkDoubleArray* radii, vtkDoubleArray* scale,
00113     vtkIdType root, int depth, RadiusMode mode );
00115 
00117 
00121   void OffsetChildren(
00122     vtkTree* tree, vtkPoints* pts, vtkDoubleArray* radii, vtkDoubleArray* scale,
00123     double parent[4], vtkIdType root, int depth, RadiusMode mode );
00124   //ETX
00126 
00135   vtkDoubleArray* CreateRadii( vtkIdType numVertices, double initialValue, vtkDataArray* inputRadii );
00136 
00141   vtkDoubleArray* CreateScaleFactors( vtkIdType numVertices );
00142 
00143   int SizeLeafNodesOnly;
00144   int LayoutDepth;
00145   vtkIdType LayoutRoot;
00146   char* NodeSizeArrayName;
00147 
00148 private:
00149   vtkCosmicTreeLayoutStrategy( const vtkCosmicTreeLayoutStrategy& ); // Not implemented.
00150   void operator = ( const vtkCosmicTreeLayoutStrategy& ); // Not implemented.
00151 };
00152 
00153 #endif // vtkCosmicTreeLayoutStrategy_h