Changeset 1575:438bc5defad1 in lemon-0.x
- Timestamp:
- 07/20/05 14:13:36 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2074
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/graph_to_eps.h
r1574 r1575 56 56 Color(double r,double g,double b) :_r(r),_g(g),_b(b) {}; 57 57 ///Returns the red component 58 59 ///\todo \c red() could be a better name... 60 /// 61 double getR() const {return _r;} 58 double & red() {return _r;} 59 ///Returns the red component 60 const double & red() const {return _r;} 62 61 ///Returns the green component 63 double getG() const {return _g;} 62 double & green() {return _g;} 63 ///Returns the green component 64 const double & green() const {return _g;} 64 65 ///Returns the blue component 65 double getB() const {return _b;} 66 double & blue() {return _b;} 67 ///Returns the blue component 68 const double & blue() const {return _b;} 66 69 ///Set the color components 67 70 void set(double r,double g,double b) { _r=r;_g=g;_b=b; }; … … 157 160 inline Color distantColor(const Color &c) 158 161 { 159 return Color(c. getR()<.5?1:0,c.getG()<.5?1:0,c.getB()<.5?1:0);162 return Color(c.red()<.5?1:0,c.green()<.5?1:0,c.blue()<.5?1:0); 160 163 } 161 164 ///Returns black for light colors and white for the dark ones. … … 163 166 ///Returns black for light colors and white for the dark ones. 164 167 inline Color distantBW(const Color &c){ 165 double v=(.2125*c. getR()+.7154*c.getG()+.0721*c.getB())<.5?1:0;168 double v=(.2125*c.red()+.7154*c.green()+.0721*c.blue())<.5?1:0; 166 169 return Color(v,v,v); 167 170 } … … 394 397 { 395 398 std::ostringstream os; 396 os << c. getR() << ' ' << c.getG() << ' ' << c.getB();399 os << c.red() << ' ' << c.green() << ' ' << c.blue(); 397 400 return os.str(); 398 401 } … … 703 706 if(_copyright.size()>0) os << "%%Copyright: " << _copyright << '\n'; 704 707 // << "%%Copyright: XXXX\n" 705 os << "%%Creator: LEMON GraphToEps function\n";708 os << "%%Creator: LEMON, graphToEps()\n"; 706 709 707 710 { … … 726 729 os <<"%%BoundingBox: 0 0 596 842\n%%DocumentPaperSizes: a4\n"; 727 730 else os << "%%BoundingBox: " 728 << bb.left() * _scale-_xBorder << ' '729 << bb.bottom() *_scale-_yBorder << ' '730 << bb.right() * _scale+_xBorder << ' '731 << bb.top() * _scale+_yBorder << '\n';731 << bb.left() * _scale - _xBorder << ' ' 732 << bb.bottom() * _scale - _yBorder << ' ' 733 << bb.right() * _scale + _xBorder << ' ' 734 << bb.top() * _scale + _yBorder << '\n'; 732 735 733 736 os << "%%EndComments\n"; … … 866 869 // bez=bez.after((t1+t2)/2); 867 870 os << _edgeWidths[*e]*_edgeWidthScale << " setlinewidth " 868 << _edgeColors[*e]. getR() << ' '869 << _edgeColors[*e].g etG() << ' '870 << _edgeColors[*e]. getB() << " setrgbcolor newpath\n"871 << _edgeColors[*e].red() << ' ' 872 << _edgeColors[*e].green() << ' ' 873 << _edgeColors[*e].blue() << " setrgbcolor newpath\n" 871 874 << bez.p1.x << ' ' << bez.p1.y << " moveto\n" 872 875 << bez.p2.x << ' ' << bez.p2.y << ' ' … … 886 889 << _coords[g.target(*e)].x << ' ' 887 890 << _coords[g.target(*e)].y << ' ' 888 << _edgeColors[*e]. getR() << ' '889 << _edgeColors[*e].g etG() << ' '890 << _edgeColors[*e]. getB() << ' '891 << _edgeColors[*e].red() << ' ' 892 << _edgeColors[*e].green() << ' ' 893 << _edgeColors[*e].blue() << ' ' 891 894 << _edgeWidths[*e]*_edgeWidthScale << " lb\n"; 892 895 } … … 913 916 << _coords[g.source(e)].x << ' ' 914 917 << _coords[g.source(e)].y << ' ' 915 << _edgeColors[e]. getR() << ' '916 << _edgeColors[e].g etG() << ' '917 << _edgeColors[e]. getB() << " arr\n";918 << _edgeColors[e].red() << ' ' 919 << _edgeColors[e].green() << ' ' 920 << _edgeColors[e].blue() << " arr\n"; 918 921 } 919 922 else os << _coords[g.source(e)].x << ' ' … … 921 924 << _coords[g.target(e)].x << ' ' 922 925 << _coords[g.target(e)].y << ' ' 923 << _edgeColors[e]. getR() << ' '924 << _edgeColors[e].g etG() << ' '925 << _edgeColors[e]. getB() << ' '926 << _edgeColors[e].red() << ' ' 927 << _edgeColors[e].green() << ' ' 928 << _edgeColors[e].blue() << ' ' 926 929 << _edgeWidths[e]*_edgeWidthScale << " l\n"; 927 930 os << "grestore\n"; … … 932 935 os << _coords[n].x << ' ' << _coords[n].y << ' ' 933 936 << _nodeSizes[n]*_nodeScale << ' ' 934 << _nodeColors[n]. getR() << ' '935 << _nodeColors[n].g etG() << ' '936 << _nodeColors[n]. getB() << ' ';937 << _nodeColors[n].red() << ' ' 938 << _nodeColors[n].green() << ' ' 939 << _nodeColors[n].blue() << ' '; 937 940 switch(_nodeShapes[n]) { 938 941 case CIRCLE:
Note: See TracChangeset
for help on using the changeset viewer.