00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00032 #ifndef __vtkCosmicTreeLayoutStrategy_h
00033 #define __vtkCosmicTreeLayoutStrategy_h
00034
00035 #include "vtkGraphLayoutStrategy.h"
00036
00037 class vtkDoubleArray;
00038 class vtkDataArray;
00039 class vtkPoints;
00040 class vtkTree;
00041
00042 class VTK_INFOVIS_EXPORT vtkCosmicTreeLayoutStrategy : public vtkGraphLayoutStrategy
00043 {
00044 public:
00045 static vtkCosmicTreeLayoutStrategy* New();
00046 virtual void PrintSelf( ostream& os, vtkIndent indent );
00047 vtkTypeMacro(vtkCosmicTreeLayoutStrategy,vtkGraphLayoutStrategy);
00048
00050 virtual void Layout();
00051
00053
00058 vtkSetMacro(SizeLeafNodesOnly,int);
00059 vtkGetMacro(SizeLeafNodesOnly,int);
00060 vtkBooleanMacro(SizeLeafNodesOnly,int);
00062
00064
00069 vtkSetMacro(LayoutDepth,int);
00070 vtkGetMacro(LayoutDepth,int);
00072
00074
00080 vtkSetMacro(LayoutRoot,vtkIdType);
00081 vtkGetMacro(LayoutRoot,vtkIdType);
00083
00085
00088 vtkSetStringMacro(NodeSizeArrayName);
00089 vtkGetStringMacro(NodeSizeArrayName);
00091
00092 protected:
00093
00094
00096 enum RadiusMode
00097 {
00098 NONE,
00099 LEAVES,
00100 ALL
00101 };
00102
00103
00104 vtkCosmicTreeLayoutStrategy();
00105 virtual ~vtkCosmicTreeLayoutStrategy();
00106
00107
00109
00110 void LayoutChildren(
00111 vtkTree* tree, vtkPoints* newPoints, vtkDoubleArray* radii, vtkDoubleArray* scale,
00112 vtkIdType root, int depth, RadiusMode mode );
00114
00116
00120 void OffsetChildren(
00121 vtkTree* tree, vtkPoints* pts, vtkDoubleArray* radii, vtkDoubleArray* scale,
00122 double parent[4], vtkIdType root, int depth, RadiusMode mode );
00123
00125
00134 vtkDoubleArray* CreateRadii( vtkIdType numVertices, double initialValue, vtkDataArray* inputRadii );
00135
00140 vtkDoubleArray* CreateScaleFactors( vtkIdType numVertices );
00141
00142 int SizeLeafNodesOnly;
00143 int LayoutDepth;
00144 vtkIdType LayoutRoot;
00145 char* NodeSizeArrayName;
00146
00147 private:
00148 vtkCosmicTreeLayoutStrategy( const vtkCosmicTreeLayoutStrategy& );
00149 void operator = ( const vtkCosmicTreeLayoutStrategy& );
00150 };
00151
00152 #endif // __vtkCosmicTreeLayoutStrategy_h