eVision Python API
Loading...
Searching...
No Matches
eVision.Legacy.EPolygon Class Reference

Represents a polygon. More...

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

Public Member Functions

None __init__ (self)
 Constructs a eVision.Legacy.EPolygon.
None __init__ (self, eVision.Legacy.EPolygon other)
 Constructs a eVision.Legacy.EPolygon.
None __init__ (self, list[eVision._eVision.EPoint] vertices, bool closed)
 Constructs a eVision.Legacy.EPolygon.
None __init__ (self, list[eVision._eVision.EPoint] vertices)
 Constructs a eVision.Legacy.EPolygon.
None CopyTo (self, eVision.Legacy.EPolygon other)
 Copies all the data of the current eVision.Legacy.EPolygon object into another eVision.Legacy.EPolygon object, and returns it.
None AppendVertex (self, eVision.EPoint pt)
 Appends a polygon vertex after the last.
None InsertVertex (self, int index, eVision.EPoint pt)
 Inserts a vertex before the given index.
None RemoveVertex (self, int index)
 Removes vertex at the given index.
None SetVertex (self, int index, eVision.EPoint pt)
 Sets a polygon vertex.
eVision.EPoint GetVertex (self, int index)
 Gets a polygon vertex.
bool IsValid (self)
 Returns true if the polygon is valid.
None Save (self, str file)
 Saves the polygon.
None Save (self, eVision.ESerializer|None serializer)
 Saves the polygon.
None Load (self, str file)
 Loads the polygon.
None Load (self, eVision.ESerializer|None serializer)
 Loads the polygon.
bool IsClosed (self)
 The polygon close attribute.
 IsClosed (self, bool value)
 The polygon close attribute.
int NumVertices (self)
 Returns the number of polygon's vertices.
int NumEdges (self)
 Returns the number of polygon's edges (or sides).
list[eVision._eVision.EPoint] Vertices (self)
 Returns the list of polygon vertices.
float Length (self)
 Returns the length (perimeter) of the polygon.
float Area (self)
 Returns the area of the polygon.
Public Member Functions inherited from eVision.Legacy.EFrame
None __init__ (self)
 Constructs a eVision.Legacy.EFrame object.
None __init__ (self, float centerX, float centerY, float angle, float scale)
 Constructs a eVision.Legacy.EFrame object.
None __init__ (self, float centerX, float centerY, float angle)
 Constructs a eVision.Legacy.EFrame object.
None __init__ (self, float centerX, float centerY)
 Constructs a eVision.Legacy.EFrame object.
None __init__ (self, eVision.EPoint center, float angle, float scale)
 Constructs a eVision.Legacy.EFrame object.
None __init__ (self, eVision.Legacy.EFrame frame)
 Constructs a eVision.Legacy.EFrame object.
eVision.EPoint LocalToGlobal (self, eVision.EPoint local)
 Transforms a geometrical element from local to global coordinates (local to world).
eVision.Legacy.ELine LocalToGlobal (self, eVision.Legacy.ELine local)
 Transforms a geometrical element from local to global coordinates (local to world).
eVision.Legacy.ECircle LocalToGlobal (self, eVision.Legacy.ECircle local)
 Transforms a geometrical element from local to global coordinates (local to world).
eVision.Legacy.EFrame LocalToGlobal (self, eVision.Legacy.EFrame local)
 Transforms a geometrical element from local to global coordinates (local to world).
eVision.EPoint GlobalToLocal (self, eVision.EPoint global_)
 Transforms a geometrical element from global to local coordinates (world to local).
eVision.Legacy.EFrame GlobalToLocal (self, eVision.Legacy.EFrame global_)
 Transforms a geometrical element from global to local coordinates (world to local).
None SetCenterXY (self, float centerX, float centerY)
 Sets the center coordinates of a eVision.Legacy.EFrame object.
eVision.EPoint MidPoint (self, eVision.EPoint Point)
 Returns the middle coordinate between this eVision.Legacy.EFrame object's center and another eVision.Legacy.EFrame object's center.
eVision.EPoint Rotate (self, float angle)
 Returns another eVision.EPoint object containing the coordinates of the rotated center point.
float Square (self)
 Compute the sum of the squared coordinates of the center of a eVision.Legacy.EFrame.
float Modulus (self)
 Compute the euclidean modulus of the center of a eVision.Legacy.EFrame.
float Argument (self)
 Compute the polar argument of the center of eVision.Legacy.EFrame object.
float Dot (self, eVision.EPoint Point)
 Compute the dot product of the centers of two eVision.Legacy.EFrame objects.
float Cross (self, eVision.EPoint Point)
 Compute the cross product of the centers of two eVision.Legacy.EFrame objects.
eVision.EPoint Project (self, eVision.Legacy.ELine shape)
 Compute the orthogonal projection of the center of a eVision.Legacy.EFrame on another shape.
eVision.EPoint Project (self, eVision.Legacy.ECircle shape)
 Compute the orthogonal projection of the center of a eVision.Legacy.EFrame on another shape.
float SquaredDistance (self, eVision.EPoint Point)
 Compute the squared distance between the centers of two eVision.Legacy.EFrame.
eVision.EPoint Move (self, float angle, float distance)
 Return the position by moving the center along angle by distance.
float Distance (self, eVision.EPoint point)
 Returns the distance between the addressed point and the center of eVision.Legacy.EFrame object.
float Distance (self, eVision.Legacy.ELine line, bool segmentOnly)
 Returns the distance between the addressed point and the center of eVision.Legacy.EFrame object.
float Distance (self, eVision.Legacy.ELine line)
 Returns the distance between the addressed point and the center of eVision.Legacy.EFrame object.
float Distance (self, eVision.Legacy.ECircle circle, bool arcOnly)
 Returns the distance between the addressed point and the center of eVision.Legacy.EFrame object.
float Distance (self, eVision.Legacy.ECircle circle)
 Returns the distance between the addressed point and the center of eVision.Legacy.EFrame object.
float Angle (self)
 Orientation of the frame.
 Angle (self, float value)
 Orientation of the frame.
float Scale (self)
 Horizontal sensor resolution, in pixels per unit.
 Scale (self, float value)
 Horizontal sensor resolution, in pixels per unit.
float CenterX (self)
 Abscissa of the origin point of the frame.
float CenterY (self)
 Ordinate of the origin point of the frame.
eVision.EPoint Center (self)
 Center.
 Center (self, eVision.EPoint value)
 Center.
float X (self)
 Abscissa (X coordinate) of the eVision.Legacy.EFrame object.
 X (self, float value)
 Abscissa (X coordinate) of the eVision.Legacy.EFrame object.
float Y (self)
 Ordinate (Y coordinate) of the eVision.Legacy.EFrame object.
 Y (self, float value)
 Ordinate (Y coordinate) of the eVision.Legacy.EFrame object.

Detailed Description

Represents a polygon.

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

Remarks:

License(s): BasicTypes

Constructor & Destructor Documentation

◆ __init__() [1/4]

None eVision.Legacy.EPolygon.__init__ ( self)

Constructs a eVision.Legacy.EPolygon.

◆ __init__() [2/4]

None eVision.Legacy.EPolygon.__init__ ( self,
eVision.Legacy.EPolygon other )

Constructs a eVision.Legacy.EPolygon.

Parameters
otherReference to the eVision.Legacy.EPolygon used for the initialization.

◆ __init__() [3/4]

None eVision.Legacy.EPolygon.__init__ ( self,
list[eVision._eVision.EPoint] vertices,
bool closed )

Constructs a eVision.Legacy.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.

◆ __init__() [4/4]

None eVision.Legacy.EPolygon.__init__ ( self,
list[eVision._eVision.EPoint] vertices )

Constructs a eVision.Legacy.EPolygon.

Parameters
verticesA vector of at least 3 points.

Member Function Documentation

◆ AppendVertex()

None eVision.Legacy.EPolygon.AppendVertex ( self,
eVision.EPoint pt )

Appends a polygon vertex after the last.

Parameters
ptThe point to append.

◆ Area()

float eVision.Legacy.EPolygon.Area ( self)

Returns the area of the polygon.

Reimplemented from eVision.Legacy.EFrame.

◆ CopyTo()

None eVision.Legacy.EPolygon.CopyTo ( self,
eVision.Legacy.EPolygon other )

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

Remarks:

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

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

Reimplemented from eVision.Legacy.EFrame.

◆ GetVertex()

eVision.EPoint eVision.Legacy.EPolygon.GetVertex ( self,
int index )

Gets a polygon vertex.

Parameters
indexThe index of the vertex.

◆ InsertVertex()

None eVision.Legacy.EPolygon.InsertVertex ( self,
int index,
eVision.EPoint pt )

Inserts a vertex before the given index.

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

◆ IsClosed() [1/2]

bool eVision.Legacy.EPolygon.IsClosed ( self)

The polygon close attribute.

◆ IsClosed() [2/2]

eVision.Legacy.EPolygon.IsClosed ( self,
bool value )

The polygon close attribute.

◆ IsValid()

bool eVision.Legacy.EPolygon.IsValid ( self)

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.

◆ Length()

float eVision.Legacy.EPolygon.Length ( self)

Returns the length (perimeter) of the polygon.

◆ Load() [1/2]

None eVision.Legacy.EPolygon.Load ( self,
eVision.ESerializer | None serializer )

Loads the polygon.

Parameters
serializerSerializer. Must be in read mode.

Reimplemented from eVision.Legacy.EFrame.

◆ Load() [2/2]

None eVision.Legacy.EPolygon.Load ( self,
str file )

Loads the polygon.

Parameters
fileFile path.

Reimplemented from eVision.Legacy.EFrame.

◆ NumEdges()

int eVision.Legacy.EPolygon.NumEdges ( self)

Returns the number of polygon's edges (or sides).

Depends on the eVision.Legacy.EPolygon.IsClosed status.

◆ NumVertices()

int eVision.Legacy.EPolygon.NumVertices ( self)

Returns the number of polygon's vertices.

◆ RemoveVertex()

None eVision.Legacy.EPolygon.RemoveVertex ( self,
int index )

Removes vertex at the given index.

Parameters
indexThe index of the vertex to remove.

◆ Save() [1/2]

None eVision.Legacy.EPolygon.Save ( self,
eVision.ESerializer | None serializer )

Saves the polygon.

Parameters
serializerSerializer. Must be in write mode.

Reimplemented from eVision.Legacy.EFrame.

◆ Save() [2/2]

None eVision.Legacy.EPolygon.Save ( self,
str file )

Saves the polygon.

Parameters
fileFile path.

Reimplemented from eVision.Legacy.EFrame.

◆ SetVertex()

None eVision.Legacy.EPolygon.SetVertex ( self,
int index,
eVision.EPoint pt )

Sets a polygon vertex.

Parameters
indexThe index of the vertex.
ptThe vertex position.

◆ Vertices()

list[eVision._eVision.EPoint] eVision.Legacy.EPolygon.Vertices ( self)

Returns the list of polygon vertices.