Claw  1.7.3
Public Types | Public Member Functions | Public Attributes | List of all members
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_typeself_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_typesize () const
 

Public Attributes

coordinate_2d< value_typeposition
 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 39 of file box_2d.hpp.


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