Open
Graph Drawing
Framework

 v.2012.05
 

PlanarStraightLayout.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_STRAIGHT_LAYOUT_H
00050 #define OGDF_PLANAR_STRAIGHT_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 
00128 class OGDF_EXPORT PlanarStraightLayout : public PlanarGridLayoutModule
00129 {
00130 public:
00132     PlanarStraightLayout();
00133 
00134     ~PlanarStraightLayout() { }
00135 
00136 
00148     bool sizeOptimization() const { return m_sizeOptimization; }
00149 
00151     void sizeOptimization(bool opt) { m_sizeOptimization = opt; }
00152 
00160     double baseRatio() const { return m_baseRatio; }
00161 
00163     void baseRatio(double ratio) { m_baseRatio = ratio; }
00164 
00165 
00177     void setAugmenter(AugmentationModule *pAugmenter) {
00178         m_augmenter.set(pAugmenter);
00179     }
00180     
00182     void setShellingOrder(ShellingOrderModule *pOrder){
00183         m_computeOrder.set(pOrder);
00184     }
00185 
00187 
00188 private:
00189     bool   m_sizeOptimization; 
00190     double m_baseRatio; 
00191 
00192     ModuleOption<AugmentationModule> m_augmenter;       
00193     ModuleOption<ShellingOrderModule> m_computeOrder;   
00194 
00195     void doCall(
00196         const Graph &G,
00197         adjEntry adjExternal,
00198         GridLayout &gridLayout,
00199         IPoint &boundingBox,
00200         bool fixEmbedding);
00201 
00202     void computeCoordinates(const Graph &G,
00203         ShellingOrder &lmc,
00204         NodeArray<int> &x,
00205         NodeArray<int> &y);
00206 
00207 };
00208 
00209 
00210 } // end namespace ogdf
00211 
00212 
00213 #endif