COIN-OR::LEMON - Graph Library

Changeset 1202:da44ee225dad in lemon-0.x for src


Ignore:
Timestamp:
03/07/05 08:53:20 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1614
Message:
  • rot90() and rot270() added to xy.h
  • graph_to_eps.h's own rot() func. replaced to this
Location:
src/lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/graph_to_eps.h

    r1180 r1202  
    158158///\todo weighted average would be better
    159159inline Color distantBW(const Color &c){
    160   //  double v=(c.getR()+c.getG()+c.getB())<1.5?1:0;
    161160  double v=(.2125*c.getR()+.7154*c.getG()+.0721*c.getB())<.5?1:0;
    162161  return Color(v,v,v);
     
    327326    return (g.source(e)==g.source(f)&&g.target(e)==g.target(f))||
    328327      (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);
    333328  }
    334329  template<class TT>
     
    776771          for(typename std::vector<Edge>::iterator e=i;e!=j;++e) {
    777772            sw+=_edgeWidths[*e]*_edgeWidthScale/2.0;
    778             xy<double> mm=m+rot(d)*sw/.75;
     773            xy<double> mm=m+rot90(d)*sw/.75;
    779774            if(_drawArrows) {
    780775              int node_shape;
     
    812807                 << bez.p3.x << ' ' << bez.p3.y << ' '
    813808                 << bez.p4.x << ' ' << bez.p4.y << " curveto stroke\n";
    814               xy<double> dd(rot(linend-apoint));
     809              xy<double> dd(rot90(linend-apoint));
    815810              dd*=(.5*_edgeWidths[*e]*_edgeWidthScale+_arrowWidth)/
    816811                sqrt(dd.normSquare());
  • src/lemon/xy.h

    r1164 r1202  
    181181  }
    182182
     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 
    183206
    184207  /// A class to calculate or store the bounding box of plainvectors.
Note: See TracChangeset for help on using the changeset viewer.