VTK  9.0.3
vtkIncrementalForceLayout.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkScatterPlotMatrix.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 
29 #ifndef vtkIncrementalForceLayout_h
30 #define vtkIncrementalForceLayout_h
31 
32 #include "vtkInfovisLayoutModule.h" // For export macro
33 #include "vtkObject.h"
34 
35 #include "vtkVector.h" // For vector ivars
36 
37 class vtkGraph;
38 
39 class VTKINFOVISLAYOUT_EXPORT vtkIncrementalForceLayout : public vtkObject
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
50  virtual void SetGraph(vtkGraph* g);
51  vtkGetObjectMacro(Graph, vtkGraph);
53 
55 
59  virtual void SetFixed(vtkIdType fixed);
60  vtkGetMacro(Fixed, vtkIdType);
62 
64 
67  vtkSetMacro(Alpha, float);
68  vtkGetMacro(Alpha, float);
70 
72 
77  vtkSetMacro(Theta, float);
78  vtkGetMacro(Theta, float);
80 
82 
86  vtkSetMacro(Charge, float);
87  vtkGetMacro(Charge, float);
89 
91 
94  vtkSetMacro(Strength, float);
95  vtkGetMacro(Strength, float);
97 
99 
103  vtkSetMacro(Distance, float);
104  vtkGetMacro(Distance, float);
106 
108 
112  vtkSetMacro(Gravity, float);
113  vtkGetMacro(Gravity, float);
115 
117 
121  vtkSetMacro(Friction, float);
122  vtkGetMacro(Friction, float);
124 
130  virtual void SetGravityPoint(const vtkVector2f& point) { this->GravityPoint = point; }
131  virtual vtkVector2f GetGravityPoint() { return this->GravityPoint; }
132 
137 
138 protected:
141 
143  class Implementation;
144  Implementation* Impl;
147  float Alpha;
148  float Theta;
149  float Charge;
150  float Strength;
151  float Distance;
152  float Gravity;
153  float Friction;
154 
155 private:
157  void operator=(const vtkIncrementalForceLayout&) = delete;
158 };
159 #endif
Base class for graph data types.
Definition: vtkGraph.h:290
incremental force-directed layout.
virtual void SetGraph(vtkGraph *g)
Set the graph to be positioned.
~vtkIncrementalForceLayout() override
virtual void SetFixed(vtkIdType fixed)
Set the id of the vertex that will not move during the simulation.
virtual vtkVector2f GetGravityPoint()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkIncrementalForceLayout * New()
virtual void SetGravityPoint(const vtkVector2f &point)
Set the gravity point where all vertices will migrate.
void UpdatePositions()
Perform one iteration of the force-directed layout.
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
@ point
Definition: vtkX3D.h:242
int vtkIdType
Definition: vtkType.h:338