00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00040 #ifndef __vtkSimple2DLayoutStrategy_h
00041 #define __vtkSimple2DLayoutStrategy_h
00042
00043 #include "vtkGraphLayoutStrategy.h"
00044
00045 class vtkFloatArray;
00046
00047 class VTK_INFOVIS_EXPORT vtkSimple2DLayoutStrategy : public vtkGraphLayoutStrategy
00048 {
00049 public:
00050 static vtkSimple2DLayoutStrategy *New();
00051
00052 vtkTypeRevisionMacro(vtkSimple2DLayoutStrategy, vtkGraphLayoutStrategy);
00053 void PrintSelf(ostream& os, vtkIndent indent);
00054
00056
00059 vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
00060 vtkGetMacro(RandomSeed, int);
00062
00064
00069 vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
00070 vtkGetMacro(MaxNumberOfIterations, int);
00072
00074
00078 vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
00079 vtkGetMacro(IterationsPerLayout, int);
00081
00083
00086 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
00087 vtkGetMacro(InitialTemperature, float);
00089
00091
00095 vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
00096 vtkGetMacro(CoolDownRate, double);
00098
00100
00103 vtkSetMacro(Jitter, bool);
00104 vtkGetMacro(Jitter, bool);
00106
00108
00110 vtkSetMacro(RestDistance, float);
00111 vtkGetMacro(RestDistance, float);
00113
00116 virtual void Initialize();
00117
00122 virtual void Layout();
00123
00126 virtual int IsLayoutComplete() {return this->LayoutComplete;}
00127
00128 protected:
00129 vtkSimple2DLayoutStrategy();
00130 ~vtkSimple2DLayoutStrategy();
00131
00132 int MaxNumberOfIterations;
00133 float InitialTemperature;
00134 float CoolDownRate;
00135
00136 private:
00137
00138
00139
00140
00141 typedef struct
00142 {
00143 vtkIdType from;
00144 vtkIdType to;
00145 float weight;
00146 } vtkLayoutEdge;
00147
00148
00149 vtkFloatArray *RepulsionArray;
00150 vtkFloatArray *AttractionArray;
00151 vtkLayoutEdge *EdgeArray;
00152
00153
00154 int RandomSeed;
00155 int IterationsPerLayout;
00156 int TotalIterations;
00157 int LayoutComplete;
00158 float Temp;
00159 float RestDistance;
00160 bool Jitter;
00161
00162 vtkSimple2DLayoutStrategy(const vtkSimple2DLayoutStrategy&);
00163 void operator=(const vtkSimple2DLayoutStrategy&);
00164 };
00165
00166 #endif
00167