PyANGKernel.GKSectionLane

class GKSectionLane

A lane in a section.

Details

It can be a full lane or a side lane. If it is a side lane it can be an entry or an exit side lane.

An entry side lane have initialOffset equal to 0.0 and finalOffset equal to the length of the side lane.

An exit side lane have initialOffset equal to the length of the side lane (but negative) and finalOffset equal to 0.0.

Example: an entry side lane of 10 m will have: - initialOffset = 0.0 - finalOffset = 10.0 an exit side lane of 10 m will have: - initialOffset = -10.0 - finalOffset = 0.0

Other side lane configurations are possible but not supported (as laterals that starts and ends at position that are not the start and end of the section).

A lane can also have a solid line disabling lane change. A lane specifies solid line information for its right part, that is:

———————— LANE 0 -> - - - - - - - - - - - - Solid lines here are specified at lane 0 LANE 1 -> - - - - - - - - - - - - Solid lines here are specified at lane 1 LANE 2 -> ————————

A lane can have more that one solid line:

————– - - - - - - - - - - - - - - - - - - —————- - - - - - - —————–

In the previous example the lane has three solid lines, at right, at left and at both sides.

Note that a solid line at left and at right in the same position is equivalent to a solid line at both sides.

A lane can also be reserved (using the GKLaneType ) for a particular vehicle class. If so the user can select if the last and/or first segments of the lane are reserved too (In some cases the last segment is not reserved to allow a turn for any vehicle class).

Synopsis

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

class GKSectionLaneFlowDirection

Flow direction: - eNormal: the flow direction is the same as the line/curve direction - eInverse: the flow direction is the inverse of the line/curve direction - eBididectional: both ways direction.

__init__()
addSolidLine(solid)
Parameters:

solidGKSectionLaneSolid

Add a solid line. The object is adopted.

adjust(lanePos, section)
Parameters:

It adjusts geometrically the stop line to the selected section considering the position and length.

canEnterFlow()
Return type:

bool

Returns true if flow can enter in this lane (it do not check if the lane is connected to in a turning but just if it can be connected and, thus, receive flow).

canExitFlow()
Return type:

bool

Returns true if flow can exit from this lane (it do not check if the lane is connected to in a turning but just if it can be connected and, thus, flow can use it to exit the section).

canUse(v)
Parameters:

vGKVehicleClass

Return type:

bool

Return true if this vehicle class can use this section lane.

canUseVehicle(vehicle)
Parameters:

vehicleGKVehicle

Return type:

bool

Returns true if the vehicle can use this section lane.

changeDirection(sectionLength)
Parameters:

sectionLength – float

Changes the lane direction, that is moves the solid lines, speed segments,… to maintain its original position in the lane with a changed direction.

clearSolidLines()

Discard all the solid lines. Objects are deleted.

getFinalOffset()
Return type:

float

For side lanes, returns the final offset of the lane. See GKSectionLane .

getFinalOffsetInSectionCenterLine(section, lanepos)
Parameters:
Return type:

float

Returns the equivalent location in the center line of the section of the final offset of the lane.

getFlowDirection()
Return type:

GKSectionLaneFlowDirection

Return the flow direction. See GKSectionLaneFlowDirection

getInitialOffset()
Return type:

float

For side lanes, returns the initial offset of the lane. See GKSectionLane .

getInitialOffsetInSectionCenterLine(section, lanepos)
Parameters:
Return type:

float

Returns the equivalent location in the center line of the section of the initial offset of the lane.

getLaneType()
Return type:

GKLaneType

Get the lane’s laneType attribute. Returns nullptr if no lane type has been assigned, UnknownCommand GKLaneType .

getReserveFirstSegment(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true is the first segment is reserved too.

getReserveLastSegment(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true is the last segment is reserved too.

getSideLaneLength2D()
Return type:

float

Returns the length of this lane if it is a side lane or 0.0 if it is a main lane.

getSolidLines()
Return type:

.list of GKSectionLaneSolid

Get all the solid lines from this lane.

getStopLine()
Return type:

float

Stop Line distance from the beginning of the section (in meters). * UnknownCommand getStopLine .

getWidth()
Return type:

float

Return the lane width. The value can be 0.0. In this case no width has been set and the * default value from getLaneWidth must be used. * * It is better to access this value through the section method getLaneWidth ( uint lanepos ) * as it will take care of 0.0 values.

isAnEntryLateral()
Return type:

bool

Check if the section lane can be categorized as an entry lateral lane.

isAnExitLateral()
Return type:

bool

Check if the section lane can be categorized as an exit lateral lane.

isFullLane()
Return type:

bool

Return true is this lane goes from the beginning to the end of the section.

isReserved()
Return type:

bool

Returns true if this lane is reserved for any vehicle type.

isReserved(vehicle)
Parameters:

vehicleGKVehicle

Return type:

bool

Returns true if this lane is reserved for the vehicle type.

removeSolidLine(solid)
Parameters:

solidGKSectionLaneSolid

Remove a solid line. The object is removed from the list but not deleted.

setFlowDirection(direction)
Parameters:

directionGKSectionLaneFlowDirection

Sets the flow direction. See GKSectionLaneFlowDirection

setLaneType(laneType)
Parameters:

laneTypeGKLaneType

Set the lane’s laneType attribute, UnknownCommand GKLaneType .

setLength(length)
Parameters:

length – float

Change the length of this lane if it is a side lane.

setOffsets(initialOffset, finalOffset)
Parameters:
  • initialOffset – float

  • finalOffset – float

For side lanes, sets the offsets of the lane. A side lane cannot be shorter than 5 meters. See GKSectionLane .

setReserveFirstSegment(value)
Parameters:

value – bool

Set the reservation status of the first segment.

setReserveLastSegment(value)
Parameters:

value – bool

Set the reservation status of the last segment.

setStopLine(v)
Parameters:

v – float

Stop Line distance from the beginning of the section (in meters) * UnknownCommand getStopLine .

setWidth(w)
Parameters:

w – float

Set the lane width.

unselectAllSolidLines()

Unselect all the selected solid lines.