364 switch (
attr.shape(v)) {
365 case Shape::Pentagon:
370 return std::max(
attr.height(v),
attr.width(v)) / 2.0;
375 return std::hypot(
attr.height(v),
attr.width(v)) / 2.0;
387 }
else if (m_copy.
isDummy(v)) {
389 }
else if (m_copy.
isDummy(w)) {
Declaration of graph copy classes.
Declaration of interface for layout algorithms (class LayoutModule)
edge theEdge() const
Returns the edge associated with this adjacency entry.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Dynamic arrays indexed with edges.
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
const Graph & original() const
Returns a reference to the original graph.
Interface of general layout algorithms.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
int degree() const
Returns the degree of the node (indegree + outdegree).
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
The NodeRespecterLayout layout algorithm.
int m_numberOfIterations
Number of times a single node is moved for each connected component.
double getOscillationAngle() const
Returns m_oscillationAngle.
void setPostProcessing(PostProcessingMode postProcessing)
Sets m_postProcessing to postProcessing.
NodeArray< double > m_localTemperature
Local temperature of the node.
double getRepulsionDistance() const
Returns m_repulsionDistance.
double getGravitation() const
Returns m_gravitation.
double m_oscillationAngle
Maximum angle between new and previous impulse such that the node movement is counted as an oscillati...
NodeArray< NodeArray< double > > m_desiredDistance
Desired distance between each pair of nodes.
double m_initialTemperature
Initial temperature of every node.
void freeData()
Frees all graph data used by the algorithm.
double m_repulsionDistance
Maximum distance between a dummy and another node such that the former is repulsed by the latter.
PostProcessingMode getPostProcessing() const
Returns m_postProcessing.
int getInitDummiesPerEdge() const
Returns m_initDummiesPerEdge.
void setGravitation(double gravitation)
Sets m_gravitation to gravitation >= 0.
void setDummyInsertionThreshold(double dummyInsertionThreshold)
Sets m_dummyInsertionThreshold to dummyInsertionThreshold >= 1.
double m_bendNormalizationAngle
Lower bound for the minimum angle between two line segments such that the bend point between them is ...
double getMinimalTemperature() const
Returns m_minimalTemperature.
double getTemperatureDecreaseOffset() const
Returns m_temperatureDecreaseOffset.
PostProcessingMode
Sets whether unnecessary edge bends should be filtered out in a post-processing step.
int m_initDummiesPerEdge
How many dummy nodes should initially be created for one edge.
void setOscillationAngle(double oscillationAngle)
Sets m_oscillationAngle to oscillationAngle in [0...Pi].
~NodeRespecterLayout()
Destroys an instance of the NodeRespecterLayout.
virtual void call(GraphAttributes &attr) override
Calls the layout algorithm for the GraphAttributes attr.
double m_minimalTemperature
Minimal temperature, lower bound for the global temperature.
double m_factor
Precomputed constant used to get the max. temperature for each iteration.
double m_cos
Precomputed cosinus of (m_oscillationAngle / 2).
void setMinDistCC(double minDistCC)
Sets m_minDistCC to minDistCC >= 0.
NodeRespecterLayout()
Creates an instance of the NodeRespecterLayout.
void addDummies(node v, SListPure< node > &nodes)
Adds dummy nodes to incident edges of v if they are too long.
void setPageRatio(double pageRatio)
Sets m_pageRatio to pageRatio > 0.
double m_globalTemperature
Average of all local node temperatures.
double m_maxDisturbance
Maximal disturbance, i.e. maximal random node movement.
void setRepulsionDistance(double repulsionDistance)
Sets m_repulsionDistance to repulsionDistance >= 0.
double radius(const GraphAttributes &attr, node v) const
Returns the radius of the smallest circle surrounding the shape of v (while still having its center a...
int getMaxDummiesPerEdge() const
Returns m_maxDummiesPerEdge.
void setMaxDisturbance(double maxDisturbance)
Sets m_maxDisturbance to maxDisturbance >= 0.
int getNumberOfIterations() const
Returns m_numberOfIterations.
double getDummyInsertionThreshold() const
Returns m_dummyInsertionThreshold.
int m_degreeSum
Twice the number of all edges in the original graph.
void setRandomInitialPlacement(bool randomInitialPlacement)
Sets m_randomInitialPlacement to randomInitialPlacement.
int m_maxDummiesPerEdge
How many dummy nodes should maximally be created for one edge.
bool m_randomInitialPlacement
Whether nodes should be initialized in random positions.
GraphCopy m_copy
Copy of the given graph which may contain dummy nodes.
void createBends(const ArrayBuffer< edge > &origEdges, GraphAttributes &attr)
Creates bends in attr at the coordinates of dummy nodes in copy.
double m_dummyInsertionThreshold
How many times larger than the desired edge length an edge has to be in order for a new dummy node to...
void setMaxDummiesPerEdge(int maxDummiesPerEdge)
Sets m_maxDummiesPerEdge to maxDummiesPerEdge > m_initDummiesPerEdge.
NodeArray< double > m_impulseX
X-coordinate of the last impulse of the node.
void setInitDummiesPerEdge(int initDummiesPerEdge)
Sets m_initDummiesPerEdge to initDummiesPerEdge >= 0.
int m_iterCounter
Number of iterations for which the algorithm still has to run.
double getBendNormalizationAngle() const
Returns m_bendNormalizationAngle.
void updateNode(node v, std::pair< double, double > newImpulse)
Updates the node data for node v using newImpulse as the x- and y-coordinate of the new impulse onto ...
double m_temperatureDecreaseOffset
Factor for which holds: If only m_numberOfIterations * m_temperatureDecreaseOffset iterations are lef...
double weight(node v) const
Returns the weight of node v according to its degree.
void setDesiredMinEdgeLength(double desiredMinEdgeLength)
Sets m_desiredMinEdgeLength to desiredMinEdgeLength > 0.
double m_barycenterY
Weighted sum of y-coordinates of all nodes.
double getInitialTemperature() const
Returns m_initialTemperature.
void setTemperatureDecreaseOffset(double temperatureDecreaseOffset)
Sets m_temperatureDecreaseOffset to temperatureDecreaseOffset in [0...1].
void setNumberOfIterations(int numberOfIterations)
Sets m_numberOfIterations to numberOfIterations >= 0.
void initData()
Initializes all graph data used by the algorithm.
double m_gravitation
Gravitational constant scaling attractive forces towards the barycenter.
double m_pageRatio
Page ratio used for the layout of connected components.
NodeArray< double > m_nodeRadius
Radius of the smallest circle encompassing the node.
bool getRandomInitialPlacement() const
Returns m_randomInitialPlacement.
double getMinDistCC() const
Returns m_minDistCC.
PostProcessingMode m_postProcessing
Whether unnecessary bends should be filtered out in a post processing step.
double m_desiredMinEdgeLength
Desired minimal node separation/edge length.
bool haveSameOriginalEdge(node v, node w) const
Returns whether v and w belong to the same original edge. If only one of the nodes is a dummy node,...
double getDesiredMinEdgeLength() const
Returns m_desiredMinEdgeLength.
void setBendNormalizationAngle(double bendNormalizationAngle)
Sets m_bendNormalizationAngle to bendNormalizationAngle in [0...Pi].
double getMaxDisturbance() const
Returns m_maxDisturbance.
EdgeArray< bool > m_hasParEdges
Whether the edge has parallel edges.
void setMinimalTemperature(double minimalTemperature)
Sets m_minimalTemperature to minimalTemperature >= 0.
void setInitialTemperature(double initialTemperature)
Sets m_initialTemperature to initialTemperature > m_minimalTemperature.
double m_minDistCC
Minimal distance between connected components.
GraphAttributes m_copyAttr
GraphAttributes for m_copy.
std::pair< double, double > computeImpulse(node v)
Returns the new impulse for node v.
NodeArray< double > m_impulseY
Y-coordinate of the last impulse of the node.
double m_barycenterX
Weighted sum of x-coordinates of all nodes.
double getPageRatio() const
Returns m_pageRatio.
void updateNodeLoop(SListPure< node > &nodes)
Computes new impulses and updates positions for random permutations of nodes until m_numberOfIteratio...
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
@ None
Two geometric objects do not intersect.