Open
Graph Drawing
Framework

 v.2012.05
 

LongestPathCompaction.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_LONGEST_PATH_COMPACTION_H
00050 #define OGDF_LONGEST_PATH_COMPACTION_H
00051 
00052 
00053 #include <ogdf/orthogonal/OrthoRep.h>
00054 #include <ogdf/planarity/PlanRepUML.h>
00055 #include <ogdf/internal/orthogonal/RoutingChannel.h>
00056 #include <ogdf/basic/tuples.h>
00057 #include <ogdf/basic/GridLayoutMapped.h>
00058 
00059 
00060 namespace ogdf {
00061 
00062     template<class ATYPE> class CompactionConstraintGraph;
00063     class OGDF_EXPORT Layout;
00064 
00065 
00083 class OGDF_EXPORT LongestPathCompaction
00084 {
00085 public:
00087     LongestPathCompaction(bool tighten = true,
00088         int maxImprovementSteps = 0);
00089 
00091     void constructiveHeuristics(
00092         PlanRepUML &PG,
00093         OrthoRep &OR,
00094         const RoutingChannel<int> &rc,
00095         GridLayoutMapped &drawing);
00096 
00097 
00099     void improvementHeuristics(
00100         PlanRepUML &PG,
00101         OrthoRep &OR,
00102         const RoutingChannel<int> &rc,
00103         GridLayoutMapped &drawing);
00104 
00105     //
00106     // options
00107 
00109     void tighten(bool select) {
00110         m_tighten = select;
00111     }
00112 
00114     bool tighten() const {
00115         return m_tighten;
00116     }
00117 
00118 
00120     void maxImprovementSteps(int maxSteps) {
00121         m_maxImprovementSteps = maxSteps;
00122     }
00123 
00125     int maxImprovementSteps() const {
00126         return m_maxImprovementSteps;
00127     }
00128 
00129 
00130 private:
00131     void computeCoords(
00132         const CompactionConstraintGraph<int> &D,
00133         NodeArray<int> &pos);
00134 
00135     void applyLongestPaths(const CompactionConstraintGraph<int> &D,
00136         NodeArray<int> &pos);
00137 
00138     void moveComponents(const CompactionConstraintGraph<int> &D,
00139         NodeArray<int> &pos);
00140 
00141 
00142     // options
00143     bool m_tighten;  
00144     int m_maxImprovementSteps; 
00145 
00146     SList<node>    m_pseudoSources; 
00147     NodeArray<int> m_component;     
00148 };
00149 
00150 
00151 } // end namespace ogdf
00152 
00153 
00154 #endif