Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches

Scales a graph layout and calls a secondary layout algorithm. More...

#include <ogdf/energybased/multilevel_mixer/ScalingLayout.h>

+ Inheritance diagram for ogdf::ScalingLayout:

Public Types

enum class  ScalingType { RelativeToDrawing , RelativeToAvgLength , RelativeToDesiredLength , Absolute }
 To define the relative scale used for a Graph, the ScalingType is applied. More...
 

Public Member Functions

 ScalingLayout ()
 
virtual void call (GraphAttributes &GA) override
 Computes a layout of graph GA.
 
virtual void call (GraphAttributes &GA) override=0
 Computes a layout of graph GA.
 
virtual void call (MultilevelGraph &MLG)
 Computes a layout of graph MLG.
 
virtual void call (MultilevelGraph &MLG) override
 Computes a layout of graph MLG.
 
void setDesiredEdgeLength (double eLength)
 
void setExtraScalingSteps (unsigned int steps)
 Sets how often the scaling should be repeated.
 
void setLayoutRepeats (unsigned int repeats)
 Sets how often the LayoutModule should be applied.
 
void setMMM (ModularMultilevelMixer *mmm)
 Is used to compute the scaling relatively to the level size change when ScalingType st_absolute is used.
 
void setScaling (double min, double max)
 Sets the minimum and the maximum scaling factor.
 
void setScalingType (ScalingType type)
 Sets a ScalingType wich sets the relative scale for the Graph.
 
void setSecondaryLayout (LayoutModule *layout)
 Sets a LayoutModule that should be applied after scaling.
 
- Public Member Functions inherited from ogdf::MultilevelLayoutModule
 MultilevelLayoutModule ()
 Initializes a multilevel layout module.
 
virtual ~MultilevelLayoutModule ()
 
- 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 Attributes

double m_desEdgeLength
 
unsigned int m_extraScalingSteps
 
unsigned int m_layoutRepeats
 
double m_maxScaling
 
double m_minScaling
 
ModularMultilevelMixerm_mmm
 Used to derive level size ratio if st_absolute.
 
ScalingType m_scalingType
 
std::unique_ptr< LayoutModulem_secondaryLayoutModule
 

Detailed Description

Scales a graph layout and calls a secondary layout algorithm.

For use with ModularMultilevelMixer.

Definition at line 47 of file ScalingLayout.h.

Member Enumeration Documentation

◆ ScalingType

To define the relative scale used for a Graph, the ScalingType is applied.

Enumerator
RelativeToDrawing 

Scales by a factor relative to the drawing.

RelativeToAvgLength 

Scales by a factor relative to the avg edge weights to be used in combination with the fixed edge length setting in ModularMultilevelMixer.

RelativeToDesiredLength 

Scales by a factor relative to the desired Edgelength m_desEdgeLength.

Absolute 

Absolute factor, can be used to scale relative to level size change.

Definition at line 52 of file ScalingLayout.h.

Constructor & Destructor Documentation

◆ ScalingLayout()

ogdf::ScalingLayout::ScalingLayout ( )

Member Function Documentation

◆ call() [1/4]

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

Computes a layout of graph GA.

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

Implements ogdf::MultilevelLayoutModule.

◆ call() [2/4]

virtual void ogdf::MultilevelLayoutModule::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::MultilevelLayoutModule.

◆ call() [3/4]

virtual void ogdf::MultilevelLayoutModule::call ( MultilevelGraph MLG)
inlinevirtual

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.

Reimplemented from ogdf::MultilevelLayoutModule.

Definition at line 83 of file MultilevelLayoutModule.h.

◆ call() [4/4]

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

Computes a layout of graph MLG.

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

Reimplemented from ogdf::MultilevelLayoutModule.

◆ setDesiredEdgeLength()

void ogdf::ScalingLayout::setDesiredEdgeLength ( double  eLength)

◆ setExtraScalingSteps()

void ogdf::ScalingLayout::setExtraScalingSteps ( unsigned int  steps)

Sets how often the scaling should be repeated.

Parameters
stepsis the number of repeats

◆ setLayoutRepeats()

void ogdf::ScalingLayout::setLayoutRepeats ( unsigned int  repeats)

Sets how often the LayoutModule should be applied.

Parameters
repeatsis the number of repeats

◆ setMMM()

void ogdf::ScalingLayout::setMMM ( ModularMultilevelMixer mmm)

Is used to compute the scaling relatively to the level size change when ScalingType st_absolute is used.

Parameters
mmmis the ModularMultilevelMixer

◆ setScaling()

void ogdf::ScalingLayout::setScaling ( double  min,
double  max 
)

Sets the minimum and the maximum scaling factor.

Parameters
minsets the minimum
maxsets the maximum

◆ setScalingType()

void ogdf::ScalingLayout::setScalingType ( ScalingType  type)

Sets a ScalingType wich sets the relative scale for the Graph.

Parameters
typeis the ScalingType

◆ setSecondaryLayout()

void ogdf::ScalingLayout::setSecondaryLayout ( LayoutModule layout)

Sets a LayoutModule that should be applied after scaling.

Parameters
layoutis the secondary LayoutModule

Member Data Documentation

◆ m_desEdgeLength

double ogdf::ScalingLayout::m_desEdgeLength
private

Definition at line 138 of file ScalingLayout.h.

◆ m_extraScalingSteps

unsigned int ogdf::ScalingLayout::m_extraScalingSteps
private

Definition at line 141 of file ScalingLayout.h.

◆ m_layoutRepeats

unsigned int ogdf::ScalingLayout::m_layoutRepeats
private

Definition at line 143 of file ScalingLayout.h.

◆ m_maxScaling

double ogdf::ScalingLayout::m_maxScaling
private

Definition at line 136 of file ScalingLayout.h.

◆ m_minScaling

double ogdf::ScalingLayout::m_minScaling
private

Definition at line 135 of file ScalingLayout.h.

◆ m_mmm

ModularMultilevelMixer* ogdf::ScalingLayout::m_mmm
private

Used to derive level size ratio if st_absolute.

Definition at line 137 of file ScalingLayout.h.

◆ m_scalingType

ScalingType ogdf::ScalingLayout::m_scalingType
private

Definition at line 145 of file ScalingLayout.h.

◆ m_secondaryLayoutModule

std::unique_ptr<LayoutModule> ogdf::ScalingLayout::m_secondaryLayoutModule
private

Definition at line 133 of file ScalingLayout.h.


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