Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ScalingLayout.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/basic.h>
36
37#include <memory>
38
39namespace ogdf {
40class GraphAttributes;
41class LayoutModule;
42class ModularMultilevelMixer;
43class MultilevelGraph;
44
46
51public:
55 enum class ScalingType {
57 RelativeToDrawing,
63 RelativeToAvgLength,
65 RelativeToDesiredLength,
67 Absolute
68 };
69
71
72 using MultilevelLayoutModule::call;
73
79 virtual void call(GraphAttributes& GA) override;
80
86 virtual void call(MultilevelGraph& MLG) override;
87
94 void setScaling(double min, double max);
95
101 void setExtraScalingSteps(unsigned int steps);
102
109
116
123
129 void setLayoutRepeats(unsigned int repeats);
130 //TODO: only a workaround, this should be retrieved from the layout module
131 //when we have a interface class on top of Layoutmodule that allows this
132 void setDesiredEdgeLength(double eLength);
133
134private:
135 // Usually a simple force-directed / energy-based Layout should be chosen.
136 std::unique_ptr<LayoutModule> m_secondaryLayoutModule;
137
142
143 // 0 = scale to maxScaling only
145
146 unsigned int m_layoutRepeats;
147
149};
150
151}
Declaration of interface for layout algorithms that allow calls with a MultilevelGraph parameter (cla...
Basic declarations, included by all source files.
Stores additional attributes of a graph (like layout information).
Interface of general layout algorithms.
Modular multilevel graph layout.
Interface of general layout algorithms that also allow a MultilevelGraph as call parameter,...
Scales a graph layout and calls a secondary layout algorithm.
unsigned int m_layoutRepeats
void setMMM(ModularMultilevelMixer *mmm)
Is used to compute the scaling relatively to the level size change when ScalingType st_absolute is us...
ModularMultilevelMixer * m_mmm
Used to derive level size ratio if st_absolute.
void setScaling(double min, double max)
Sets the minimum and the maximum scaling factor.
ScalingType m_scalingType
void setSecondaryLayout(LayoutModule *layout)
Sets a LayoutModule that should be applied after scaling.
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
void setExtraScalingSteps(unsigned int steps)
Sets how often the scaling should be repeated.
void setDesiredEdgeLength(double eLength)
virtual void call(MultilevelGraph &MLG) override
Computes a layout of graph MLG.
void setLayoutRepeats(unsigned int repeats)
Sets how often the LayoutModule should be applied.
void setScalingType(ScalingType type)
Sets a ScalingType wich sets the relative scale for the Graph.
std::unique_ptr< LayoutModule > m_secondaryLayoutModule
unsigned int m_extraScalingSteps
ScalingType
To define the relative scale used for a Graph, the ScalingType is applied.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.