VTK
|
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 "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 //BTX 00096 enum RadiusMode 00097 { 00098 NONE, 00099 LEAVES, 00100 ALL 00101 }; 00102 //ETX 00103 00104 vtkCosmicTreeLayoutStrategy(); 00105 virtual ~vtkCosmicTreeLayoutStrategy(); 00106 00107 //BTX 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 //ETX 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& ); // Not implemented. 00149 void operator = ( const vtkCosmicTreeLayoutStrategy& ); // Not implemented. 00150 }; 00151 00152 #endif // __vtkCosmicTreeLayoutStrategy_h