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 vtkTypeMacro(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
00104 vtkSetMacro(ThreeDimensionalLayout, int);
00105 vtkGetMacro(ThreeDimensionalLayout, int);
00106 vtkBooleanMacro(ThreeDimensionalLayout, int);
00108
00110
00112 vtkSetMacro(RandomInitialPoints, int);
00113 vtkGetMacro(RandomInitialPoints, int);
00114 vtkBooleanMacro(RandomInitialPoints, int);
00116
00118
00120 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
00121 vtkGetMacro(InitialTemperature, float);
00123
00126 virtual void Initialize();
00127
00132 virtual void Layout();
00133
00136 virtual int IsLayoutComplete() {return this->LayoutComplete;}
00137
00138 protected:
00139 vtkForceDirectedLayoutStrategy();
00140 ~vtkForceDirectedLayoutStrategy();
00141
00142 double GraphBounds[6];
00143 int AutomaticBoundsComputation;
00144 int MaxNumberOfIterations;
00145 double CoolDownRate;
00146 double InitialTemperature;
00147 int ThreeDimensionalLayout;
00148 int RandomInitialPoints;
00149 private:
00150
00151
00152
00153 typedef struct
00154 {
00155 double x[3];
00156 double d[3];
00157 } vtkLayoutVertex;
00158
00159
00160
00161 typedef struct
00162 {
00163 int t;
00164 int u;
00165 } vtkLayoutEdge;
00166
00167
00168 int RandomSeed;
00169 int IterationsPerLayout;
00170 int TotalIterations;
00171 int LayoutComplete;
00172 double Temp;
00173 double optDist;
00174 vtkLayoutVertex *v;
00175 vtkLayoutEdge *e;
00176
00177 vtkForceDirectedLayoutStrategy(const vtkForceDirectedLayoutStrategy&);
00178 void operator=(const vtkForceDirectedLayoutStrategy&);
00179 };
00180
00181 #endif
00182