//-*-c++-*- #ifndef Tulip_Sugiyama_H #define Tulip_Sugiyama_H #include class SelfLoops { public: SelfLoops(node n1,node n2,edge ee1, edge ee2,edge ee3,edge old) { ghostNode1=n1; ghostNode2=n2; e1=ee1; e2=ee2; e3=ee3; oldEdge=old; } ~SelfLoops(){} node ghostNode1,ghostNode2; edge e1,e2,e3,oldEdge; }; class LessThanNode2 { public: MetricProxy *metric; bool operator() (node n1,node n2){return (metric->getNodeValue(n1) < metric->getNodeValue(n2));} }; struct LR { int L; int R; }; /// class Sugiyama:public Layout { public: Sugiyama(PropertyContext *); ~Sugiyama(); bool run(); private: void makeAcyclic(SuperGraph*,std::set &,std::list &); node makeSimpleSource(SuperGraph* superGraph); void makeProperDag(SuperGraph* superGraph,std::list &, STL_EXT_NS::hash_map &); void buildGrid(SuperGraph*); bool assert_twoLayerCrossReduction(unsigned int freeLayer,bool sense); unsigned int degree(SuperGraph*,node,bool); void forceNoTwoLayerCross(SuperGraph*,unsigned int freeLayer,bool sense); void twoLayerCrossReduction(SuperGraph*,unsigned int freeLayer,bool sense); void crossReduction(SuperGraph*); void coordAssign(SuperGraph*,LayoutProxy *layout); node getOpposite(SuperGraph *superGraph,node n,bool sense); void initCross(SuperGraph*superGraph,node n, STL_EXT_NS::hash_map &visited,int &id); void minimize(SuperGraph* superGraph, STL_EXT_NS::hash_map &xcoord,double maxW,bool bary); void forceAlignBends(SuperGraph* superGraph, STL_EXT_NS::hash_map &xcoord,bool sense); std::list selfloops; std::set reversedEdges; std::vector< std::vector > grid; STL_EXT_NS::hash_map > bends; LessThanNode2 lessNode; MetricProxy *metricProxy; }; #endif