41 namespace spring_embedder {
44 template<
class Master,
class NodeInfo>
47 WorkerBase(
unsigned int id, Master &master,
int vStartIndex,
int vStopIndex,
node vStart,
node vStop)
77 m_master.syncThreads();
80 m_master.scaleLayout(m_sumLengths);
82 m_master.syncThreads();
84 double s = m_master.scaleFactor();
86 const GraphCopy &gc = m_master.getGraph();
89 double xmin = std::numeric_limits<double>::max(), xmax = std::numeric_limits<double>::lowest();
90 double ymin = std::numeric_limits<double>::max(), ymax = std::numeric_limits<double>::lowest();
95 NodeInfo &vj = vInfo[j];
97 double xv = s * vj.m_pos.m_x;
98 double yv = s * vj.m_pos.m_y;
102 double wv = ga.
width(vOrig);
103 double hv = ga.
height(vOrig);
111 m_xmin = xmin; m_xmax = xmax;
112 m_ymin = ymin; m_ymax = ymax;
114 m_master.syncThreads();
120 m_master.syncThreads();
123 m_master.scaleLayout(m_sumLengths);
125 m_master.syncThreads();
127 double s = m_master.scaleFactor();
132 m_master.initImprovementPhase();
134 m_master.syncThreads();
138 double sumLengths = 0.0;
140 const NodeInfo &vj = vInfo[j];
141 for(
int k = vj.m_adjBegin; k != vj.m_adjStop; ++k) {
144 DPoint dist = vj.m_pos - vInfo[u].m_pos;
145 sumLengths += dist.
norm();
double width(node v) const
Returns the width of the bounding box of node v.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
virtual ~WorkerBase()=default
double height(node v) const
Returns the height of the bounding box of node v.
void updateMin(T &min, const T &newValue)
Stores the minimum of min and newValue in min.
Implementation of a thread barrier.
Stores additional attributes of a graph (like layout information).
Declaration of graph copy classes.
double sumUpLengths(Array< NodeInfo > &vInfo, const Array< int > &adjLists)
Copies of graphs supporting edge splitting.
void finalScaling(Array< NodeInfo > &vInfo, const Array< int > &adjLists)
Class for the representation of nodes.
virtual void operator()()=0
const Graph & original() const
Returns a reference to the original graph.
void scaling(Array< NodeInfo > &vInfo, const Array< int > &adjLists)
The namespace for all OGDF objects.
WorkerBase(unsigned int id, Master &master, int vStartIndex, int vStopIndex, node vStart, node vStop)
Declaration and definition of ogdf::SpringEmbedderBase.
Base class for ogdf::SpringEmbedderGridVariant::Worker.
void updateMax(T &max, const T &newValue)
Stores the maximum of max and newValue in max.
double norm() const
Returns the norm of the point.