Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Attributes
jafar::geom::Rectangle< _T_ > Class Template Reference

This class is used to represent a rectangle on an image. More...


Detailed Description

template<typename _T_>
class jafar::geom::Rectangle< _T_ >

This class is used to represent a rectangle on an image.

Definition at line 14 of file Rectangle.hpp.

#include <Rectangle.hpp>

List of all members.

Public Types

typedef
boost::numeric::ublas::bounded_vector
< _T_, 2 > 
vec2

Public Member Functions

 Rectangle (const _T_ x, const _T_ y, const _T_ width, const _T_ height)
 Rectangle (const typename Rectangle::vec2 &topLeft, const typename Rectangle::vec2 &bottomRight)
_T_ left () const
 Return the left coordinate of the rectangle.
void setLeft (_T_ v)
 Set the left coordinate of the rectangle, width can be changed.
void moveLeft (_T_ v)
 Set the left coordinate of the rectangle, but don't touch the width.
_T_ top () const
 Return the top coordinate of the rectangle.
void setTop (_T_ v)
 Set the top coordinate of the rectangle, height can be changed.
void moveTop (_T_ v)
 Set the top coordinate of the rectangle, but don't touch the height.
_T_ right () const
 Return the right coordinate of the rectangle.
void setRight (_T_ v)
 Set the right coordinate of the rectangle, width can be changed.
void moveRight (_T_ v)
 Set the right coordinate of the rectangle, but don't touch the width.
_T_ bottom () const
 Return the bottom coordinate of the rectangle.
void setBottom (_T_ v)
 Set the bottom coordinate of the rectangle, height can be changed.
void moveBottom (_T_ v)
 Set the bottom coordinate of the rectangle, but don't touch the height.
bool contains (_T_ x, _T_ y) const
bool contains (typename Rectangle::vec2 v) const
bool strictlyContains (typename Rectangle::vec2 v) const
void extend (const typename Rectangle::vec2 &v)
 Extend the rectangle, in such a way that the rectangle contains the point.
void extend (const _T_ u, const _T_ v)
void addCoord (_T_ x1, _T_ y1, _T_ x2, _T_ y2)
 Add the coordinates to the respective coordinates of the corner of the point.

Private Attributes

vec2 m_topLeft
vec2 m_bottomRight

Member Function Documentation

template<typename _T_ >
bool jafar::geom::Rectangle< _T_ >::contains ( _T_  x,
_T_  y 
) const [inline]
Returns:
true if the vector v is inside the rectangle or on the edge

Definition at line 55 of file Rectangle.hpp.

References jafar::geom::Rectangle< _T_ >::bottom(), jafar::geom::Rectangle< _T_ >::left(), jafar::geom::Rectangle< _T_ >::right(), and jafar::geom::Rectangle< _T_ >::top().

template<typename _T_ >
bool jafar::geom::Rectangle< _T_ >::contains ( typename Rectangle< _T_ >::vec2  v) const [inline]
Returns:
true if the vector v is inside the rectangle or on the edge

Definition at line 61 of file Rectangle.hpp.

References jafar::geom::Rectangle< _T_ >::bottom(), jafar::geom::Rectangle< _T_ >::left(), jafar::geom::Rectangle< _T_ >::right(), and jafar::geom::Rectangle< _T_ >::top().

template<typename _T_ >
bool jafar::geom::Rectangle< _T_ >::strictlyContains ( typename Rectangle< _T_ >::vec2  v) const [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:37 for Jafar by doxygen 1.7.6.1
LAAS-CNRS