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 
a force directed graph layout algorithm
#define VTK_DOUBLE_MAX
Definition: vtkType.h:140
#define VTKINFOVISLAYOUT_EXPORT
#define VTK_INT_MAX
Definition: vtkType.h:130
abstract superclass for all graph layout strategies
#define VTK_FLOAT_MAX
Definition: vtkType.h:138
a simple class to control print indentation
Definition: vtkIndent.h:38
static vtkObject * New()
virtual void Layout()=0
void PrintSelf(ostream &os, vtkIndent indent)