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-------------------------------------------------------------------------*/
33#ifndef vtkAttributeClustering2DLayoutStrategy_h
34#define vtkAttributeClustering2DLayoutStrategy_h
35
36#include "vtkInfovisLayoutModule.h" // For export macro
38
39#include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
40
41class vtkFastSplatter;
42class vtkImageData;
43class vtkIntArray;
44class vtkFloatArray;
45
47{
48public:
50
52 void PrintSelf(ostream& os, vtkIndent indent);
53
55
59 vtkGetStringMacro(VertexAttribute);
60 void SetVertexAttribute(const char*);
62
64
69 vtkSetClampMacro(RandomSeed, int, 0, VTK_INT_MAX);
70 vtkGetMacro(RandomSeed, int);
72
74
82 vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_INT_MAX);
83 vtkGetMacro(MaxNumberOfIterations, int);
85
87
94 vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_INT_MAX);
95 vtkGetMacro(IterationsPerLayout, int);
97
99
105 vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
106 vtkGetMacro(InitialTemperature, float);
108
110
118 vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
119 vtkGetMacro(CoolDownRate, double);
121
123
127 vtkSetMacro(RestDistance, float);
128 vtkGetMacro(RestDistance, float);
130
135 virtual void Initialize();
136
144 virtual void Layout();
145
150 virtual int IsLayoutComplete() {return this->LayoutComplete;}
151
152protected:
155
156 int MaxNumberOfIterations; //Maximum number of iterations.
158 float CoolDownRate; //Cool-down rate. Note: Higher # = Slower rate.
159
160private:
161
162 // This class 'has a' vtkFastSplatter for the density grid
165 vtkSmartPointer<vtkFloatArray> RepulsionArray;
166 vtkSmartPointer<vtkFloatArray> AttractionArray;
167 vtkSmartPointer<vtkIntArray> EdgeCountArray;
168
169 int RandomSeed;
170 int IterationsPerLayout;
171 int TotalIterations;
172 int LayoutComplete;
173 float Temp;
174 float RestDistance;
175 float CuttingThreshold;
176 char* VertexAttribute;
177
178 // Private helper methods
179 void GenerateCircularSplat(vtkImageData *splat, int x, int y);
180 void GenerateGaussianSplat(vtkImageData *splat, int x, int y);
181 void ResolveCoincidentVertices();
182
183 class Internals;
184 Internals* Implementation;
185
187 void operator=(const vtkAttributeClustering2DLayoutStrategy&) VTK_DELETE_FUNCTION;
188};
189
190#endif
191
virtual int IsLayoutComplete()
I'm an iterative layout so this method lets the caller know if I'm done laying out the graph.
static vtkAttributeClustering2DLayoutStrategy * New()
virtual void Initialize()
This strategy sets up some data structures for faster processing of each Layout() call.
virtual void Layout()
This is the layout method where the graph that was set in SetGraph() is laid out.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
A splatter optimized for splatting single kernels.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
abstract superclass for all graph layout strategies
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163
#define VTK_INT_MAX
Definition: vtkType.h:153
#define VTK_FLOAT_MAX
Definition: vtkType.h:161