lemon/graph_to_eps.h
changeset 334 ada5f74d1c9e
parent 220 a5d8c039f218
child 280 e7f8647ce760
equal deleted inserted replaced
13:030847014832 14:a18fd910850f
   723       }
   723       }
   724     }
   724     }
   725 
   725 
   726     double diag_len = 1;
   726     double diag_len = 1;
   727     if(!(_absoluteNodeSizes&&_absoluteArcWidths)) {
   727     if(!(_absoluteNodeSizes&&_absoluteArcWidths)) {
   728       dim2::BoundingBox<double> bb;
   728       dim2::Box<double> bb;
   729       for(NodeIt n(g);n!=INVALID;++n) bb.add(mycoords[n]);
   729       for(NodeIt n(g);n!=INVALID;++n) bb.add(mycoords[n]);
   730       if (bb.empty()) {
   730       if (bb.empty()) {
   731         bb = dim2::BoundingBox<double>(dim2::Point<double>(0,0));
   731         bb = dim2::Box<double>(dim2::Point<double>(0,0));
   732       }
   732       }
   733       diag_len = std::sqrt((bb.bottomLeft()-bb.topRight()).normSquare());
   733       diag_len = std::sqrt((bb.bottomLeft()-bb.topRight()).normSquare());
   734       if(diag_len<EPSILON) diag_len = 1;
   734       if(diag_len<EPSILON) diag_len = 1;
   735       if(!_absoluteNodeSizes) _nodeScale*=diag_len;
   735       if(!_absoluteNodeSizes) _nodeScale*=diag_len;
   736       if(!_absoluteArcWidths) _arcWidthScale*=diag_len;
   736       if(!_absoluteArcWidths) _arcWidthScale*=diag_len;
   737     }
   737     }
   738 
   738 
   739     dim2::BoundingBox<double> bb;
   739     dim2::Box<double> bb;
   740     for(NodeIt n(g);n!=INVALID;++n) {
   740     for(NodeIt n(g);n!=INVALID;++n) {
   741       double ns=_nodeSizes[n]*_nodeScale;
   741       double ns=_nodeSizes[n]*_nodeScale;
   742       dim2::Point<double> p(ns,ns);
   742       dim2::Point<double> p(ns,ns);
   743       switch(_nodeShapes[n]) {
   743       switch(_nodeShapes[n]) {
   744       case CIRCLE:
   744       case CIRCLE:
   756         bb.add(dim2::Point<double>(-ns,-3.01*ns)+mycoords[n]);
   756         bb.add(dim2::Point<double>(-ns,-3.01*ns)+mycoords[n]);
   757         break;
   757         break;
   758       }
   758       }
   759     }
   759     }
   760     if (bb.empty()) {
   760     if (bb.empty()) {
   761       bb = dim2::BoundingBox<double>(dim2::Point<double>(0,0));
   761       bb = dim2::Box<double>(dim2::Point<double>(0,0));
   762     }
   762     }
   763 
   763 
   764     if(_scaleToA4)
   764     if(_scaleToA4)
   765       os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n";
   765       os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n";
   766     else {
   766     else {