00001 /* 00002 * $Revision: 2299 $ 00003 * 00004 * last checkin: 00005 * $Author: gutwenger $ 00006 * $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 00007 ***************************************************************/ 00008 00042 #ifdef _MSC_VER 00043 #pragma once 00044 #endif 00045 00046 #ifndef OGDF_SCALING_LAYOUT_H 00047 #define OGDF_SCALING_LAYOUT_H 00048 00049 #include <ogdf/basic/ModuleOption.h> 00050 #include <ogdf/module/MultilevelLayoutModule.h> 00051 #include <ogdf/energybased/multilevelmixer/ModularMultilevelMixer.h> 00052 #include <ogdf/internal/energybased/MultilevelGraph.h> 00053 00054 00055 namespace ogdf { 00056 00062 class OGDF_EXPORT ScalingLayout : public MultilevelLayoutModule 00063 { 00064 public: 00068 enum ScalingType { 00070 st_relativeToDrawing, 00076 st_relativeToAvgLength, 00078 st_relativeToDesiredLength, 00080 st_absolute 00081 }; 00082 00083 ScalingLayout(); 00084 00090 void call(GraphAttributes &GA); 00091 00097 void call(MultilevelGraph &MLG); 00098 00105 void setScaling(double min, double max); 00106 00112 void setExtraScalingSteps(unsigned int steps); 00113 00119 void setSecondaryLayout(LayoutModule* layout); 00120 00126 void setMMM(ModularMultilevelMixer* mmm); 00127 00133 void setScalingType(ScalingType type); 00134 00140 void setLayoutRepeats(unsigned int repeats); 00141 //TODO: only a workaround, this should be retrieved from the layout module 00142 //when we have a interface class on top of Layoutmodule that allows this 00143 void setDesiredEdgeLength(double eLength); 00144 00145 private: 00146 00147 // Usually a simple force-directed / energy-based Layout should be chosen. 00148 ModuleOption<LayoutModule> m_secondaryLayoutModule; 00149 00150 double m_minScaling; 00151 double m_maxScaling; 00152 ModularMultilevelMixer* m_mmm; 00153 double m_desEdgeLength; 00154 00155 // 0 = scale to maxScaling only 00156 unsigned int m_extraScalingSteps; 00157 00158 unsigned int m_layoutRepeats; 00159 00160 ScalingType m_scalingType; 00161 }; 00162 00163 } // namespace ogdf 00164 00165 #endif