Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ScalingLayout.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <memory>
38 
39 
40 namespace ogdf {
41 
42 
44 
49 {
50 public:
54  enum class ScalingType {
56  RelativeToDrawing,
62  RelativeToAvgLength,
64  RelativeToDesiredLength,
66  Absolute
67  };
68 
69  ScalingLayout();
70 
72 
78  virtual void call(GraphAttributes &GA) override;
79 
85  virtual void call(MultilevelGraph &MLG) override;
86 
93  void setScaling(double min, double max);
94 
100  void setExtraScalingSteps(unsigned int steps);
101 
107  void setSecondaryLayout(LayoutModule* layout);
108 
114  void setMMM(ModularMultilevelMixer* mmm);
115 
121  void setScalingType(ScalingType type);
122 
128  void setLayoutRepeats(unsigned int repeats);
129  //TODO: only a workaround, this should be retrieved from the layout module
130  //when we have a interface class on top of Layoutmodule that allows this
131  void setDesiredEdgeLength(double eLength);
132 
133 private:
134 
135  // Usually a simple force-directed / energy-based Layout should be chosen.
136  std::unique_ptr<LayoutModule> m_secondaryLayoutModule;
137 
138  double m_minScaling;
139  double m_maxScaling;
142 
143  // 0 = scale to maxScaling only
144  unsigned int m_extraScalingSteps;
145 
146  unsigned int m_layoutRepeats;
147 
149 };
150 
151 } // namespace ogdf
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:48
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:54
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