Changeset 1202:da44ee225dad in lemon-0.x
- Timestamp:
- 03/07/05 08:53:20 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1614
- Location:
- src/lemon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/graph_to_eps.h
r1180 r1202 158 158 ///\todo weighted average would be better 159 159 inline Color distantBW(const Color &c){ 160 // double v=(c.getR()+c.getG()+c.getB())<1.5?1:0;161 160 double v=(.2125*c.getR()+.7154*c.getG()+.0721*c.getB())<.5?1:0; 162 161 return Color(v,v,v); … … 327 326 return (g.source(e)==g.source(f)&&g.target(e)==g.target(f))|| 328 327 (g.source(e)==g.target(f)&&g.target(e)==g.source(f)); 329 }330 static xy<double> rot(xy<double> v)331 {332 return xy<double>(v.y,-v.x);333 328 } 334 329 template<class TT> … … 776 771 for(typename std::vector<Edge>::iterator e=i;e!=j;++e) { 777 772 sw+=_edgeWidths[*e]*_edgeWidthScale/2.0; 778 xy<double> mm=m+rot (d)*sw/.75;773 xy<double> mm=m+rot90(d)*sw/.75; 779 774 if(_drawArrows) { 780 775 int node_shape; … … 812 807 << bez.p3.x << ' ' << bez.p3.y << ' ' 813 808 << bez.p4.x << ' ' << bez.p4.y << " curveto stroke\n"; 814 xy<double> dd(rot (linend-apoint));809 xy<double> dd(rot90(linend-apoint)); 815 810 dd*=(.5*_edgeWidths[*e]*_edgeWidthScale+_arrowWidth)/ 816 811 sqrt(dd.normSquare()); -
src/lemon/xy.h
r1164 r1202 181 181 } 182 182 183 ///Rotate by 90 degrees 184 185 ///Returns its parameter rotated by 90 degrees in positive direction. 186 ///\relates xy 187 /// 188 template<typename T> 189 inline xy<T> rot90(const xy<T> &z) 190 { 191 return xy<T>(-z.y,z.x); 192 } 193 194 ///Rotate by 270 degrees 195 196 ///Returns its parameter rotated by 90 degrees in negative direction. 197 ///\relates xy 198 /// 199 template<typename T> 200 inline xy<T> rot270(const xy<T> &z) 201 { 202 return xy<T>(z.y,-z.x); 203 } 204 205 183 206 184 207 /// A class to calculate or store the bounding box of plainvectors.
Note: See TracChangeset
for help on using the changeset viewer.