00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00035 #ifndef __vtkAttributeClustering2DLayoutStrategy_h
00036 #define __vtkAttributeClustering2DLayoutStrategy_h
00037
00038 #include "vtkGraphLayoutStrategy.h"
00039
00040 #include "vtkSmartPointer.h"
00041
00042 class vtkFastSplatter;
00043 class vtkImageData;
00044 class vtkIntArray;
00045 class vtkFloatArray;
00046
00047 class VTK_INFOVIS_EXPORT vtkAttributeClustering2DLayoutStrategy : public vtkGraphLayoutStrategy
00048 {
00049 public:
00050 static vtkAttributeClustering2DLayoutStrategy *New();
00051
00052 vtkTypeMacro(vtkAttributeClustering2DLayoutStrategy, vtkGraphLayoutStrategy);
00053 void PrintSelf(ostream& os, vtkIndent indent);
00054
00056
00058 vtkGetStringMacro(VertexAttribute);
00059 void SetVertexAttribute(const char*);
00061
00063
00066 vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
00067 vtkGetMacro(RandomSeed, int);
00069
00071
00076 vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
00077 vtkGetMacro(MaxNumberOfIterations, int);
00079
00081
00085 vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
00086 vtkGetMacro(IterationsPerLayout, int);
00088
00090
00093 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
00094 vtkGetMacro(InitialTemperature, float);
00096
00098
00102 vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
00103 vtkGetMacro(CoolDownRate, double);
00105
00107
00109 vtkSetMacro(RestDistance, float);
00110 vtkGetMacro(RestDistance, float);
00112
00115 virtual void Initialize();
00116
00121 virtual void Layout();
00122
00125 virtual int IsLayoutComplete() {return this->LayoutComplete;}
00126
00127 protected:
00128 vtkAttributeClustering2DLayoutStrategy();
00129 ~vtkAttributeClustering2DLayoutStrategy();
00130
00131 int MaxNumberOfIterations;
00132 float InitialTemperature;
00133 float CoolDownRate;
00134
00135 private:
00136
00137
00138
00139 vtkSmartPointer<vtkFastSplatter> DensityGrid;
00140 vtkSmartPointer<vtkImageData> SplatImage;
00141 vtkSmartPointer<vtkFloatArray> RepulsionArray;
00142 vtkSmartPointer<vtkFloatArray> AttractionArray;
00143 vtkSmartPointer<vtkIntArray> EdgeCountArray;
00144
00145
00146 int RandomSeed;
00147 int IterationsPerLayout;
00148 int TotalIterations;
00149 int LayoutComplete;
00150 float Temp;
00151 float RestDistance;
00152 float CuttingThreshold;
00153 char* VertexAttribute;
00154
00155
00156 void GenerateCircularSplat(vtkImageData *splat, int x, int y);
00157 void GenerateGaussianSplat(vtkImageData *splat, int x, int y);
00158 void ResolveCoincidentVertices();
00159
00160
00161 class Internals;
00162 Internals* Implementation;
00163
00164
00165 vtkAttributeClustering2DLayoutStrategy(const vtkAttributeClustering2DLayoutStrategy&);
00166 void operator=(const vtkAttributeClustering2DLayoutStrategy&);
00167 };
00168
00169 #endif
00170