56 void set(
int i,
double x,
double y) {
62 double getX(
int i)
const {
return m_x[i]; }
65 double getY(
int i)
const {
return m_y[i]; }
Declaration of interface for layout algorithms (class LayoutModule)
Stores additional attributes of a graph (like layout information).
Interface of general layout algorithms.
~ProcrustesPointSet()
Destructor.
double getX(int i) const
Returns i'th x-coordinate.
double m_scale
Scale factor.
void rotateTo(const ProcrustesPointSet &other)
Rotates the point set so it fits somehow on other.
int m_numPoints
Number of points.
double * m_y
Y coordinates.
double originY() const
Returns the origin's y.
double getY(int i) const
Returns i'th y-coordinate.
double * m_x
X coordinates.
double m_originY
Original average center's y when normalized.
bool isFlipped() const
Returns true if the point set is flipped by y coord.
double m_angle
If rotated, the angle.
double m_originX
Original average center's x when normalized.
ProcrustesPointSet(int numPoints)
Constructor for allocating memory for numPoints points.
void normalize(bool flip=false)
Translates and scales the set such that the average center is 0, 0 and the average size is 1....
double angle() const
Returns the rotation angle.
double compare(const ProcrustesPointSet &other) const
Calculates a value how good the two point sets match.
double originX() const
Returns the origin's x.
void set(int i, double x, double y)
Sets i'th coordinate.
double scale() const
Returns the scale factor.
Simple procrustes analysis.
void scale(GraphAttributes &graphAttributes, double scale)
Scales all coords in graphAttributes by scale.
void flipY(GraphAttributes &graphAttributes)
Flips all y coordinates.
void rotate(GraphAttributes &graphAttributes, double angle)
Rotates all coords in graphAttributes by angle.
void copyFromGraphAttributes(const GraphAttributes &graphAttributes, ProcrustesPointSet &pointSet)
Copies the coords in graph attributes to the point set.
virtual ~ProcrustesSubLayout()
Destructor.
void reverseTransform(GraphAttributes &graphAttributes, const ProcrustesPointSet &pointSet)
Does a reverse transform of graph attributes by using the origin, scale and angle in pointset.
bool m_scaleToInitialLayout
Option for enabling/disabling scaling to initial layout scale.
LayoutModule * m_pSubLayout
Layout module to call for a new layout.
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
ProcrustesSubLayout(LayoutModule *pSubLayout)
Constructor.
void setScaleToInitialLayout(bool flag)
Should the new layout scale be used or the initial scale? Defaults to true.
void translate(GraphAttributes &graphAttributes, double dx, double dy)
Moves all coords in graphAttributes by dx, dy.
bool scaleToInitialLayout() const
Should the new layout scale be used or the initial scale? Defaults to true.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.