lemon/graph_to_eps.h
changeset 1503 97836166605d
parent 1470 9b6f8c3587f0
child 1539 8f589de42c76
equal deleted inserted replaced
1:6de2e40f2aa7 2:7349192a82d0
   328   typedef typename Graph::Edge Edge;
   328   typedef typename Graph::Edge Edge;
   329   typedef typename Graph::EdgeIt EdgeIt;
   329   typedef typename Graph::EdgeIt EdgeIt;
   330   typedef typename Graph::InEdgeIt InEdgeIt;
   330   typedef typename Graph::InEdgeIt InEdgeIt;
   331   typedef typename Graph::OutEdgeIt OutEdgeIt;
   331   typedef typename Graph::OutEdgeIt OutEdgeIt;
   332 
   332 
   333   static const int INTERPOL_PREC=20;
   333   static const int INTERPOL_PREC;
   334   static const double A4HEIGHT = 841.8897637795276;
   334   static const double A4HEIGHT;
   335   static const double A4WIDTH  = 595.275590551181;
   335   static const double A4WIDTH;
   336   static const double A4BORDER = 15;
   336   static const double A4BORDER;
   337 
   337 
   338   bool dontPrint;
   338   bool dontPrint;
   339 
   339 
   340 public:
   340 public:
   341   ///Node shapes
   341   ///Node shapes
   703       timeval tv;
   703       timeval tv;
   704       gettimeofday(&tv, 0);
   704       gettimeofday(&tv, 0);
   705       ctime_r(&tv.tv_sec,cbuf);
   705       ctime_r(&tv.tv_sec,cbuf);
   706       os << "%%CreationDate: " << cbuf;
   706       os << "%%CreationDate: " << cbuf;
   707     }
   707     }
   708     ///\todo: Chech whether the graph is empty.
       
   709     BoundingBox<double> bb;
   708     BoundingBox<double> bb;
       
   709     ///\bug: Chech whether the graph is empty.
       
   710     if(NodeIt(g)==INVALID) bb+=xy<double>(0,0);
   710     for(NodeIt n(g);n!=INVALID;++n) {
   711     for(NodeIt n(g);n!=INVALID;++n) {
   711       double ns=_nodeSizes[n]*_nodeScale;
   712       double ns=_nodeSizes[n]*_nodeScale;
   712       xy<double> p(ns,ns);
   713       xy<double> p(ns,ns);
   713       bb+=p+_coords[n];
   714       bb+=p+_coords[n];
   714       bb+=-p+_coords[n];
   715       bb+=-p+_coords[n];
   973     //CleanUp:
   974     //CleanUp:
   974     if(_pleaseRemoveOsStream) {delete &os;}
   975     if(_pleaseRemoveOsStream) {delete &os;}
   975   } 
   976   } 
   976 };
   977 };
   977 
   978 
       
   979 template<class T>
       
   980 const int GraphToEps<T>::INTERPOL_PREC = 20;
       
   981 template<class T>
       
   982 const double GraphToEps<T>::A4HEIGHT = 841.8897637795276;
       
   983 template<class T>
       
   984 const double GraphToEps<T>::A4WIDTH  = 595.275590551181;
       
   985 template<class T>
       
   986 const double GraphToEps<T>::A4BORDER = 15;
       
   987 
   978 
   988 
   979 ///Generates an EPS file from a graph
   989 ///Generates an EPS file from a graph
   980 
   990 
   981 ///\ingroup io_group
   991 ///\ingroup io_group
   982 ///Generates an EPS file from a graph.
   992 ///Generates an EPS file from a graph.