VTK
vtkForceDirectedLayoutStrategy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkForceDirectedLayoutStrategy.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 -------------------------------------------------------------------------*/
36 #ifndef vtkForceDirectedLayoutStrategy_h
37 #define vtkForceDirectedLayoutStrategy_h
38 
39 #include "vtkInfovisLayoutModule.h" // For export macro
40 #include "vtkGraphLayoutStrategy.h"
41 
43 {
44 public:
46 
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
51 
54  vtkSetClampMacro(RandomSeed, int, 0, VTK_INT_MAX);
55  vtkGetMacro(RandomSeed, int);
57 
59 
62  vtkSetVector6Macro(GraphBounds,double);
63  vtkGetVectorMacro(GraphBounds,double,6);
65 
67 
70  vtkSetMacro(AutomaticBoundsComputation, int);
71  vtkGetMacro(AutomaticBoundsComputation, int);
72  vtkBooleanMacro(AutomaticBoundsComputation, int);
74 
76 
80  vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_INT_MAX);
81  vtkGetMacro(MaxNumberOfIterations, int);
83 
85 
89  vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_INT_MAX);
90  vtkGetMacro(IterationsPerLayout, int);
92 
94 
97  vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
98  vtkGetMacro(CoolDownRate, double);
100 
102 
105  vtkSetMacro(ThreeDimensionalLayout, int);
106  vtkGetMacro(ThreeDimensionalLayout, int);
107  vtkBooleanMacro(ThreeDimensionalLayout, int);
109 
111 
113  vtkSetMacro(RandomInitialPoints, int);
114  vtkGetMacro(RandomInitialPoints, int);
115  vtkBooleanMacro(RandomInitialPoints, int);
117 
119 
121  vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
122  vtkGetMacro(InitialTemperature, float);
124 
127  virtual void Initialize();
128 
133  virtual void Layout();
134 
137  virtual int IsLayoutComplete() {return this->LayoutComplete;}
138 
139 protected:
142 
143  double GraphBounds[6];
144  int AutomaticBoundsComputation; //Boolean controls automatic bounds calc.
145  int MaxNumberOfIterations; //Maximum number of iterations.
146  double CoolDownRate; //Cool-down rate. Note: Higher # = Slower rate.
148  int ThreeDimensionalLayout; //Boolean for a third dimension.
149  int RandomInitialPoints; //Boolean for having random points
150 private:
151 
152  //BTX
153  // A vertex contains a position and a displacement.
154  typedef struct
155  {
156  double x[3];
157  double d[3];
158  } vtkLayoutVertex;
159 
160  // An edge consists of two vertices joined together.
161  // This struct acts as a "pointer" to those two vertices.
162  typedef struct
163  {
164  int t;
165  int u;
166  } vtkLayoutEdge;
167  //ETX
168 
169  int RandomSeed;
170  int IterationsPerLayout;
171  int TotalIterations;
172  int LayoutComplete;
173  double Temp;
174  double optDist;
175  vtkLayoutVertex *v;
176  vtkLayoutEdge *e;
177 
179  void operator=(const vtkForceDirectedLayoutStrategy&); // Not implemented.
180 };
181 
182 #endif
183 
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkGraphLayoutStrategy
abstract superclass for all graph layout strategies
Definition: vtkGraphLayoutStrategy.h:45
vtkForceDirectedLayoutStrategy
a force directed graph layout algorithm
Definition: vtkForceDirectedLayoutStrategy.h:43
vtkForceDirectedLayoutStrategy::New
static vtkForceDirectedLayoutStrategy * New()
vtkForceDirectedLayoutStrategy::RandomInitialPoints
int RandomInitialPoints
Definition: vtkForceDirectedLayoutStrategy.h:149
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkGetVectorMacro
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:424
vtkForceDirectedLayoutStrategy::Layout
virtual void Layout()
vtkForceDirectedLayoutStrategy::ThreeDimensionalLayout
int ThreeDimensionalLayout
Definition: vtkForceDirectedLayoutStrategy.h:148
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkForceDirectedLayoutStrategy::CoolDownRate
double CoolDownRate
Definition: vtkForceDirectedLayoutStrategy.h:146
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
VTKINFOVISLAYOUT_EXPORT
#define VTKINFOVISLAYOUT_EXPORT
Definition: vtkInfovisLayoutModule.h:15
vtkGraphLayoutStrategy.h
vtkInfovisLayoutModule.h
vtkForceDirectedLayoutStrategy::vtkForceDirectedLayoutStrategy
vtkForceDirectedLayoutStrategy()
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkForceDirectedLayoutStrategy::AutomaticBoundsComputation
int AutomaticBoundsComputation
Definition: vtkForceDirectedLayoutStrategy.h:144
vtkForceDirectedLayoutStrategy::InitialTemperature
double InitialTemperature
Definition: vtkForceDirectedLayoutStrategy.h:147
vtkForceDirectedLayoutStrategy::~vtkForceDirectedLayoutStrategy
~vtkForceDirectedLayoutStrategy()
vtkSetVector6Macro
#define vtkSetVector6Macro(name, type)
Definition: vtkSetGet.h:360
vtkForceDirectedLayoutStrategy::IsLayoutComplete
virtual int IsLayoutComplete()
Definition: vtkForceDirectedLayoutStrategy.h:137
vtkForceDirectedLayoutStrategy::Initialize
virtual void Initialize()
vtkForceDirectedLayoutStrategy::MaxNumberOfIterations
int MaxNumberOfIterations
Definition: vtkForceDirectedLayoutStrategy.h:145
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
vtkForceDirectedLayoutStrategy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)