COIN-OR::LEMON - Graph Library

Changeset 1927:12f289d6187f in lemon-0.x


Ignore:
Timestamp:
01/30/06 10:31:15 (18 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2502
Message:

Functions added to set the edges/corners of the bounding box directly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/xy.h

    r1875 r1927  
    246246      }
    247247
    248       ///Gives back the bottom left corner (if the bounding box is empty, then the return value is not defined)
     248      ///\brief Gives back the bottom left corner
     249      ///(if the bounding box is empty, then the return value is not defined)
    249250      xy<T> bottomLeft() const {
    250251        return bottom_left;
    251252      }
    252253
    253       ///Gives back the top right corner (if the bounding box is empty, then the return value is not defined)
     254      ///\brief Sets the bottom left corner
     255      ///(should only bee used for non-empty box)
     256      void bottomLeft(xy<T> p) {
     257        bottom_left = p;
     258      }
     259
     260      ///\brief Gives back the top right corner
     261      ///(if the bounding box is empty, then the return value is not defined)
    254262      xy<T> topRight() const {
    255263        return top_right;
    256264      }
    257265
    258       ///Gives back the bottom right corner (if the bounding box is empty, then the return value is not defined)
     266      ///\brief Sets the top right corner
     267      ///(should only bee used for non-empty box)
     268      void topRight(xy<T> p) {
     269        top_right = p;
     270      }
     271
     272      ///\brief Gives back the bottom right corner
     273      ///(if the bounding box is empty, then the return value is not defined)
    259274      xy<T> bottomRight() const {
    260275        return xy<T>(top_right.x,bottom_left.y);
    261276      }
    262277
    263       ///Gives back the top left corner (if the bounding box is empty, then the return value is not defined)
     278      ///\brief Sets the bottom right corner
     279      ///(should only bee used for non-empty box)
     280      void bottomRight(xy<T> p) {
     281        top_right.x = p.x;
     282        bottom_left.y = p.y;
     283      }
     284
     285      ///\brief Gives back the top left corner
     286      ///(if the bounding box is empty, then the return value is not defined)
    264287      xy<T> topLeft() const {
    265288        return xy<T>(bottom_left.x,top_right.y);
    266289      }
    267290
    268       ///Gives back the bottom of the box (if the bounding box is empty, then the return value is not defined)
     291      ///\brief Sets the top left corner
     292      ///(should only bee used for non-empty box)
     293      void topLeft(xy<T> p) {
     294        top_right.y = p.y;
     295        bottom_left.x = p.x;
     296      }
     297
     298      ///\brief Gives back the bottom of the box
     299      ///(if the bounding box is empty, then the return value is not defined)
    269300      T bottom() const {
    270301        return bottom_left.y;
    271302      }
    272303
    273       ///Gives back the top of the box (if the bounding box is empty, then the return value is not defined)
     304      ///\brief Sets the bottom of the box
     305      ///(should only bee used for non-empty box)
     306      void bottom(T t) {
     307        bottom_left.y = t;
     308      }
     309
     310      ///\brief Gives back the top of the box
     311      ///(if the bounding box is empty, then the return value is not defined)
    274312      T top() const {
    275313        return top_right.y;
    276314      }
    277315
    278       ///Gives back the left side of the box (if the bounding box is empty, then the return value is not defined)
     316      ///\brief Sets the top of the box
     317      ///(should only bee used for non-empty box)
     318      void top(T t) {
     319        top_right.y = t;
     320      }
     321
     322      ///\brief Gives back the left side of the box
     323      ///(if the bounding box is empty, then the return value is not defined)
    279324      T left() const {
    280325        return bottom_left.x;
    281326      }
    282327
    283       ///Gives back the right side of the box (if the bounding box is empty, then the return value is not defined)
     328      ///\brief Sets the left side of the box
     329      ///(should only bee used for non-empty box)
     330      void left(T t) {
     331        bottom_left.x = t;
     332      }
     333
     334      ///\brief Gives back the right side of the box
     335      ///(if the bounding box is empty, then the return value is not defined)
    284336      T right() const {
    285337        return top_right.x;
    286338      }
    287339
    288       ///Gives back the height of the box (if the bounding box is empty, then the return value is not defined)
     340      ///\brief Sets the right side of the box
     341      ///(should only bee used for non-empty box)
     342      void right(T t) {
     343        top_right.x = t;
     344      }
     345
     346      ///\brief Gives back the height of the box
     347      ///(if the bounding box is empty, then the return value is not defined)
    289348      T height() const {
    290349        return top_right.y-bottom_left.y;
    291350      }
    292351
    293       ///Gives back the width of the box (if the bounding box is empty, then the return value is not defined)
     352      ///\brief Gives back the width of the box
     353      ///(if the bounding box is empty, then the return value is not defined)
    294354      T width() const {
    295355        return top_right.x-bottom_left.x;
Note: See TracChangeset for help on using the changeset viewer.