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 "vtkGraphLayoutStrategy.h"
39 
40 #include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
41 
42 class vtkFastSplatter;
43 class vtkImageData;
44 class vtkIntArray;
45 class vtkFloatArray;
46 
48 {
49 public:
51 
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
58  vtkGetStringMacro(VertexAttribute);
59  void SetVertexAttribute(const char*);
61 
63 
66  vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
67  vtkGetMacro(RandomSeed, int);
69 
71 
76  vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
77  vtkGetMacro(MaxNumberOfIterations, int);
79 
81 
85  vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
86  vtkGetMacro(IterationsPerLayout, int);
88 
90 
93  vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
94  vtkGetMacro(InitialTemperature, float);
96 
98 
102  vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
103  vtkGetMacro(CoolDownRate, double);
105 
107 
109  vtkSetMacro(RestDistance, float);
110  vtkGetMacro(RestDistance, float);
112 
115  virtual void Initialize();
116 
121  virtual void Layout();
122 
125  virtual int IsLayoutComplete() {return this->LayoutComplete;}
126 
127 protected:
130 
131  int MaxNumberOfIterations; //Maximum number of iterations.
133  float CoolDownRate; //Cool-down rate. Note: Higher # = Slower rate.
134 
135 private:
136 
137  //BTX
138  // This class 'has a' vtkFastSplatter for the density grid
141  vtkSmartPointer<vtkFloatArray> RepulsionArray;
142  vtkSmartPointer<vtkFloatArray> AttractionArray;
143  vtkSmartPointer<vtkIntArray> EdgeCountArray;
144  //ETX
145 
146  int RandomSeed;
147  int IterationsPerLayout;
148  int TotalIterations;
149  int LayoutComplete;
150  float Temp;
151  float RestDistance;
152  float CuttingThreshold;
153  char* VertexAttribute;
154 
155  // Private helper methods
156  void GenerateCircularSplat(vtkImageData *splat, int x, int y);
157  void GenerateGaussianSplat(vtkImageData *splat, int x, int y);
158  void ResolveCoincidentVertices();
159 
160 //BTX
161  class Internals;
162  Internals* Implementation;
163 //ETX
164 
166  void operator=(const vtkAttributeClustering2DLayoutStrategy&); // Not implemented.
167 };
168 
169 #endif
170 
#define VTK_DOUBLE_MAX
Definition: vtkType.h:133
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
abstract superclass for all graph layout strategies
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:42
#define VTK_FLOAT_MAX
Definition: vtkType.h:131
A splatter optimized for splatting single kernels.
a simple class to control print indentation
Definition: vtkIndent.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
#define VTK_INFOVIS_EXPORT
#define VTK_LARGE_INTEGER
Definition: vtkType.h:148
static vtkObject * New()
virtual void Layout()=0
void PrintSelf(ostream &os, vtkIndent indent)