Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

ScalingLayout.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <memory>
38 
39 namespace ogdf {
40 
42 
47 {
48 public:
52  enum class ScalingType {
54  RelativeToDrawing,
60  RelativeToAvgLength,
62  RelativeToDesiredLength,
64  Absolute
65  };
66 
67  ScalingLayout();
68 
70 
76  virtual void call(GraphAttributes &GA) override;
77 
83  virtual void call(MultilevelGraph &MLG) override;
84 
91  void setScaling(double min, double max);
92 
98  void setExtraScalingSteps(unsigned int steps);
99 
105  void setSecondaryLayout(LayoutModule* layout);
106 
112  void setMMM(ModularMultilevelMixer* mmm);
113 
119  void setScalingType(ScalingType type);
120 
126  void setLayoutRepeats(unsigned int repeats);
127  //TODO: only a workaround, this should be retrieved from the layout module
128  //when we have a interface class on top of Layoutmodule that allows this
129  void setDesiredEdgeLength(double eLength);
130 
131 private:
132 
133  // Usually a simple force-directed / energy-based Layout should be chosen.
134  std::unique_ptr<LayoutModule> m_secondaryLayoutModule;
135 
136  double m_minScaling;
137  double m_maxScaling;
140 
141  // 0 = scale to maxScaling only
142  unsigned int m_extraScalingSteps;
143 
144  unsigned int m_layoutRepeats;
145 
147 };
148 
149 }
ModularMultilevelMixer * m_mmm
Used to derive level size ratio if st_absolute.
unsigned int m_extraScalingSteps
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
MMM is a Multilevel Graph drawing Algorithm that can use different modules.
Scales a graph layout and calls a secondary layout algorithm.
Definition: ScalingLayout.h:46
Stores additional attributes of a graph (like layout information).
MLG is the main data structure for ModularMultilevelMixer.
Declaration of interface for layout algorithms that allow calls with a MultilevelGraph parameter (cla...
ScalingType
To define the relative scale used for a Graph, the ScalingType is applied.
Definition: ScalingLayout.h:52
virtual void call(GraphAttributes &GA) override=0
Computes a layout of graph GA.
Interface of general layout algorithms.
Definition: LayoutModule.h:44
Interface of general layout algorithms that also allow a MultilevelGraph as call parameter, extending the interface of a simple LayoutModule.
std::unique_ptr< LayoutModule > m_secondaryLayoutModule
Modular multilevel graph layout.
The namespace for all OGDF objects.
ScalingType m_scalingType
unsigned int m_layoutRepeats