Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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

Tutte's layout algorithm. More...

#include <ogdf/energybased/TutteLayout.h>

+ Inheritance diagram for ogdf::TutteLayout:

Public Member Functions

 TutteLayout ()
 
DRect bbox () const
 
void bbox (const DRect &bb)
 
virtual void call (GraphAttributes &AG) override
 Computes a layout of graph GA.
 
void call (GraphAttributes &AG, const List< node > &givenNodes)
 
- Public Member Functions inherited from ogdf::LayoutModule
 LayoutModule ()
 Initializes a layout module.
 
virtual ~LayoutModule ()
 
void operator() (GraphAttributes &GA)
 Computes a layout of graph GA.
 

Private Member Functions

bool doCall (GraphAttributes &AG, const List< node > &fixedNodes, List< DPoint > &fixedPositions)
 
void setFixedNodes (const Graph &G, List< node > &nodes, const List< node > &givenNodes, List< DPoint > &pos, double radius=1.0)
 sets the positions of the nodes in a largest face of $G$ in the form of a regular $k$-gon with the prescribed radius.
 
void setFixedNodes (const Graph &G, List< node > &nodes, List< DPoint > &pos, double radius=1.0)
 

Static Private Member Functions

static bool solveLP (int cols, const CoinPackedMatrix &Matrix, const Array< double > &rightHandSide, Array< double > &x)
 

Private Attributes

DRect m_bbox
 

Detailed Description

Tutte's layout algorithm.

This algorithm draws a planar graph straight-line without crossings.

The idea of the algorithm is to place every vertex into the center of gravity by its neighbours.

See "How to draw a graph" by W. T. Tutte (1962) for details.

Precondition
Input graphs need to be triconnected.

Definition at line 56 of file TutteLayout.h.

Constructor & Destructor Documentation

◆ TutteLayout()

ogdf::TutteLayout::TutteLayout ( )

Member Function Documentation

◆ bbox() [1/2]

DRect ogdf::TutteLayout::bbox ( ) const
inline

Definition at line 60 of file TutteLayout.h.

◆ bbox() [2/2]

void ogdf::TutteLayout::bbox ( const DRect bb)
inline

Definition at line 62 of file TutteLayout.h.

◆ call() [1/2]

virtual void ogdf::TutteLayout::call ( GraphAttributes GA)
overridevirtual

Computes a layout of graph GA.

This method is the actual algorithm call and must be implemented by derived classes.

Parameters
GAis the input graph and will also be assigned the layout information.

Implements ogdf::LayoutModule.

◆ call() [2/2]

void ogdf::TutteLayout::call ( GraphAttributes AG,
const List< node > &  givenNodes 
)

◆ doCall()

bool ogdf::TutteLayout::doCall ( GraphAttributes AG,
const List< node > &  fixedNodes,
List< DPoint > &  fixedPositions 
)
private

◆ setFixedNodes() [1/2]

void ogdf::TutteLayout::setFixedNodes ( const Graph G,
List< node > &  nodes,
const List< node > &  givenNodes,
List< DPoint > &  pos,
double  radius = 1.0 
)
private

sets the positions of the nodes in a largest face of $G$ in the form of a regular $k$-gon with the prescribed radius.

The corresponding nodes and their positions are stored in nodes and pos, respectively. $G$ does not have to be planar!

◆ setFixedNodes() [2/2]

void ogdf::TutteLayout::setFixedNodes ( const Graph G,
List< node > &  nodes,
List< DPoint > &  pos,
double  radius = 1.0 
)
private

◆ solveLP()

static bool ogdf::TutteLayout::solveLP ( int  cols,
const CoinPackedMatrix Matrix,
const Array< double > &  rightHandSide,
Array< double > &  x 
)
staticprivate

Member Data Documentation

◆ m_bbox

DRect ogdf::TutteLayout::m_bbox
private

Definition at line 83 of file TutteLayout.h.


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