Public Member Functions | Private Attributes
Box2D< T > Class Template Reference

Represents a box given by the upper-left and lower-right corner. More...

#include <Box2D.h>

List of all members.

Public Member Functions

area ()
 area covered by the box
 Box2D (T minX=0, T minY=0, T maxX=0, T maxY=0)
 Creates a box given by top-left (minX,minY) and lower-right (maxX,maxY) coordinates.
Point2D centerPoint ()
void clip (Box2D< T > clipArea)
 Clip the box to fit into clipArea.
bool contains (T x, T y)
void enclose (Point2D point)
 expand the box so that it contains the given point
void enclose (T x, T y)
template<class OtherT >
void enclose (Box2D< OtherT > box)
void expand (T size)
 enlarge the box by 'size' units in all directions
height () const
maxX () const
maxY () const
minX () const
minY () const
Box2D< T > & operator*= (T div)
Box2D< T > & operator/= (T div)
void setMaxX (T value)
void setMaxY (T value)
void setMinX (T value)
void setMinY (T value)
void shrink (T size)
 shrink the box by 'size' units in all directions
std::vector< Point2D > vertices ()
width () const
 ~Box2D ()
 The destructor.

Private Attributes

m_MaxX
m_MaxY
m_MinX
m_MinY

Detailed Description

template<class T = float>
class Box2D< T >

Represents a box given by the upper-left and lower-right corner.

Author:
David Gossow (RX)

Definition at line 23 of file Box2D.h.


Constructor & Destructor Documentation

template<class T >
Box2D< T >::Box2D ( minX = 0,
minY = 0,
maxX = 0,
maxY = 0 
)

Creates a box given by top-left (minX,minY) and lower-right (maxX,maxY) coordinates.

Definition at line 92 of file Box2D.h.

template<class T = float>
Box2D< T >::~Box2D ( ) [inline]

The destructor.

Definition at line 32 of file Box2D.h.


Member Function Documentation

template<class T >
T Box2D< T >::area ( )

area covered by the box

Definition at line 134 of file Box2D.h.

template<class T = float>
Point2D Box2D< T >::centerPoint ( ) [inline]

Definition at line 68 of file Box2D.h.

template<class T >
void Box2D< T >::clip ( Box2D< T >  clipArea)

Clip the box to fit into clipArea.

Definition at line 101 of file Box2D.h.

template<class T >
bool Box2D< T >::contains ( x,
y 
)
Returns:
true if the given point is inside the box

Definition at line 110 of file Box2D.h.

template<class T >
void Box2D< T >::enclose ( Point2D  point)

expand the box so that it contains the given point

Definition at line 145 of file Box2D.h.

template<class T >
void Box2D< T >::enclose ( x,
y 
)

Definition at line 154 of file Box2D.h.

template<class T >
template<class OtherT >
void Box2D< T >::enclose ( Box2D< OtherT >  box)

Definition at line 164 of file Box2D.h.

template<class T >
void Box2D< T >::expand ( size)

enlarge the box by 'size' units in all directions

Definition at line 116 of file Box2D.h.

template<class T = float>
T Box2D< T >::height ( ) const [inline]

Definition at line 45 of file Box2D.h.

template<class T = float>
T Box2D< T >::maxX ( ) const [inline]

Definition at line 40 of file Box2D.h.

template<class T = float>
T Box2D< T >::maxY ( ) const [inline]

Definition at line 42 of file Box2D.h.

template<class T = float>
T Box2D< T >::minX ( ) const [inline]

Definition at line 39 of file Box2D.h.

template<class T = float>
T Box2D< T >::minY ( ) const [inline]

Definition at line 41 of file Box2D.h.

template<class T = float>
Box2D<T>& Box2D< T >::operator*= ( div) [inline]

Definition at line 80 of file Box2D.h.

template<class T = float>
Box2D<T>& Box2D< T >::operator/= ( div) [inline]

Definition at line 79 of file Box2D.h.

template<class T = float>
void Box2D< T >::setMaxX ( value) [inline]

Definition at line 35 of file Box2D.h.

template<class T = float>
void Box2D< T >::setMaxY ( value) [inline]

Definition at line 37 of file Box2D.h.

template<class T = float>
void Box2D< T >::setMinX ( value) [inline]

Definition at line 34 of file Box2D.h.

template<class T = float>
void Box2D< T >::setMinY ( value) [inline]

Definition at line 36 of file Box2D.h.

template<class T >
void Box2D< T >::shrink ( size)

shrink the box by 'size' units in all directions

Definition at line 125 of file Box2D.h.

template<class T >
std::vector< Point2D > Box2D< T >::vertices ( )

Definition at line 172 of file Box2D.h.

template<class T = float>
T Box2D< T >::width ( ) const [inline]

Definition at line 44 of file Box2D.h.


Member Data Documentation

template<class T = float>
T Box2D< T >::m_MaxX [private]

Definition at line 85 of file Box2D.h.

template<class T = float>
T Box2D< T >::m_MaxY [private]

Definition at line 87 of file Box2D.h.

template<class T = float>
T Box2D< T >::m_MinX [private]

Definition at line 84 of file Box2D.h.

template<class T = float>
T Box2D< T >::m_MinY [private]

Definition at line 86 of file Box2D.h.


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


robbie_architecture
Author(s): Viktor Seib
autogenerated on Mon Oct 6 2014 02:53:09