Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

SEGV_ForceModel.h
Go to the documentation of this file.
1 
32 #pragma once
33 
36 
37 namespace ogdf {
38 
40  : public spring_embedder::CommonForceModelBase<NodeInfo> {
41 public:
42  ForceModelBase(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
43  const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
44  : spring_embedder::CommonForceModelBase<NodeInfo>(vInfo, adjLists, idealEdgeLength)
45  , m_gridCell(gridCell) { }
46 
47  virtual ~ForceModelBase() { }
48 
49  virtual DPoint computeDisplacement(int j, double boxLength) const = 0;
50 
51 protected:
53 
54  DPoint computeRepulsiveForce(int j, double boxLength, int idealExponent,
55  int normExponent = 1) const;
56  DPoint computeMixedForcesDisplacement(int j, int boxLength,
57  std::function<DPoint(double, const DPoint&)> attractiveChange,
58  std::function<double()> attractiveFinal) const;
59 };
60 
62 public:
63  ForceModelFR(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
64  const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
65  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
66 
67  DPoint computeDisplacement(int j, double boxLength) const override;
68 };
69 
71 public:
72  ForceModelFRModAttr(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
73  const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
74  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
75 
76  DPoint computeDisplacement(int j, double boxLength) const override;
77 };
78 
80 public:
81  ForceModelFRModRep(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
82  const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
83  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
84 
85  DPoint computeDisplacement(int j, double boxLength) const override;
86 };
87 
89 public:
90  ForceModelEades(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
91  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 
98 public:
99  ForceModelHachul(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
100  const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
101  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
102 
103  DPoint computeDisplacement(int j, double boxLength) const override;
104 };
105 
107 public:
108  ForceModelGronemann(const Array<NodeInfo>& vInfo, const Array<int>& adjLists,
109  const Array2D<ListPure<int>>& gridCell, double idealEdgeLength)
110  : ForceModelBase(vInfo, adjLists, gridCell, idealEdgeLength) { }
111 
112  DPoint computeDisplacement(int j, double boxLength) const override;
113 };
114 
115 }
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:106
ogdf::GenericPoint< double >
ogdf::SpringEmbedderGridVariant::ForceModelFRModRep
Definition: SEGV_ForceModel.h:79
ogdf::SpringEmbedderGridVariant::ForceModelEades
Definition: SEGV_ForceModel.h:88
ogdf::spring_embedder::CommonForceModelBase
Definition: common.h:41
ogdf::SpringEmbedderGridVariant::ForceModelFRModAttr
Definition: SEGV_ForceModel.h:70
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:47
ogdf::SpringEmbedderGridVariant::ForceModelHachul::ForceModelHachul
ForceModelHachul(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:99
ogdf::SpringEmbedderGridVariant::ForceModelHachul
Definition: SEGV_ForceModel.h:97
ogdf::SpringEmbedderGridVariant::ForceModelBase::m_gridCell
const Array2D< ListPure< int > > & m_gridCell
Definition: SEGV_ForceModel.h:52
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:61
ogdf::SpringEmbedderGridVariant::ForceModelBase::~ForceModelBase
virtual ~ForceModelBase()
Definition: SEGV_ForceModel.h:47
ogdf::SpringEmbedderGridVariant::ForceModelGronemann::computeDisplacement
DPoint computeDisplacement(int j, double boxLength) const override
ogdf::SpringEmbedderGridVariant::NodeInfo
Definition: SpringEmbedderGridVariant.h:89
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:108
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:237
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:230
ogdf::SpringEmbedderGridVariant::ForceModelEades::ForceModelEades
ForceModelEades(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, const Array2D< ListPure< int >> &gridCell, double idealEdgeLength)
Definition: SEGV_ForceModel.h:90
ogdf::spring_embedder::CommonForceModelBase::CommonForceModelBase
CommonForceModelBase(const Array< NodeInfo > &vInfo, const Array< int > &adjLists, double idealEdgeLength)
Definition: common.h:43