VTK  9.3.20240418
vtkIncrementalForceLayout.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
20 #ifndef vtkIncrementalForceLayout_h
21 #define vtkIncrementalForceLayout_h
22 
23 #include "vtkInfovisLayoutModule.h" // For export macro
24 #include "vtkObject.h"
25 
26 #include "vtkVector.h" // For vector ivars
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkGraph;
30 
31 class VTKINFOVISLAYOUT_EXPORT vtkIncrementalForceLayout : public vtkObject
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
42  virtual void SetGraph(vtkGraph* g);
43  vtkGetObjectMacro(Graph, vtkGraph);
45 
47 
51  virtual void SetFixed(vtkIdType fixed);
52  vtkGetMacro(Fixed, vtkIdType);
54 
56 
59  vtkSetMacro(Alpha, float);
60  vtkGetMacro(Alpha, float);
62 
64 
69  vtkSetMacro(Theta, float);
70  vtkGetMacro(Theta, float);
72 
74 
78  vtkSetMacro(Charge, float);
79  vtkGetMacro(Charge, float);
81 
83 
86  vtkSetMacro(Strength, float);
87  vtkGetMacro(Strength, float);
89 
91 
95  vtkSetMacro(Distance, float);
96  vtkGetMacro(Distance, float);
98 
100 
104  vtkSetMacro(Gravity, float);
105  vtkGetMacro(Gravity, float);
107 
109 
113  vtkSetMacro(Friction, float);
114  vtkGetMacro(Friction, float);
116 
122  virtual void SetGravityPoint(const vtkVector2f& point) { this->GravityPoint = point; }
123  virtual vtkVector2f GetGravityPoint() { return this->GravityPoint; }
124 
129 
130 protected:
133 
135  class Implementation;
136  Implementation* Impl;
139  float Alpha;
140  float Theta;
141  float Charge;
142  float Strength;
143  float Distance;
144  float Gravity;
145  float Friction;
146 
147 private:
149  void operator=(const vtkIncrementalForceLayout&) = delete;
150 };
151 VTK_ABI_NAMESPACE_END
152 #endif
Base class for graph data types.
Definition: vtkGraph.h:340
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:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
@ point
Definition: vtkX3D.h:236
int vtkIdType
Definition: vtkType.h:315