Nebula
Loading...
Searching...
No Matches
Math::rectangle< TYPE > Class Template Reference

#include <rectangle.h>

Detailed Description

template<class TYPE>
class Math::rectangle< TYPE >

A 2d rectangle class.

Public Member Functions

 rectangle ()
 default constructor
 rectangle (TYPE l, TYPE t, TYPE r, TYPE b)
 constructor 1
void set (TYPE l, TYPE t, TYPE r, TYPE b)
 set content
bool inside (TYPE x, TYPE y) const
 return true if point is inside
TYPE width () const
 return width
TYPE height () const
 return height
TYPE centerX () const
 return center x
TYPE centerY () const
 return center y

Public Attributes

TYPE left
TYPE top
TYPE right
TYPE bottom

Constructor & Destructor Documentation

◆ rectangle() [1/2]

template<class TYPE>
Math::rectangle< TYPE >::rectangle ( )

default constructor

◆ rectangle() [2/2]

template<class TYPE>
Math::rectangle< TYPE >::rectangle ( TYPE l,
TYPE t,
TYPE r,
TYPE b )

constructor 1

Member Function Documentation

◆ centerX()

template<class TYPE>
TYPE Math::rectangle< TYPE >::centerX ( ) const

return center x

◆ centerY()

template<class TYPE>
TYPE Math::rectangle< TYPE >::centerY ( ) const

return center y

◆ height()

template<class TYPE>
TYPE Math::rectangle< TYPE >::height ( ) const

return height

◆ inside()

template<class TYPE>
bool Math::rectangle< TYPE >::inside ( TYPE x,
TYPE y ) const

return true if point is inside

◆ set()

template<class TYPE>
void Math::rectangle< TYPE >::set ( TYPE l,
TYPE t,
TYPE r,
TYPE b )

set content

◆ width()

template<class TYPE>
TYPE Math::rectangle< TYPE >::width ( ) const

return width

Member Data Documentation

◆ bottom

template<class TYPE>
TYPE Math::rectangle< TYPE >::bottom

◆ left

template<class TYPE>
TYPE Math::rectangle< TYPE >::left

◆ right

template<class TYPE>
TYPE Math::rectangle< TYPE >::right

◆ top

template<class TYPE>
TYPE Math::rectangle< TYPE >::top

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