claw::math::rectangle< T > Class Template Reference

A class representing a rectangle by his x,y coordinates, width and height. More...

`#include <rectangle.hpp>`

## Public Types

typedef T | value_type
| The type of the values we store.
typedef rectangle< value_type > | self_type
| The type of the current class.

## Public Member Functions

template<typename U>
| rectangle (const rectangle< U > &that)
template<typename U>
| rectangle (const box_2d< U > &that)
| rectangle (const value_type &_x, const value_type &_y, const value_type &_width, const value_type &_height)
template<typename U>
| rectangle (const coordinate_2d< U > &pos, const value_type &_width, const value_type &_height)
template<typename U>
| rectangle (const coordinate_2d< U > &pos, const coordinate_2d< U > &size)
template<typename U>
rectangle< U > | cast_value_type_to () const
bool | operator== (const self_type &that) const
bool | operator!= (const self_type &that) const
value_type | area () const
bool | includes (const coordinate_2d< value_type > &p) const
bool | includes (const self_type &r) const
bool | intersects (const self_type &r) const
self_type | intersection (const self_type &r) const
self_type | join (const self_type &r) const
void | set (const value_type &new_x, const value_type &new_y, const value_type &new_width, const value_type &new_height)
value_type | left () const
value_type | right () const
value_type | bottom () const
value_type | top () const
coordinate_2d< value_type > | size () const

## Public Attributes

coordinate_2d< value_type > | position
| value_typeop left coordinates.
value_type | width
| Width.
value_type | height
| Height.

## Detailed Description

template<class T>
class claw::math::rectangle< T >

A class representing a rectangle by his x,y coordinates, width and height.

This class considers that the y-axis increases from the top to the bottom (like a screen).

Author
  Julien Jorge

Definition at line 51 of file rectangle.hpp.

## Member Typedef Documentation

## self_type

template<class T>

typedef rectangle<value_type> claw::math::rectangle< T >::self_type

The type of the current class.

Definition at line 58 of file rectangle.hpp.

## value_type

template<class T>

typedef T claw::math::rectangle< T >::value_type

The type of the values we store.

Definition at line 55 of file rectangle.hpp.

## Member Data Documentation

## height

template<class T>

value_type claw::math::rectangle< T >::height

Height.

Definition at line 114 of file rectangle.hpp.

Referenced by claw::graphic::image::fill(), claw::graphic::image::merge(), and claw::graphic::image::partial_copy().

## position

template<class T>

coordinate_2d<value_type> claw::math::rectangle< T >::position

value_typeop left coordinates.

Definition at line 108 of file rectangle.hpp.

Referenced by claw::graphic::image::fill(), claw::graphic::image::merge(), and claw::graphic::image::partial_copy().

## width

template<class T>

value_type claw::math::rectangle< T >::width

Width.

Definition at line 111 of file rectangle.hpp.

Referenced by claw::graphic::image::fill(), claw::graphic::image::merge(), and claw::graphic::image::partial_copy().

The documentation for this class was generated from the following files:

- box_2d.hpp
- rectangle.hpp