PyANGKernel.GKNode¶
- class GKNode¶
A node is a turn collection.
Details
A node is a point or an area in the network where vehicles change their direction and/or disperse. Hence, a node has one or more origin sections and one or more destination sections. Each node has a turns list, which determines the possible exits of a vehicle entering the nodes.
Synopsis¶
Methods¶
def
__init__()def
addSignal()def
addTurning()def
anyToTurnings()def
contains()def
containsSignal()def
existTurning()def
getAllowMerge()def
getConflicts()def
getDetailLevel()def
getFirstSignal()def
getLowerLayer()def
getNodeType()def
getPolygon()def
getSignal()def
getSignalAtPos()def
getSignalPos()def
getSignals()def
getSuperNode()def
getToTurnings()def
getTurning()def
getTurnings()def
hasPriority()def
isAligned()def
isEntrySection()def
isExitSection()def
isRoundabout()def
isTLeg()def
isToTheLeft()def
isToTheRight()def
isUTurning()def
isYellowBox()def
laneUsed()def
neededSection()def
removeSignal()def
removeTurning()def
setAllowMerge()def
setConflicts()def
setDetailLevel()def
setPriority()def
setRoundabout()def
setSignalsName()def
setSuperNode()def
setYellowBox()def
updatePosition()def
usesSignal()
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 GKNodeType¶
- __init__()¶
- addSignal(signal)¶
- Parameters:
signal –
GKControlPlanSignal
Add a signal group to this node. The object is adopted.
- addTurning(turning, curveTurning[, sortTurnings=true])¶
- Parameters:
turning –
GKTurningcurveTurning – bool
sortTurnings – bool
Adds a turn to this node. The object is adopted. If curveTurning is true the turn will be curve (
curve)By default it sorts the turns by ID. When adding several turns (in a importer for example) is faster to add them without sorting and call after all the adds to
orderTurningsByIdReturns true is there are any turning that starts at section “from” .
Returns true is there are any turn that ends at section “to”.
- changeTurningsDestinationToAnotherSection(oldObject, newObject)¶
Look in the turns and change the connection origin from “oldObject” to “newObject”. So, all the connections from “oldObject” will be then turns from “newObject”.
This function will not change the GKSection::origin or GKSection::destination attributes.
- changeTurningsOriginToAnotherSection(oldObject, newObject)¶
Look in the turns and change the connection origin from “oldObject” to “newObject”. So, all the connections from “oldObject” will be then turns from “newObject”.
This function will not change the GKSection::origin or GKSection::destination attributes.
- conflictingTurnings(iTurning1, iTurning2[, considerUserDefinedConflicts=true])¶
Return if the two turns are considered conflicting
Returns true if a turn is in this node.
- containsSignal(signal)¶
- Parameters:
signal –
GKControlPlanSignal- Return type:
- discardAllPriorities()¶
Removes all the priorities info.
Any connection between “from” a “to” sections?
- getAllPriorities()¶
- Return type:
Dictionary with keys of type .std.pairGKTurning and values of type GKTurning.
Gets the structure containing all priorities between turns. This structure is the following: QMap< QPair<
GKTurning,GKTurning>, bool >- getConflicts()¶
- Return type:
.list of GKNodeConflict
Returns the list of conflicts for all entities in this node.
- getDetailLevel()¶
- Return type:
Get the detail level for this object.
Returns a vector with all the entrance sections.
- getEntranceSections(scenario)
- Parameters:
scenario –
GKGenericScenario- Return type:
.list of GKSection
Returns a vector with the entrance sections that exist on the given scenario.
Returns a vector with the all the exit sections.
- getExitSections(scenario)
- Parameters:
scenario –
GKGenericScenario- Return type:
.list of GKSection
Returns a vector with the exit sections that exist on the given scenario.
- getFirstSignal(cross)¶
- Parameters:
cross –
GKCrosswalkArea- Return type:
Returns the first signal that contains this crosswalk area if any or NULL if the crosswalk area is not used in any signal group.
- getFirstSignal(cross)
- Parameters:
cross –
GKPedestrianCrossing- Return type:
Returns the first signal that contains this pedestrian crossing if any or NULL if the pedestrian crossing is not used in any signal group.
- getFirstSignal(turn)
- Parameters:
turn –
GKTurning- Return type:
Returns the first signal that contains this turn if any or NULL if the turn is not used in any signal group.
Gets turns that starts at section “from”
- getFromTurnings(from, laneIndex)
Gets turns that starts at section “from” at lane “laneIndex”.
- getFromTurningsOrderedFromLeftToRight(fromPolyline[, scenario=None])¶
- Parameters:
fromPolyline –
GKSectionscenario –
GKGenericScenario
- Return type:
.list of GKTurning
Gets turns that starts at section “from” ordered from left to right in the section direction. * If scenario != nullptr, filters by scenario.
- getFromTurningsOrderedFromRightToLeft(fromPolyline[, scenario=None])¶
- Parameters:
fromPolyline –
GKSectionscenario –
GKGenericScenario
- Return type:
.list of GKTurning
Gets turns that starts at section “from” ordered from right to left in the section direction.
Returns the lower layer of all the sections in it.
- getMinimalPolygons(scenario[, includeNotDrawn=true[, curvedGeometry=true]])¶
- Parameters:
scenario –
GKGenericScenarioincludeNotDrawn – bool
curvedGeometry – bool
- Return type:
.list of GKPoints
Calculates a group of polygons, that do not need to be convex, each of them having a group of turns that intersects with some of the others turns in the polygon. * The scenario will give us the geometry configuration context. * It will return polygons with curved geometry following the turns curves if curvedGeometry is true or polygons with straight segments joining the sections when curvedGeometry is false.
- getNodeType()¶
- Return type:
Calculates the type of this node based on its turns as eSimpleNode, eComplexNode, eMerging or eDiverging.
Returns the number of entrance sections.
Returns the number of exit sections.
Returns the number of signals where the section is the origin at turn in a signal.
Returns the number of signals where the turn “turn” is in.
Calculates the convex polygon that contains all the node turns.
Calculates the center of the Roundabout
- getSignal(signalName)¶
- Parameters:
signalName – str
- Return type:
Returns a signal group for this node by its name.
- getSignal(idSignal)
- Parameters:
idSignal – int
- Return type:
Returns a signal group for this node by its identifier.
- getSignalAtPos(posSignal, scenario)¶
- Parameters:
posSignal – int
scenario –
GKGenericScenario
- Return type:
Returns the id of a signal in the posSignal position of the list of all the signal groups in this node. The signal group is identified by its unique id. If the signal group is not found it returns 0, else it returns the signal group id.
If scenario is different than null it will consider only the signal groups existing in that scenario.
- getSignalPos(signal[, scenario=None])¶
- Parameters:
signal –
GKControlPlanSignalscenario –
GKGenericScenario
- Return type:
Returns the position of a signal in the list of the signal groups in this node, but only considering those existing in the active scenario. Those signal groups without turnings present in the active scenario are not considered. The signal group is identified by its unique id. If the signal group is not found it returns 0, else it returns a number between 1 and
getSignals().count both inclusiveIf a scenario is provided it will consider only the signal groups existing in that scenario.
- getSignalPos(idSignal[, scenario=None])
- Parameters:
idSignal – int
scenario –
GKGenericScenario
- Return type:
Returns the position of a signal in the list of the signal groups in this node, but only considering those existing in the active scenario. Those signal groups without turnings present in the active scenario are not considered. The signal group is identified by its unique id. If the signal group is not found it returns 0, else it returns a number between 1 and
getSignals().count both inclusiveIf a scenario is provided it will consider only the signal groups existing in that scenario.
- getSignals()¶
- Return type:
.list of GKControlPlanSignal
Returns all the signal groups for this node.
- getSignals(turn)
- Parameters:
turn –
GKTurning- Return type:
.list of GKControlPlanSignal
Returns the list of signals where the turn “turn” is in.
- getSignalsUsingCrosswalk(crossing)¶
- Parameters:
crossing –
GKCrosswalkArea- Return type:
.list of GKControlPlanSignal
returns the signals containing the given crosswalk
- getSignalsUsingPedestrianCrossing(crossing)¶
- Parameters:
crossing –
GKPedestrianCrossing- Return type:
.list of GKControlPlanSignal
returns the signals containing the specified pedestrian crossing
- getSuperNode()¶
- Return type:
- getToTurnings(to[, scenario=None])¶
- Parameters:
to –
GKSectionscenario –
GKGenericScenario
- Return type:
.list of GKTurning
Gets turns that ends at section “to” and present in the given scenario.
- getToTurnings(section, laneIndex[, scenario=None])
- Parameters:
section –
GKSectionlaneIndex – int
scenario –
GKGenericScenario
- Return type:
.list of GKTurning
Gets turns that ends at section “section” at lane “laneIndex” and present in the given scenario.
- getToTurningsOrderedFromLeftToRight(toPolyline)¶
Gets turns that starts at section “to” ordered from left to right in the section direction.
- getToTurningsOrderedFromRightToLeft(toPolyline)¶
Gets turns that starts at section “to” ordered from right to left in the section direction.
Gets turn that starts at “from” and ends at “to”.
Gets the list of all the turns in this connector.
Returns true if turn “turn1” has priority over “turn2”.
- hasUserDefinedTurningConflict(turn1, turn2)¶
Return true if turn1 and turn2 are conflicting turns.
Checks if secA is aligned with secB
Checks if sec is an entry section in this node.
Checks if sec is an exit section in this node.
Verify if a section is a tLeg in the node (tLeg is considered to be a section which doesn’t have any aligned sections, but has sections to the right and to the left of it).
Checks if secB is located to the left of secA.
Checks if secB is located to the right of secA.
Checks if there is a u-turn between secA and SecB.
Is a yellow box?
- laneUsed(section, lane[, asOrigin=true[, asDestination=true]])¶
Returns true if a lane from section is used in any turn of this node. If asOrigin is true then the method will return true if is used in a turn and from this lane the turn starts. Id asDestination is true then the method will return true if is used in a turn and to this lane the turn ends. If both are true, it will return true if any turn uses this lane.
Returns true if removing all the turns used by this section will remove in fact all the connector turns (that is, all the connection uses this section).
- orderTurningsById()¶
Sort the turns by id. Required if turns are added unsorted (
See also
- removeSignal(signal)¶
- Parameters:
signal –
GKControlPlanSignal
Removes a signal group from this node. The object is not deleted. *
Warning
The specified signal group MUST be one of the node’s signal groups.
Removes a turn from this node. Note that turn is a pointer to the turn that will be removed. The connection will NOT be deleted.
If the turn is not found in this node it will return false and true otherwise.
- setAllowMerge(allow)¶
- Parameters:
allow – bool
- setConflicts(iConflicts)¶
- Parameters:
iConflicts – .list of GKNodeConflict
Sets the list of conflicts for all entities in this node.
- setDetailLevel(level)¶
- Parameters:
level –
DetailLevel
Set the detail level for this object.
- setMergeCooperationDistance(distance)¶
- Parameters:
distance – float
- setPriority(turn1, turn2, priority)¶
Sets turn “turn1” priority over “turn2” or removes it, depending on the value of “priority”.
See also
- setRoundabout(on)¶
- Parameters:
on – bool
- setSignalsName()¶
Give a name to any signal without.
- setSuperNode(superNode)¶
- Parameters:
superNode –
GKSuperNode
- setUserDefinedConflicts(value)¶
- Parameters:
value – bool
Activate or deactivate user-defined conflicts.
See also
- setUserDefinedPriorities(value)¶
- Parameters:
value – bool
Activate or deactivate user-defined priorities.
See also
- setUserDefinedTurningConflict(turn1, turn2, priority)¶
Set if turn1 and turn2 are conflicting turns.
See also
- setYellowBox(value)¶
- Parameters:
value – bool
Mark (or unmark) this node as yellow box
See also
- updatePosition()¶
Update the node position. As the position is only relevant to macro model be sure to update it before using it. At this moment no auto update is done.
Are user-defined priorities used in this node?
See also
Are user-defined priorities used in this node?
See also
- usesSignal(signal)¶
- Parameters:
signal –
GKControlPlanSignal- Return type:
Returns true if the signal is from this node.