00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00043 #ifndef __vtkSimple2DLayoutStrategy_h
00044 #define __vtkSimple2DLayoutStrategy_h
00045
00046 #include "vtkGraphLayoutStrategy.h"
00047
00048 class vtkFloatArray;
00049
00050 class VTK_INFOVIS_EXPORT vtkSimple2DLayoutStrategy : public vtkGraphLayoutStrategy
00051 {
00052 public:
00053 static vtkSimple2DLayoutStrategy *New();
00054
00055 vtkTypeMacro(vtkSimple2DLayoutStrategy, vtkGraphLayoutStrategy);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00059
00062 vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
00063 vtkGetMacro(RandomSeed, int);
00065
00067
00072 vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
00073 vtkGetMacro(MaxNumberOfIterations, int);
00075
00077
00081 vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
00082 vtkGetMacro(IterationsPerLayout, int);
00084
00086
00089 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
00090 vtkGetMacro(InitialTemperature, float);
00092
00094
00098 vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
00099 vtkGetMacro(CoolDownRate, double);
00101
00103
00106 vtkSetMacro(Jitter, bool);
00107 vtkGetMacro(Jitter, bool);
00109
00111
00113 vtkSetMacro(RestDistance, float);
00114 vtkGetMacro(RestDistance, float);
00116
00119 virtual void Initialize();
00120
00125 virtual void Layout();
00126
00129 virtual int IsLayoutComplete() {return this->LayoutComplete;}
00130
00131 protected:
00132 vtkSimple2DLayoutStrategy();
00133 ~vtkSimple2DLayoutStrategy();
00134
00135 int MaxNumberOfIterations;
00136 float InitialTemperature;
00137 float CoolDownRate;
00138
00139 private:
00140
00141
00142
00143
00144 typedef struct
00145 {
00146 vtkIdType from;
00147 vtkIdType to;
00148 float weight;
00149 } vtkLayoutEdge;
00150
00151
00152 vtkFloatArray *RepulsionArray;
00153 vtkFloatArray *AttractionArray;
00154 vtkLayoutEdge *EdgeArray;
00155
00156
00157 int RandomSeed;
00158 int IterationsPerLayout;
00159 int TotalIterations;
00160 int LayoutComplete;
00161 float Temp;
00162 float RestDistance;
00163 bool Jitter;
00164
00165 vtkSimple2DLayoutStrategy(const vtkSimple2DLayoutStrategy&);
00166 void operator=(const vtkSimple2DLayoutStrategy&);
00167 };
00168
00169 #endif
00170