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: |