Open
Graph Drawing
Framework

 v.2012.05
 

PlanarDrawLayout.h
Go to the documentation of this file.
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  
00044 #ifdef _MSC_VER
00045 #pragma once
00046 #endif
00047 
00048 
00049 #ifndef OGDF_PLANAR_DRAW_LAYOUT_H
00050 #define OGDF_PLANAR_DRAW_LAYOUT_H
00051 
00052 
00053 #include <ogdf/module/GridLayoutModule.h>
00054 #include <ogdf/basic/ModuleOption.h>
00055 #include <ogdf/module/AugmentationModule.h>
00056 #include <ogdf/module/ShellingOrderModule.h>
00057 
00058 
00059 namespace ogdf {
00060 
00061     class OGDF_EXPORT ShellingOrder;
00062 
00133 class OGDF_EXPORT PlanarDrawLayout : public PlanarGridLayoutModule
00134 {
00135 public:
00137     PlanarDrawLayout();
00138 
00139     ~PlanarDrawLayout() { }
00140 
00141 
00153     bool sizeOptimization() const { return m_sizeOptimization; }
00154 
00156     void sizeOptimization(bool opt) { m_sizeOptimization = opt; }
00157 
00164     bool sideOptimization() const { return m_sizeOptimization; }
00165 
00167     void sideOptimization(bool opt) { m_sizeOptimization = opt; }
00168 
00176     double baseRatio() const { return m_baseRatio; }
00177 
00179     void baseRatio(double ratio) { m_baseRatio = ratio; }
00180 
00181 
00193     void setAugmenter(AugmentationModule *pAugmenter) {
00194         m_augmenter.set(pAugmenter);
00195     }
00196     
00198     void setShellingOrder(ShellingOrderModule *pOrder){
00199         m_computeOrder.set(pOrder);
00200     }
00201 
00203 
00204 private:
00205     bool   m_sizeOptimization; 
00206     bool   m_sideOptimization; 
00207     double m_baseRatio; 
00208 
00209     ModuleOption<AugmentationModule>  m_augmenter;      
00210     ModuleOption<ShellingOrderModule> m_computeOrder;   
00211 
00212     // computes grid layout for graph G
00213     void doCall(
00214         const Graph &G,
00215         adjEntry adjExternal,
00216         GridLayout &gridLayout,
00217         IPoint &boundingBox,
00218         bool fixEmbedding);
00219 
00220     void computeCoordinates(const Graph &G,
00221         ShellingOrder &order,
00222         NodeArray<int> &x,
00223         NodeArray<int> &y);
00224 
00225 };
00226 
00227 
00228 } // end namespace ogdf
00229 
00230 
00231 #endif