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

Represents a model of a line segment. More...

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

Inheritance diagram for eVision::Legacy::ELine:
Collaboration diagram for eVision::Legacy::ELine:

Public Member Functions

 ELine ()
 Constructs a ELine object.
 ELine (const eVision::EPoint &center, float length, float angle)
 Constructs a ELine object.
 ELine (const eVision::EPoint &center, float length)
 Constructs a ELine object.
 ELine (const eVision::EPoint &origin, const eVision::EPoint &end)
 Constructs a ELine object.
 ELine (const eVision::Legacy::ELine &other)
 Constructs a ELine object.
virtual ~ELine () throw ()
eVision::Legacy::ELine & operator= (const eVision::Legacy::ELine &other)
 Copies all the data from another ELine object into the current ELine object.
void CopyTo (eVision::Legacy::ELine &other) const
 Copies all the data of the current ELine object into another ELine object and returns it.
eVision::Legacy::ELine * CopyTo (eVision::Legacy::ELine *other) const
 Copies all the data of the current ELine object into another ELine object and returns it.
void SetFromOriginAndEnd (const eVision::EPoint &origin, const eVision::EPoint &end)
 Sets the geometric parameters (center coordinates, length, and rotation angle) of a ELine object.
void SetFromTwoPoints (const eVision::EPoint &origin, const eVision::EPoint &end)
 Sets the geometric parameters (center coordinates, length, and rotation angle) of a ELine object.
void SetLength (float length)
 Length of the ELine object.
float GetLength () const
 Length of the ELine object.
eVision::EPoint GetOrg () const
 Origin point coordinates of the ELine object.
eVision::EPoint GetEnd () const
 End point coordinates of the ELine object.
eVision::EPoint GetPoint (float fraction) const
 Returns the coordinates of a point along the line.
void Load (const std::string &path)
 Load the ELine configuration. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Load the ELine configuration. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Save the ELine configuration. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Save the ELine configuration. The given ESerializer must have been created for writing.
 ELine (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)

Static Public Member Functions

static float GetAngleBetweenLines (const eVision::Legacy::ELine &line1, const eVision::Legacy::ELine &line2)
 Computes the angle between two lines.
static float GetDistanceBetweenPointAndLine (const eVision::EPoint &pt, const eVision::Legacy::ELine &line, bool limited)
 Computes the distance between a point and a line.
static float GetDistanceBetweenPointAndLine (const eVision::EPoint &pt, const eVision::Legacy::ELine &line)
 Computes the distance between a point and a line.
static eVision::EPoint GetProjectionOfPointOnLine (const eVision::EPoint &pt, const eVision::Legacy::ELine &line, bool limited)
 Computes the projection of a point on a line.
static eVision::EPoint GetProjectionOfPointOnLine (const eVision::EPoint &pt, const eVision::Legacy::ELine &line)
 Computes the projection of a point on a line.
static int32_t GetIntersectionOfLines (const eVision::Legacy::ELine &line1, const eVision::Legacy::ELine &line2, eVision::EPoint &intersection, bool limited)
 Computes the intersection between two lines.
static int32_t GetIntersectionOfLines (const eVision::Legacy::ELine &line1, const eVision::Legacy::ELine &line2, eVision::EPoint &intersection)
 Computes the intersection between two lines.

Additional Inherited Members

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

Detailed Description

Represents a model of a line segment.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ ELine() [1/6]

eVision::Legacy::ELine::ELine ( )

Constructs a ELine object.

◆ ELine() [2/6]

eVision::Legacy::ELine::ELine ( const eVision::EPoint & center,
float length,
float angle )

Constructs a ELine object.

Parameters
centerCenter coordinates of the line at its nominal position. The default value is (0,0).
lengthNominal length of the line. The default value is 100.
angleNominal rotation angle of the line. The default value is 0.

◆ ELine() [3/6]

eVision::Legacy::ELine::ELine ( const eVision::EPoint & center,
float length )

Constructs a ELine object.

Parameters
centerCenter coordinates of the line at its nominal position. The default value is (0,0).
lengthNominal length of the line. The default value is 100.

◆ ELine() [4/6]

eVision::Legacy::ELine::ELine ( const eVision::EPoint & origin,
const eVision::EPoint & end )

Constructs a ELine object.

Parameters
originOrigin point coordinates of the line.
endEnd point coordinates of the line.

◆ ELine() [5/6]

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

Constructs a ELine object.

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

◆ ~ELine()

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

◆ ELine() [6/6]

eVision::Legacy::ELine::ELine ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ CopyTo() [1/2]

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

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

Parameters
otherELine object in which the current ELine object data have to be copied.

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

◆ CopyTo() [2/2]

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

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

Parameters
otherELine object in which the current ELine object data have to be copied.

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

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

◆ GetAngleBetweenLines()

float eVision::Legacy::ELine::GetAngleBetweenLines ( const eVision::Legacy::ELine & line1,
const eVision::Legacy::ELine & line2 )
static

Computes the angle between two lines.

Parameters
line1First line
line2Second line

The angle returned by this function is signed in the trigonometric sense, meaning that angle(1,2) = -angle(2,1).

◆ GetDistanceBetweenPointAndLine() [1/2]

float eVision::Legacy::ELine::GetDistanceBetweenPointAndLine ( const eVision::EPoint & pt,
const eVision::Legacy::ELine & line )
static

Computes the distance between a point and a line.

Parameters
ptThe point.
lineThe line.

When the line is restricted to a segment and the orthogonal projection of the point onto the line falls outside this segment, the distance to the closest endpoint of the segment is returned instead.

◆ GetDistanceBetweenPointAndLine() [2/2]

float eVision::Legacy::ELine::GetDistanceBetweenPointAndLine ( const eVision::EPoint & pt,
const eVision::Legacy::ELine & line,
bool limited )
static

Computes the distance between a point and a line.

Parameters
ptThe point.
lineThe line.
limitedIndicates if the line parameter should be considered as an infinite line or as a segment.

When the line is restricted to a segment and the orthogonal projection of the point onto the line falls outside this segment, the distance to the closest endpoint of the segment is returned instead.

◆ GetEnd()

eVision::EPoint eVision::Legacy::ELine::GetEnd ( ) const

End point coordinates of the ELine object.

◆ GetIntersectionOfLines() [1/2]

int32_t eVision::Legacy::ELine::GetIntersectionOfLines ( const eVision::Legacy::ELine & line1,
const eVision::Legacy::ELine & line2,
eVision::EPoint & intersection )
static

Computes the intersection between two lines.

Parameters
line1First line.
line2Second line.
intersectionFound intersection.

The function returns the number of intersections found. It will return -1 if the two lines are overlapping.

◆ GetIntersectionOfLines() [2/2]

int32_t eVision::Legacy::ELine::GetIntersectionOfLines ( const eVision::Legacy::ELine & line1,
const eVision::Legacy::ELine & line2,
eVision::EPoint & intersection,
bool limited )
static

Computes the intersection between two lines.

Parameters
line1First line.
line2Second line.
intersectionFound intersection.
limitedIndicates if the line parameters should be considered as infinite lines or as a segments.

The function returns the number of intersections found. It will return -1 if the two lines are overlapping.

◆ GetLength()

float eVision::Legacy::ELine::GetLength ( ) const

Length of the ELine object.

By default, the length of the line is 100, which means 100 pixels when the field of view is not calibrated, and 100 physical units in case of a calibrated field of view.

◆ GetOrg()

eVision::EPoint eVision::Legacy::ELine::GetOrg ( ) const

Origin point coordinates of the ELine object.

◆ GetPoint()

eVision::EPoint eVision::Legacy::ELine::GetPoint ( float fraction) const

Returns the coordinates of a point along the line.

Parameters
fractionPoint location expressed as a fraction of the line length (range [-1, +1]).

◆ GetProjectionOfPointOnLine() [1/2]

eVision::EPoint eVision::Legacy::ELine::GetProjectionOfPointOnLine ( const eVision::EPoint & pt,
const eVision::Legacy::ELine & line )
static

Computes the projection of a point on a line.

Parameters
ptThe point.
lineThe line.

When the line is restricted to a segment and the orthogonal projection of the point onto the line falls outside this segment, the closest endpoint of the segment is returned instead.

◆ GetProjectionOfPointOnLine() [2/2]

eVision::EPoint eVision::Legacy::ELine::GetProjectionOfPointOnLine ( const eVision::EPoint & pt,
const eVision::Legacy::ELine & line,
bool limited )
static

Computes the projection of a point on a line.

Parameters
ptThe point.
lineThe line.
limitedIndicates if the line parameter should be considered as an infinite line or as a segment.

When the line is restricted to a segment and the orthogonal projection of the point onto the line falls outside this segment, the closest endpoint of the segment is returned instead.

◆ Load() [1/2]

void eVision::Legacy::ELine::Load ( const std::string & path)

Load the ELine configuration. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Load() [2/2]

void eVision::Legacy::ELine::Load ( eVision::ESerializer * serializer)

Load the ELine configuration. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ operator=()

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

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

Parameters
otherELine object to be copied

◆ Save() [1/2]

void eVision::Legacy::ELine::Save ( const std::string & path)

Save the ELine configuration. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ Save() [2/2]

void eVision::Legacy::ELine::Save ( eVision::ESerializer * serializer)

Save the ELine configuration. The given ESerializer must have been created for writing.

Parameters
serializerThe serializer.

◆ SetFromOriginAndEnd()

void eVision::Legacy::ELine::SetFromOriginAndEnd ( const eVision::EPoint & origin,
const eVision::EPoint & end )

Sets the geometric parameters (center coordinates, length, and rotation angle) of a ELine object.

Parameters
originOrigin point coordinates of the line.
endEnd point coordinates of the line.

◆ SetFromTwoPoints()

void eVision::Legacy::ELine::SetFromTwoPoints ( const eVision::EPoint & origin,
const eVision::EPoint & end )

Sets the geometric parameters (center coordinates, length, and rotation angle) of a ELine object.

Parameters
originOrigin point coordinates of the line.
endEnd point coordinates of the line.
Deprecated

Use ELine::SetFromOriginAndEnd.

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

◆ SetLength()

void eVision::Legacy::ELine::SetLength ( float length)

Length of the ELine object.

By default, the length of the line is 100, which means 100 pixels when the field of view is not calibrated, and 100 physical units in case of a calibrated field of view.