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

Represents a polygon. The number of vertices is arbitrary. A EPolygon could be closed (last and first point connected) or open (like a polyline shape). More...

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

Inheritance diagram for eVision::Legacy::EPolygon:
Collaboration diagram for eVision::Legacy::EPolygon:

Public Member Functions

 EPolygon ()
 Constructs a EPolygon.
 EPolygon (const eVision::Legacy::EPolygon &other)
 Constructs a EPolygon.
 EPolygon (const std::vector< eVision::EPoint > &vertices, bool closed)
 Constructs a EPolygon.
 EPolygon (const std::vector< eVision::EPoint > &vertices)
 Constructs a EPolygon.
virtual ~EPolygon () throw ()
eVision::Legacy::EPolygon & operator= (const eVision::Legacy::EPolygon &other)
 Copies all the data from another EPolygon object into the current EPolygon object.
bool operator== (const eVision::Legacy::EPolygon &polygon) const
 Compares the current EPolygon with another EPolygon object.
bool operator!= (const eVision::Legacy::EPolygon &polygon) const
 Compares the current EPolygon with another EPolygon object.
void CopyTo (eVision::Legacy::EPolygon &other) const
 Copies all the data of the current EPolygon object into another EPolygon object, and returns it.
eVision::Legacy::EPolygon * CopyTo (eVision::Legacy::EPolygon *other) const
 Copies all the data of the current EPolygon object into another EPolygon object, and returns it.
void AppendVertex (const eVision::EPoint &pt)
 Appends a polygon vertex after the last.
void InsertVertex (int index, const eVision::EPoint &pt)
 Inserts a vertex before the given index.
void RemoveVertex (int index)
 Removes vertex at the given index.
void SetVertex (int index, const eVision::EPoint &pt)
 Sets a polygon vertex.
eVision::EPoint GetVertex (int index) const
 Gets a polygon vertex.
void SetIsClosed (bool state)
 The polygon close attribute.
bool GetIsClosed () const
 The polygon close attribute.
int GetNumVertices () const
 Returns the number of polygon's vertices.
int GetNumEdges () const
 Returns the number of polygon's edges (or sides). Depends on the EPolygon::SetIsClosed status.
std::vector< eVision::EPoint > GetVertices () const
 Returns the list of polygon vertices.
bool IsValid () const
 Returns true if the polygon is valid. A valid polygon has at least 2 (when open) or 3 (when closed) distinct and valid vertices and no duplicate points.
float GetLength () const
 Returns the length (perimeter) of the polygon.
float GetArea () const
 Returns the area of the polygon.
void Save (const std::string &file)
 Saves the polygon.
void Save (eVision::ESerializer *serializer)
 Saves the polygon.
void Load (const std::string &file)
 Loads the polygon.
void Load (eVision::ESerializer *serializer)
 Loads the polygon.
 EPolygon (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 polygon. The number of vertices is arbitrary. A EPolygon could be closed (last and first point connected) or open (like a polyline shape).

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EPolygon() [1/5]

eVision::Legacy::EPolygon::EPolygon ( )

Constructs a EPolygon.

◆ EPolygon() [2/5]

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

Constructs a EPolygon.

Parameters
otherReference to the EPolygon used for the initialization.

◆ EPolygon() [3/5]

eVision::Legacy::EPolygon::EPolygon ( const std::vector< eVision::EPoint > & vertices,
bool closed )

Constructs a EPolygon.

Parameters
verticesA vector of at least 3 points.
closedAn optional parameter to set the closed properties. When closed, an edge exists between the last and first points of the polygon. By default, created polygons are closed.

◆ EPolygon() [4/5]

eVision::Legacy::EPolygon::EPolygon ( const std::vector< eVision::EPoint > & vertices)

Constructs a EPolygon.

Parameters
verticesA vector of at least 3 points.

◆ ~EPolygon()

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

◆ EPolygon() [5/5]

eVision::Legacy::EPolygon::EPolygon ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ AppendVertex()

void eVision::Legacy::EPolygon::AppendVertex ( const eVision::EPoint & pt)

Appends a polygon vertex after the last.

Parameters
ptThe point to append.

◆ CopyTo() [1/2]

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

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

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

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

◆ CopyTo() [2/2]

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

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

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

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

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

◆ GetArea()

float eVision::Legacy::EPolygon::GetArea ( ) const

Returns the area of the polygon.

◆ GetIsClosed()

bool eVision::Legacy::EPolygon::GetIsClosed ( ) const

The polygon close attribute.

◆ GetLength()

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

Returns the length (perimeter) of the polygon.

◆ GetNumEdges()

int eVision::Legacy::EPolygon::GetNumEdges ( ) const

Returns the number of polygon's edges (or sides). Depends on the EPolygon::SetIsClosed status.

◆ GetNumVertices()

int eVision::Legacy::EPolygon::GetNumVertices ( ) const

Returns the number of polygon's vertices.

◆ GetVertex()

eVision::EPoint eVision::Legacy::EPolygon::GetVertex ( int index) const

Gets a polygon vertex.

Parameters
indexThe index of the vertex.

◆ GetVertices()

std::vector< eVision::EPoint > eVision::Legacy::EPolygon::GetVertices ( ) const

Returns the list of polygon vertices.

◆ InsertVertex()

void eVision::Legacy::EPolygon::InsertVertex ( int index,
const eVision::EPoint & pt )

Inserts a vertex before the given index.

Parameters
indexThe index after which the vertex will be inserted.
ptThe point to insert.

◆ IsValid()

bool eVision::Legacy::EPolygon::IsValid ( ) const

Returns true if the polygon is valid. A valid polygon has at least 2 (when open) or 3 (when closed) distinct and valid vertices and no duplicate points.

◆ Load() [1/2]

void eVision::Legacy::EPolygon::Load ( const std::string & file)

Loads the polygon.

Parameters
fileFile path.

◆ Load() [2/2]

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

Loads the polygon.

Parameters
serializerSerializer. Must be in read mode.

◆ operator!=()

bool eVision::Legacy::EPolygon::operator!= ( const eVision::Legacy::EPolygon & polygon) const

Compares the current EPolygon with another EPolygon object.

Parameters
polygonThe other EPolygon object.

◆ operator=()

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

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

Parameters
otherEPolygon object to be copied

◆ operator==()

bool eVision::Legacy::EPolygon::operator== ( const eVision::Legacy::EPolygon & polygon) const

Compares the current EPolygon with another EPolygon object.

Parameters
polygonThe other EPolygon object.

◆ RemoveVertex()

void eVision::Legacy::EPolygon::RemoveVertex ( int index)

Removes vertex at the given index.

Parameters
indexThe index of the vertex to remove.

◆ Save() [1/2]

void eVision::Legacy::EPolygon::Save ( const std::string & file)

Saves the polygon.

Parameters
fileFile path.

◆ Save() [2/2]

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

Saves the polygon.

Parameters
serializerSerializer. Must be in write mode.

◆ SetIsClosed()

void eVision::Legacy::EPolygon::SetIsClosed ( bool state)

The polygon close attribute.

Parameters
stateUse true to close the polygon.

◆ SetVertex()

void eVision::Legacy::EPolygon::SetVertex ( int index,
const eVision::EPoint & pt )

Sets a polygon vertex.

Parameters
indexThe index of the vertex.
ptThe vertex position.