# HG changeset patch # User alpar # Date 1121861616 0 # Node ID 438bc5defad1934939785e678674d279d0529575 # Parent 697ed4dd309a046d188a153aa89104d76574ba35 - spellcheck in doc - getR(),getG(),getB() -> red(),green(),blue() - reformatting diff -r 697ed4dd309a -r 438bc5defad1 lemon/graph_to_eps.h --- a/lemon/graph_to_eps.h Wed Jul 20 08:33:33 2005 +0000 +++ b/lemon/graph_to_eps.h Wed Jul 20 12:13:36 2005 +0000 @@ -55,14 +55,17 @@ ///Constructor Color(double r,double g,double b) :_r(r),_g(g),_b(b) {}; ///Returns the red component - - ///\todo \c red() could be a better name... - /// - double getR() const {return _r;} + double & red() {return _r;} + ///Returns the red component + const double & red() const {return _r;} ///Returns the green component - double getG() const {return _g;} + double & green() {return _g;} + ///Returns the green component + const double & green() const {return _g;} ///Returns the blue component - double getB() const {return _b;} + double & blue() {return _b;} + ///Returns the blue component + const double & blue() const {return _b;} ///Set the color components void set(double r,double g,double b) { _r=r;_g=g;_b=b; }; }; @@ -156,13 +159,13 @@ ///as it is possible. inline Color distantColor(const Color &c) { - return Color(c.getR()<.5?1:0,c.getG()<.5?1:0,c.getB()<.5?1:0); + return Color(c.red()<.5?1:0,c.green()<.5?1:0,c.blue()<.5?1:0); } ///Returns black for light colors and white for the dark ones. ///Returns black for light colors and white for the dark ones. inline Color distantBW(const Color &c){ - double v=(.2125*c.getR()+.7154*c.getG()+.0721*c.getB())<.5?1:0; + double v=(.2125*c.red()+.7154*c.green()+.0721*c.blue())<.5?1:0; return Color(v,v,v); } @@ -393,7 +396,7 @@ static std::string psOut(const Color &c) { std::ostringstream os; - os << c.getR() << ' ' << c.getG() << ' ' << c.getB(); + os << c.red() << ' ' << c.green() << ' ' << c.blue(); return os.str(); } @@ -702,7 +705,7 @@ if(_title.size()>0) os << "%%Title: " << _title << '\n'; if(_copyright.size()>0) os << "%%Copyright: " << _copyright << '\n'; // << "%%Copyright: XXXX\n" - os << "%%Creator: LEMON GraphToEps function\n"; + os << "%%Creator: LEMON, graphToEps()\n"; { char cbuf[50]; @@ -725,10 +728,10 @@ if(_scaleToA4) os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n"; else os << "%%BoundingBox: " - << bb.left()* _scale-_xBorder << ' ' - << bb.bottom()*_scale-_yBorder << ' ' - << bb.right()* _scale+_xBorder << ' ' - << bb.top()* _scale+_yBorder << '\n'; + << bb.left() * _scale - _xBorder << ' ' + << bb.bottom() * _scale - _yBorder << ' ' + << bb.right() * _scale + _xBorder << ' ' + << bb.top() * _scale + _yBorder << '\n'; os << "%%EndComments\n"; @@ -865,9 +868,9 @@ // else t2=(t1+t2)/2; // bez=bez.after((t1+t2)/2); os << _edgeWidths[*e]*_edgeWidthScale << " setlinewidth " - << _edgeColors[*e].getR() << ' ' - << _edgeColors[*e].getG() << ' ' - << _edgeColors[*e].getB() << " setrgbcolor newpath\n" + << _edgeColors[*e].red() << ' ' + << _edgeColors[*e].green() << ' ' + << _edgeColors[*e].blue() << " setrgbcolor newpath\n" << bez.p1.x << ' ' << bez.p1.y << " moveto\n" << bez.p2.x << ' ' << bez.p2.y << ' ' << bez.p3.x << ' ' << bez.p3.y << ' ' @@ -885,9 +888,9 @@ << mm.x << ' ' << mm.y << ' ' << _coords[g.target(*e)].x << ' ' << _coords[g.target(*e)].y << ' ' - << _edgeColors[*e].getR() << ' ' - << _edgeColors[*e].getG() << ' ' - << _edgeColors[*e].getB() << ' ' + << _edgeColors[*e].red() << ' ' + << _edgeColors[*e].green() << ' ' + << _edgeColors[*e].blue() << ' ' << _edgeWidths[*e]*_edgeWidthScale << " lb\n"; } sw+=_edgeWidths[*e]*_edgeWidthScale/2.0+_parEdgeDist; @@ -912,17 +915,17 @@ << d.x << ' ' << d.y << ' ' << _coords[g.source(e)].x << ' ' << _coords[g.source(e)].y << ' ' - << _edgeColors[e].getR() << ' ' - << _edgeColors[e].getG() << ' ' - << _edgeColors[e].getB() << " arr\n"; + << _edgeColors[e].red() << ' ' + << _edgeColors[e].green() << ' ' + << _edgeColors[e].blue() << " arr\n"; } else os << _coords[g.source(e)].x << ' ' << _coords[g.source(e)].y << ' ' << _coords[g.target(e)].x << ' ' << _coords[g.target(e)].y << ' ' - << _edgeColors[e].getR() << ' ' - << _edgeColors[e].getG() << ' ' - << _edgeColors[e].getB() << ' ' + << _edgeColors[e].red() << ' ' + << _edgeColors[e].green() << ' ' + << _edgeColors[e].blue() << ' ' << _edgeWidths[e]*_edgeWidthScale << " l\n"; os << "grestore\n"; } @@ -931,9 +934,9 @@ for(NodeIt n(g);n!=INVALID;++n) { os << _coords[n].x << ' ' << _coords[n].y << ' ' << _nodeSizes[n]*_nodeScale << ' ' - << _nodeColors[n].getR() << ' ' - << _nodeColors[n].getG() << ' ' - << _nodeColors[n].getB() << ' '; + << _nodeColors[n].red() << ' ' + << _nodeColors[n].green() << ' ' + << _nodeColors[n].blue() << ' '; switch(_nodeShapes[n]) { case CIRCLE: os<< "nc";break;