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).
Synopsis¶
Methods¶
def
__init__()def
add()def
addBookmark()def
addMode()def
addStyle()def
changeLayer()def
doAfullUpdate()def
expandWorld()def
findLayer()def
findMode()def
findStyle()def
getActiveLayer()def
getBBox()def
getBookmarks()def
getDefaultCS()def
getLayers()def
getMarkStyle()def
getModel()def
getSelection()def
getWorld()def
nbObjects()def
registerTick()def
registerView()def
remove()def
removeBookmark()def
removeMode()def
removeStyle()def
resetReviews()def
selectAll()def
setActiveLayer()def
setDefaultCS()def
setExpandOnly()def
setLayerLevel()def
setWorld()def
unregisterTick()def
unregisterView()
Virtual methods¶
def
getDelCmd()
Signals¶
def
layerInserted()def
layerMoved()def
layerRemoved()def
resized()
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
- add(layer, obj[, lookForObjectsAlreadyInlayers=true])¶
- Parameters:
layer –
GKLayerobj –
GKGeoObjectlookForObjectsAlreadyInlayers – bool
Adds an object to the geo model in a specific layer (the layer cannot be NULL).
- addBookmark(abookmark)¶
- Parameters:
abookmark –
GKViewBookmark
Add a bookmark to the geo model, the pointer is adopted.
- addMode(mode)¶
- Parameters:
mode –
GKViewMode
Add a new mode: the mode is adopted
- addStyle(style)¶
- Parameters:
style –
GKViewModeStyle
Adds a new style: the style is adopted
A style using this column is present ?
- changeLayer(oldlayer, newlayer, obj)¶
- Parameters:
oldlayer –
GKLayernewlayer –
GKLayerobj –
GKGeoObject
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:
p –
GKPointgeoObject –
GKGeoObject
- Return type:
Returns the distance from a point to an object.
Expand the world
Expand the world
- findClosestObject(p[, type=None[, distance=-1.0]])¶
- Parameters:
- Return type:
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:
p –
GKPointdistance – float
current –
GKPolyline
- Return type:
find a layer using its internal name (that is unique)
- findMode(iname, automatic)¶
- Parameters:
iname – str
automatic – bool
- Return type:
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:
Finds a style by its internal name
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.Returns the bbox (slow: the bbox is calculated)
Returns the bbox (slow: the bbox is calculated) without taking into account the objects located in external layers
- getBookmarks()¶
- Return type:
.list of GKViewBookmark
Returns all the bookmarks
- getCoordinateTranslator()¶
- Return type:
Coordinate translation from/to degrees and meters.
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:
- getLayers()¶
- Return type:
.QSetGKLayer
Returns all the layers in this geomodel
- getMarkStyle()¶
- Return type:
Returns the style using when marking and object
See also
- getModeAfterExecution(activation)¶
- Parameters:
activation –
Activation- Return type:
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.
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
getLayerinstead we will take this information from the layers. Use it to discover mismatch information and missing objects.- getObjectsToUpdate(widget)¶
- Parameters:
widget –
QWidget- Return type:
.QSetconst GKGeoObject
- getSectionsLength([polygon=None])¶
- Parameters:
polygon –
GKPolygon- 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:
A list of selected objects (common for all the views).
Returns the total network length (in m). It is the sum of all sections and all turns.
Returns the current world size (min and max coordinates)
- inverseSelection()¶
Inverse the selection.
Signal: layer inserted in the geomodel.
Signal: layer moved from a parent to another in the geomodel.
Signal: layer removed from the geomodel.
Returns the number of graphical objects in the geo model.
Signal: an object has changed its level in a layer.
Recalculates the world size based in the current Geo-Model contents.
- registerTick(obj)¶
- Parameters:
obj –
GKGeoObject
- registerView(widget)¶
- Parameters:
widget –
QWidget
- remove(layer, obj)¶
- Parameters:
layer –
GKLayerobj –
GKGeoObject
- Return type:
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).
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:
abookmark –
GKViewBookmark
Removes the bookmark from the model. Does not delete it.
- removeMode(mode)¶
- Parameters:
mode –
GKViewMode
Removes a mode. The object is NOT deleted.
- removeStyle(style)¶
- Parameters:
style –
GKViewModeStyle
Removes a style. The object is NOT deleted.
- resetReviews(widget)¶
- Parameters:
widget –
QWidget
- resized()¶
The geometrical limits of this geomodel has been changed.
- selectAll()¶
Select all the objects in this geomodel.
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.
Change the layer level. The drawing order will be modified.
Set the world extends…
- unregisterTick(obj)¶
- Parameters:
obj –
GKGeoObject
- unregisterView(widget)¶
- Parameters:
widget –
QWidget