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¶
def
__init__()def
addSolidLine()def
adjust()def
canEnterFlow()def
canExitFlow()def
canUse()def
canUseVehicle()def
getFinalOffset()def
getLaneType()def
getSolidLines()def
getStopLine()def
getWidth()def
isFullLane()def
isReserved()def
setLaneType()def
setLength()def
setOffsets()def
setStopLine()def
setWidth()
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:
solid –
GKSectionLaneSolid
Add a solid line. The object is adopted.
It adjusts geometrically the stop line to the selected section considering the position and length.
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).
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:
v –
GKVehicleClass- Return type:
Return true if this vehicle class can use this section lane.
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.
For side lanes, returns the final offset of the lane. See
GKSectionLane.- getFinalOffsetInSectionCenterLine(section, lanepos)¶
Returns the equivalent location in the center line of the section of the final offset of the lane.
- getFlowDirection()¶
- Return type:
Return the flow direction. See
GKSectionLaneFlowDirectionFor side lanes, returns the initial offset of the lane. See
GKSectionLane.- getInitialOffsetInSectionCenterLine(section, lanepos)¶
Returns the equivalent location in the center line of the section of the initial offset of the lane.
- getLaneType()¶
- Return type:
Get the lane’s laneType attribute. Returns nullptr if no lane type has been assigned, UnknownCommand
GKLaneType.Returns true is the first segment is reserved too.
Returns true is the last segment is reserved too.
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.
Stop Line distance from the beginning of the section (in meters). * UnknownCommand
getStopLine.Return the lane width. The value can be 0.0. In this case no width has been set and the * default value from
getLaneWidthmust be used. * * It is better to access this value through the section methodgetLaneWidth( uint lanepos ) * as it will take care of 0.0 values.Check if the section lane can be categorized as an entry lateral lane.
Check if the section lane can be categorized as an exit lateral lane.
Return true is this lane goes from the beginning to the end of the section.
Returns true if this lane is reserved for any vehicle type.
Returns true if this lane is reserved for the vehicle type.
- removeSolidLine(solid)¶
- Parameters:
solid –
GKSectionLaneSolid
Remove a solid line. The object is removed from the list but not deleted.
- setFlowDirection(direction)¶
- Parameters:
direction –
GKSectionLaneFlowDirection
Sets the flow direction. See
GKSectionLaneFlowDirection- setLaneType(laneType)¶
- Parameters:
laneType –
GKLaneType
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.