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

Rectangle object. More...

#include <cvb/rect.hpp>

Public Member Functions

 Rect () noexcept
 Default rectangle in the integral type system.
 
 Rect (T left, T top, T right, T bottom) noexcept
 Constructor for a rectangle.
 
 Rect (Point2D< T > location, Size2D< T > size) noexcept
 Constructor for a rectangle.
 
T Left () const noexcept
 Gets first column of the rectangle.
 
void SetLeft (T left) noexcept
 Sets first column of the rectangle.
 
T Top () const noexcept
 Gets first row of the rectangle.
 
void SetTop (T top) noexcept
 Sets first row of the rectangle.
 
T Right () const noexcept
 Gets rightmost column of the rectangle (still inside the rectangle).
 
void SetRight (T right) noexcept
 Sets rightmost column of the rectangle (still inside the rectangle).
 
T Bottom () const noexcept
 Gets bottom row of the rectangle (still inside the rectangle).
 
void SetBottom (T bottom) noexcept
 Sets bottom row of the rectangle (still inside 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 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 Rect< T > &rect) const noexcept
 Compares to another rectangle.
 
bool operator!= (const Rect< T > &rect) const noexcept
 Compares to another rectangle.
 

Detailed Description

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

Rectangle object.

Common Vision Blox always uses rectangles (or rectangular shaped areas of interest represented by integer parameters left, top, right and bottom) in such a way, that right and bottom are still part of the area to be investigated (i.e. Width = Right - Left + 1 and Height = Bottom - Top + 1).

Constructor & Destructor Documentation

◆ Rect() [1/3]

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

Default rectangle in the integral type system.

Exceptions
Doesnot throw any exception.

The top-left corner will be at (0, 0) and the other corner point will be at (-1, -1).

◆ Rect() [2/3]

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

Constructor for a rectangle.

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

◆ Rect() [3/3]

template<class T, class ENABLE = void>
Rect ( 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 row of the rectangle (still inside the rectangle).

Returns
The last row.
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.

◆ Left()

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

Gets first column of the rectangle.

Returns
First column.
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 Rect< 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 Rect< 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 column of the rectangle (still inside the rectangle).

Returns
int Rightmost column.
Exceptions
Doesnot throw any exception.

◆ SetBottom()

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

Sets bottom row of the rectangle (still inside the rectangle).

Parameters
[in]bottomThe last row.
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 first column of the rectangle.

Parameters
[in]leftFirst column.
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 column of the rectangle (still inside the rectangle).

Parameters
[in]rightRightmost column.
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 first row of the rectangle.

Parameters
[in]topFirst row.
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 first row of the rectangle.

Returns
int First row.
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.