Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
39 namespace ogdf {
40 class GraphAttributes;
41 class LayoutModule;
42 class ModularMultilevelMixer;
43 class MultilevelGraph;
44 
46 
51 public:
55  enum class ScalingType {
57  RelativeToDrawing,
63  RelativeToAvgLength,
65  RelativeToDesiredLength,
67  Absolute
68  };
69 
70  ScalingLayout();
71 
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 
108  void setSecondaryLayout(LayoutModule* layout);
109 
115  void setMMM(ModularMultilevelMixer* mmm);
116 
122  void setScalingType(ScalingType type);
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 
134 private:
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 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
ogdf::ScalingLayout::ScalingType
ScalingType
To define the relative scale used for a Graph, the ScalingType is applied.
Definition: ScalingLayout.h:55
ogdf::MultilevelGraph
Definition: MultilevelGraph.h:69
ogdf::ScalingLayout::m_mmm
ModularMultilevelMixer * m_mmm
Used to derive level size ratio if st_absolute.
Definition: ScalingLayout.h:140
ogdf::ScalingLayout::m_secondaryLayoutModule
std::unique_ptr< LayoutModule > m_secondaryLayoutModule
Definition: ScalingLayout.h:136
ogdf::MultilevelLayoutModule::call
virtual void call(GraphAttributes &GA) override=0
Computes a layout of graph GA.
backward::Color::type
type
Definition: backward.hpp:1716
MultilevelLayoutModule.h
Declaration of interface for layout algorithms that allow calls with a MultilevelGraph parameter (cla...
ogdf::ScalingLayout::m_scalingType
ScalingType m_scalingType
Definition: ScalingLayout.h:148
ogdf::ScalingLayout::m_maxScaling
double m_maxScaling
Definition: ScalingLayout.h:139
ogdf::MultilevelLayoutModule
Interface of general layout algorithms that also allow a MultilevelGraph as call parameter,...
Definition: MultilevelLayoutModule.h:48
ogdf::ScalingLayout::m_layoutRepeats
unsigned int m_layoutRepeats
Definition: ScalingLayout.h:146
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::ScalingLayout::m_extraScalingSteps
unsigned int m_extraScalingSteps
Definition: ScalingLayout.h:144
ogdf::ScalingLayout
Scales a graph layout and calls a secondary layout algorithm.
Definition: ScalingLayout.h:50
ogdf::ModularMultilevelMixer
Modular multilevel graph layout.
Definition: ModularMultilevelMixer.h:75
ogdf::ScalingLayout::m_desEdgeLength
double m_desEdgeLength
Definition: ScalingLayout.h:141
ogdf::ScalingLayout::m_minScaling
double m_minScaling
Definition: ScalingLayout.h:138
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:45