eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::ERectangle Class Reference

Represents a model of a rectangle. More...

#include <eVision/Easy/ERectangle.h>

Inheritance diagram for eVision::ERectangle:
Collaboration diagram for eVision::ERectangle:

Public Member Functions

 ERectangle ()
 Constructs a ERectangle.
 ERectangle (const eVision::EPoint &center, float sizeX, float sizeY, float angle)
 Constructs a ERectangle.
 ERectangle (const eVision::EPoint &center, float sizeX, float sizeY)
 Constructs a ERectangle.
 ERectangle (const eVision::EPoint &origin, const eVision::EPoint &end)
 Constructs a ERectangle.
 ERectangle (const eVision::EPoint &origin, const eVision::EPoint &middle, const eVision::EPoint &end)
 Constructs a ERectangle.
 ERectangle (const eVision::ERectangle &other)
 Constructs a ERectangle.
 ERectangle (const eVision::ERotatedBoundingBox &other)
 Constructs a ERectangle.
virtual ~ERectangle () throw ()
eVision::ERectangle & operator= (const eVision::ERectangle &other)
 Copies all the data from another ERectangle object into the current ERectangle object.
bool operator== (const eVision::ERectangle &other) const
 Equality operator.
bool operator!= (const eVision::ERectangle &other) const
 Inequality operator.
void CopyTo (eVision::ERectangle &other) const
 Copies all the data from this object to the other object.
eVision::ERectangle LocalToSensor (const eVision::EFrame &frame) const
 Transforms a rectangle from local to sensor coordinates. This method throws an exception if the input frame has an anisotropic scale and if the angle is non-null.
eVision::ERectangle SensorToLocal (const eVision::EFrame &frame) const
 Transforms a rectangle from sensor to local coordinates. This method throws an exception if the input frame has an anisotropic scale and if the angle is non-null.
void SetCenter (const eVision::EPoint &center)
 Center of the ERectangle.
eVision::EPoint GetCenter () const
 Center of the ERectangle.
float GetCenterX () const
 Abscissa of the center of the ERectangle.
void SetCenterX (float centerX)
 Abscissa of the center of the ERectangle.
float GetCenterY () const
 Ordinate of the the center of the ERectangle.
void SetCenterY (float centerY)
 Ordinate of the the center of the ERectangle.
float GetAngle () const
 Orientation of the ERectangle.
void SetAngle (float angle)
 Orientation of the ERectangle.
void SetFromOppositeCorners (const eVision::EPoint &origin, const eVision::EPoint &end)
 Sets the geometric parameters (center coordinates, size, and rotation angle) of an ERectangle object.
void SetFromThreeCorners (const eVision::EPoint &origin, const eVision::EPoint &middle, const eVision::EPoint &end)
 Sets the geometric parameters (center coordinates, size, and rotation angle) of an ERectangle object.
void SetSize (float sizeX, float sizeY)
 Sets the size of a ERectangle object.
float GetSizeX () const
 X size of the ERectangle.
void SetSizeX (float val)
 X size of the ERectangle.
float GetSizeY () const
 Y size of the ERectangle.
void SetSizeY (float val)
 Y size of the ERectangle.
eVision::EPoint GetPoint (float fractionX, float fractionY)
 Returns the coordinates of a particular point, specified by its location in the ERectangle area.
void GetMidEdges (eVision::EPoint &x, eVision::EPoint &XX, eVision::EPoint &y, eVision::EPoint &YY) const
 Retrieves the center coordinates of each edge of a ERectangle object.
void GetCorners (eVision::EPoint &xy, eVision::EPoint &XXy, eVision::EPoint &xYY, eVision::EPoint &XXYY) const
 Retrieves the coordinates of each corner of a ERectangle object.
void GetEdges (eVision::ELine &x, eVision::ELine &XX, eVision::ELine &y, eVision::ELine &YY) const
 Retrieves each edge of a ERectangle object.
bool Contains (eVision::EPoint p) const
 Whether the specified point is inside the rectangle or not.
float ComputeOverlap (const eVision::ERectangle &other) const
 Computes the overlap (intersection / min(area1, area2)) of this and the other ERectangle.
bool IsEqual (const eVision::ERectangle &other) const
 Comparison operator.
virtual eVision::EEditionMode GetAvailableEditionModes () const
 Available edition modes for the shape.
virtual std::string GetDescription () const
 Textual description of the shape and its parameters.
 ERectangle (CppWrapperInternal::InternalConstructor)
Public Member Functions inherited from eVision::EShape
virtual ~EShape () throw ()
void Load (const std::string &path)
 Load the EShape configuration. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Load the EShape configuration. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Save the EShape configuration. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Save the EShape configuration. The given ESerializer must have been created for writing.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY, float panX, float panY, bool drawDiagonals) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY, float panX, float panY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY, float panX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY, bool drawDiagonals) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY, float panX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame) const
 Draws the EShape shape.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX, float zoomY, float panX)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX, float zoomY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX)
 Detects if the cursor is placed over one of the dragging handles.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void SetEditionMode (eVision::EEditionMode modes)
 Current edition mode for the shape. Default: EEditionMode_None.
eVision::EEditionMode GetEditionMode () const
 Current edition mode for the shape. Default: EEditionMode_None.
eVision::EFrame ToFrame (bool useAngle, eVision::EFrameScaling frameScaling) const
 Converts the shape to a frame.
eVision::EFrame ToFrame (bool useAngle, eVision::EFrameScaling frameScaling, const eVision::EFrame &shapeFrame) const
 Converts the shape to a frame.
 EShape (CppWrapperInternal::InternalConstructor)

Additional Inherited Members

Public Attributes inherited from eVision::EShape
CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a model of a rectangle.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ ERectangle() [1/8]

eVision::ERectangle::ERectangle ( )

Constructs a ERectangle.

◆ ERectangle() [2/8]

eVision::ERectangle::ERectangle ( const eVision::EPoint & center,
float sizeX,
float sizeY,
float angle )

Constructs a ERectangle.

Parameters
centerCenter coordinates of the rectangle at its nominal position. The default value is (0,0).
sizeXNominal size X/Y of the rectangle. Both default values are 100.
sizeYNominal size X/Y of the rectangle. Both default values are 100.
angleNominal rotation angle of the rectangle. The default value is 0.

◆ ERectangle() [3/8]

eVision::ERectangle::ERectangle ( const eVision::EPoint & center,
float sizeX,
float sizeY )

Constructs a ERectangle.

Parameters
centerCenter coordinates of the rectangle at its nominal position. The default value is (0,0).
sizeXNominal size X/Y of the rectangle. Both default values are 100.
sizeYNominal size X/Y of the rectangle. Both default values are 100.

◆ ERectangle() [4/8]

eVision::ERectangle::ERectangle ( const eVision::EPoint & origin,
const eVision::EPoint & end )

Constructs a ERectangle.

Parameters
originUpper left point coordinates of the rectangle.
endLower right point coordinates of the rectangle.

◆ ERectangle() [5/8]

eVision::ERectangle::ERectangle ( const eVision::EPoint & origin,
const eVision::EPoint & middle,
const eVision::EPoint & end )

Constructs a ERectangle.

Parameters
originUpper left point coordinates of the rectangle.
middleA third corner point coordinates.
endLower right point coordinates of the rectangle.

◆ ERectangle() [6/8]

eVision::ERectangle::ERectangle ( const eVision::ERectangle & other)

Constructs a ERectangle.

Parameters
otherAnother object to be copied in the new object.

◆ ERectangle() [7/8]

eVision::ERectangle::ERectangle ( const eVision::ERotatedBoundingBox & other)

Constructs a ERectangle.

Parameters
otherAnother object to be copied in the new object.

◆ ~ERectangle()

eVision::ERectangle::~ERectangle ( )
throw ( )
virtual

◆ ERectangle() [8/8]

eVision::ERectangle::ERectangle ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ ComputeOverlap()

float eVision::ERectangle::ComputeOverlap ( const eVision::ERectangle & other) const

Computes the overlap (intersection / min(area1, area2)) of this and the other ERectangle.

Parameters
otherThe other ERectangle to which we compute overlap.

◆ Contains()

bool eVision::ERectangle::Contains ( eVision::EPoint p) const

Whether the specified point is inside the rectangle or not.

Parameters
pA point.

◆ CopyTo()

void eVision::ERectangle::CopyTo ( eVision::ERectangle & other) const

Copies all the data from this object to the other object.

Parameters
otherOther ERectangle object in which to copy the content of this object.

◆ GetAngle()

float eVision::ERectangle::GetAngle ( ) const

Orientation of the ERectangle.

◆ GetAvailableEditionModes()

eVision::EEditionMode eVision::ERectangle::GetAvailableEditionModes ( ) const
virtual

Available edition modes for the shape.

Implements eVision::EShape.

◆ GetCenter()

eVision::EPoint eVision::ERectangle::GetCenter ( ) const

Center of the ERectangle.

◆ GetCenterX()

float eVision::ERectangle::GetCenterX ( ) const

Abscissa of the center of the ERectangle.

◆ GetCenterY()

float eVision::ERectangle::GetCenterY ( ) const

Ordinate of the the center of the ERectangle.

◆ GetCorners()

void eVision::ERectangle::GetCorners ( eVision::EPoint & xy,
eVision::EPoint & XXy,
eVision::EPoint & xYY,
eVision::EPoint & XXYY ) const

Retrieves the coordinates of each corner of a ERectangle object.

Parameters
xyCoordinates of the lower leftmost corner of the ERectangle object.
XXyCoordinates of the lower rightmost corner of the ERectangle object.
xYYCoordinates of the upper leftmost corner of the ERectangle object.
XXYYCoordinates of the upper rightmost corner of the ERectangle object.

◆ GetDescription()

std::string eVision::ERectangle::GetDescription ( ) const
virtual

Textual description of the shape and its parameters.

Implements eVision::EShape.

◆ GetEdges()

void eVision::ERectangle::GetEdges ( eVision::ELine & x,
eVision::ELine & XX,
eVision::ELine & y,
eVision::ELine & YY ) const

Retrieves each edge of a ERectangle object.

Parameters
xLeftmost edge of the ERectangle object.
XXRightmost edge of the ERectangle object.
yLower edge of the ERectangle object.
YYUpper edge of the ERectangle object.

◆ GetMidEdges()

void eVision::ERectangle::GetMidEdges ( eVision::EPoint & x,
eVision::EPoint & XX,
eVision::EPoint & y,
eVision::EPoint & YY ) const

Retrieves the center coordinates of each edge of a ERectangle object.

Parameters
xCenter coordinates of the leftmost edge of the ERectangle object.
XXCenter coordinates of the rightmost edge of the ERectangle object.
yCenter coordinates of the lower edge of the ERectangle object.
YYCenter coordinates of the upper edge of the ERectangle object.

◆ GetPoint()

eVision::EPoint eVision::ERectangle::GetPoint ( float fractionX,
float fractionY )

Returns the coordinates of a particular point, specified by its location in the ERectangle area.

Parameters
fractionXPoint location expressed as a fraction of the ERectangle vertical edges (range -1, +1).
fractionYPoint location expressed as a fraction of the ERectangle horizontal edges (range -1, +1).

◆ GetSizeX()

float eVision::ERectangle::GetSizeX ( ) const

X size of the ERectangle.

◆ GetSizeY()

float eVision::ERectangle::GetSizeY ( ) const

Y size of the ERectangle.

◆ IsEqual()

bool eVision::ERectangle::IsEqual ( const eVision::ERectangle & other) const

Comparison operator.

Parameters
otherOther ERectangle to compare to.

The comparison is only applied on the geometrical parameters of the ERectangle and not its drawing and graphic manipulation or its frame of reference.

◆ LocalToSensor()

eVision::ERectangle eVision::ERectangle::LocalToSensor ( const eVision::EFrame & frame) const

Transforms a rectangle from local to sensor coordinates. This method throws an exception if the input frame has an anisotropic scale and if the angle is non-null.

Parameters
frameReference frame in which the region is defined.

◆ operator!=()

bool eVision::ERectangle::operator!= ( const eVision::ERectangle & other) const

Inequality operator.

Parameters
otherOther ERectangle to compare to.

◆ operator=()

eVision::ERectangle & eVision::ERectangle::operator= ( const eVision::ERectangle & other)

Copies all the data from another ERectangle object into the current ERectangle object.

Parameters
otherERectangle object to be copied

◆ operator==()

bool eVision::ERectangle::operator== ( const eVision::ERectangle & other) const

Equality operator.

Parameters
otherOther ERectangle to compare to.

◆ SensorToLocal()

eVision::ERectangle eVision::ERectangle::SensorToLocal ( const eVision::EFrame & frame) const

Transforms a rectangle from sensor to local coordinates. This method throws an exception if the input frame has an anisotropic scale and if the angle is non-null.

Parameters
frameReference frame in which the region is defined.

◆ SetAngle()

void eVision::ERectangle::SetAngle ( float angle)

Orientation of the ERectangle.

Parameters
angleNew starting orientation of the ERectangle.

◆ SetCenter()

void eVision::ERectangle::SetCenter ( const eVision::EPoint & center)

Center of the ERectangle.

Parameters
centerNew center of the ERectangle.

◆ SetCenterX()

void eVision::ERectangle::SetCenterX ( float centerX)

Abscissa of the center of the ERectangle.

Parameters
centerXX coordinate of the center of the ERectangle.

◆ SetCenterY()

void eVision::ERectangle::SetCenterY ( float centerY)

Ordinate of the the center of the ERectangle.

Parameters
centerYY coordinate of the center of the ERectangle.

◆ SetFromOppositeCorners()

void eVision::ERectangle::SetFromOppositeCorners ( const eVision::EPoint & origin,
const eVision::EPoint & end )

Sets the geometric parameters (center coordinates, size, and rotation angle) of an ERectangle object.

Parameters
originUpper left point coordinates of the rectangle.
endLower right point coordinates of the rectangle.

◆ SetFromThreeCorners()

void eVision::ERectangle::SetFromThreeCorners ( const eVision::EPoint & origin,
const eVision::EPoint & middle,
const eVision::EPoint & end )

Sets the geometric parameters (center coordinates, size, and rotation angle) of an ERectangle object.

Parameters
originUpper left point coordinates of the rectangle.
middleA third corner point coordinates.
endLower right point coordinates of the rectangle.

◆ SetSize()

void eVision::ERectangle::SetSize ( float sizeX,
float sizeY )

Sets the size of a ERectangle object.

Parameters
sizeXNominal size X of the ERectangle object. Default values is 100.
sizeYNominal size Y of the ERectangle object. Default values is 100.

A ERectangle object is fully defined knowing its nominal position (given by the coordinates of its center), its nominal size, its rotation angle and its outline tolerance. By default, the width and height values are 100, which means 100 pixels when the field of view is not calibrated and 100 "units" in case of a calibrated field of view.

◆ SetSizeX()

void eVision::ERectangle::SetSizeX ( float val)

X size of the ERectangle.

◆ SetSizeY()

void eVision::ERectangle::SetSizeY ( float val)

Y size of the ERectangle.