Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

SEGV_ForceModel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
36 
37 namespace ogdf {
38 
40 {
41 public:
42  ForceModelBase(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
43  : spring_embedder::CommonForceModelBase<NodeInfo>(vInfo, adjLists, idealEdgeLength)
44  , m_gridCell(gridCell)
45  {
46  }
47 
48  virtual ~ForceModelBase() { }
49 
50  virtual DPoint computeDisplacement(int j, double boxLength) const = 0;
51 
52 protected:
54 
55  DPoint computeRepulsiveForce(int j, double boxLength, int idealExponent, int normExponent = 1) const;
56  DPoint computeMixedForcesDisplacement(int j, int boxLength, std::function<DPoint(double, const DPoint &)> attractiveChange, std::function<double()> attractiveFinal) const;
57 };
58 
59 
61 {
62 public:
63  ForceModelFR(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
64  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
65 
66  DPoint computeDisplacement(int j, double boxLength) const override;
67 };
68 
70 {
71 public:
72  ForceModelFRModAttr(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
73  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
74 
75  DPoint computeDisplacement(int j, double boxLength) const override;
76 };
77 
79 {
80 public:
81  ForceModelFRModRep(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
82  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
83 
84  DPoint computeDisplacement(int j, double boxLength) const override;
85 };
86 
87 
89 {
90 public:
91  ForceModelEades(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
92  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
93 
94  DPoint computeDisplacement(int j, double boxLength) const override;
95 };
96 
97 
99 {
100 public:
101  ForceModelHachul(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
102  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
103 
104  DPoint computeDisplacement(int j, double boxLength) const override;
105 };
106 
107 
109 {
110 public:
111  ForceModelGronemann(const Array<NodeInfo> &vInfo, const Array<int> &adjLists, const Array2D<ListPure<int>> &gridCell, double idealEdgeLength)
112  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
113 
114  DPoint computeDisplacement(int j, double boxLength) const override;
115 };
116 
117 }
ForceModelFRModAttr(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Definition: geometry.h:244
ForceModelFR(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
ForceModelFRModRep(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Common implementations of force models for SpringEmbedder algorithms.
DPoint computeRepulsiveForce(int j, double boxLength, int idealExponent, int normExponent=1) const
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition: Array2D.h:46
DPoint computeMixedForcesDisplacement(int j, int boxLength, std::function< DPoint(double, const DPoint &)> attractiveChange, std::function< double()> attractiveFinal) const
CommonForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, double idealEdgeLength)
Definition: common.h:44
Declaration of ogdf::SpringEmbedderGridVariant.
double idealEdgeLength() const
Returns the current setting of ideal edge length.
virtual DPoint computeDisplacement(int j, double boxLength) const =0
ForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
ForceModelEades(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
The namespace for all OGDF objects.
const Array2D< ListPure< int > > & m_gridCell
ForceModelGronemann(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
ForceModelHachul(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)