Changeset 132 for trunk


Ignore:
Timestamp:
06/25/13 18:43:24 (12 years ago)
Author:
shark
Message:
  • Added missing spaces in all of my documentation comments (whoops!)
  • nv::to_string( string ) and nv::from_string( string, string ) were missing template <>
Location:
trunk/nv
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/array2d.hh

    r131 r132  
    3636
    3737                /**
    38                  *Creates a new 2D array.
     38                 * Creates a new 2D array.
    3939                 */
    4040                array2d() : m_size(), m_data( nullptr ) {}
    4141
    4242                /**
    43                  *Creates a new 2D array.
    44                  *
    45                  *@param asize The dimensions of the new array.
     43                 * Creates a new 2D array.
     44                 *
     45                 * @param asize The dimensions of the new array.
    4646                 */
    4747                array2d( const ivec2& asize ) : m_size(), m_data( nullptr ) { resize( asize ); }
    4848
    4949                /**
    50                  *Creates a new 2D array.
    51                  *
    52                  *@param asize_x The width of the new array.
    53                  *@param asize_y The height of the new array.
     50                 * Creates a new 2D array.
     51                 *
     52                 * @param asize_x The width of the new array.
     53                 * @param asize_y The height of the new array.
    5454                 */
    5555                array2d( const sint32 asize_x, const sint32 asize_y ) : m_size(), m_data( nullptr ) { resize( new ivec2( asize_x, asize_y ) ); }
    5656               
    5757                /**
    58                  *Gets the dimensions of the array.
    59                  *
    60                  *@returns The size of the array.
     58                 * Gets the dimensions of the array.
     59                 *
     60                 * @returns The size of the array.
    6161                 */
    6262                const ivec2& size() const { return m_size; }
    6363
    6464                /**
    65                  *Gets a pointer to the data in the array.
    66                  *
    67                  *@returns A pointer to the data in the array.
     65                 * Gets a pointer to the data in the array.
     66                 *
     67                 * @returns A pointer to the data in the array.
    6868                 */
    6969                pointer data() { return m_data; }
    7070
    7171                /**
    72                  *Gets a constant pointer to the data in the array.
    73                  *
    74                  *@returns A constant pointer to the data in the array.
     72                 * Gets a constant pointer to the data in the array.
     73                 *
     74                 * @returns A constant pointer to the data in the array.
    7575                 */
    7676                const_pointer data() const { return m_data; }
    7777
    7878                /**
    79                  *Changes the dimensions of the array.
    80                  *
    81                  *@param new_size The new dimensions of the array.
    82                  *@param preserve True to keep as much of the existing data as will fit in the new array, False to discard the existing data.
     79                 * Changes the dimensions of the array.
     80                 *
     81                 * @param new_size The new dimensions of the array.
     82                 * @param preserve True to keep as much of the existing data as will fit in the new array, False to discard the existing data.
    8383                 */
    8484                void resize( const ivec2& new_size, bool preserve = false )
     
    110110
    111111                /**
    112                  *Gets a pointer to the start of the array.
    113                  *
    114                  *@returns A pointer to the first position in the array.
     112                 * Gets a pointer to the start of the array.
     113                 *
     114                 * @returns A pointer to the first position in the array.
    115115                 */
    116116                iterator       begin()       { return m_data; }
    117117
    118118                /**
    119                  *Gets a constant pointer to the start of the array.
    120                  *
    121                  *@returns A constant pointer to the first position in the array.
     119                 * Gets a constant pointer to the start of the array.
     120                 *
     121                 * @returns A constant pointer to the first position in the array.
    122122                 */
    123123                const_iterator begin() const { return m_data; }
    124124
    125125                /**
    126                  *Gets a pointer to the end of the array.
    127                  *
    128                  *@returns A pointer to the end of the array.
     126                 * Gets a pointer to the end of the array.
     127                 *
     128                 * @returns A pointer to the end of the array.
    129129                 */
    130130                iterator       end()         { return m_data + ( m_size.x * m_size.y ); }
    131131
    132132                /**
    133                  *Gets a constant pointer to the end of the array.
    134                  *
    135                  *@returns A constant pointer to the end of the array.
     133                 * Gets a constant pointer to the end of the array.
     134                 *
     135                 * @returns A constant pointer to the end of the array.
    136136                 */
    137137                const_iterator end() const   { return m_data + ( m_size.x * m_size.y ); }
     
    139139
    140140                /**
    141                  *Looks up a position by X and Y value.
    142                  *
    143                  *@param x The X position of the array to look up.
    144                  *@param y The Y position of the array to look up.
    145                  *@returns A reference to the data at the indicated position.
     141                 * Looks up a position by X and Y value.
     142                 *
     143                 * @param x The X position of the array to look up.
     144                 * @param y The Y position of the array to look up.
     145                 * @returns A reference to the data at the indicated position.
    146146                 */
    147147                inline const_reference operator() ( sint32 x, sint32 y ) const
     
    152152
    153153                /**
    154                  *Looks up a position by X and Y value.
    155                  *
    156                  *@param x The X position of the array to look up.
    157                  *@param y The Y position of the array to look up.
    158                  *@returns A reference to the data at the indicated position.
     154                 * Looks up a position by X and Y value.
     155                 *
     156                 * @param x The X position of the array to look up.
     157                 * @param y The Y position of the array to look up.
     158                 * @returns A reference to the data at the indicated position.
    159159                 */
    160160                inline reference operator() ( sint32 x, sint32 y )
     
    165165
    166166                /**
    167                  *Looks up the given position in the array.
    168                  *
    169                  *@param c The position to look up.
    170                  *@returns A reference to the data at the indicated position.
     167                 * Looks up the given position in the array.
     168                 *
     169                 * @param c The position to look up.
     170                 * @returns A reference to the data at the indicated position.
    171171                 */
    172172                inline const_reference operator[] ( const ivec2& c ) const
     
    177177
    178178                /**
    179                  *Looks up the given position in the array.
    180                  *
    181                  *@param c The position to look up.
    182                  *@returns A reference to the data at the indicated position.
     179                 * Looks up the given position in the array.
     180                 *
     181                 * @param c The position to look up.
     182                 * @returns A reference to the data at the indicated position.
    183183                 */
    184184                inline reference operator[] ( const ivec2& c )
     
    189189
    190190                /**
    191                  *Returns a copy of this array in a new instance.
    192                  *
    193                  *@returns An independent copy of this array.
     191                 * Returns a copy of this array in a new instance.
     192                 *
     193                 * @returns An independent copy of this array.
    194194                 */
    195195                array2d<T> clone()
     
    204204
    205205                /**
    206                  *Returns an array that represents a subset of the data in this array.
    207                  *
    208                  *@param start The upper and left bounds of data to retrieve.
    209                  *@param size The width and height of the data to retrieve.
    210                  *@returns A new 2D array containing the subset of data within the bounds specified.
     206                 * Returns an array that represents a subset of the data in this array.
     207                 *
     208                 * @param start The upper and left bounds of data to retrieve.
     209                 * @param size The width and height of the data to retrieve.
     210                 * @returns A new 2D array containing the subset of data within the bounds specified.
    211211                 */
    212212                array2d<T> get_sub_array( const ivec2& start, const ivec2& size ) {     return get_sub_array( start.x, start.y, size.x, size.y ); }
    213                 /**
    214                  *Returns an array that represents a subset of the data in this array.
    215                  *
    216                  *@param start_x The left bound of the data to retrieve.
    217                  *@param start_y The upper bound of the data to retrieve.
    218                  *@param size_x The width of the data to retrieve.
    219                  *@param size_y The height of the data to retrieve.
    220                  *@returns A new 2D array containing the subset of data within the bounds specified.
     213
     214                /**
     215                 * Returns an array that represents a subset of the data in this array.
     216                 *
     217                 * @param start_x The left bound of the data to retrieve.
     218                 * @param start_y The upper bound of the data to retrieve.
     219                 * @param size_x The width of the data to retrieve.
     220                 * @param size_y The height of the data to retrieve.
     221                 * @returns A new 2D array containing the subset of data within the bounds specified.
    221222                 */
    222223                array2d<T> get_sub_array( const sint32 start_x, const sint32 start_y, const sint32 size_x, const sint32 size_y)
     
    239240
    240241                /**
    241                  *Fills this array with another array.
    242                  *
    243                  *@param source The array to fill with.  If it does not fit in the destination it will be truncated.
    244                  *@param dest_start The upper and left bounds of the data to fill.
     242                 * Fills this array with another array.
     243                 *
     244                 * @param source The array to fill with.  If it does not fit in the destination it will be truncated.
     245                 * @param dest_start The upper and left bounds of the data to fill.
    245246                 */
    246247                void set_sub_array( const array2d<T> source, const ivec2& dest_start )
     
    250251
    251252                /**
    252                  *Fills this array with a subset of another array.
    253                  *
    254                  *@param source The arrya to fill with.  If it does not fit in the destination it will be truncated.
    255                  *@param dest_start The upper and left bounds of the data to fill.
    256                  *@param size The size of the area to copy over.
     253                 * Fills this array with a subset of another array.
     254                 *
     255                 * @param source The arrya to fill with.  If it does not fit in the destination it will be truncated.
     256                 * @param dest_start The upper and left bounds of the data to fill.
     257                 * @param size The size of the area to copy over.
    257258                 */
    258259                void set_sub_array( const array2d<T> source, const ivec2& dest_start, const ivec2& size )
     
    263264
    264265                /**
    265                  *Fills this array with a subset of another array.
    266                  *
    267                  *@param source The array to fill with.  If it does not fit in the destination it will be truncated.
    268                  *@param dest_start The upper and left bounds of the data to fill.
    269                  *@param source_start The upper and left bounds of the source to fill with.
    270                  *@param size The size of the area to copy over.
     266                 * Fills this array with a subset of another array.
     267                 *
     268                 * @param source The array to fill with.  If it does not fit in the destination it will be truncated.
     269                 * @param dest_start The upper and left bounds of the data to fill.
     270                 * @param source_start The upper and left bounds of the source to fill with.
     271                 * @param size The size of the area to copy over.
    271272                 */
    272273                void set_sub_array( const array2d<T> source, const ivec2& dest_start, const ivec2& source_start, const ivec2& size )
     
    276277
    277278                /**
    278                  *Fills this array with another array.
    279                  *
    280                  *@param source The array to fill with.  If it does not fit in the area to fill, it will be truncated.
    281                  *@param dest_start_x The left bound of the data to fill.
    282                  *@param dest_start_y The upper bound of the data to fill.
     279                 * Fills this array with another array.
     280                 *
     281                 * @param source The array to fill with.  If it does not fit in the area to fill, it will be truncated.
     282                 * @param dest_start_x The left bound of the data to fill.
     283                 * @param dest_start_y The upper bound of the data to fill.
    283284                 */
    284285                void set_sub_array( const array2d<T> source, const sint32 dest_start_x, const sint32 dest_start_y )
     
    288289
    289290                /**
    290                  *Fills this array with another array.
    291                  *
    292                  *@param source The array to fill with.  If it does not fit in the area to fill, it will be truncated.
    293                  *@param dest_start_x The left bound of the data to fill.
    294                  *@param dest_start_y The upper bound of the data to fill.
    295                  *@param size_x The width of the area to copy over.
    296                  *@param size_y The height of the area to copy over.
     291                 * Fills this array with another array.
     292                 *
     293                 * @param source The array to fill with.  If it does not fit in the area to fill, it will be truncated.
     294                 * @param dest_start_x The left bound of the data to fill.
     295                 * @param dest_start_y The upper bound of the data to fill.
     296                 * @param size_x The width of the area to copy over.
     297                 * @param size_y The height of the area to copy over.
    297298                 */
    298299                void set_sub_array( const array2d<T> source, const sint32 dest_start_x, const sint32 dest_start_y, const sint32 size_x, const sint32 size_y )
     
    302303
    303304                /**
    304                  *Fills this array with a subset of another array.
    305                  *
    306                  *@param source The array to fill with.  If it does not fit in the area to fill, it will be truncated.
    307                  *@param dest_start_x The left bound of the data to fill.
    308                  *@param dest_start_y The upper bound of the data to fill.
    309                  *@param source_start_x The left bound of the source to fill with.
    310                  *@param source_start_y The upper bound of the source to fill with.
    311                  *@param size_x The width of the area to copy over.
    312                  *@param size_y The height of the area to copy over.
     305                 * Fills this array with a subset of another array.
     306                 *
     307                 * @param source The array to fill with.  If it does not fit in the area to fill, it will be truncated.
     308                 * @param dest_start_x The left bound of the data to fill.
     309                 * @param dest_start_y The upper bound of the data to fill.
     310                 * @param source_start_x The left bound of the source to fill with.
     311                 * @param source_start_y The upper bound of the source to fill with.
     312                 * @param size_x The width of the area to copy over.
     313                 * @param size_y The height of the area to copy over.
    313314                 */
    314315                void set_sub_array( const array2d<T> source, const sint32 dest_start_x, const sint32 dest_start_y, const sint32 source_start_x, const sint32 source_start_y, const sint32 size_x, const sint32 size_y )
     
    342343
    343344                /**
    344                  *Destructor.
     345                 * Destructor.
    345346                 */
    346347                ~array2d()
  • trunk/nv/gfx/texture_font.hh

    r121 r132  
    2727
    2828                /**
    29                  *Creates a new texture_glyph.
     29                 * Creates a new texture_glyph.
    3030                 */
    3131                texture_glyph();
    3232
    3333                /**
    34                  *Gets the kerning space between this character and the requested character.
     34                 * Gets the kerning space between this character and the requested character.
    3535                 *
    36                  *@param other The character to get the spacing for.
    37                  *@returns The amount of space for kerning.
     36                 * @param other The character to get the spacing for.
     37                 * @returns The amount of space for kerning.
    3838                 */
    3939                float get_kerning( const uint16 other );
  • trunk/nv/gui/gui_element.hh

    r126 r132  
    2828
    2929                        /**
    30                          *Creates a new GUI element.
     30                         * Creates a new GUI element.
    3131                         */
    3232                        element() : object() {}
    3333
    3434                        /**
    35                          *Creates a new GUI element with the give root node and postioning data.
    36                          *
    37                          *@param aroot The root object that will be this object's parent.
    38                          *@param r The rectangle representing the position and size of this element.
     35                         * Creates a new GUI element with the give root node and postioning data.
     36                         *
     37                         * @param aroot The root object that will be this object's parent.
     38                         * @param r The rectangle representing the position and size of this element.
    3939                         */
    4040                        element( root* aroot, const rectangle& r );
    4141
    4242                        /**
    43                          *Gets the deepest child element that contains the indicated point.
    44                          *
    45                          *@param p The position to check.
    46                          *@returns The last child element that contains the given point.
     43                         * Gets the deepest child element that contains the indicated point.
     44                         *
     45                         * @param p The position to check.
     46                         * @returns The last child element that contains the given point.
    4747                         */
    4848                        element* get_element( const position& p );
    4949
    5050                        /**
    51                          *Event handler for update events.  Calls on_update for all affected children.
    52                          *
    53                          *@param elapsed Time since last update.
     51                         * Event handler for update events.  Calls on_update for all affected children.
     52                         *
     53                         * @param elapsed Time since last update.
    5454                         */
    5555                        virtual void on_update( uint32 elapsed );
    5656
    5757                        /**
    58                          *Event handler for draw events.  Calls on_draw for all affected children.
     58                         * Event handler for draw events.  Calls on_draw for all affected children.
    5959                         */
    6060                        virtual void on_draw();
    6161
    6262                        /**
    63                          *Event handler for IO events.  Class on_event for all affected children.
    64                          *
    65                          *@param event The event data.
    66                          *@returns ???
     63                         * Event handler for IO events.  Calls on_event for all affected children.
     64                         *
     65                         * @param event The event data.
     66                         * @returns ???
    6767                         */
    6868                        virtual bool on_event( const io_event& event );
    6969
    7070                        /**
    71                          *Checks if this element contains the given point.
    72                          *
    73                          *@param p The point to check.
    74                          *@returns True if the point is within the region of the element, false otherwise.
     71                         * Checks if this element contains the given point.
     72                         *
     73                         * @param p The point to check.
     74                         * @returns True if the point is within the region of the element, false otherwise.
    7575                         */
    7676                        virtual bool contains( const position& p ) const;
    7777
    7878                        /**
    79                          *Sets the position and size of this element relative to its parent.
    80                          *
    81                          *@param r The new position and size of the element.
     79                         * Sets the position and size of this element relative to its parent.
     80                         *
     81                         * @param r The new position and size of the element.
    8282                         */
    8383                        virtual void set_relative( const rectangle& r );
    8484
    8585                        /**
    86                          *Sets the position of this element relative to its parent.
    87                          *
    88                          *@param p The new position of the element.
     86                         * Sets the position of this element relative to its parent.
     87                         *
     88                         * @param p The new position of the element.
    8989                         */
    9090                        virtual void set_relative( const position& p );
    9191
    9292                        /**
    93                          *Gets the position and size of the element relative to its parent.
    94                          *
    95                          *@returns The element's position and size relative to its parent.
     93                         * Gets the position and size of the element relative to its parent.
     94                         *
     95                         * @returns The element's position and size relative to its parent.
    9696                         */
    9797                        virtual const rectangle& get_relative() const { return m_relative; }
    9898
    9999                        /**
    100                          *Gets the position and size of the element relative to the root (window).
    101                          *
    102                          *@returns The element's position and size relative to the root (window).
     100                         * Gets the position and size of the element relative to the root (window).
     101                         *
     102                         * @returns The element's position and size relative to the root (window).
    103103                         */
    104104                        virtual const rectangle& get_absolute() const { return m_absolute; }
    105105
    106106                        /**
    107                          *Gets the parent element of this element.
    108                          *
    109                          *@returns The parent element.
     107                         * Gets the parent element of this element.
     108                         *
     109                         * @returns The parent element.
    110110                         */
    111111                        virtual element* get_parent() const { return (element*)m_parent; }
    112112
    113113                        /**
    114                          *Gets whether this element is currently accepting events.
    115                          *
    116                          *@returns True if the element is receiving events, false otherwise.
     114                         * Gets whether this element is currently accepting events.
     115                         *
     116                         * @returns True if the element is receiving events, false otherwise.
    117117                         */
    118118                        virtual bool is_enabled() const { return m_enabled; }
    119119
    120120                        /**
    121                          *Gets whether this element is currently visible.
    122                          *
    123                          *@returns True if the element is visible, false otherwise.
     121                         * Gets whether this element is currently visible.
     122                         *
     123                         * @returns True if the element is visible, false otherwise.
    124124                         */
    125125                        virtual bool is_visible() const { return m_visible; }
    126126
    127127                        /**
    128                          *Gets whether this element needs to be redrawn.
    129                          *
    130                          *@returns True if the element needs to be redrawn, false if not.
     128                         * Gets whether this element needs to be redrawn.
     129                         *
     130                         * @returns True if the element needs to be redrawn, false if not.
    131131                         */
    132132                        virtual bool is_dirty()   const { return m_dirty; }
    133133
    134134                        /**
    135                          *Sets whether this element is currently accepting events.
    136                          *
    137                          *@param value True to allow the element and its children to receive events, false to disable.
     135                         * Sets whether this element is currently accepting events.
     136                         *
     137                         * @param value True to allow the element and its children to receive events, false to disable.
    138138                         */
    139139                        virtual void set_enabled( bool value ) { m_enabled = value; }
    140140
    141141                        /**
    142                          *Sets whether this element is visible on the screen.
    143                          *
    144                          *@param value True to display the element and its children, false to hide it and its children.
     142                         * Sets whether this element is visible on the screen.
     143                         *
     144                         * @param value True to display the element and its children, false to hide it and its children.
    145145                         */
    146146                        virtual void set_visible( bool value ) { m_visible = value; }
    147147
    148148                        /**
    149                          *Sets whether this element needs to be redrawn.
    150                          *
    151                          *@param value True to request that the element and its children be redrawn, false if not.
     149                         * Sets whether this element needs to be redrawn.
     150                         *
     151                         * @param value True to request that the element and its children be redrawn, false if not.
    152152                         */
    153153                        virtual void set_dirty( bool value )   { m_dirty   = value; }
    154154
    155155                        /**
    156                          *Gets the text associated with this element.
    157                          *
    158                          *@returns A string containing the associated text.
     156                         * Gets the text associated with this element.
     157                         *
     158                         * @returns A string containing the associated text.
    159159                         */
    160160                        virtual const string& get_text() const { return m_text; }
    161161
    162162                        /**
    163                          *Sets the text associated with this element.
    164                          *
    165                          *@param text The new text to associate with this element.
     163                         * Sets the text associated with this element.
     164                         *
     165                         * @param text The new text to associate with this element.
    166166                         */
    167167                        virtual void set_text( const string& text ) { m_text = text; m_dirty = true; }
    168168
    169169                        /**
    170                          *Gets the class name associated with this element.
    171                          *
    172                          *@returns A string containing the class name of this element.
     170                         * Gets the class name associated with this element.
     171                         *
     172                         * @returns A string containing the class name of this element.
    173173                         */
    174174                        virtual const string& get_class() const { return m_class; }
    175175
    176176                        /**
    177                          *sets the class name associated with this element.
    178                          *
    179                          *@param class_ The new class name.
     177                         * sets the class name associated with this element.
     178                         *
     179                         * @param class_ The new class name.
    180180                         */
    181181                        virtual void set_class( const string& class_ ) { m_class = class_; m_dirty = true; }
    182182
    183183                        /**
    184                          *Recalcuates the absolute position of the element and the element's children.
     184                         * Recalcuates the absolute position of the element and the element's children.
    185185                         */
    186186                        virtual void recalculate_absolute();
    187187
    188188                        /**
    189                          *Recalculates the aboslute position of the element's children.
     189                         * Recalculates the aboslute position of the element's children.
    190190                         */
    191191                        virtual void recalculate_absolute_children();
    192192
    193193                        /**
    194                          *Destroys the element.
     194                         * Destroys the element.
    195195                         */
    196196                        virtual ~element();
  • trunk/nv/io_event.hh

    r110 r132  
    131131
    132132        /**
    133          *Gets the name of the key given the code.
     133         * Gets the name of the key given the code.
    134134         *
    135          *@param key The code value of the key.
    136          *@returns The name of the key.
     135         * @param key The code value of the key.
     136         * @returns The name of the key.
    137137         */
    138138        const char* get_key_name( key_code key );
    139139
    140140        /**
    141          *Gets the name of the mouse button given the code.
     141         * Gets the name of the mouse button given the code.
    142142         *
    143          *@param button The code value of the mouse button.
    144          *@returns The name of the button.
     143         * @param button The code value of the mouse button.
     144         * @returns The name of the button.
    145145         */
    146146        const char* get_mouse_name( mouse_code button );
    147147
    148148        /**
    149          *Gets the name of the IO event given the code.
     149         * Gets the name of the IO event given the code.
    150150         *
    151          *@param event The code value of the IO event.
    152          *@returns The name of the event.
     151         * @param event The code value of the IO event.
     152         * @returns The name of the event.
    153153         */
    154154        const char* get_io_event_name( io_event_code event );
    155155
    156156        /**
    157          *Registers all events to the specified database.
     157         * Registers all events to the specified database.
    158158         *
    159          *@param db The database to store all event data in.
     159         * @param db The database to store all event data in.
    160160         */
    161161        void register_io_types( type_database* db );
  • trunk/nv/position.hh

    r121 r132  
    3232                position lr;
    3333                /**
    34                  *Creates a new rectangle assigned to {0, 0, 0, 0}.
     34                 * Creates a new rectangle assigned to {0, 0, 0, 0}.
    3535                 */
    3636                rectangle() : ul(), lr() {}
    3737               
    3838                /**
    39                  *Creates a new rectangle given a position.
    40                  *
    41                  *@param p The position to assign the rectangle to.
     39                 * Creates a new rectangle given a position.
     40                 *
     41                 * @param p The position to assign the rectangle to.
    4242                 */
    4343                rectangle( position p ) : ul(p), lr(p) {}
    4444               
    4545                /**
    46                  *Creates a new rectangle given an upper-left and lower-right position.
    47                  *
    48                  *@param aul The position of the upper-left corner of the rectangle.
    49                  *@param alr The position of the lower-right corner of the rectangle.
     46                 * Creates a new rectangle given an upper-left and lower-right position.
     47                 *
     48                 * @param aul The position of the upper-left corner of the rectangle.
     49                 * @param alr The position of the lower-right corner of the rectangle.
    5050                 */
    5151                rectangle( position aul, position alr ) : ul(aul), lr(alr) {}
    5252               
    5353                /**
    54                  *Creates a new rectangle given an upper-left position, width, and height.
    55                  *
    56                  *@param aul The position of the upper-left corner of the rectangle.
    57                  *@param width The width of the rectangle.
    58                  *@param height The height of the rectangle.
     54                 * Creates a new rectangle given an upper-left position, width, and height.
     55                 *
     56                 * @param aul The position of the upper-left corner of the rectangle.
     57                 * @param width The width of the rectangle.
     58                 * @param height The height of the rectangle.
    5959                 */
    6060                rectangle( position aul, value_type width, value_type height ) : ul(aul), lr(aul + position(width,height)) {}
     
    6666       
    6767        /**
    68          * Explicit Copy constructor
     68         * Explicit Copy assignment operator
    6969         */
    7070        rectangle& operator= (const rectangle& r) { ul = r.ul; lr = r.lr; return *this; }
    7171               
    7272                /**
    73                  *Sets the dimensions of the rectangle without moving the upper-left of the rectangle.
    74                  *
    75                  *@param d The new dimensions of the rectangle.
     73                 * Sets the dimensions of the rectangle without moving the upper-left of the rectangle.
     74                 *
     75                 * @param d The new dimensions of the rectangle.
    7676                 */
    7777                rectangle& dim( dimension d ) { lr = ul + d; return *this; }
    7878
    7979                /**
    80                  *Moves the rectangle to a new position while maintaining its size.
    81                  *
    82                  *@param p The new position of the rectangle's upper-left corner.
     80                 * Moves the rectangle to a new position while maintaining its size.
     81                 *
     82                 * @param p The new position of the rectangle's upper-left corner.
    8383                 */
    8484                rectangle& pos( position p )  { lr = p + (lr - ul); lr = p; return *this; }
    8585
    8686                /**
    87                  *Sets the dimensions of the rectangle without moving the upper-left of the rectangle.
    88                  *
    89                  *@param d The new dimensions of the rectangle.
     87                 * Sets the dimensions of the rectangle without moving the upper-left of the rectangle.
     88                 *
     89                 * @param d The new dimensions of the rectangle.
    9090                 */
    9191                void set_dimension( dimension d ) { lr = ul + d; }
    9292               
    9393                /**
    94                  *Moves the rectangle to a new position while maintaining its size.
    95                  *
    96                  *@param p The new position of the rectangle's upper-left corner.
     94                 * Moves the rectangle to a new position while maintaining its size.
     95                 *
     96                 * @param p The new position of the rectangle's upper-left corner.
    9797                 */
    9898                void set_position( position p ) { lr = p + (lr - ul); ul = p; }
     
    101101                position ll() const { return position( ul.x, lr.y ); }
    102102                /**
    103                  *Gets the dimensions of the rectangle.  Synonym for get_size.
    104                  *
    105                  *@returns The dimensions of the rectangle.
    106                  *@see get_size
     103                 * Gets the dimensions of the rectangle.  Synonym for get_size.
     104                 *
     105                 * @returns The dimensions of the rectangle.
     106                 * @see get_size
    107107                 */
    108108                dimension get_dimension() const { return lr - ul; }
    109109
    110110                /**
    111                  *Gets the position of the upper-left corner of the rectangle.
    112                  *
    113                  *@returns The position of the rectangle's upper-left corner.
     111                 * Gets the position of the upper-left corner of the rectangle.
     112                 *
     113                 * @returns The position of the rectangle's upper-left corner.
    114114                 */
    115115                position  get_position() const { return ul; }
    116116
    117117                /**
    118                  *Gets the dimensions of the rectangle.  Synonym for get_dimension.
    119                  *
    120                  *@returns The dimensions of the rectangle.
    121                  *@see get_dimension
     118                 * Gets the dimensions of the rectangle.  Synonym for get_dimension.
     119                 *
     120                 * @returns The dimensions of the rectangle.
     121                 * @see get_dimension
    122122                 */
    123123                dimension get_size() const { return lr - ul; }
    124124
    125125                /**
    126                  *Gets the center of the rectangle.
    127                  *
    128                  *@returns The center of the rectangle.
     126                 * Gets the center of the rectangle.
     127                 *
     128                 * @returns The center of the rectangle.
    129129                 */
    130130                position get_center() const { return ( lr + ul ) / 2; }
    131131
    132132                /**
    133                  *Gets the width of the rectangle.
    134                  *
    135                  *@returns The width of the rectangle.
     133                 * Gets the width of the rectangle.
     134                 *
     135                 * @returns The width of the rectangle.
    136136                 */
    137137                value_type get_width() const { return lr.x - ul.x; }
    138138
    139139                /**
    140                  *Gets the height of the rectangle.
    141                  *
    142                  *@returns The height of the rectangle.
     140                 * Gets the height of the rectangle.
     141                 *
     142                 * @returns The height of the rectangle.
    143143                 */
    144144                value_type get_height() const { return lr.y - ul.y; }
    145145
    146146                /**
    147                  *Gets the area of the rectangle.
    148                  *
    149                  *@returns The area of the rectangle.
     147                 * Gets the area of the rectangle.
     148                 *
     149                 * @returns The area of the rectangle.
    150150                 */
    151151                value_type get_area() const { return (lr.y - ul.y) * (lr.x - ul.x); }
    152152
    153153                /**
    154                  *Checks to see if the rectangle is backwards.
    155                  *
    156                  *@returns True if the rectangle's upper-left is above and left (or equal to) the rectangle's lower-right, false if it is not.
     154                 * Checks to see if the rectangle is backwards.
     155                 *
     156                 * @returns True if the rectangle's upper-left is above and left (or equal to) the rectangle's lower-right, false if it is not.
    157157                 */
    158158                bool is_valid() const { return lr.x >= ul.x && lr.y >= ul.y; }
    159159
    160160                /**
    161                  *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.
    162                  *
    163                  *@param value The amount to adjust each sides by.
     161                 * 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.
     162                 *
     163                 * @param value The amount to adjust each sides by.
    164164                 */
    165165                void expand( value_type value ) { position p(value,value); ul -= p; lr += p; }
    166166
    167167                /**
    168                  *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.
    169                  *
    170                  *@param value The amount to adjust each side by.
     168                 * 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.
     169                 *
     170                 * @param value The amount to adjust each side by.
    171171                 */
    172172                void shrink( value_type value ) { position p(value,value); ul += p; lr -= p; }
    173173
    174174                /**
    175                  *Gets a rectangle that is an expanded version of this rectangle.
    176                  *
    177                  *@param value The amount to adjust each side by.
    178                  *@returns An expanded rectangle.
    179                  *@see expand
     175                 * Gets a rectangle that is an expanded version of this rectangle.
     176                 *
     177                 * @param value The amount to adjust each side by.
     178                 * @returns An expanded rectangle.
     179                 * @see expand
    180180                 */
    181181                rectangle expanded( int value ) { position p(value,value); return rectangle(ul-p, lr+p); }
    182182
    183183                /**
    184                  *Gets a rectangle that is a shrunk version of this rectangle.
    185                  *
    186                  *@param value The amount to adjust each side by.
    187                  *@returns A shrunk rectangle.
    188                  *@see shrink
     184                 * Gets a rectangle that is a shrunk version of this rectangle.
     185                 *
     186                 * @param value The amount to adjust each side by.
     187                 * @returns A shrunk rectangle.
     188                 * @see shrink
    189189                 */
    190190                rectangle shrinked( int value ) { position p(value,value); return rectangle(ul+p, lr-p); }
    191191               
    192192                /**
    193                  *Shifts the rectangle by a given amount.
    194                  *
    195                  *@param pos The amount to shift the rectangle by.
     193                 * Shifts the rectangle by a given amount.
     194                 *
     195                 * @param pos The amount to shift the rectangle by.
    196196                 */
    197197                rectangle& operator+=( const position& pos ) { ul += pos; lr += pos; return (*this); }
    198198
    199199                /**
    200                  *Returns a rectangle shifted by a given amount.
    201                  *
    202                  *@param pos The amount to shift by.
    203                  *@returns The shifted rectangle.
     200                 * Returns a rectangle shifted by a given amount.
     201                 *
     202                 * @param pos The amount to shift by.
     203                 * @returns The shifted rectangle.
    204204                 */
    205205                rectangle operator+( const position& pos ) const {      rectangle r(*this); return r += pos; }
    206206
    207207                /**
    208                  *Shifts the rectangle by a given amount.
    209                  *
    210                  *@param pos The amount to shift the rectangle by.
     208                 * Shifts the rectangle by a given amount.
     209                 *
     210                 * @param pos The amount to shift the rectangle by.
    211211                 */
    212212                rectangle& operator-=( const position& pos ) { ul -= pos; lr -= pos; return (*this); }
    213213
    214214                /**
    215                  *Returns a rectangle shifted by a given amount.
    216                  *
    217                  *@oaram pos The amount to shift by.
    218                  *@returns The shifted rectangle.
     215                 * Returns a rectangle shifted by a given amount.
     216                 *
     217                 * @param pos The amount to shift by.
     218                 * @returns The shifted rectangle.
    219219                 */
    220220                rectangle operator-( const position& pos ) const {      rectangle r(*this); return r -= pos; }
    221221
    222222                /**
    223                  *Compares two rectangles to see if they are the same.
    224                  *
    225                  *@param r The rectangle to compare to.
    226                  *@returns True if the rectangles have the same positions and dimensions, false otherwise.
     223                 * Compares two rectangles to see if they are the same.
     224                 *
     225                 * @param r The rectangle to compare to.
     226                 * @returns True if the rectangles have the same positions and dimensions, false otherwise.
    227227                 */
    228228                bool operator==( const rectangle& r ) const { return r.ul == ul && r.lr == lr; }
    229229
    230230                /**
    231                  *Compares two rectangles to see if they are different.
    232                  *
    233                  *@param r The rectangle to compare to.
    234                  *@returns True if the rectangles have different positions or dimensions, false otherwise.
     231                 * Compares two rectangles to see if they are different.
     232                 *
     233                 * @param r The rectangle to compare to.
     234                 * @returns True if the rectangles have different positions or dimensions, false otherwise.
    235235                 */
    236236                bool operator!=( const rectangle& r ) const { return r.ul != ul || r.lr != lr; }
    237237
    238238                /**
    239                  *Checks if a position is within the bounds of this rectangle.
    240                  *
    241                  *@param r The position to check.
    242                  *@returns True if the position is inside or on the edge of the rectangle, false otherwise.
     239                 * Checks if a position is within the bounds of this rectangle.
     240                 *
     241                 * @param r The position to check.
     242                 * @returns True if the position is inside or on the edge of the rectangle, false otherwise.
    243243                 */
    244244                bool contains( const position& r ) const{ return lr.y >= r.y && ul.y <= r.y && lr.x >= r.x && ul.x <= r.x; }
    245245
    246246                /**
    247                  *Checks if a rectangle is within the bounds of this rectangle.
    248                  *
    249                  *@param r The rectangle to check.
    250                  *@returns True if the entire rectangle to check is inside or on the edge of this rectangle, false otherwise.
     247                 * Checks if a rectangle is within the bounds of this rectangle.
     248                 *
     249                 * @param r The rectangle to check.
     250                 * @returns True if the entire rectangle to check is inside or on the edge of this rectangle, false otherwise.
    251251                 */
    252252                bool contains( const rectangle& r ) const { return contains( r.ul ) && contains( r.lr ); }
    253253
    254254                /**
    255                  *Checks if another rectangle overlaps this one.
    256                  *
    257                  *@param r The rectangle to check.
    258                  *@returns True if any part of the rectangle to check overlaps this rectangle, false otherwise.
     255                 * Checks if another rectangle overlaps this one.
     256                 *
     257                 * @param r The rectangle to check.
     258                 * @returns True if any part of the rectangle to check overlaps this rectangle, false otherwise.
    259259                 */
    260260                bool collides( const rectangle& r ) const { return lr.y > r.ul.y && ul.y < r.lr.y && lr.x > r.ul.x && ul.x < r.lr.x; }
    261261
    262262                /**
    263                  *Limits the region of the rectangle to the inidicated rectangle.
    264                  *
    265                  *@param r The rectangle that this rectangle is confined to.
    266                  *@returns True if the rectangle was changed, false otherwise.
     263                 * Limits the region of the rectangle to the inidicated rectangle.
     264                 *
     265                 * @param r The rectangle that this rectangle is confined to.
     266                 * @returns True if the rectangle was changed, false otherwise.
    267267                 */
    268268                bool clamp_to( const rectangle& r )
     
    276276
    277277                /**
    278                  *Limits the size of the rectangle to the given rectangle's size.
    279                  *
    280                  *@param r The rectangle representing the maximum dimensions this rectangle can be.
    281                  *@returns True if the rectangle needed to be resized, false otherwise.
     278                 * Limits the size of the rectangle to the given rectangle's size.
     279                 *
     280                 * @param r The rectangle representing the maximum dimensions this rectangle can be.
     281                 * @returns True if the rectangle needed to be resized, false otherwise.
    282282                 */
    283283                bool constrain_to( const rectangle& r )
     
    290290
    291291                /**
    292                  *Fixes an invalid rectangle.
     292                 * Fixes an invalid rectangle.
    293293                 */
    294294                void repair()
     
    299299
    300300                /**
    301                  *Expands the rectangle to just include the given point.
    302                  *
    303                  *@param p The point to include in the rectangle.
     301                 * Expands the rectangle to just include the given point.
     302                 *
     303                 * @param p The point to include in the rectangle.
    304304                 */
    305305                void include_point( position p )
  • trunk/nv/singleton.hh

    r110 r132  
    1919{
    2020        /**
    21          *singleton
    22          *@brief Represents an accessible static object that will only have one instance.
     21         * singleton
     22         * @brief Represents an accessible static object that will only have one instance.
    2323         */
    2424    template <class T>
     
    3131
    3232                /**
    33                  *Creates the single instance if one doesn't already exist.
     33                 * Creates the single instance if one doesn't already exist.
    3434                 */
    3535        singleton()
     
    4040
    4141                /**
    42                  *Destroys the instance.
     42                 * Destroys the instance.
    4343                 */
    4444        ~singleton()
     
    5050    public:
    5151                /**
    52                  *Checks to see if the instance exists.
     52                 * Checks to see if the instance exists.
    5353                 *
    54                  *@returns True if this singleton has an instance assigned, false otherwise.
     54                 * @returns True if this singleton has an instance assigned, false otherwise.
    5555                 */
    5656        static bool is_valid()
     
    6060
    6161                /**
    62                  *Returns the pointer to the instance.
     62                 * Returns the pointer to the instance.
    6363                 *
    64                  *@returns The pointer to the instance.
     64                 * @returns The pointer to the instance.
    6565                 */
    6666        static T *pointer()
     
    7070        }
    7171                /**
    72                  *Returns the object referenced by this singleton.
     72                 * Returns the object referenced by this singleton.
    7373                 */
    7474        static T &reference()
     
    8484
    8585        /**
    86          *auto_singleton
    87          *@brief Represents a singleton that automatically creates an instance if one doesn't already exist.
     86         * auto_singleton
     87         * @brief Represents a singleton that automatically creates an instance if one doesn't already exist.
    8888         */
    8989    template <class T>
     
    9292    public:
    9393                /**
    94                  *Returns the pointer to the instance.  Makes an instance if one doesn't already exist.
     94                 * Returns the pointer to the instance.  Makes an instance if one doesn't already exist.
    9595                 */
    9696        static T *pointer()
     
    104104
    105105                /**
    106                  *Returns the object referenced by this singleton.  Makes an instance if one doesn't already exist.
     106                 * Returns the object referenced by this singleton.  Makes an instance if one doesn't already exist.
    107107                 */
    108108        static T &reference()
  • trunk/nv/string.hh

    r64 r132  
    4242        * value passed.
    4343        */
     44        template <>
    4445        inline string to_string( const string& value)
    4546        {
     
    9192        * value passed.
    9293        */
     94        template <>
    9395        inline void from_string( const string& vin, string& vout )
    9496        {
  • trunk/nv/uid.hh

    r110 r132  
    2424               
    2525                /**
    26                  *Creates a new instance of the unique indentifer store.
     26                 * Creates a new instance of the unique indentifer store.
    2727                 */
    2828                uid_store();
    2929
    3030                /**
    31                  *Gets the object with the specified ID.
     31                 * Gets the object with the specified ID.
    3232                 *
    33                  *@param auid The ID to fetch.
    34                  *@returns The stored object for that ID.
     33                 * @param auid The ID to fetch.
     34                 * @returns The stored object for that ID.
    3535                 */
    3636                object* get( uid auid ) const;
    3737
    3838                /**
    39                  *Removes the object with the specified ID.
     39                 * Removes the object with the specified ID.
    4040                 *
    41                  *@param auid The ID to remove.
    42                  *@returns True if the removal was successful, false if the ID didn't exist.
     41                 * @param auid The ID to remove.
     42                 * @returns True if the removal was successful, false if the ID didn't exist.
    4343                 */
    4444                bool remove( uid auid );
    4545
    4646                /**
    47                  *Adds an object to the store assigned to the indicated ID.
     47                 * Adds an object to the store assigned to the indicated ID.
    4848                 *
    49                  *@param o The object to add to the store.
    50                  *@param auid The ID to assign to the object.
     49                 * @param o The object to add to the store.
     50                 * @param auid The ID to assign to the object.
    5151                 */
    5252                void insert( object* o, uid auid );
    5353
    5454                /**
    55                  *Adds an object to the store and assigns it a new ID.
     55                 * Adds an object to the store and assigns it a new ID.
    5656                 *
    57                  *@param o The object to add to the store.
    58                  *@returns The ID the object was store under.
     57                 * @param o The object to add to the store.
     58                 * @returns The ID the object was store under.
    5959                 */
    6060                uid insert( object* o );
    6161
    6262                /**
    63                  *Gets the next available ID.
     63                 * Gets the next available ID.
    6464                 *
    65                  *@returns The next ID in the store.
     65                 * @returns The next ID in the store.
    6666                 */
    6767                uid request_uid();
    6868
    6969                /**
    70                  *Destroys the unique identifier store.
     70                 * Destroys the unique identifier store.
    7171                 */
    7272                ~uid_store();
    7373
    7474                /**
    75                  *Retrieves an object and casts it to the specified type.
     75                 * Retrieves an object and casts it to the specified type.
    7676                 *
    77                  *@tparam T The type to cast to.
    78                  *@param auid The ID the object is stored under.
    79                  *@returns An object of the indicated type that was stored at the indicated ID.
     77                 * @tparam T The type to cast to.
     78                 * @param auid The ID the object is stored under.
     79                 * @returns An object of the indicated type that was stored at the indicated ID.
    8080                 */
    8181                template< typename T >
Note: See TracChangeset for help on using the changeset viewer.