Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

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 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::SpringEmbedderGridVariant::ForceModelBase::computeRepulsiveForce
DPoint computeRepulsiveForce(int j, double boxLength, int idealExponent, int normExponent=1) const
ogdf::SpringEmbedderGridVariant::ForceModelBase::computeMixedForcesDisplacement
DPoint computeMixedForcesDisplacement(int j, int boxLength, std::function< DPoint(double, const DPoint &)> attractiveChange, std::function< double()> attractiveFinal) const
ogdf::SpringEmbedderGridVariant::ForceModelGronemann
Definition: SEGV_ForceModel.h:108
ogdf::GenericPoint< double >
ogdf::SpringEmbedderGridVariant::ForceModelFRModRep
Definition: SEGV_ForceModel.h:78
ogdf::SpringEmbedderGridVariant::ForceModelEades
Definition: SEGV_ForceModel.h:88
ogdf::spring_embedder::CommonForceModelBase
Definition: common.h:41
ogdf::SpringEmbedderGridVariant::ForceModelFRModAttr
Definition: SEGV_ForceModel.h:69
ogdf::SpringEmbedderGridVariant::ForceModelBase
Definition: SEGV_ForceModel.h:39
ogdf::SpringEmbedderGridVariant::ForceModelBase::ForceModelBase
ForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:42
ogdf::SpringEmbedderGridVariant::ForceModelHachul::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
ogdf::SpringEmbedderGridVariant::ForceModelFRModRep::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
ogdf::SpringEmbedderGridVariant::ForceModelBase::computeDisplacement
virtual DPoint computeDisplacement(int j, double boxLength) const =0
ogdf::Array2D
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition: Array2D.h:46
ogdf::SpringEmbedderGridVariant::ForceModelHachul::ForceModelHachul
ForceModelHachul(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:101
ogdf::SpringEmbedderGridVariant::ForceModelHachul
Definition: SEGV_ForceModel.h:98
ogdf::SpringEmbedderGridVariant::ForceModelBase::m_gridCell
const Array2D< ListPure< int > > & m_gridCell
Definition: SEGV_ForceModel.h:53
ogdf::SpringEmbedderGridVariant::ForceModelFRModRep::ForceModelFRModRep
ForceModelFRModRep(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:81
SpringEmbedderGridVariant.h
Declaration of ogdf::SpringEmbedderGridVariant.
ogdf::SpringEmbedderGridVariant::ForceModelFR
Definition: SEGV_ForceModel.h:60
ogdf::SpringEmbedderGridVariant::ForceModelBase::~ForceModelBase
virtual ~ForceModelBase()
Definition: SEGV_ForceModel.h:48
ogdf::SpringEmbedderGridVariant::ForceModelGronemann::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
ogdf::SpringEmbedderGridVariant::NodeInfo
Definition: SpringEmbedderGridVariant.h:92
ogdf::Array< NodeInfo >
ogdf::SpringEmbedderGridVariant::ForceModelFRModAttr::ForceModelFRModAttr
ForceModelFRModAttr(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:72
ogdf::SpringEmbedderGridVariant::ForceModelEades::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
common.h
Common implementations of force models for SpringEmbedder algorithms.
ogdf::SpringEmbedderGridVariant::ForceModelGronemann::ForceModelGronemann
ForceModelGronemann(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:111
ogdf::ListPure< int >
ogdf::SpringEmbedderGridVariant::ForceModelFRModAttr::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
ogdf::DPoint
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Definition: geometry.h:244
ogdf::SpringEmbedderGridVariant::ForceModelFR::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
ogdf::SpringEmbedderGridVariant::ForceModelFR::ForceModelFR
ForceModelFR(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:63
ogdf::spring_embedder::SpringEmbedderBase::idealEdgeLength
double idealEdgeLength() const
Returns the current setting of ideal edge length.
Definition: SpringEmbedderBase.h:241
ogdf::SpringEmbedderGridVariant::ForceModelEades::ForceModelEades
ForceModelEades(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:91
ogdf::spring_embedder::CommonForceModelBase::CommonForceModelBase
CommonForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, double idealEdgeLength)
Definition: common.h:44