Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::BertaultLayout Class Reference

#include <ogdf/misclayout/BertaultLayout.h>

+ Inheritance diagram for ogdf::BertaultLayout:

Classes

class  BertaultSections
 The sections associated with each node. More...
 
class  CCElement
 Objects of this class are members of the containment heirarchy made in preprocessing stage of ImPrEd. More...
 
struct  proj
 a structure which stores the projection of a node on an edge More...
 

Public Member Functions

 BertaultLayout ()
 Constructor, sets options to default values. More...
 
 BertaultLayout (double length, int number)
 Constructor, with user defined values for required length and number of iterations. More...
 
 BertaultLayout (int number)
 Constructor, with user defined values for number of iterations. More...
 
 ~BertaultLayout ()
 
virtual void call (GraphAttributes &AG) override
 The main call to the algorithm. AG should have nodeGraphics and EdgeGraphics attributes enabled. More...
 
int edgeCrossings (GraphAttributes &AG)
 Calculates the edge crossings in the graph corresponding to AG. Node attributes required. More...
 
double edgelength (GraphAttributes &GA)
 Calculates the normalised standard deviation of edge lengths in the graph corresponding to AG. Node attributes required. More...
 
void initPositions (GraphAttributes &AG, char c)
 Set the initPositions of nodes. More...
 
int iterno ()
 Returns the number of iterations. More...
 
void iterno (int no)
 Sets the number of iterations. If no <= 0, 10*n will be used. More...
 
double nodeDistribution (GraphAttributes &GA)
 Gives a measure of the node distribution in the graph corresponding to AG. The lesser the value, the more uniform the distribution. Node attributes required. More...
 
double reqlength ()
 Returns the required length. More...
 
void reqlength (double length)
 Sets the required length. If length <= 0, the average edge length will be used. More...
 
void setImpred (bool option)
 Sets impred option true or false. More...
 
- Public Member Functions inherited from ogdf::LayoutModule
 LayoutModule ()
 Initializes a layout module. More...
 
virtual ~LayoutModule ()
 
void operator() (GraphAttributes &GA)
 Computes a layout of graph GA. More...
 

Protected Member Functions

void compute_I (node *v, edge *e, GraphAttributes &AG)
 Computes the projection of node v on the edge (a,b) More...
 
void f_Edge (node *v, edge *e, GraphAttributes &AG)
 Calculates the repulsive force on node v due to the edge on which node i lies and adds it to total force on v. More...
 
void f_Node_Attractive (node *v, node *j, GraphAttributes &AG)
 Calculates the attractive force on node v due to node j and adds it to total force on v. More...
 
void f_Node_Repulsive (node *v, node *j, GraphAttributes &AG)
 Calculates the repulsive force on node v due to node j and adds it to total force on v. More...
 
bool i_On_Edge (edge *e, GraphAttributes &AG)
 Returns true if node i lies on the edge (a,b) More...
 
void move (node *v, GraphAttributes &AG)
 Moves the node v according to the forces Fx and Fy on it. Also ensures that movement is within the respective zones. More...
 
void r_Calc_On_Edge (node *v, edge *e, GraphAttributes &AG)
 Calculates the radii of the zones of node v if node i lies on edge (a,b) More...
 
void r_Calc_Outside_Edge (node *v, edge *e, GraphAttributes &AG)
 Calculates the radii of the zones of node v if node i does not lie on edge (a,b) More...
 

Private Member Functions

void compute (CCElement *element, PlanRep &PG, GraphAttributes &AG1, GraphCopy &G1)
 Computes the surrounding edges from the data calculated so far. More...
 
int contained (CCElement *ele1, CCElement *ele2, GraphAttributes &PAG, PlanRep &PG)
 Checks if the first connected component is within the second one. Returns -1 if not contained. If contained, returns the index of the face of the second connected component which contains it. More...
 
void crossingPlanarize (GraphAttributes &AG)
 Inserts a node at each edge crossing in a GraphCopy and assigns weights to the new edges formed. More...
 
int insert (CCElement *new1, CCElement *node, GraphAttributes &PAG, PlanRep &PG)
 Insert method for the data structure which stores the heirarchy of containment of Connected Components. More...
 
void labelling (GraphAttributes &AG)
 labels the edges with weights which aids in surrounding edge computation More...
 
void preprocess (GraphAttributes &AG)
 preprocessing for ImPrEd More...
 

Private Attributes

NodeArray< double > F_x
 Sections associated with all nodes. More...
 
NodeArray< double > F_y
 Force in x direction. More...
 
bool impred
 number of iterations to be performed More...
 
int iter_no
 req_length is the required edge length More...
 
struct ogdf::BertaultLayout::proj proj
 
double req_length
 number of iterations set by the user More...
 
NodeArray< BertaultSectionssect
 
Array2D< bool > surr
 sets the algorithm to ImPrEd when true More...
 
double userIterNo
 required edge length set by the user More...
 
double userReqLength
 Force in y direction. More...
 

Detailed Description

Definition at line 47 of file BertaultLayout.h.

Constructor & Destructor Documentation

◆ BertaultLayout() [1/3]

ogdf::BertaultLayout::BertaultLayout ( )

Constructor, sets options to default values.

◆ ~BertaultLayout()

ogdf::BertaultLayout::~BertaultLayout ( )

◆ BertaultLayout() [2/3]

ogdf::BertaultLayout::BertaultLayout ( double  length,
int  number 
)

Constructor, with user defined values for required length and number of iterations.

◆ BertaultLayout() [3/3]

ogdf::BertaultLayout::BertaultLayout ( int  number)
explicit

Constructor, with user defined values for number of iterations.

Member Function Documentation

◆ call()

virtual void ogdf::BertaultLayout::call ( GraphAttributes AG)
overridevirtual

The main call to the algorithm. AG should have nodeGraphics and EdgeGraphics attributes enabled.

Implements ogdf::LayoutModule.

◆ compute()

void ogdf::BertaultLayout::compute ( CCElement element,
PlanRep PG,
GraphAttributes AG1,
GraphCopy G1 
)
private

Computes the surrounding edges from the data calculated so far.

◆ compute_I()

void ogdf::BertaultLayout::compute_I ( node v,
edge e,
GraphAttributes AG 
)
protected

Computes the projection of node v on the edge (a,b)

◆ contained()

int ogdf::BertaultLayout::contained ( CCElement ele1,
CCElement ele2,
GraphAttributes PAG,
PlanRep PG 
)
private

Checks if the first connected component is within the second one. Returns -1 if not contained. If contained, returns the index of the face of the second connected component which contains it.

◆ crossingPlanarize()

void ogdf::BertaultLayout::crossingPlanarize ( GraphAttributes AG)
private

Inserts a node at each edge crossing in a GraphCopy and assigns weights to the new edges formed.

◆ edgeCrossings()

int ogdf::BertaultLayout::edgeCrossings ( GraphAttributes AG)

Calculates the edge crossings in the graph corresponding to AG. Node attributes required.

◆ edgelength()

double ogdf::BertaultLayout::edgelength ( GraphAttributes GA)

Calculates the normalised standard deviation of edge lengths in the graph corresponding to AG. Node attributes required.

◆ f_Edge()

void ogdf::BertaultLayout::f_Edge ( node v,
edge e,
GraphAttributes AG 
)
protected

Calculates the repulsive force on node v due to the edge on which node i lies and adds it to total force on v.

◆ f_Node_Attractive()

void ogdf::BertaultLayout::f_Node_Attractive ( node v,
node j,
GraphAttributes AG 
)
protected

Calculates the attractive force on node v due to node j and adds it to total force on v.

◆ f_Node_Repulsive()

void ogdf::BertaultLayout::f_Node_Repulsive ( node v,
node j,
GraphAttributes AG 
)
protected

Calculates the repulsive force on node v due to node j and adds it to total force on v.

◆ i_On_Edge()

bool ogdf::BertaultLayout::i_On_Edge ( edge e,
GraphAttributes AG 
)
protected

Returns true if node i lies on the edge (a,b)

◆ initPositions()

void ogdf::BertaultLayout::initPositions ( GraphAttributes AG,
char  c 
)

Set the initPositions of nodes.

Must for graphs without node attributes c accepts character arguments: 'm' for Grid-like Layout of nodes 'c' for arranging nodes in concentric circles 'r' for random arrangement of nodes

◆ insert()

int ogdf::BertaultLayout::insert ( CCElement new1,
CCElement node,
GraphAttributes PAG,
PlanRep PG 
)
private

Insert method for the data structure which stores the heirarchy of containment of Connected Components.

◆ iterno() [1/2]

int ogdf::BertaultLayout::iterno ( )
inline

Returns the number of iterations.

Definition at line 72 of file BertaultLayout.h.

◆ iterno() [2/2]

void ogdf::BertaultLayout::iterno ( int  no)
inline

Sets the number of iterations. If no <= 0, 10*n will be used.

Definition at line 69 of file BertaultLayout.h.

◆ labelling()

void ogdf::BertaultLayout::labelling ( GraphAttributes AG)
private

labels the edges with weights which aids in surrounding edge computation

◆ move()

void ogdf::BertaultLayout::move ( node v,
GraphAttributes AG 
)
protected

Moves the node v according to the forces Fx and Fy on it. Also ensures that movement is within the respective zones.

◆ nodeDistribution()

double ogdf::BertaultLayout::nodeDistribution ( GraphAttributes GA)

Gives a measure of the node distribution in the graph corresponding to AG. The lesser the value, the more uniform the distribution. Node attributes required.

◆ preprocess()

void ogdf::BertaultLayout::preprocess ( GraphAttributes AG)
private

preprocessing for ImPrEd

◆ r_Calc_On_Edge()

void ogdf::BertaultLayout::r_Calc_On_Edge ( node v,
edge e,
GraphAttributes AG 
)
protected

Calculates the radii of the zones of node v if node i lies on edge (a,b)

◆ r_Calc_Outside_Edge()

void ogdf::BertaultLayout::r_Calc_Outside_Edge ( node v,
edge e,
GraphAttributes AG 
)
protected

Calculates the radii of the zones of node v if node i does not lie on edge (a,b)

◆ reqlength() [1/2]

double ogdf::BertaultLayout::reqlength ( )
inline

Returns the required length.

Definition at line 79 of file BertaultLayout.h.

◆ reqlength() [2/2]

void ogdf::BertaultLayout::reqlength ( double  length)
inline

Sets the required length. If length <= 0, the average edge length will be used.

Definition at line 76 of file BertaultLayout.h.

◆ setImpred()

void ogdf::BertaultLayout::setImpred ( bool  option)
inline

Sets impred option true or false.

Definition at line 66 of file BertaultLayout.h.

Member Data Documentation

◆ F_x

NodeArray<double> ogdf::BertaultLayout::F_x
private

Sections associated with all nodes.

Definition at line 188 of file BertaultLayout.h.

◆ F_y

NodeArray<double> ogdf::BertaultLayout::F_y
private

Force in x direction.

Definition at line 189 of file BertaultLayout.h.

◆ impred

bool ogdf::BertaultLayout::impred
private

number of iterations to be performed

Definition at line 194 of file BertaultLayout.h.

◆ iter_no

int ogdf::BertaultLayout::iter_no
private

req_length is the required edge length

Definition at line 193 of file BertaultLayout.h.

◆ proj

◆ req_length

double ogdf::BertaultLayout::req_length
private

number of iterations set by the user

Definition at line 192 of file BertaultLayout.h.

◆ sect

NodeArray<BertaultSections> ogdf::BertaultLayout::sect
private

Definition at line 187 of file BertaultLayout.h.

◆ surr

Array2D<bool> ogdf::BertaultLayout::surr
private

sets the algorithm to ImPrEd when true

Definition at line 195 of file BertaultLayout.h.

◆ userIterNo

double ogdf::BertaultLayout::userIterNo
private

required edge length set by the user

Definition at line 191 of file BertaultLayout.h.

◆ userReqLength

double ogdf::BertaultLayout::userReqLength
private

Force in y direction.

Definition at line 190 of file BertaultLayout.h.


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