PyANGKernel.GKGeoModel

class GKGeoModel

Container for all graphical objects, part of the model ( getGeoModel ).

Details

Aimsun catalogs all the objects (no matter the type) in the catalog and the objects that can be drawn (geo objects) in a view in this GKGeoModel . Geo objects are stored in its layers so, in fact, the geomodel contains a list of layers ( getLayers ) and these layers ( GKLayer ) the objects.

Only one geomodel exists and is part of the model ( getGeoModel ).

A geo object can be in the model but not in the geomodel, that means that the object will not be shown (a centroid in a deactivated centroid configuration).

Inheritance diagram of PyANGKernel.GKGeoModel

Synopsis

Methods

Virtual methods

Signals

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

__init__(amodel)
Parameters:

amodelGKModel

add(layer, obj[, lookForObjectsAlreadyInlayers=true])
Parameters:

Adds an object to the geo model in a specific layer (the layer cannot be NULL).

addBookmark(abookmark)
Parameters:

abookmarkGKViewBookmark

Add a bookmark to the geo model, the pointer is adopted.

addMode(mode)
Parameters:

modeGKViewMode

Add a new mode: the mode is adopted

addStyle(style)
Parameters:

styleGKViewModeStyle

Adds a new style: the style is adopted

anyStyleUsesThisColumn(column)
Parameters:

columnGKColumn

Return type:

bool

A style using this column is present ?

changeLayer(oldlayer, newlayer, obj)
Parameters:

Changes the layer of an object, given the old layer, new layer, and object.

deleteBookmarks()

Removes and deletes all the bookmarks from the model.

distanceFromPointToGeoObject(p, geoObject)
Parameters:
Return type:

float

Returns the distance from a point to an object.

doAfullUpdate(widget)
Parameters:

widgetQWidget

Return type:

bool

expandWorld(worldRect[, extra=GKPoint.zero])
Parameters:

Expand the world

expandWorld(point[, extra=GKPoint.zero])
Parameters:

Expand the world

findClosestObject(p[, type=None[, distance=-1.0]])
Parameters:
Return type:

GKGeoObject

Returns the closest objects to a point. If a type is specified, only objects of that type will be considered.

findClosestObjects(p, maxDistance[, type=None])
Parameters:
Return type:

.list of GKGeoObject

Returns the closest objects to a point within the maxDistance range. Max Distance must be >= 0. * If a type is specified, only objects of that type will be considered.

findClosestPointOfPolygon(p, distance[, current=None])
Parameters:
Return type:

GKPoint

findLayer(byName)
Parameters:

byName – str

Return type:

GKLayer

find a layer using its internal name (that is unique)

findMode(iname, automatic)
Parameters:
  • iname – str

  • automatic – bool

Return type:

GKViewMode

Find a mode by its internal name. If automatic is true, it only looks for automatic modes; if false, for user-defined modes.

findStyle(iname)
Parameters:

iname – str

Return type:

GKViewModeStyle

Finds a style by its internal name

getActiveLayer([getAnything=false])
Parameters:

getAnything – bool

Return type:

GKLayer

Return the current active layer (the layer that has the focus in the GGui ) or NULL if no layer is active. If getAnything is true it will return a layer (any) when no layer is active. If getAnything is true and there is no layer to return, it will create a default one.

getBBox()
Return type:

GKBBox

Returns the bbox (slow: the bbox is calculated)

getBBoxWithoutExternalLayers()
Return type:

GKBBox

Returns the bbox (slow: the bbox is calculated) without taking into account the objects located in external layers

getBBoxWithoutExternalLayersNorCameras()
Return type:

GKBBox

getBookmarks()
Return type:

.list of GKViewBookmark

Returns all the bookmarks

getCoordinateTranslator()
Return type:

GKCoordinateTranslator

Coordinate translation from/to degrees and meters.

getDefaultCS()
Return type:

str

The coordinate system for this model. The default value is EPSG:32601 that correspont to WGS 84 / UTM zone 1N. * UnknownCommand getCoordinateTranslator

getDelCmd()
Return type:

GKObjectDelCmd

getLayers()
Return type:

.QSetGKLayer

Returns all the layers in this geomodel

getMarkStyle()
Return type:

GKViewModeStyle

Returns the style using when marking and object

See also

setMark

getModeAfterExecution(activation)
Parameters:

activationActivation

Return type:

GKViewMode

Returns a view mode to activate after the execution of a model (micro, meso, macro, hybrid…) It looks first for the user-defined models, then for the automatic ones. Returns NULL if no mode is found.

getModel()
Return type:

GKModel

Returns the gkmodel this object belongs to

getNetworkNodesInfo()
Return type:

.std.pairuint,uint

Returns the total number of nodes in the network. The first part of the pair is the number of nodes, the second part is the number of nodes that are evaluated as intersections.

getObjectsInLayers()
Return type:

Dictionary with keys of type .GKGeoObject and values of type GKLayer.

Return a map containing all the objects in layers and the layer assigned. To build this map we will not use getLayer instead we will take this information from the layers. Use it to discover mismatch information and missing objects.

getObjectsToUpdate(widget)
Parameters:

widgetQWidget

Return type:

.QSetconst GKGeoObject

getSectionsLength([polygon=None])
Parameters:

polygonGKPolygon

Return type:

.std.pairdouble,double

Returns the sum of lengths for all sections in the whole network (in m) or for the sections located inside the polygon. The first part of the pair has the sum of lengths (in 3D) by section, the second part of the pair has the sum of lengths by lane including side lanes (in 2D).

getSelection()
Return type:

GKGeoSelection

A list of selected objects (common for all the views).

getTotalNetworkLength()
Return type:

float

Returns the total network length (in m). It is the sum of all sections and all turns.

getWorld()
Return type:

GKBBox

Returns the current world size (min and max coordinates)

inverseSelection()

Inverse the selection.

layerInserted(layer)
Parameters:

layerGKLayer

Signal: layer inserted in the geomodel.

layerMoved(layer)
Parameters:

layerGKLayer

Signal: layer moved from a parent to another in the geomodel.

layerRemoved(layer)
Parameters:

layerGKLayer

Signal: layer removed from the geomodel.

nbObjects()
Return type:

int

Returns the number of graphical objects in the geo model.

objectLevelChanged(arg__1, arg__2, arg__3)
Parameters:
  • arg__1GKLayer

  • arg__2 – int

  • arg__3 – int

Signal: an object has changed its level in a layer.

recalculateWorld([extra=GKPoint.zero])
Parameters:

extraGKPoint

Recalculates the world size based in the current Geo-Model contents.

registerTick(obj)
Parameters:

objGKGeoObject

registerView(widget)
Parameters:

widgetQWidget

remove(layer, obj)
Parameters:
Return type:

bool

Removes an object from the layer (and the geo model). The object is not deleted, just removed from the drawing list. Returns true if the object was in the geo model (and, thus, removed from it).

removeAllObjects(type[, includeSubtypes=true])
Parameters:
  • typeGKType

  • includeSubtypes – bool

Remove all objects from a type for this geomodel. The object is still alive in the model (not deleted, just removed from the drawing list).

removeBookmark(abookmark)
Parameters:

abookmarkGKViewBookmark

Removes the bookmark from the model. Does not delete it.

removeMode(mode)
Parameters:

modeGKViewMode

Removes a mode. The object is NOT deleted.

removeStyle(style)
Parameters:

styleGKViewModeStyle

Removes a style. The object is NOT deleted.

resetReviews(widget)
Parameters:

widgetQWidget

resized()

The geometrical limits of this geomodel has been changed.

selectAll()

Select all the objects in this geomodel.

setActiveLayer(alayer)
Parameters:

alayerGKLayer

Sets the active layer, the previous active layer will be deactivated.

setDefaultCS(cs)
Parameters:

cs – str

The coordinate system for this model. The default value is EPSG:32601 that correspont to WGS 84 / UTM zone 1N.

setExpandOnly(value)
Parameters:

value – bool

If true the world will be expanded when an object is inserted. If false (the default) the world will be set with the first object insertion and expanded afterwards.

setLayerLevel(obj, level)
Parameters:

Change the layer level. The drawing order will be modified.

setWorld(worldRect)
Parameters:

worldRectGKBBox

Set the world extends…

unregisterTick(obj)
Parameters:

objGKGeoObject

unregisterView(widget)
Parameters:

widgetQWidget