VTK
vtkSimple2DLayoutStrategy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSimple2DLayoutStrategy.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 -------------------------------------------------------------------------*/
43 #ifndef vtkSimple2DLayoutStrategy_h
44 #define vtkSimple2DLayoutStrategy_h
45 
46 #include "vtkInfovisLayoutModule.h" // For export macro
47 #include "vtkGraphLayoutStrategy.h"
48 
49 class vtkFloatArray;
50 
52 {
53 public:
55 
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
60 
63  vtkSetClampMacro(RandomSeed, int, 0, VTK_INT_MAX);
64  vtkGetMacro(RandomSeed, int);
66 
68 
73  vtkSetClampMacro(MaxNumberOfIterations, int, 0, VTK_INT_MAX);
74  vtkGetMacro(MaxNumberOfIterations, int);
76 
78 
82  vtkSetClampMacro(IterationsPerLayout, int, 0, VTK_INT_MAX);
83  vtkGetMacro(IterationsPerLayout, int);
85 
87 
90  vtkSetClampMacro(InitialTemperature, float, 0.0, VTK_FLOAT_MAX);
91  vtkGetMacro(InitialTemperature, float);
93 
95 
99  vtkSetClampMacro(CoolDownRate, double, 0.01, VTK_DOUBLE_MAX);
100  vtkGetMacro(CoolDownRate, double);
102 
104 
107  vtkSetMacro(Jitter, bool);
108  vtkGetMacro(Jitter, bool);
110 
112 
114  vtkSetMacro(RestDistance, float);
115  vtkGetMacro(RestDistance, float);
117 
120  virtual void Initialize();
121 
126  virtual void Layout();
127 
130  virtual int IsLayoutComplete() {return this->LayoutComplete;}
131 
132 protected:
135 
136  int MaxNumberOfIterations; //Maximum number of iterations.
138  float CoolDownRate; //Cool-down rate. Note: Higher # = Slower rate.
139 
140 private:
141 
142  //BTX
143  // An edge consists of two vertices joined together.
144  // This struct acts as a "pointer" to those two vertices.
145  typedef struct
146  {
147  vtkIdType from;
148  vtkIdType to;
149  float weight;
150  } vtkLayoutEdge;
151 
152  // These are for storage of repulsion and attraction
153  vtkFloatArray *RepulsionArray;
154  vtkFloatArray *AttractionArray;
155  vtkLayoutEdge *EdgeArray;
156  //ETX
157 
158  int RandomSeed;
159  int IterationsPerLayout;
160  int TotalIterations;
161  int LayoutComplete;
162  float Temp;
163  float RestDistance;
164  bool Jitter;
165 
166  vtkSimple2DLayoutStrategy(const vtkSimple2DLayoutStrategy&); // Not implemented.
167  void operator=(const vtkSimple2DLayoutStrategy&); // Not implemented.
168 };
169 
170 #endif
171 
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
#define VTKINFOVISLAYOUT_EXPORT
#define VTK_INT_MAX
Definition: vtkType.h:132
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
int vtkIdType
Definition: vtkType.h:275
a simple 2D graph layout
abstract superclass for all graph layout strategies
#define VTK_FLOAT_MAX
Definition: vtkType.h:140
a simple class to control print indentation
Definition: vtkIndent.h:38
static vtkObject * New()
virtual void Layout()=0
void PrintSelf(ostream &os, vtkIndent indent)