CVB++ 14.1
RectLT< T, ENABLE > Class Template Referencefinal

Rectangle object. More...

#include <cvb/rect_lt.hpp>

Public Member Functions

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

Examples
ShapeFinder2/QtShapeFinder2, and ShapeFinder2/QtShapeFinder2Cuda.

Constructor & Destructor Documentation

◆ RectLT() [1/3]

RectLT ( )
inlinenoexcept

Default rectangle.

Exceptions
Doesnot throw any exception.

All of the corner points will be at 0.

◆ RectLT() [2/3]

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]

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()

T Bottom ( ) const
inlinenoexcept

Gets bottom of the rectangle.

Returns
The bottom.
Exceptions
Doesnot throw any exception.

◆ Contains()

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()

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()

T Height ( ) const
inlinenoexcept

Gets the height of the rectangle.

Returns
The height.
Exceptions
Doesnot throw any exception.

◆ IsValid()

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()

T Left ( ) const
inlinenoexcept

Gets the leftmost point of the rectangle.

Returns
Leftmost point.
Exceptions
Doesnot throw any exception.

◆ Location()

Point2D< T > Location ( ) const
inlinenoexcept

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

Returns
The location.
Exceptions
Doesnot throw any exception.
Examples
ShapeFinder2/QtShapeFinder2, and ShapeFinder2/QtShapeFinder2Cuda.

◆ operator!=()

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==()

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()

T Right ( ) const
inlinenoexcept

Gets rightmost point of the rectangle.

Returns
int Rightmost point.
Exceptions
Doesnot throw any exception.

◆ SetBottom()

void SetBottom ( T  bottom)
inlinenoexcept

Sets bottom of the rectangle.

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

◆ SetHeight()

void SetHeight ( T  height)
inlinenoexcept

Sets the height of the rectangle.

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

◆ SetLeft()

void SetLeft ( T  left)
inlinenoexcept

Sets leftmost point of the rectangle.

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

◆ SetLocation()

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()

void SetRight ( T  right)
inlinenoexcept

Sets rightmost point of the rectangle.

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

◆ SetSize()

void SetSize ( Size2D< T >  size)
inlinenoexcept

Gets the size of the rectangle.

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

◆ SetTop()

void SetTop ( T  top)
inlinenoexcept

Sets top of the rectangle.

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

◆ SetWidth()

void SetWidth ( T  width)
inlinenoexcept

Sets the width of the rectangle.

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

◆ Size()

Size2D< T > Size ( ) const
inlinenoexcept

Gets the size of the rectangle.

Returns
The size.
Exceptions
Doesnot throw any exception.
Examples
ShapeFinder2/QtShapeFinder2, and ShapeFinder2/QtShapeFinder2Cuda.

◆ Top()

T Top ( ) const
inlinenoexcept

Gets top of the rectangle.

Returns
int The top.
Exceptions
Doesnot throw any exception.

◆ Width()

T Width ( ) const
inlinenoexcept

Gets the width of the rectangle.

Returns
The width.
Exceptions
Doesnot throw any exception.