00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00036 #ifndef __vtkForceDirectedLayoutStrategy_h
00037 #define __vtkForceDirectedLayoutStrategy_h
00038
00039 #include "vtkGraphLayoutStrategy.h"
00040
00041 class VTK_INFOVIS_EXPORT vtkForceDirectedLayoutStrategy : public vtkGraphLayoutStrategy
00042 {
00043 public:
00044 static vtkForceDirectedLayoutStrategy *New();
00045
00046 vtkTypeRevisionMacro(vtkForceDirectedLayoutStrategy, vtkGraphLayoutStrategy);
00047 void PrintSelf(ostream& os, vtkIndent indent);
00048
00050
00053 vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
00054 vtkGetMacro(RandomSeed, int);
00056
00058
00061 vtkSetVector6Macro(GraphBounds,double);
00062 vtkGetVectorMacro(GraphBounds,double,6);
00064
00066
00069 vtkSetMacro(AutomaticBoundsComputation, int);
00070 vtkGetMacro(AutomaticBoundsComputation, int);
00071 vtkBooleanMacro(AutomaticBoundsComputation, int);
00073
00075
00079 vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
00080 vtkGetMacro(MaxNumberOfIterations, int);
00082
00084
00088 vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
00089 vtkGetMacro(IterationsPerLayout, int);
00091
00093
00096 vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
00097 vtkGetMacro(CoolDownRate, double);
00099
00101
00103 vtkSetMacro(ThreeDimensionalLayout, int);
00104 vtkGetMacro(ThreeDimensionalLayout, int);
00105 vtkBooleanMacro(ThreeDimensionalLayout, int);
00107
00109
00111 vtkSetMacro(RandomInitialPoints, int);
00112 vtkGetMacro(RandomInitialPoints, int);
00113 vtkBooleanMacro(RandomInitialPoints, int);
00115
00117
00119 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
00120 vtkGetMacro(InitialTemperature, float);
00122
00125 virtual void Initialize();
00126
00131 virtual void Layout();
00132
00135 virtual int IsLayoutComplete() {return this->LayoutComplete;}
00136
00137 protected:
00138 vtkForceDirectedLayoutStrategy();
00139 ~vtkForceDirectedLayoutStrategy();
00140
00141 double GraphBounds[6];
00142 int AutomaticBoundsComputation;
00143 int MaxNumberOfIterations;
00144 double CoolDownRate;
00145 double InitialTemperature;
00146 int ThreeDimensionalLayout;
00147 int RandomInitialPoints;
00148 private:
00149
00150
00151
00152 typedef struct
00153 {
00154 double x[3];
00155 double d[3];
00156 } vtkLayoutVertex;
00157
00158
00159
00160 typedef struct
00161 {
00162 int t;
00163 int u;
00164 } vtkLayoutEdge;
00165
00166
00167 int RandomSeed;
00168 int IterationsPerLayout;
00169 int TotalIterations;
00170 int LayoutComplete;
00171 double Temp;
00172 double optDist;
00173 vtkLayoutVertex *v;
00174 vtkLayoutEdge *e;
00175
00176 vtkForceDirectedLayoutStrategy(const vtkForceDirectedLayoutStrategy&);
00177 void operator=(const vtkForceDirectedLayoutStrategy&);
00178 };
00179
00180 #endif
00181