Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::ProcrustesPointSet Class Reference

#include <ogdf/misclayout/ProcrustesSubLayout.h>

Public Member Functions

 ProcrustesPointSet (int numPoints)
 Constructor for allocating memory for numPoints points.
 
 ~ProcrustesPointSet ()
 Destructor.
 
double angle () const
 Returns the rotation angle.
 
double compare (const ProcrustesPointSet &other) const
 Calculates a value how good the two point sets match.
 
double getX (int i) const
 Returns i'th x-coordinate.
 
double getY (int i) const
 Returns i'th y-coordinate.
 
bool isFlipped () const
 Returns true if the point set is flipped by y coord.
 
void normalize (bool flip=false)
 Translates and scales the set such that the average center is 0, 0 and the average size is 1.0.
 
double originX () const
 Returns the origin's x.
 
double originY () const
 Returns the origin's y.
 
void rotateTo (const ProcrustesPointSet &other)
 Rotates the point set so it fits somehow on other.
 
double scale () const
 Returns the scale factor.
 
void set (int i, double x, double y)
 Sets i'th coordinate.
 

Private Attributes

double m_angle
 If rotated, the angle.
 
bool m_flipped
 
int m_numPoints
 Number of points.
 
double m_originX
 Original average center's x when normalized.
 
double m_originY
 Original average center's y when normalized.
 
double m_scale
 Scale factor.
 
doublem_x
 X coordinates.
 
doublem_y
 Y coordinates.
 

Detailed Description

Definition at line 38 of file ProcrustesSubLayout.h.

Constructor & Destructor Documentation

◆ ProcrustesPointSet()

ogdf::ProcrustesPointSet::ProcrustesPointSet ( int  numPoints)
explicit

Constructor for allocating memory for numPoints points.

◆ ~ProcrustesPointSet()

ogdf::ProcrustesPointSet::~ProcrustesPointSet ( )

Destructor.

Member Function Documentation

◆ angle()

double ogdf::ProcrustesPointSet::angle ( ) const
inline

Returns the rotation angle.

Definition at line 77 of file ProcrustesSubLayout.h.

◆ compare()

double ogdf::ProcrustesPointSet::compare ( const ProcrustesPointSet other) const

Calculates a value how good the two point sets match.

◆ getX()

double ogdf::ProcrustesPointSet::getX ( int  i) const
inline

Returns i'th x-coordinate.

Definition at line 62 of file ProcrustesSubLayout.h.

◆ getY()

double ogdf::ProcrustesPointSet::getY ( int  i) const
inline

Returns i'th y-coordinate.

Definition at line 65 of file ProcrustesSubLayout.h.

◆ isFlipped()

bool ogdf::ProcrustesPointSet::isFlipped ( ) const
inline

Returns true if the point set is flipped by y coord.

Definition at line 80 of file ProcrustesSubLayout.h.

◆ normalize()

void ogdf::ProcrustesPointSet::normalize ( bool  flip = false)

Translates and scales the set such that the average center is 0, 0 and the average size is 1.0.

◆ originX()

double ogdf::ProcrustesPointSet::originX ( ) const
inline

Returns the origin's x.

Definition at line 68 of file ProcrustesSubLayout.h.

◆ originY()

double ogdf::ProcrustesPointSet::originY ( ) const
inline

Returns the origin's y.

Definition at line 71 of file ProcrustesSubLayout.h.

◆ rotateTo()

void ogdf::ProcrustesPointSet::rotateTo ( const ProcrustesPointSet other)

Rotates the point set so it fits somehow on other.

◆ scale()

double ogdf::ProcrustesPointSet::scale ( ) const
inline

Returns the scale factor.

Definition at line 74 of file ProcrustesSubLayout.h.

◆ set()

void ogdf::ProcrustesPointSet::set ( int  i,
double  x,
double  y 
)
inline

Sets i'th coordinate.

Definition at line 56 of file ProcrustesSubLayout.h.

Member Data Documentation

◆ m_angle

double ogdf::ProcrustesPointSet::m_angle
private

If rotated, the angle.

Definition at line 102 of file ProcrustesSubLayout.h.

◆ m_flipped

bool ogdf::ProcrustesPointSet::m_flipped
private

Definition at line 104 of file ProcrustesSubLayout.h.

◆ m_numPoints

int ogdf::ProcrustesPointSet::m_numPoints
private

Number of points.

Definition at line 84 of file ProcrustesSubLayout.h.

◆ m_originX

double ogdf::ProcrustesPointSet::m_originX
private

Original average center's x when normalized.

Definition at line 93 of file ProcrustesSubLayout.h.

◆ m_originY

double ogdf::ProcrustesPointSet::m_originY
private

Original average center's y when normalized.

Definition at line 96 of file ProcrustesSubLayout.h.

◆ m_scale

double ogdf::ProcrustesPointSet::m_scale
private

Scale factor.

Definition at line 99 of file ProcrustesSubLayout.h.

◆ m_x

double* ogdf::ProcrustesPointSet::m_x
private

X coordinates.

Definition at line 87 of file ProcrustesSubLayout.h.

◆ m_y

double* ogdf::ProcrustesPointSet::m_y
private

Y coordinates.

Definition at line 90 of file ProcrustesSubLayout.h.


The documentation for this class was generated from the following file: