Changeset 115 for trunk


Ignore:
Timestamp:
06/11/13 20:22:57 (12 years ago)
Author:
shark
Message:
  • Documenting added functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/position.hh

    r114 r115  
    161161                 */
    162162                bool is_valid() const { return x2 >= x1 && y2 >= y1; }
     163
     164                /**
     165                 *Enlarges the rectangle by a given amount.  Each side is adjusted by the given amount, e.g. expanding by 1 increases the width and height by 2 each.
     166                 *
     167                 *@param value The amount to adjust each sides by.
     168                 */
    163169                void expand( value_type value ) { position p(value,value); ul -= p; lr += p; }
     170
     171                /**
     172                 *Reduces the rectangle by a given amount.  Each side is adjusted by the given amount, e.g. shrinking by 1 decreases the width and height by 2 each.
     173                 *
     174                 *@param value The amount to adjust each side by.
     175                 */
    164176                void shrink( value_type value ) { position p(value,value); ul += p; lr -= p; }
     177
     178                /**
     179                 *Gets a rectangle that is an expanded version of this rectangle.
     180                 *
     181                 *@param value The amount to adjust each side by.
     182                 *@returns An expanded rectangle.
     183                 *@see expand
     184                 */
    165185                rectangle expanded( int value ) { position p(value,value); return rectangle(ul-p, lr+p); }
     186
     187                /**
     188                 *Gets a rectangle that is a shrunk version of this rectangle.
     189                 *
     190                 *@param value The amount to adjust each side by.
     191                 *@returns A shrunk rectangle.
     192                 *@see shrink
     193                 */
    166194                rectangle shrinked( int value ) { position p(value,value); return rectangle(ul+p, lr-p); }
    167195               
Note: See TracChangeset for help on using the changeset viewer.