00001 /* 00002 * $Revision: 1.4 $ 00003 * 00004 * last checkin: 00005 * $Author: klein $ 00006 * $Date: 2007-11-15 12:18:51 +0100 (Do, 15 Nov 2007) $ 00007 ***************************************************************/ 00008 00051 #ifdef _MSC_VER 00052 #pragma once 00053 #endif 00054 00055 00056 #ifndef OGDF_CLUSTER_ORTHO_LAYOUT_H 00057 #define OGDF_CLUSTER_ORTHO_LAYOUT_H 00058 00059 00060 #include <ogdf/module/LayoutClusterPlanRepModule.h> 00061 #include <ogdf/orthogonal/OrthoRep.h> 00062 #include <ogdf/cluster/ClusterPlanRep.h> 00063 #include <ogdf/cluster/CPlanarEdgeInserter.h> 00064 00065 00066 namespace ogdf { 00067 00068 enum OrthoDir; 00069 00070 00071 //--------------------------------------------------------- 00072 // ClusterOrthoLayout 00073 // represents planar orthogonal drawing algorithm for 00074 // c-planar c-connected Clustergraphs 00075 //--------------------------------------------------------- 00076 class ClusterOrthoLayout : public LayoutClusterPlanRepModule 00077 { 00078 public: 00080 ClusterOrthoLayout(); 00081 00082 00089 void call(ClusterPlanRep &PG, adjEntry adjExternal, Layout &drawing); 00091 void call(ClusterPlanRep &PG, 00092 adjEntry adjExternal, 00093 Layout &drawing, 00094 List<NodePair>& npEdges, 00095 List<edge>& newEdges, 00096 Graph& originalGraph); 00097 00098 //void call(PlanRepUML & /* PG */, adjEntry /* adjExternal */, Layout & /* drawing */) {} 00099 00100 // 00101 // options 00102 00104 double separation() const { 00105 return m_separation; 00106 } 00108 void separation(double sep) { 00109 m_separation = sep; 00110 } 00111 00113 //distance between the glue point of an edge and a corner of the vertex boundary 00114 double cOverhang() const { 00115 return m_cOverhang; 00116 } 00118 void cOverhang(double c) { 00119 m_cOverhang = c; 00120 } 00121 00122 00124 double margin() const { 00125 return m_margin; 00126 } 00128 void margin(double m) { 00129 m_margin = m; 00130 } 00131 00132 00134 OrthoDir preferedDir() const { 00135 return m_preferedDir; 00136 } 00138 void preferedDir(OrthoDir dir) { 00139 m_preferedDir = dir; 00140 } 00141 00143 int costAssoc() const { 00144 return m_costAssoc; 00145 } 00147 void costAssoc(int c) { 00148 m_costAssoc = c; 00149 } 00150 00152 int costGen() const { 00153 return m_costGen; 00154 } 00156 void costGen(int c) { 00157 m_costGen = c; 00158 } 00159 00161 void optionProfile(int i) {m_optionProfile = i;} 00162 00164 void align(bool b) {m_align = b;} 00165 00167 void scaling(bool b) {m_useScalingCompaction = b;} 00168 00170 //Necessary to allow setting over base class pointer 00171 //bit 0 = alignment 00172 //bit 1 = scaling 00173 //bit 2 = progressive/traditional 00174 //=> 0 is standard 00175 virtual void setOptions(int optionField) 00176 { 00177 if (optionField & 1) m_align = true; 00178 else m_align = false; 00179 if (optionField & 2) m_useScalingCompaction = true; 00180 else m_useScalingCompaction = false; 00181 if (optionField & 4) m_orthoStyle = 1; 00182 else m_orthoStyle = 0; //traditional 00183 } 00184 00185 00186 private: 00187 // compute bounding box and move final drawing such that it is 0 aligned 00188 // respecting margins 00189 void computeBoundingBox(const ClusterPlanRep &PG, Layout &drawing); 00190 00191 00192 // options 00193 double m_separation; 00194 double m_cOverhang; 00195 double m_margin; 00196 OrthoDir m_preferedDir; 00197 int m_optionProfile; 00198 int m_costAssoc; 00199 int m_costGen; 00200 //align merger sons on same level 00201 bool m_align; 00202 //settings for scaling compaction 00203 bool m_useScalingCompaction; 00204 int m_scalingSteps; 00205 int m_orthoStyle; 00206 }; 00207 00208 00209 } // end namespace ogdf 00210 00211 00212 #endif