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

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

#include <eVision/Easy/ELine.h>

Inheritance diagram for eVision::ELine:
Collaboration diagram for eVision::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::ELine &other)
 Constructs a ELine object.
 ELine (const eVision::Legacy::ELine &other)
 Constructs a ELine object.
virtual ~ELine () throw ()
eVision::ELine & operator= (const eVision::ELine &other)
 Copies all the data from another ELine object into the current ELine object.
void CopyTo (eVision::ELine &other) const
 Copy the ELine to other.
eVision::EPoint GetCenter () const
 Center of the line.
void SetCenter (const eVision::EPoint &center)
 Center of the line.
void SetCenterX (float centerX)
 Abscissa of the center of the ELine.
float GetCenterX () const
 Abscissa of the center of the ELine.
void SetCenterY (float centerY)
 Ordinate of the center of the ELine.
float GetCenterY () const
 Ordinate of the center of the ELine.
float GetAngle () const
 Orientation of the line.
void SetAngle (float angle)
 Orientation of the line.
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 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.
virtual eVision::EEditionMode GetAvailableEditionModes () const
 Available edition modes for the shape.
virtual std::string GetDescription () const
 Textual description of the shape and its parameters.
 ELine (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)

Static Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Represents a model of a line segment.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ ELine() [1/7]

eVision::ELine::ELine ( )

Constructs a ELine object.

◆ ELine() [2/7]

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

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

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

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

Constructs a ELine object.

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

◆ ELine() [6/7]

eVision::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::ELine::~ELine ( )
throw ( )
virtual

◆ ELine() [7/7]

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

Member Function Documentation

◆ CopyTo()

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

Copy the ELine to other.

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

◆ GetAngle()

float eVision::ELine::GetAngle ( ) const

Orientation of the line.

◆ GetAngleBetweenLines()

float eVision::ELine::GetAngleBetweenLines ( const eVision::ELine & line1,
const eVision::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).

◆ GetAvailableEditionModes()

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

Available edition modes for the shape.

Implements eVision::EShape.

◆ GetCenter()

eVision::EPoint eVision::ELine::GetCenter ( ) const

Center of the line.

◆ GetCenterX()

float eVision::ELine::GetCenterX ( ) const

Abscissa of the center of the ELine.

◆ GetCenterY()

float eVision::ELine::GetCenterY ( ) const

Ordinate of the center of the ELine.

◆ GetDescription()

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

Textual description of the shape and its parameters.

Implements eVision::EShape.

◆ GetDistanceBetweenPointAndLine() [1/2]

float eVision::ELine::GetDistanceBetweenPointAndLine ( const eVision::EPoint & pt,
const eVision::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::ELine::GetDistanceBetweenPointAndLine ( const eVision::EPoint & pt,
const eVision::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::ELine::GetEnd ( ) const

End point coordinates of the ELine object.

◆ GetIntersectionOfLines() [1/2]

int32_t eVision::ELine::GetIntersectionOfLines ( const eVision::ELine & line1,
const eVision::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::ELine::GetIntersectionOfLines ( const eVision::ELine & line1,
const eVision::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::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::ELine::GetOrg ( ) const

Origin point coordinates of the ELine object.

◆ GetPoint()

eVision::EPoint eVision::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::ELine::GetProjectionOfPointOnLine ( const eVision::EPoint & pt,
const eVision::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::ELine::GetProjectionOfPointOnLine ( const eVision::EPoint & pt,
const eVision::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::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::ELine::Load ( eVision::ESerializer * serializer)

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

Parameters
serializerThe serializer.

◆ operator=()

eVision::ELine & eVision::ELine::operator= ( const eVision::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::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::ELine::Save ( eVision::ESerializer * serializer)

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

Parameters
serializerThe serializer.

◆ SetAngle()

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

Orientation of the line.

Parameters
angleNew orientation of the line

◆ SetCenter()

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

Center of the line.

Parameters
centerNew center of the line

◆ SetCenterX()

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

Abscissa of the center of the ELine.

Parameters
centerXX coordinate of the center of the ELine.

◆ SetCenterY()

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

Ordinate of the center of the ELine.

Parameters
centerYY coordinate of the center of the ELine.

◆ SetFromOriginAndEnd()

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

◆ SetLength()

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