Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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

The planarization layout algorithm. More...

#include <ogdf/uml/PlanarizationLayoutUML.h>

+ Inheritance diagram for ogdf::PlanarizationLayoutUML:

Public Member Functions

 PlanarizationLayoutUML ()
 Creates an instance of planarization layout and sets options to default values.
 
virtual ~PlanarizationLayoutUML ()
 
Algorithm call
void call (GraphAttributes &GA)
 Calls planarization layout for GraphAttributes GA and computes a layout.
 
virtual void call (UMLGraph &umlGraph) override
 Calls planarization layout for UML-graph umlGraph and computes a mixed-upward layout.
 
void simpleCall (UMLGraph &umlGraph)
 Simple call function that does not care about cliques etc.
 
void simpleCall (GraphAttributes &GA)
 Simple call function.
 
virtual void callIncremental (UMLGraph &umlgraph, NodeArray< bool > &fixedNodes, const EdgeArray< bool > &fixedEdges)
 Incremental call function.
 
Optional parameters
double pageRatio () const
 Returns the current setting of option pageRatio.
 
void pageRatio (double ratio)
 Sets the option pageRatio to ratio.
 
void setLayouterOptions (int ops)
 
void alignSons (bool b)
 
Module options
void setCrossMin (UMLCrossingMinimizationModule *pCrossMin)
 Sets the module option for UML crossing minimization.
 
void setEmbedder (EmbedderModule *pEmbedder)
 Sets the module option for the graph embedding algorithm.
 
void setPlanarLayouter (LayoutPlanRepUMLModule *pPlanarLayouter)
 Sets the module option for the planar layout algorithm.
 
void setPacker (CCLayoutPackModule *pPacker)
 Sets the module option for the arrangement of connected components.
 
Further information
int numberOfCrossings () const
 Returns the number of crossings in computed layout.
 
void assureDrawability (UMLGraph &umlGraph)
 
- Public Member Functions inherited from ogdf::UMLLayoutModule
 UMLLayoutModule ()
 Initializes a UML layout module.
 
virtual ~UMLLayoutModule ()
 
void operator() (UMLGraph &umlGraph)
 Computes a layout of UML graph umlGraph.
 

Protected Member Functions

void arrangeCCs (PlanRep &PG, GraphAttributes &GA, Array< DPoint > &boundingBox)
 
void doSimpleCall (GraphAttributes &GA)
 
void getFixationDistance (node startNode, HashArray< int, int > &distance, const NodeArray< bool > &fixedNodes)
 
virtual void postProcess (UMLGraph &UG)
 
virtual void preProcess (UMLGraph &UG)
 
void reembed (PlanRepUML &PG, int ccNumber, bool l_align=false, bool l_gensExist=false)
 
void sortIncrementalNodes (List< node > &addNodes, const NodeArray< bool > &fixedNodes)
 

Private Member Functions

face findBestExternalFace (const PlanRep &PG, const CombinatorialEmbedding &E)
 

Private Attributes

bool m_arrangeLabels
 Option for re-arranging labels.
 
std::unique_ptr< UMLCrossingMinimizationModulem_crossMin
 The moule for UML crossing minimization.
 
std::unique_ptr< EmbedderModulem_embedder
 The module for planar embedding.
 
List< edgem_fakedGens
 
bool m_fakeTree
 
int m_nCrossings
 The number of crossings in the computed layout.
 
std::unique_ptr< CCLayoutPackModulem_packer
 The module for arranging connected components.
 
double m_pageRatio
 The desired page ratio.
 
std::unique_ptr< LayoutPlanRepUMLModulem_planarLayouter
 The module for computing a planar layout.
 

Detailed Description

The planarization layout algorithm.

The class PlanarizationLayout represents a customizable implementation of the planarization approach for drawing graphs. The class provides three different algorithm calls:

  • Calling the algorithm for a usual graph (call with GraphAttributes).
  • Calling the algorithm for a mixed-upward graph (e.g., a UML class diagram; call with UMLGraph); a simplified version is provided by simpleCall.
  • Calling the algorithm for simultaneous drawing.

If the planarization layout algorithm shall be used for simultaneous drawing, you need to define the different subgraphs by setting the subgraphs option.

The implementation used in PlanarizationLayout is based on the following publication:

C. Gutwenger, P. Mutzel: An Experimental Study of Crossing Minimization Heuristics. 11th International Symposium on Graph Drawing 2003, Perugia (GD '03), LNCS 2912, pp. 13-24, 2004.

Optional parameters

OptionTypeDefaultDescription
pageRatiodouble1.0 Specifies the desired ration of width / height of the computed layout. It is currently only used when packing connected components.
preprocessCliquesboolfalse If set to true, a preprocessing for cliques (complete subgraphs) is performed and cliques will be laid out in a special form (straight-line, not orthogonal). The preprocessing may reduce running time and improve layout quality if the input graphs contains dense subgraphs.
minCliqueSizeint10If preprocessing of cliques is enabled, this option determines the minimal size of cliques to search for.

Module options

The various phases of the algorithm can be exchanged by setting module options allowing flexible customization. The algorithm provides the following module options:

OptionTypeDefaultDescription
crossMinUMLCrossingMinimizationModuleSubgraphPlanarizerUML The module used for the crossing minimization step.
embedderEmbedderModuleSimpleEmbedder The graph embedding algorithm applied after the crossing minimization step.
planarLayouterLayoutPlanRepUMLModuleOrthoLayoutUML The planar layout algorithm used to compute a planar layout of the planarized representation resulting from the crossing minimization step.
packerCCLayoutPackModuleTileToRowsCCPacker The packer module used for arranging connected components.

Definition at line 115 of file PlanarizationLayoutUML.h.

Constructor & Destructor Documentation

◆ PlanarizationLayoutUML()

ogdf::PlanarizationLayoutUML::PlanarizationLayoutUML ( )

Creates an instance of planarization layout and sets options to default values.

◆ ~PlanarizationLayoutUML()

virtual ogdf::PlanarizationLayoutUML::~PlanarizationLayoutUML ( )
inlinevirtual

Definition at line 121 of file PlanarizationLayoutUML.h.

Member Function Documentation

◆ alignSons()

void ogdf::PlanarizationLayoutUML::alignSons ( bool  b)
inline

Definition at line 222 of file PlanarizationLayoutUML.h.

◆ arrangeCCs()

void ogdf::PlanarizationLayoutUML::arrangeCCs ( PlanRep PG,
GraphAttributes GA,
Array< DPoint > &  boundingBox 
)
protected

◆ assureDrawability()

void ogdf::PlanarizationLayoutUML::assureDrawability ( UMLGraph umlGraph)
Precondition
umlGraph may not violate a precondition of planarization layout.

◆ call() [1/2]

void ogdf::PlanarizationLayoutUML::call ( GraphAttributes GA)
inline

Calls planarization layout for GraphAttributes GA and computes a layout.

Precondition
The graph has no self-loops.
Parameters
GAis the input graph and will also be assigned the layout information.

Definition at line 133 of file PlanarizationLayoutUML.h.

◆ call() [2/2]

virtual void ogdf::PlanarizationLayoutUML::call ( UMLGraph umlGraph)
overridevirtual

Calls planarization layout for UML-graph umlGraph and computes a mixed-upward layout.

Precondition
The graph has no self-loops.
Parameters
umlGraphis the input graph and will also be assigned the layout information.

Implements ogdf::UMLLayoutModule.

◆ callIncremental()

virtual void ogdf::PlanarizationLayoutUML::callIncremental ( UMLGraph umlgraph,
NodeArray< bool > &  fixedNodes,
const EdgeArray< bool > &  fixedEdges 
)
virtual

Incremental call function.

Call with information about objects that should be fixed as much as possible in the old/new drawing for incremental drawing: takes a fixed part of the input graph (indicated by fixedNodes(Edges)==true), embeds it using the input layout, then inserts the remaining part into this embedding.

◆ doSimpleCall()

void ogdf::PlanarizationLayoutUML::doSimpleCall ( GraphAttributes GA)
protected

◆ findBestExternalFace()

face ogdf::PlanarizationLayoutUML::findBestExternalFace ( const PlanRep PG,
const CombinatorialEmbedding E 
)
private

◆ getFixationDistance()

void ogdf::PlanarizationLayoutUML::getFixationDistance ( node  startNode,
HashArray< int, int > &  distance,
const NodeArray< bool > &  fixedNodes 
)
protected

◆ numberOfCrossings()

int ogdf::PlanarizationLayoutUML::numberOfCrossings ( ) const
inline

Returns the number of crossings in computed layout.

Definition at line 278 of file PlanarizationLayoutUML.h.

◆ pageRatio() [1/2]

double ogdf::PlanarizationLayoutUML::pageRatio ( ) const
inline

Returns the current setting of option pageRatio.

This option specifies the desired ration width / height of the computed layout. It is currently only used for packing connected components.

Definition at line 213 of file PlanarizationLayoutUML.h.

◆ pageRatio() [2/2]

void ogdf::PlanarizationLayoutUML::pageRatio ( double  ratio)
inline

Sets the option pageRatio to ratio.

Definition at line 216 of file PlanarizationLayoutUML.h.

◆ postProcess()

virtual void ogdf::PlanarizationLayoutUML::postProcess ( UMLGraph UG)
protectedvirtual

◆ preProcess()

virtual void ogdf::PlanarizationLayoutUML::preProcess ( UMLGraph UG)
protectedvirtual

◆ reembed()

void ogdf::PlanarizationLayoutUML::reembed ( PlanRepUML PG,
int  ccNumber,
bool  l_align = false,
bool  l_gensExist = false 
)
protected

◆ setCrossMin()

void ogdf::PlanarizationLayoutUML::setCrossMin ( UMLCrossingMinimizationModule pCrossMin)
inline

Sets the module option for UML crossing minimization.

Definition at line 238 of file PlanarizationLayoutUML.h.

◆ setEmbedder()

void ogdf::PlanarizationLayoutUML::setEmbedder ( EmbedderModule pEmbedder)
inline

Sets the module option for the graph embedding algorithm.

The result of the crossing minimization step is a planar graph, in which crossings are replaced by dummy nodes. The embedding module then computes a planar embedding of this planar graph.

Definition at line 247 of file PlanarizationLayoutUML.h.

◆ setLayouterOptions()

void ogdf::PlanarizationLayoutUML::setLayouterOptions ( int  ops)
inline

Definition at line 219 of file PlanarizationLayoutUML.h.

◆ setPacker()

void ogdf::PlanarizationLayoutUML::setPacker ( CCLayoutPackModule pPacker)
inline

Sets the module option for the arrangement of connected components.

The planarization layout algorithm draws each connected component of the input graph seperately, and then arranges the resulting drawings using a packing algorithm.

Definition at line 270 of file PlanarizationLayoutUML.h.

◆ setPlanarLayouter()

void ogdf::PlanarizationLayoutUML::setPlanarLayouter ( LayoutPlanRepUMLModule pPlanarLayouter)
inline

Sets the module option for the planar layout algorithm.

The planar layout algorithm is used to compute a planar layout of the planarized representation resulting from the crossing minimization step. Planarized representation means that edge crossings are replaced by dummy nodes of degree four, so the actual layout algorithm obtains a planar graph as input. By default, the planar layout algorithm produces an orthogonal drawing.

Definition at line 259 of file PlanarizationLayoutUML.h.

◆ simpleCall() [1/2]

void ogdf::PlanarizationLayoutUML::simpleCall ( GraphAttributes GA)
inline

Simple call function.

Definition at line 173 of file PlanarizationLayoutUML.h.

◆ simpleCall() [2/2]

void ogdf::PlanarizationLayoutUML::simpleCall ( UMLGraph umlGraph)
inline

Simple call function that does not care about cliques etc.

Definition at line 143 of file PlanarizationLayoutUML.h.

◆ sortIncrementalNodes()

void ogdf::PlanarizationLayoutUML::sortIncrementalNodes ( List< node > &  addNodes,
const NodeArray< bool > &  fixedNodes 
)
protected

Member Data Documentation

◆ m_arrangeLabels

bool ogdf::PlanarizationLayoutUML::m_arrangeLabels
private

Option for re-arranging labels.

Definition at line 317 of file PlanarizationLayoutUML.h.

◆ m_crossMin

std::unique_ptr<UMLCrossingMinimizationModule> ogdf::PlanarizationLayoutUML::m_crossMin
private

The moule for UML crossing minimization.

Definition at line 304 of file PlanarizationLayoutUML.h.

◆ m_embedder

std::unique_ptr<EmbedderModule> ogdf::PlanarizationLayoutUML::m_embedder
private

The module for planar embedding.

Definition at line 307 of file PlanarizationLayoutUML.h.

◆ m_fakedGens

List<edge> ogdf::PlanarizationLayoutUML::m_fakedGens
private

Definition at line 320 of file PlanarizationLayoutUML.h.

◆ m_fakeTree

bool ogdf::PlanarizationLayoutUML::m_fakeTree
private

Definition at line 321 of file PlanarizationLayoutUML.h.

◆ m_nCrossings

int ogdf::PlanarizationLayoutUML::m_nCrossings
private

The number of crossings in the computed layout.

Definition at line 316 of file PlanarizationLayoutUML.h.

◆ m_packer

std::unique_ptr<CCLayoutPackModule> ogdf::PlanarizationLayoutUML::m_packer
private

The module for arranging connected components.

Definition at line 313 of file PlanarizationLayoutUML.h.

◆ m_pageRatio

double ogdf::PlanarizationLayoutUML::m_pageRatio
private

The desired page ratio.

Definition at line 315 of file PlanarizationLayoutUML.h.

◆ m_planarLayouter

std::unique_ptr<LayoutPlanRepUMLModule> ogdf::PlanarizationLayoutUML::m_planarLayouter
private

The module for computing a planar layout.

Definition at line 310 of file PlanarizationLayoutUML.h.


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