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 00045 #ifdef _MSC_VER 00046 #pragma once 00047 #endif 00048 00049 #ifndef OGDF_DAVIDSON_HAREL_LAYOUT_H 00050 #define OGDF_DAVIDSON_HAREL_LAYOUT_H 00051 00052 00053 #include <ogdf/module/LayoutModule.h> 00054 #include <ogdf/energybased/DavidsonHarel.h> 00055 00056 00057 namespace ogdf { 00058 00059 00061 00068 class OGDF_EXPORT DavidsonHarelLayout : public LayoutModule 00069 { 00070 public: 00072 enum SettingsParameter {spStandard, spRepulse, spPlanar}; //tuning of costs 00073 00075 enum SpeedParameter {sppFast, sppMedium, sppHQ}; 00076 00078 DavidsonHarelLayout(); 00079 00080 ~DavidsonHarelLayout(){} 00081 00083 void call(GraphAttributes &GA); 00084 00086 void fixSettings(SettingsParameter sp); 00087 00089 00093 void setSpeed(SpeedParameter sp); 00094 00096 00100 void setPreferredEdgeLengthMultiplier(double multi) {m_multiplier = multi;} 00101 00103 void setPreferredEdgeLength(double elen) {m_prefEdgeLength = elen;} 00104 00106 void setRepulsionWeight(double w); 00107 00109 double getRepulsionWeight() const {return m_repulsionWeight;} 00110 00112 void setAttractionWeight(double); 00113 00115 double getAttractionWeight() const {return m_attractionWeight;} 00116 00118 void setNodeOverlapWeight(double); 00119 00121 double getNodeOverlapWeight() const {return m_nodeOverlapWeight;} 00122 00124 void setPlanarityWeight(double); 00125 00127 double getPlanarityWeight() const {return m_planarityWeight;} 00128 00130 void setStartTemperature(int t); 00131 00133 int getStartTemperature() const {return m_startTemperature;} 00134 00136 void setNumberOfIterations(int steps); 00137 00139 int getNumberOfIterations() const {return m_numberOfIterations;} 00140 00143 void setIterationNumberAsFactor(bool b) {m_itAsFactor = b;} 00144 00145 private: 00146 double m_repulsionWeight; 00147 double m_attractionWeight; 00148 double m_nodeOverlapWeight; 00149 double m_planarityWeight; 00150 int m_startTemperature; 00151 int m_numberOfIterations; 00152 SpeedParameter m_speed; 00153 double m_multiplier; 00154 double m_prefEdgeLength; 00155 bool m_crossings; 00156 bool m_itAsFactor; 00157 }; 00158 00159 } 00160 #endif