Scales a graph layout and calls a secondary layout algorithm. More...
#include <ogdf/energybased/multilevel_mixer/ScalingLayout.h>
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 |
ModularMultilevelMixer * | m_mmm |
Used to derive level size ratio if st_absolute. | |
ScalingType | m_scalingType |
std::unique_ptr< LayoutModule > | m_secondaryLayoutModule |
Scales a graph layout and calls a secondary layout algorithm.
For use with ModularMultilevelMixer.
Definition at line 47 of file ScalingLayout.h.
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.
ogdf::ScalingLayout::ScalingLayout | ( | ) |
|
overridevirtual |
Computes a layout of graph GA
.
GA | is the input graph and will also be assigned the layout information. |
Implements ogdf::MultilevelLayoutModule.
|
overridevirtual |
Computes a layout of graph GA
.
This method is the actual algorithm call and must be implemented by derived classes.
GA | is the input graph and will also be assigned the layout information. |
Implements ogdf::MultilevelLayoutModule.
|
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); }
MLG | is the input graph and will also be assigned the layout information. |
Reimplemented from ogdf::MultilevelLayoutModule.
Definition at line 83 of file MultilevelLayoutModule.h.
|
overridevirtual |
Computes a layout of graph MLG
.
MLG | is the input graph and will also be assigned the layout information. |
Reimplemented from ogdf::MultilevelLayoutModule.
Sets how often the scaling should be repeated.
steps | is the number of repeats |
Sets how often the LayoutModule should be applied.
repeats | is the number of repeats |
void ogdf::ScalingLayout::setMMM | ( | ModularMultilevelMixer * | mmm | ) |
Is used to compute the scaling relatively to the level size change when ScalingType st_absolute is used.
mmm | is the ModularMultilevelMixer |
Sets the minimum and the maximum scaling factor.
min | sets the minimum |
max | sets the maximum |
void ogdf::ScalingLayout::setScalingType | ( | ScalingType | type | ) |
Sets a ScalingType wich sets the relative scale for the Graph.
type | is the ScalingType |
void ogdf::ScalingLayout::setSecondaryLayout | ( | LayoutModule * | layout | ) |
Sets a LayoutModule that should be applied after scaling.
layout | is the secondary LayoutModule |
|
private |
Definition at line 138 of file ScalingLayout.h.
Definition at line 141 of file ScalingLayout.h.
Definition at line 143 of file ScalingLayout.h.
|
private |
Definition at line 136 of file ScalingLayout.h.
|
private |
Definition at line 135 of file ScalingLayout.h.
|
private |
Used to derive level size ratio if st_absolute.
Definition at line 137 of file ScalingLayout.h.
|
private |
Definition at line 145 of file ScalingLayout.h.
|
private |
Definition at line 133 of file ScalingLayout.h.