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 "vtkGraphLayoutStrategy.h"
40 
42 {
43 public:
45 
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
53  vtkSetClampMacro(RandomSeed, int, 0, VTK_LARGE_INTEGER);
54  vtkGetMacro(RandomSeed, int);
56 
58 
61  vtkSetVector6Macro(GraphBounds,double);
62  vtkGetVectorMacro(GraphBounds,double,6);
64 
66 
69  vtkSetMacro(AutomaticBoundsComputation, int);
70  vtkGetMacro(AutomaticBoundsComputation, int);
71  vtkBooleanMacro(AutomaticBoundsComputation, int);
73 
75 
79  vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_LARGE_INTEGER);
80  vtkGetMacro(MaxNumberOfIterations, int);
82 
84 
88  vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_LARGE_INTEGER);
89  vtkGetMacro(IterationsPerLayout, int);
91 
93 
96  vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
97  vtkGetMacro(CoolDownRate, double);
99 
101 
104  vtkSetMacro(ThreeDimensionalLayout, int);
105  vtkGetMacro(ThreeDimensionalLayout, int);
106  vtkBooleanMacro(ThreeDimensionalLayout, int);
108 
110 
112  vtkSetMacro(RandomInitialPoints, int);
113  vtkGetMacro(RandomInitialPoints, int);
114  vtkBooleanMacro(RandomInitialPoints, int);
116 
118 
120  vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
121  vtkGetMacro(InitialTemperature, float);
123 
126  virtual void Initialize();
127 
132  virtual void Layout();
133 
136  virtual int IsLayoutComplete() {return this->LayoutComplete;}
137 
138 protected:
141 
142  double GraphBounds[6];
143  int AutomaticBoundsComputation; //Boolean controls automatic bounds calc.
144  int MaxNumberOfIterations; //Maximum number of iterations.
145  double CoolDownRate; //Cool-down rate. Note: Higher # = Slower rate.
147  int ThreeDimensionalLayout; //Boolean for a third dimension.
148  int RandomInitialPoints; //Boolean for having random points
149 private:
150 
151  //BTX
152  // A vertex contains a position and a displacement.
153  typedef struct
154  {
155  double x[3];
156  double d[3];
157  } vtkLayoutVertex;
158 
159  // An edge consists of two vertices joined together.
160  // This struct acts as a "pointer" to those two vertices.
161  typedef struct
162  {
163  int t;
164  int u;
165  } vtkLayoutEdge;
166  //ETX
167 
168  int RandomSeed;
169  int IterationsPerLayout;
170  int TotalIterations;
171  int LayoutComplete;
172  double Temp;
173  double optDist;
174  vtkLayoutVertex *v;
175  vtkLayoutEdge *e;
176 
178  void operator=(const vtkForceDirectedLayoutStrategy&); // Not implemented.
179 };
180 
181 #endif
182 
a force directed graph layout algorithm
#define VTK_DOUBLE_MAX
Definition: vtkType.h:133
abstract superclass for all graph layout strategies
#define VTK_FLOAT_MAX
Definition: vtkType.h:131
a simple class to control print indentation
Definition: vtkIndent.h:37
#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)