claw 1.9.0
 
Loading...
Searching...
No Matches
claw::math::box_2d< T > Class Template Reference

A rectangle represented by two points in a 2D space. More...

#include <box_2d.hpp>

Collaboration diagram for claw::math::box_2d< T >:

Public Types

typedef T value_type
 The type of the values we store.
 
typedef coordinate_2d< value_typepoint_type
 The type of the coordinates of the points representing the corners.
 
typedef box_2d< value_typeself_type
 The type of the current class.
 

Public Member Functions

 box_2d (const self_type &that)
 
 box_2d (const rectangle< value_type > &that)
 
 box_2d (const point_type &p1, const point_type &p2)
 
 box_2d (const value_type &x1, const value_type &y1, const value_type &x2, const value_type &y2)
 
void set (const value_type &x1, const value_type &y1, const value_type &x2, const value_type &y2)
 
template<typename U>
box_2d< U > cast_value_type_to () 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
 
bool empty () const
 
value_type top () const
 
value_type bottom () const
 
value_type left () const
 
value_type right () const
 
point_type top_left () const
 
point_type top_right () const
 
point_type bottom_left () const
 
point_type bottom_right () const
 
void top (const value_type &p)
 
void bottom (const value_type &p)
 
void left (const value_type &p)
 
void right (const value_type &p)
 
void top_left (const coordinate_2d< value_type > &p)
 
void top_right (const coordinate_2d< value_type > &p)
 
void bottom_left (const coordinate_2d< value_type > &p)
 
void bottom_right (const coordinate_2d< value_type > &p)
 
void shift_x (const value_type &d)
 
void shift_y (const value_type &d)
 
value_type width () const
 
value_type height () const
 
coordinate_2d< value_typesize () const
 
bool operator== (const self_type &vect) const
 
bool operator!= (const self_type &vect) const
 
self_type operator+ (const point_type &vect) const
 
self_type operator- (const point_type &vect) const
 
self_typeoperator+= (const point_type &vect)
 
self_typeoperator-= (const point_type &vect)
 

Public Attributes

point_type first_point
 The first of the two points, representing one corner.
 
point_type second_point
 The second of the two points, representing an other corner.
 

Detailed Description

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

A rectangle represented by two points in a 2D space.

Author
Julien Jorge

Definition at line 47 of file box_2d.hpp.

Member Typedef Documentation

◆ point_type

template<class T>
typedef coordinate_2d<value_type> claw::math::box_2d< T >::point_type

The type of the coordinates of the points representing the corners.

Definition at line 55 of file box_2d.hpp.

◆ self_type

template<class T>
typedef box_2d<value_type> claw::math::box_2d< T >::self_type

The type of the current class.

Definition at line 58 of file box_2d.hpp.

◆ value_type

template<class T>
typedef T claw::math::box_2d< T >::value_type

The type of the values we store.

Definition at line 51 of file box_2d.hpp.

Member Data Documentation

◆ first_point

template<class T>
point_type claw::math::box_2d< T >::first_point

The first of the two points, representing one corner.

Definition at line 121 of file box_2d.hpp.

◆ second_point

template<class T>
point_type claw::math::box_2d< T >::second_point

The second of the two points, representing an other corner.

Definition at line 124 of file box_2d.hpp.


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