Open
Graph Drawing
Framework

 v.2012.05
 

FlowCompaction.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  
00043 #ifdef _MSC_VER
00044 #pragma once
00045 #endif
00046 
00047 
00048 #ifndef OGDF_FLOW_COMPACTION_H
00049 #define OGDF_FLOW_COMPACTION_H
00050 
00051 
00052 #include <ogdf/orthogonal/OrthoRep.h>
00053 #include <ogdf/planarity/PlanRep.h>
00054 #include <ogdf/internal/orthogonal/RoutingChannel.h>
00055 #include <ogdf/orthogonal/MinimumEdgeDistances.h>
00056 #include <ogdf/basic/GridLayoutMapped.h>
00057 
00058 
00059 namespace ogdf {
00060 
00061     template<class ATYPE> class CompactionConstraintGraph;
00062     class OGDF_EXPORT Layout;
00063 
00064 
00066 class OGDF_EXPORT FlowCompaction
00067 {
00068 public:
00070     FlowCompaction(int maxImprovementSteps = 0,
00071         int costGen = 1, 
00072         int costAssoc = 1);
00073 
00075     void constructiveHeuristics(
00076         PlanRep &PG,
00077         OrthoRep &OR,
00078         const RoutingChannel<int> &rc,
00079         GridLayoutMapped &drawing);
00080 
00081 
00083     void improvementHeuristics(
00084         PlanRep &PG,
00085         OrthoRep &OR,
00086         const RoutingChannel<int> &rc,
00087         GridLayoutMapped &drawing);
00088 
00090     void improvementHeuristics(
00091         PlanRep &PG,
00092         OrthoRep &OR,
00093         //const 
00094         MinimumEdgeDistances<int> &minDist,
00095         GridLayoutMapped &drawing,
00096         int originalSeparation //the input value before multiplication test for compaction improvement
00097         );
00098 
00099     //
00100     // options
00101 
00103     void maxImprovementSteps(int maxSteps) {
00104         m_maxImprovementSteps = maxSteps;
00105     }
00106 
00108     int maxImprovementSteps() const {
00109         return m_maxImprovementSteps;
00110     }
00111 
00113     void costGen(int c) {
00114         m_costGen = c;
00115     }
00116 
00118     int costGen() const {
00119         return m_costGen;
00120     }
00121 
00123     void costAssoc(int c) {
00124         m_costAssoc = c;
00125     }
00126 
00128     int costAssoc() const {
00129         return m_costAssoc;
00130     }
00131 
00133     void scalingSteps(int sc) {m_scalingSteps = sc;}
00134 
00136     void align(bool b) {m_align = b;}
00137 
00138 
00139 private:
00140     void computeCoords(
00141         CompactionConstraintGraph<int> &D,
00142         NodeArray<int> &pos,
00143         bool fixZeroLength = false,
00144         bool fixVertexSize = false,
00145         bool improvementHeuristics = false,
00146         bool onlyGen = false);
00147     void dfsAssignPos(
00148         NodeArray<bool> &visited,
00149         NodeArray<int> &pos,
00150         node v,
00151         int x);
00152 
00153     // options
00154     int m_maxImprovementSteps; 
00155     int m_costGen;   
00156     int m_costAssoc; 
00157     bool m_cageExpense; 
00158     //int m_costCage; //!< preliminary: Carsten uses 10
00159     int m_numGenSteps; 
00160     int m_scalingSteps; 
00161     bool m_align; 
00162 
00163 
00164     EdgeArray<edge> m_dualEdge;
00165     EdgeArray<int>  m_flow;
00166 };
00167 
00168 
00169 } // end namespace ogdf
00170 
00171 
00172 #endif