Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00055 #ifdef _MSC_VER
00056 #pragma once
00057 #endif
00058
00059
00060 #ifndef OGDF_UML_ORTHO_LAYOUT_H
00061 #define OGDF_UML_ORTHO_LAYOUT_H
00062
00063
00064 #include <ogdf/module/LayoutPlanRepModule.h>
00065 #include <ogdf/orthogonal/OrthoRep.h>
00066
00067
00068 namespace ogdf {
00069
00070 enum OptionProfile {standard, minBendsperEdge, fullService};
00071
00072 enum OrthoDir;
00073
00074
00075
00076
00077
00078
00079
00080 class OGDF_EXPORT OrthoLayout : public LayoutPlanRepModule
00081 {
00082 public:
00083
00084 OrthoLayout();
00085
00086
00087
00088
00089
00090 void call(PlanRepUML &PG, adjEntry adjExternal, Layout &drawing);
00091
00092
00093
00094
00095
00096 double separation() const {
00097 return m_separation;
00098 }
00099
00100 void separation(double sep) {
00101 m_separation = sep;
00102 }
00103
00104
00105
00106 double cOverhang() const {
00107 return m_cOverhang;
00108 }
00109
00110 void cOverhang(double c) {
00111 m_cOverhang = c;
00112 }
00113
00114
00115
00116 double margin() const {
00117 return m_margin;
00118 }
00119
00120 void margin(double m) {
00121 m_margin = m;
00122 }
00123
00124
00125
00126 OrthoDir preferedDir() const {
00127 return m_preferedDir;
00128 }
00129
00130 void preferedDir(OrthoDir dir) {
00131 m_preferedDir = dir;
00132 }
00133
00134
00135 int costAssoc() const {
00136 return m_costAssoc;
00137 }
00138
00139 void costAssoc(int c) {
00140 m_costAssoc = c;
00141 }
00142
00143
00144 int costGen() const {
00145 return m_costGen;
00146 }
00147
00148 void costGen(int c) {
00149 m_costGen = c;
00150 }
00151
00152
00153 void optionProfile(int i) {m_optionProfile = i;}
00154
00155
00156 void align(bool b) {m_align = b;}
00157
00158
00159 void scaling(bool b) {m_useScalingCompaction = b;}
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 virtual void setOptions(int optionField)
00171 {
00172 if (optionField & umlOpAlign) m_align = true;
00173 else m_align = false;
00174 if (optionField & umlOpScale) m_useScalingCompaction = true;
00175 else m_useScalingCompaction = false;
00176 if (optionField & umlOpProg) m_orthoStyle = 1;
00177 else m_orthoStyle = 0;
00178 }
00179
00180 virtual int getOptions()
00181 {
00182 int result = 0;
00183 if (m_align) result = umlOpAlign;
00184 if (m_useScalingCompaction) result += umlOpScale;
00185 if (m_orthoStyle == 1) result += umlOpProg;
00186
00187 return result;
00188 }
00189
00190
00191 protected:
00192 void classifyEdges(PlanRepUML &PG, adjEntry &adjExternal);
00193
00194 private:
00195
00196
00197 void computeBoundingBox(const PlanRepUML &PG, Layout &drawing);
00198
00199
00200
00201 double m_separation;
00202 double m_cOverhang;
00203 double m_margin;
00204 OrthoDir m_preferedDir;
00205 int m_optionProfile;
00206 int m_costAssoc;
00207 int m_costGen;
00208
00209 bool m_align;
00210
00211 bool m_useScalingCompaction;
00212 int m_scalingSteps;
00213
00214 int m_orthoStyle;
00215 };
00216
00217
00218 }
00219
00220
00221 #endif