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

Represents a model of a rectangle. More...

#include <eVision/Easy/Legacy/ERectangle.h>

Inheritance diagram for eVision::Legacy::ERectangle:
Collaboration diagram for eVision::Legacy::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::Legacy::ERectangle &other)
 Constructs a ERectangle.
virtual ~ERectangle () throw ()
eVision::Legacy::ERectangle & operator= (const eVision::Legacy::ERectangle &other)
 Copies all the data from another ERectangle object into the current ERectangle object.
void CopyTo (eVision::Legacy::ERectangle &other) const
 Copies all the data of the current ERectangle object into another ERectangle object, and returns it.
eVision::Legacy::ERectangle * CopyTo (eVision::Legacy::ERectangle *other) const
 Copies all the data of the current ERectangle object into another ERectangle object, and returns it.
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 SetFromTwoPoints (const eVision::EPoint &origin, const eVision::EPoint &end)
 Sets the geometric parameters (center coordinates, size, and rotation angle) of an ERectangle object.
void SetFromOriginMiddleEnd (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.
float GetSizeY () const
 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::Legacy::ELine &x, eVision::Legacy::ELine &XX, eVision::Legacy::ELine &y, eVision::Legacy::ELine &YY)
 Retrieves each edge of a ERectangle object.
 ERectangle (CppWrapperInternal::InternalConstructor)
Public Member Functions inherited from eVision::Legacy::EFrame
 EFrame ()
 Constructs a EFrame object.
 EFrame (float centerX, float centerY, float angle, float scale)
 Constructs a EFrame object.
 EFrame (float centerX, float centerY, float angle)
 Constructs a EFrame object.
 EFrame (float centerX, float centerY)
 Constructs a EFrame object.
 EFrame (const eVision::EPoint &center, float angle, float scale)
 Constructs a EFrame object.
 EFrame (const eVision::Legacy::EFrame &frame)
 Constructs a EFrame object.
virtual ~EFrame () throw ()
eVision::Legacy::EFrame & operator= (const eVision::Legacy::EFrame &frame)
 Copies all the data from another EFrame object into the current EFrame object.
eVision::EPoint operator+ (const eVision::EPoint &point) const
 Returns the addition of the point to the center of the EFrame.
eVision::EPoint operator- (const eVision::EPoint &point) const
 Returns the substraction of the center of the EFrame with the given point.
eVision::EPoint operator* (float scalar) const
 Returns the multiplication of the center of the EFrame with the given multiplier.
eVision::EPoint operator/ (float scalar) const
 Returns the division of the center of the EFrame with the given divisor.
bool operator== (const eVision::Legacy::EFrame &frame) const
 Compares the current EFrame center coordinates with the center coordinates of another EFrame object.
bool operator!= (const eVision::Legacy::EFrame &frame) const
 Compares the current EFrame center coordinates with the center coordinates of another EFrame object.
void CopyTo (eVision::Legacy::EFrame &other) const
 Copies all the data from the current EFrame object into another EFrame object, and returns it.
eVision::Legacy::EFrame * CopyTo (eVision::Legacy::EFrame *other) const
 Copies all the data from the current EFrame object into another EFrame object, and returns it.
void SetAngle (float angle)
 Orientation of the frame.
void SetScale (float scale)
 Horizontal sensor resolution, in pixels per unit.
float GetCenterX () const
 Abscissa of the origin point of the frame.
float GetCenterY () const
 Ordinate of the origin point of the frame.
float GetAngle () const
 Orientation of the frame.
float GetScale () const
 Horizontal sensor resolution, in pixels per unit.
eVision::EPoint LocalToGlobal (const eVision::EPoint &local) const
 Transforms a geometrical element from local to global coordinates (local to world).
eVision::Legacy::EFrame LocalToGlobal (const eVision::Legacy::EFrame &local) const
 Transforms a geometrical element from local to global coordinates (local to world).
eVision::Legacy::ELine LocalToGlobal (const eVision::Legacy::ELine &local) const
 Transforms a geometrical element from local to global coordinates (local to world).
eVision::Legacy::ECircle LocalToGlobal (const eVision::Legacy::ECircle &local) const
 Transforms a geometrical element from local to global coordinates (local to world).
eVision::EPoint GlobalToLocal (const eVision::EPoint &global) const
 Transforms a geometrical element from global to local coordinates (world to local).
eVision::Legacy::EFrame GlobalToLocal (const eVision::Legacy::EFrame &global) const
 Transforms a geometrical element from global to local coordinates (world to local).
void Load (const std::string &path)
 Load the EFrame configuration. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Load the EFrame configuration. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Save the EFrame configuration. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Save the EFrame configuration. The given ESerializer must have been created for writing.
virtual void SetCenter (const eVision::EPoint &center)
 Center coordinates of a EFrame object.
virtual eVision::EPoint GetCenter () const
 Center.
void SetCenterXY (float centerX, float centerY)
 Sets the center coordinates of a EFrame object.
float GetX () const
 Abscissa (X coordinate) of the EFrame object.
void SetX (float value)
 Abscissa (X coordinate) of the EFrame object.
float GetY () const
 Ordinate (Y coordinate) of the EFrame object.
void SetY (float value)
 Ordinate (Y coordinate) of the EFrame object.
eVision::EPoint MidPoint (const eVision::EPoint &Point) const
 Returns the middle coordinate between this EFrame object's center and another EFrame object's center.
eVision::EPoint Rotate (float angle) const
 Returns another EPoint object containing the coordinates of the rotated center point.
float Square () const
 Compute the sum of the squared coordinates of the center of a EFrame.
float Modulus () const
 Compute the euclidean modulus of the center of a EFrame.
float Argument () const
 Compute the polar argument of the center of EFrame object.
float Dot (const eVision::EPoint &Point) const
 Compute the dot product of the centers of two EFrame objects.
float Cross (const eVision::EPoint &Point) const
 Compute the cross product of the centers of two EFrame objects.
float Area (const eVision::EPoint &Point) const
 Compute the oriented area of the parallelogram built on the centers of two EFrame.
eVision::EPoint Project (const eVision::Legacy::ELine &shape) const
 Compute the orthogonal projection of the center of a EFrame on another shape.
eVision::EPoint Project (const eVision::Legacy::ECircle &shape) const
 Compute the orthogonal projection of the center of a EFrame on another shape.
float SquaredDistance (const eVision::EPoint &Point) const
 Compute the squared distance between the centers of two EFrame.
eVision::EPoint Move (float angle, float distance) const
 Return the position by moving the center along angle by distance.
virtual float Distance (const eVision::EPoint &point) const
 Returns the distance between the addressed point and the center of EFrame object.
virtual float Distance (const eVision::Legacy::ELine &line, bool segmentOnly) const
 Returns the distance between the addressed point and the center of EFrame object.
virtual float Distance (const eVision::Legacy::ELine &line) const
 Returns the distance between the addressed point and the center of EFrame object.
virtual float Distance (const eVision::Legacy::ECircle &circle, bool arcOnly) const
 Returns the distance between the addressed point and the center of EFrame object.
virtual float Distance (const eVision::Legacy::ECircle &circle) const
 Returns the distance between the addressed point and the center of EFrame object.
 EFrame (CppWrapperInternal::InternalConstructor)

Additional Inherited Members

Public Attributes inherited from eVision::Legacy::EFrame
CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a model of a rectangle.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ ERectangle() [1/7]

eVision::Legacy::ERectangle::ERectangle ( )

Constructs a ERectangle.

◆ ERectangle() [2/7]

eVision::Legacy::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/7]

eVision::Legacy::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/7]

eVision::Legacy::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/7]

eVision::Legacy::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/7]

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

Constructs a ERectangle.

Parameters
otherAnother ERectangle object to be copied in the new ERectangle object.

◆ ~ERectangle()

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

◆ ERectangle() [7/7]

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

Member Function Documentation

◆ CopyTo() [1/2]

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

Copies all the data of the current ERectangle object into another ERectangle object, and returns it.

Parameters
otherPointer to the ERectangle object in which the current ERectangle object data have to be copied.

In the overload taking a pointer, in case of a NULL pointer, a new ERectangle object will be created and returned.

◆ CopyTo() [2/2]

eVision::Legacy::ERectangle * eVision::Legacy::ERectangle::CopyTo ( eVision::Legacy::ERectangle * other) const

Copies all the data of the current ERectangle object into another ERectangle object, and returns it.

Parameters
otherPointer to the ERectangle object in which the current ERectangle object data have to be copied.

In the overload taking a pointer, in case of a NULL pointer, a new ERectangle object will be created and returned.

Deprecated
Deprecated in version 25.10. Scheduled to be removed in version 27.6.

◆ GetCorners()

void eVision::Legacy::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.

◆ GetEdges()

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

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::Legacy::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::Legacy::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::Legacy::ERectangle::GetSizeX ( ) const

X size of the ERectangle.

◆ GetSizeY()

float eVision::Legacy::ERectangle::GetSizeY ( ) const

Y size of the ERectangle.

◆ operator=()

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

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

Parameters
otherERectangle object to be copied

◆ SetFromOppositeCorners()

void eVision::Legacy::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.

◆ SetFromOriginMiddleEnd()

void eVision::Legacy::ERectangle::SetFromOriginMiddleEnd ( 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.
Deprecated

Use ERectangle::SetFromThreeCorners instead.

Deprecated in version 25.10. Scheduled to be removed in version 27.6.

◆ SetFromThreeCorners()

void eVision::Legacy::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.

◆ SetFromTwoPoints()

void eVision::Legacy::ERectangle::SetFromTwoPoints ( 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.
Deprecated

Use ERectangle::SetFromOppositeCorners instead.

Deprecated in version 25.10. Scheduled to be removed in version 27.6.

◆ SetSize()

void eVision::Legacy::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.