CVB++ 15.1
Loading...
Searching...
No Matches
RectLT< T, ENABLE > Class Template Referencefinal

Rectangle object. More...

#include <cvb/rect_lt.hpp>

Public Member Functions

 RectLT () noexcept
 Default rectangle.
 
 RectLT (T left, T top, T right, T bottom) noexcept
 Constructor for a rectangle.
 
 RectLT (Point2D< T > location, Size2D< T > size) noexcept
 Constructor for a rectangle.
 
T Left () const noexcept
 Gets the leftmost point of the rectangle.
 
void SetLeft (T left) noexcept
 Sets leftmost point of the rectangle.
 
T Top () const noexcept
 Gets top of the rectangle.
 
void SetTop (T top) noexcept
 Sets top of the rectangle.
 
T Right () const noexcept
 Gets rightmost point of the rectangle.
 
void SetRight (T right) noexcept
 Sets rightmost point of the rectangle.
 
T Bottom () const noexcept
 Gets bottom of the rectangle.
 
void SetBottom (T bottom) noexcept
 Sets bottom of the rectangle.
 
T Width () const noexcept
 Gets the width of the rectangle.
 
void SetWidth (T width) noexcept
 Sets the width of the rectangle.
 
T Height () const noexcept
 Gets the height of the rectangle.
 
void SetHeight (T height) noexcept
 Sets the height of the rectangle.
 
Size2D< T > Size () const noexcept
 Gets the size of the rectangle.
 
void SetSize (Size2D< T > size) noexcept
 Gets the size of the rectangle.
 
Point2D< T > Location () const noexcept
 Gets the location of the top left corner of the rectangle.
 
void SetLocation (Point2D< T > location) noexcept
 Sets the location of the top left corner of the rectangle.
 
bool IsValid () const noexcept
 Checks if the rectangle is valid.
 
bool Contains (Point2D< T > point) const noexcept
 Checks if this rectangle contains a point.
 
CoordinateSystemType CoordinateSystem () const noexcept
 Indicates the coordinate system in which this object is being measured (when used as an area of interest).
 
bool operator== (const RectLT< T > &rect) const noexcept
 Compares to another rectangle.
 
bool operator!= (const RectLT< T > &rect) const noexcept
 Compares to another rectangle.
 
template<class C>
 operator RectLT< C > () const noexcept
 Enable casting.
 

Detailed Description

template<class T, class ENABLE = void>
class Cvb::RectLT< T, ENABLE >

Rectangle object.

In contrast to the Rect class this class uses left top of each pixel as anchor point. Therefore right and bottom are not included (i.e. Width = Right - Left and Height = Bottom - Top).

Constructor & Destructor Documentation

◆ RectLT() [1/3]

template<class T, class ENABLE = void>
RectLT ( )
inlinenoexcept

Default rectangle.

Exceptions
Doesnot throw any exception.

All of the corner points will be at 0.

◆ RectLT() [2/3]

template<class T, class ENABLE = void>
RectLT ( T left,
T top,
T right,
T bottom )
inlinenoexcept

Constructor for a rectangle.

Parameters
[in]leftLeftmost point of the rectangle.
[in]topTopmost point of the rectangle.
[in]rightRightmost point of the rectangle.
[in]bottomBottom point of the rectangle.
Exceptions
Doesnot throw any exception.

◆ RectLT() [3/3]

template<class T, class ENABLE = void>
RectLT ( Point2D< T > location,
Size2D< T > size )
inlinenoexcept

Constructor for a rectangle.

Parameters
[in]locationLocation of the rectangle.
[in]sizeSize of the rectangle.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ Bottom()

template<class T, class ENABLE = void>
T Bottom ( ) const
inlinenoexcept

Gets bottom of the rectangle.

Returns
The bottom.
Exceptions
Doesnot throw any exception.

◆ Contains()

template<class T, class ENABLE = void>
bool Contains ( Point2D< T > point) const
inlinenoexcept

Checks if this rectangle contains a point.

Parameters
[in]pointPoint to check.
Returns
True if the point is inside this rect, false otherwise.
Exceptions
Doesnot throw any exception.

◆ CoordinateSystem()

template<class T, class ENABLE = void>
CoordinateSystemType CoordinateSystem ( ) const
inlinenoexcept

Indicates the coordinate system in which this object is being measured (when used as an area of interest).

Returns
The coordinate system type.
Exceptions
Doesnot throw any exception.

◆ Height()

template<class T, class ENABLE = void>
T Height ( ) const
inlinenoexcept

Gets the height of the rectangle.

Returns
The height.
Exceptions
Doesnot throw any exception.

◆ IsValid()

template<class T, class ENABLE = void>
bool IsValid ( ) const
inlinenoexcept

Checks if the rectangle is valid.

Returns
True if width and height are positive, false otherwise.
Exceptions
Doesnot throw any exception.

◆ Left()

template<class T, class ENABLE = void>
T Left ( ) const
inlinenoexcept

Gets the leftmost point of the rectangle.

Returns
Leftmost point.
Exceptions
Doesnot throw any exception.

◆ Location()

template<class T, class ENABLE = void>
Point2D< T > Location ( ) const
inlinenoexcept

Gets the location of the top left corner of the rectangle.

Returns
The location.
Exceptions
Doesnot throw any exception.

◆ operator!=()

template<class T, class ENABLE = void>
bool operator!= ( const RectLT< T > & rect) const
inlinenoexcept

Compares to another rectangle.

Parameters
[in]rectOther rectangle.
Returns
True if not equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator==()

template<class T, class ENABLE = void>
bool operator== ( const RectLT< T > & rect) const
inlinenoexcept

Compares to another rectangle.

Parameters
[in]rectOther rectangle.
Returns
True if equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ Right()

template<class T, class ENABLE = void>
T Right ( ) const
inlinenoexcept

Gets rightmost point of the rectangle.

Returns
int Rightmost point.
Exceptions
Doesnot throw any exception.

◆ SetBottom()

template<class T, class ENABLE = void>
void SetBottom ( T bottom)
inlinenoexcept

Sets bottom of the rectangle.

Parameters
[in]bottomThe bottom.
Exceptions
Doesnot throw any exception.

◆ SetHeight()

template<class T, class ENABLE = void>
void SetHeight ( T height)
inlinenoexcept

Sets the height of the rectangle.

Parameters
[in]heightThe height.
Exceptions
Doesnot throw any exception.

◆ SetLeft()

template<class T, class ENABLE = void>
void SetLeft ( T left)
inlinenoexcept

Sets leftmost point of the rectangle.

Parameters
[in]leftLeftmost point.
Exceptions
Doesnot throw any exception.

◆ SetLocation()

template<class T, class ENABLE = void>
void SetLocation ( Point2D< T > location)
inlinenoexcept

Sets the location of the top left corner of the rectangle.

Parameters
[in]locationThe location.
Exceptions
Doesnot throw any exception.

◆ SetRight()

template<class T, class ENABLE = void>
void SetRight ( T right)
inlinenoexcept

Sets rightmost point of the rectangle.

Parameters
[in]rightRightmost point.
Exceptions
Doesnot throw any exception.

◆ SetSize()

template<class T, class ENABLE = void>
void SetSize ( Size2D< T > size)
inlinenoexcept

Gets the size of the rectangle.

Parameters
[in]sizeThe size.
Exceptions
Doesnot throw any exception.

◆ SetTop()

template<class T, class ENABLE = void>
void SetTop ( T top)
inlinenoexcept

Sets top of the rectangle.

Parameters
[in]topThe top.
Exceptions
Doesnot throw any exception.

◆ SetWidth()

template<class T, class ENABLE = void>
void SetWidth ( T width)
inlinenoexcept

Sets the width of the rectangle.

Parameters
[in]widthThe width.
Exceptions
Doesnot throw any exception.

◆ Size()

template<class T, class ENABLE = void>
Size2D< T > Size ( ) const
inlinenoexcept

Gets the size of the rectangle.

Returns
The size.
Exceptions
Doesnot throw any exception.

◆ Top()

template<class T, class ENABLE = void>
T Top ( ) const
inlinenoexcept

Gets top of the rectangle.

Returns
int The top.
Exceptions
Doesnot throw any exception.

◆ Width()

template<class T, class ENABLE = void>
T Width ( ) const
inlinenoexcept

Gets the width of the rectangle.

Returns
The width.
Exceptions
Doesnot throw any exception.