VTK
vtkAttributeClustering2DLayoutStrategy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAttributeClustering2DLayoutStrategy.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
35 #ifndef vtkAttributeClustering2DLayoutStrategy_h
36 #define vtkAttributeClustering2DLayoutStrategy_h
37 
38 #include "vtkInfovisLayoutModule.h" // For export macro
39 #include "vtkGraphLayoutStrategy.h"
40 
41 #include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
42 
43 class vtkFastSplatter;
44 class vtkImageData;
45 class vtkIntArray;
46 class vtkFloatArray;
47 
49 {
50 public:
52 
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
59  vtkGetStringMacro(VertexAttribute);
60  void SetVertexAttribute(const char*);
62 
64 
67  vtkSetClampMacro(RandomSeed, int, 0, VTK_INT_MAX);
68  vtkGetMacro(RandomSeed, int);
70 
72 
77  vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_INT_MAX);
78  vtkGetMacro(MaxNumberOfIterations, int);
80 
82 
86  vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_INT_MAX);
87  vtkGetMacro(IterationsPerLayout, int);
89 
91 
94  vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
95  vtkGetMacro(InitialTemperature, float);
97 
99 
103  vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
104  vtkGetMacro(CoolDownRate, double);
106 
108 
110  vtkSetMacro(RestDistance, float);
111  vtkGetMacro(RestDistance, float);
113 
116  virtual void Initialize();
117 
122  virtual void Layout();
123 
126  virtual int IsLayoutComplete() {return this->LayoutComplete;}
127 
128 protected:
131 
132  int MaxNumberOfIterations; //Maximum number of iterations.
134  float CoolDownRate; //Cool-down rate. Note: Higher # = Slower rate.
135 
136 private:
137 
138  //BTX
139  // This class 'has a' vtkFastSplatter for the density grid
142  vtkSmartPointer<vtkFloatArray> RepulsionArray;
143  vtkSmartPointer<vtkFloatArray> AttractionArray;
144  vtkSmartPointer<vtkIntArray> EdgeCountArray;
145  //ETX
146 
147  int RandomSeed;
148  int IterationsPerLayout;
149  int TotalIterations;
150  int LayoutComplete;
151  float Temp;
152  float RestDistance;
153  float CuttingThreshold;
154  char* VertexAttribute;
155 
156  // Private helper methods
157  void GenerateCircularSplat(vtkImageData *splat, int x, int y);
158  void GenerateGaussianSplat(vtkImageData *splat, int x, int y);
159  void ResolveCoincidentVertices();
160 
161 //BTX
162  class Internals;
163  Internals* Implementation;
164 //ETX
165 
167  void operator=(const vtkAttributeClustering2DLayoutStrategy&); // Not implemented.
168 };
169 
170 #endif
171 
#define VTK_DOUBLE_MAX
Definition: vtkType.h:140
#define VTKINFOVISLAYOUT_EXPORT
#define VTK_INT_MAX
Definition: vtkType.h:130
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
abstract superclass for all graph layout strategies
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:49
#define VTK_FLOAT_MAX
Definition: vtkType.h:138
A splatter optimized for splatting single kernels.
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
static vtkObject * New()
virtual void Layout()=0
void PrintSelf(ostream &os, vtkIndent indent)