Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
SEGV_ForceModel.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Array.h>
35#include <ogdf/basic/geometry.h>
38
39#include <functional>
40
41namespace ogdf {
42template<class E>
43class Array2D;
44template<class E>
45class ListPure;
46
48 : public spring_embedder::CommonForceModelBase<NodeInfo> {
49public:
50 ForceModelBase(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
51 const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
52 : spring_embedder::CommonForceModelBase<NodeInfo>(vInfo, adjLists, idealEdgeLength)
53 , m_gridCell(gridCell) { }
54
55 virtual ~ForceModelBase() { }
56
57 virtual DPoint computeDisplacement(int j, double boxLength) const = 0;
58
59protected:
61
62 DPoint computeRepulsiveForce(int j, double boxLength, int idealExponent,
63 int normExponent = 1) const;
65 std::function<DPoint(double, const DPoint&)> attractiveChange,
66 std::function<double()> attractiveFinal) const;
67};
68
70public:
71 ForceModelFR(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
72 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
79public:
80 ForceModelFRModAttr(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
81 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
88public:
89 ForceModelFRModRep(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
90 const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
91 : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
92
93 DPoint computeDisplacement(int j, double boxLength) const override;
94};
95
97public:
98 ForceModelEades(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
99 const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
100 : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
101
102 DPoint computeDisplacement(int j, double boxLength) const override;
103};
104
106public:
107 ForceModelHachul(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
108 const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
109 : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
110
111 DPoint computeDisplacement(int j, double boxLength) const override;
112};
113
115public:
116 ForceModelGronemann(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
117 const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
118 : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
119
120 DPoint computeDisplacement(int j, double boxLength) const override;
121};
122
123}
Declaration and implementation of Array class and Array algorithms.
Declaration of ogdf::SpringEmbedderGridVariant.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition Array2D.h:53
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
Doubly linked lists.
Definition List.h:233
ForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
virtual DPoint computeDisplacement(int j, double boxLength) const =0
DPoint computeMixedForcesDisplacement(int j, int boxLength, std::function< DPoint(double, const DPoint &)> attractiveChange, std::function< double()> attractiveFinal) const
const Array2D< ListPure< int > > & m_gridCell
DPoint computeRepulsiveForce(int j, double boxLength, int idealExponent, int normExponent=1) const
DPoint computeDisplacement(int j, double boxLength) const override
ForceModelEades(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
ForceModelFR(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
DPoint computeDisplacement(int j, double boxLength) const override
ForceModelFRModAttr(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
DPoint computeDisplacement(int j, double boxLength) const override
ForceModelFRModRep(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
DPoint computeDisplacement(int j, double boxLength) const override
ForceModelGronemann(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
DPoint computeDisplacement(int j, double boxLength) const override
ForceModelHachul(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int > > &gridCell, double idealEdgeLength)
DPoint computeDisplacement(int j, double boxLength) const override
CommonForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, double idealEdgeLength)
Definition common.h:45
double idealEdgeLength() const
Returns the current setting of ideal edge length.
The namespace for all OGDF objects.
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Definition geometry.h:244
Common implementations of force models for SpringEmbedder algorithms.