PyANGKernel.GKPolyline

class GKPolyline

Inheritance diagram of PyANGKernel.GKPolyline

Inherited by: GKPolygon, GKSuperNode, GKSimulationArea, GKProblemNet, GKPolygonWithHoles, GKPTZone, GKPTStation, GKGroup, GKExtrudedPolygon, GKCrosswalkArea, GKCentroid, GKImage3D, GKExtrudedPolyline, GKBezierCurve, GKTurning, GKSuperNodeTrajectory, GKSection, GKObjectConnection, GKCenConnection

Synopsis

Methods

Virtual methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

Array of points defining a polyline.

PyANGKernel.GKPolyline.gcMinimumLength
PyANGKernel.GKPolyline.gkDefaultPolylineColor
__init__()
__init__(l)
Parameters:

lGKPoints

__init__(rhs)
Parameters:

rhsGKPolyline

add(ps)
Parameters:

psGKPoints

Add points at the end of this polyline

addPoint(p)
Parameters:

pGKPoint

Adds a point to the polyline

addPointAt(pos, p)
Parameters:

Adds a point to the polyline at the desired position

canBeJoined(pol)
Parameters:

polGKPolyline

Return type:

bool

Return true if “this” and “pol” can be joined in a single object. In this case if both are polylines.

canPointBeAdded(pos)
Parameters:

pos – int

Return type:

bool

Can a new point at position “pos” be added?

changeDirection()

Changes the direction of this polyline, that is: changes the order of the points so the first one becomes the last one and so on.

getNbSelPoints()
Return type:

int

Gets the number of the selected points

getPenColor()
Return type:

QColor

Gets the pen color to draw the polyline

getPenSize()
Return type:

float

Gets the size of the pen

getPenSizeUnits()
Return type:

SizeUnits

Gets the pen size units

getPenStyle()
Return type:

PenStyle

Gets the pen style to draw the polyline

getPoint(at)
Parameters:

at – int

Return type:

GKPoint

Gets the GKPoint of the polyline at the desired position

getPoints()
Return type:

GKPoints

Get the points that define the polyline in a vector of GKPoint

getSlope(segmentPos)
Parameters:

segmentPos – int

Return type:

float

It returns the slope for the segment ‘segmentPos’ that is, between point at ‘segmentPos’ and point at ‘segmentPos+1’

getSlope(pointPos1, pointPos2)
Parameters:
  • pointPos1 – int

  • pointPos2 – int

Return type:

float

It returns the slope for the segment definet by ‘pointPos1’ and ‘pointPos2’. Warning: Position must exist or crash.

hasSlope()
Return type:

bool

It returns true if at least two point are at a different height. It returns false if all the points are at the same height.

isPointAtRightArea(p)
Parameters:

pGKPoint

Return type:

bool

Returns true if point p is located at the right side of this polyline (right going from the first point to the last one) and false if p is located at the left side

isPointSelected(p)
Parameters:

p – int

Return type:

bool

Returns true if the desired point is selected. Return false if the desired point is not selected

join(pol, atStart)
Parameters:

Add “pol” information to this polyline either at the beginning (atStart = true) or at the end (atStart = false). Note that pol will not be moified and/or removed.

length2D()
Return type:

float

Returns the length of the polyline in 2D

length2DToPoint(pointIndex)
Parameters:

pointIndex – int

Return type:

float

Returns the length of the polyline in 2D from the first point to the given index point in the polyline

length3D()
Return type:

float

Returns the length of the polyline in 3D

length3DToPoint(pointIndex)
Parameters:

pointIndex – int

Return type:

float

Returns the length of the polyline in 3D from the first point to the given index point in the polyline

nbPoints()
Return type:

int

Gets the number of points in the polyline

prepend(ps)
Parameters:

psGKPoints

Add points at the beginning of this polyline

push_back(p)
Parameters:

pGKPoint

STL like interface for adding points to the back.

removePoint(pos)
Parameters:

pos – int

Removes the desired point in the polyline

removePoints(nbPoints, atStart)
Parameters:
  • nbPoints – int

  • atStart – bool

Removes nbPoints from this polyline either at the beginning (atStart = true) or at the end (atStart = false).

selectAllPoints()

Selects all the points contained in the polyline

setPenColor(color)
Parameters:

colorQColor

Sets the pen color to draw the polyline

setPenSize(size)
Parameters:

size – float

Sets the size of the pen

setPenSizeUnits(units)
Parameters:

unitsSizeUnits

Sets the pen size units

setPenStyle(astyle)
Parameters:

astylePenStyle

Sets the pen style to draw the polyline

setPoint(at, p)
Parameters:

Sets the values of a point in a desired position

setPointSelected(p, value)
Parameters:
  • p – int

  • value – bool

Changes the selection status of a desired point

setPoints(ps)
Parameters:

psGKPoints

Constructs the polyline using the given GKPoints as the new definition points

unselectAllPoints()

Unselects all the points contained in the polyline