Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::PreprocessorLayout Class Reference

The PreprocessorLayout removes multi-edges and self-loops. More...

#include <ogdf/basic/PreprocessorLayout.h>

+ Inheritance diagram for ogdf::PreprocessorLayout:

Classes

struct  EdgeData
 Deleted Edges are stored in EdgeData. More...
 

Public Member Functions

 PreprocessorLayout ()
 Constructor. More...
 
 ~PreprocessorLayout ()
 Destructor. More...
 
virtual void call (GraphAttributes &GA) override
 Calculates a drawing for the Graph GA. More...
 
virtual void call (GraphAttributes &GA) override=0
 Computes a layout of graph GA. More...
 
virtual void call (MultilevelGraph &MLG)
 Computes a layout of graph MLG. More...
 
virtual void call (MultilevelGraph &MLG) override
 Calculates a drawing for the Graph MLG. More...
 
void setLayoutModule (LayoutModule *layout)
 Sets the secondary layout. More...
 
void setRandomizePositions (bool on)
 Defines whether the positions of the node are randomized before the secondary layout call. More...
 
- Public Member Functions inherited from ogdf::MultilevelLayoutModule
 MultilevelLayoutModule ()
 Initializes a multilevel layout module. More...
 
virtual ~MultilevelLayoutModule ()
 
- 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...
 

Private Member Functions

void call (Graph &G, MultilevelGraph &MLG)
 

Private Attributes

std::vector< EdgeDatam_deletedEdges
 
bool m_randomize
 
std::unique_ptr< LayoutModulem_secondaryLayout
 

Detailed Description

The PreprocessorLayout removes multi-edges and self-loops.

To draw a graph using the ModularMultilevelMixer or other layouts the graph must be simple, i.e., contain neither multi-edges nor self-loops. Edges that conflict with these rules are deleted in the PreprocessorLayout. A secondary layout is then called that can work on the graph in required form. After the layout has been computed, the edges are inserted back into the graph, as they may have been relevant for the user.

Definition at line 50 of file PreprocessorLayout.h.

Constructor & Destructor Documentation

◆ PreprocessorLayout()

ogdf::PreprocessorLayout::PreprocessorLayout ( )

Constructor.

◆ ~PreprocessorLayout()

ogdf::PreprocessorLayout::~PreprocessorLayout ( )
inline

Destructor.

Definition at line 82 of file PreprocessorLayout.h.

Member Function Documentation

◆ call() [1/5]

void ogdf::PreprocessorLayout::call ( Graph G,
MultilevelGraph MLG 
)
private

◆ call() [2/5]

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

Calculates a drawing for the Graph GA.

Implements ogdf::MultilevelLayoutModule.

◆ call() [3/5]

virtual void ogdf::MultilevelLayoutModule::call
override

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.

◆ call() [4/5]

virtual void ogdf::MultilevelLayoutModule::call
inline

Computes a layout of graph MLG.

This method can be implemented optionally to allow a LayoutModule to modify the Graph. This allows some Layout Algorithms to save Memory, compared to a normal call(GA) DO NOT implement this if you are not sure whether this would save you Memory! This method only helps if the Graph is already in the MultiLevelGraph Format (or can be converted without creating a copy) AND the layout would need a copy otherwise. All Incremental Layouts (especially energy based) CAN be called by ModularMultilevelMixer. The standard implementation converts the MLG to GA and uses call(GA).

If implemented, the following Implementation of call(GA) is advised to ensure consistent behaviour of the two call Methods: void YourLayout::call(GraphAttributes &GA) { MultilevelGraph MLG(GA); call(MLG); MLG.exportAttributes(GA); }

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

Definition at line 83 of file MultilevelLayoutModule.h.

◆ call() [5/5]

virtual void ogdf::PreprocessorLayout::call ( MultilevelGraph MLG)
overridevirtual

Calculates a drawing for the Graph MLG.

Reimplemented from ogdf::MultilevelLayoutModule.

◆ setLayoutModule()

void ogdf::PreprocessorLayout::setLayoutModule ( LayoutModule layout)
inline

Sets the secondary layout.

Definition at line 94 of file PreprocessorLayout.h.

◆ setRandomizePositions()

void ogdf::PreprocessorLayout::setRandomizePositions ( bool  on)
inline

Defines whether the positions of the node are randomized before the secondary layout call.

Definition at line 99 of file PreprocessorLayout.h.

Member Data Documentation

◆ m_deletedEdges

std::vector<EdgeData> ogdf::PreprocessorLayout::m_deletedEdges
private

Definition at line 71 of file PreprocessorLayout.h.

◆ m_randomize

bool ogdf::PreprocessorLayout::m_randomize
private

Definition at line 72 of file PreprocessorLayout.h.

◆ m_secondaryLayout

std::unique_ptr<LayoutModule> ogdf::PreprocessorLayout::m_secondaryLayout
private

Definition at line 70 of file PreprocessorLayout.h.


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