Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor::Rectangle Class Reference

#include <Rectangle.hpp>

Inheritance diagram for castor::Rectangle:
Inheritance graph
[legend]
Collaboration diagram for castor::Rectangle:
Collaboration graph
[legend]

Public Member Functions

CU_API Rectangle (Position const &origin=Position(), Size const &size=Size())
 Constructor.
 
CU_API Rectangle (int32_t left, int32_t top, int32_t right, int32_t bottom)
 Constructor.
 
CU_API Intersection intersects (Position const &point) const
 Test if the givent point is onto or into this rectangle.
 
CU_API Intersection intersects (Rectangle const &rect) const
 Test if the givent rectangle intersects this rectangle.
 
CU_API void set (int32_t left, int32_t top, int32_t right, int32_t bottom)
 sets the rectangle values
 
CU_API void size (Size &result) const
 Retrieves the rectangle size.
 
int left () const
 Retrieves the left coordinate.
 
int & left ()
 Retrieves the left coordinate.
 
int right () const
 Retrieves the right coordinate.
 
int & right ()
 Retrieves the right coordinate.
 
int top () const
 Retrieves the top coordinate.
 
int & top ()
 Retrieves the top coordinate.
 
int bottom () const
 Retrieves the bottom coordinate.
 
int & bottom ()
 Retrieves the bottom coordinate.
 
int getWidth () const
 Retrieves the width.
 
int getHeight () const
 Retrieves the height.
 

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

CU_API castor::Rectangle::Rectangle ( Position const & origin = Position(),
Size const & size = Size() )

Constructor.

Parameters
[in]originPosition
[in]sizeSize

◆ Rectangle() [2/2]

CU_API castor::Rectangle::Rectangle ( int32_t left,
int32_t top,
int32_t right,
int32_t bottom )

Constructor.

Parameters
[in]left,topTop left point
[in]right,bottomRight bottom point

Member Function Documentation

◆ bottom() [1/2]

int & castor::Rectangle::bottom ( )
inline

Retrieves the bottom coordinate.

Returns
The rectangle's bottom coordinate

References castor::RectangleData::Mbr::bottom, castor::DataHolderT< RectangleData >::getData(), and castor::RectangleData::rect.

Here is the call graph for this function:

◆ bottom() [2/2]

int castor::Rectangle::bottom ( ) const
inline

Retrieves the bottom coordinate.

Returns
The rectangle's bottom coordinate

References castor::RectangleData::Mbr::bottom, castor::DataHolderT< RectangleData >::getData(), and castor::RectangleData::rect.

Here is the call graph for this function:

◆ getHeight()

int castor::Rectangle::getHeight ( ) const
inline

Retrieves the height.

Returns
The rectangle's height

References castor::RectangleData::Mbr::bottom, castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::rect, and castor::RectangleData::Mbr::top.

Here is the call graph for this function:

◆ getWidth()

int castor::Rectangle::getWidth ( ) const
inline

Retrieves the width.

Returns
The rectangle's width

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::Mbr::left, castor::RectangleData::rect, and castor::RectangleData::Mbr::right.

Here is the call graph for this function:

◆ intersects() [1/2]

CU_API Intersection castor::Rectangle::intersects ( Position const & point) const

Test if the givent point is onto or into this rectangle.

Parameters
[in]pointThe point to test
Returns
Intersection::eIn if onto or into, Intersection::eOut if not

◆ intersects() [2/2]

CU_API Intersection castor::Rectangle::intersects ( Rectangle const & rect) const

Test if the givent rectangle intersects this rectangle.

Parameters
[in]rectThe rectangle to test
Returns
The intersection type between the 2 rectangles

◆ left() [1/2]

int & castor::Rectangle::left ( )
inline

Retrieves the left coordinate.

Returns
The rectangle's left coordinate

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::Mbr::left, and castor::RectangleData::rect.

Here is the call graph for this function:

◆ left() [2/2]

int castor::Rectangle::left ( ) const
inline

Retrieves the left coordinate.

Returns
The rectangle's left coordinate

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::Mbr::left, and castor::RectangleData::rect.

Here is the call graph for this function:

◆ right() [1/2]

int & castor::Rectangle::right ( )
inline

Retrieves the right coordinate.

Returns
The rectangle's right coordinate

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::rect, and castor::RectangleData::Mbr::right.

Here is the call graph for this function:

◆ right() [2/2]

int castor::Rectangle::right ( ) const
inline

Retrieves the right coordinate.

Returns
The rectangle's right coordinate

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::rect, and castor::RectangleData::Mbr::right.

Here is the call graph for this function:

◆ set()

CU_API void castor::Rectangle::set ( int32_t left,
int32_t top,
int32_t right,
int32_t bottom )

sets the rectangle values

Parameters
[in]left,topTop left point
[in]right,bottomRight bottom point

◆ size()

CU_API void castor::Rectangle::size ( Size & result) const

Retrieves the rectangle size.

Parameters
[out]resultThe rectangle size

◆ top() [1/2]

int & castor::Rectangle::top ( )
inline

Retrieves the top coordinate.

Returns
The rectangle's top coordinate

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::rect, and castor::RectangleData::Mbr::top.

Here is the call graph for this function:

◆ top() [2/2]

int castor::Rectangle::top ( ) const
inline

Retrieves the top coordinate.

Returns
The rectangle's top coordinate

References castor::DataHolderT< RectangleData >::getData(), castor::RectangleData::rect, and castor::RectangleData::Mbr::top.

Here is the call graph for this function:

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