PyANGKernel.GKLayer

class GKLayer

Geographical objects container

Details

Aimsun organises objects in layers. The use of layers has a dual role: - to determine the drawing order (what is drawn over what) - to hold together related objects (for example: decorative elements in a layer, main roads in another)

Inheritance diagram of PyANGKernel.GKLayer

Synopsis

Methods

Virtual 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 GKLayerDrawMode

visibility type. See getDrawMode

__init__()
allowObjectsEdition()
Return type:

bool

Is Editable? If it is objects on it can be selected and edited.

allowObjectsEditionRec()
Return type:

bool

Is Editable? If it is objects on it can be selected and edited. This function is used in 3D Selection.

contains(obj)
Parameters:

objGKGeoObject

Return type:

bool

Returns true if an object is in this layer

findLayer(byName)
Parameters:

byName – str

Return type:

GKLayer

Find a layer in this layer using its internal name.

fromMeters(p)
Parameters:

pGKPoint

Return type:

GKPoint

Converts a point from m to its coordinate system, if degrees is uses toDegrees

getCS()
Return type:

str

The coordinate system for this layer. The initial value is empty (so it will look in the geomodel getDefaultCS ).

getDrawMode()
Return type:

GKLayerDrawMode

Get the draw mode for this layer. It can be: - eNever : the layer will not be drawn. - eAlways : the layer will be always draw. - eScale : the layer will be draw bases on the view Scale: in the range [ getFromScale() , getToScale() ] the layer will be draw.

getFromScale()
Return type:

int

Get the drawing scale. See getDrawMode .

getInternalName()
Return type:

str

Get the internal, unique, name for this layer.

getLayers()
Return type:

.QSetGKLayer

Returns all the layers in this layer.

getLevel()
Return type:

int

Gets the layer’s level.

getNorthing()
Return type:

bool

If true we are in the northern hemisphere

getObjects()
Return type:

.QSetGKGeoObject

Returns all the objects (no layers) in this layer.

getOwnStyle()
Return type:

GKDrawStyle

Get the style for this layer.

getRotation()
Return type:

float

Rotation of this layer when drawing it, in degrees.

getScale()
Return type:

GKPoint

Scale of this layer when drawing it.

getStyle()
Return type:

GKDrawStyle

Get the style for this layer. If useStyle is set to false, * it returns the style of the layer that this layer belongs

getToScale()
Return type:

int

Get the drawing scale. See getDrawMode .

getTranslation()
Return type:

GKPoint

Translation of this layer when drawing it.

getUTMZone()
Return type:

int

the UTM zone for this layer. If 0 then use the UTM Zone set in the model ( GKModel::getUTMZone )

getUnits()
Return type:

SizeUnits

Get the layer units

getUseRotation()
Return type:

bool

Rotation of this layer when drawing it.

getUseScale()
Return type:

bool

Scale of this layer when drawing it.

getUseStyle()
Return type:

bool

If true, when the view draw the objects on this layer it will use the style specified in this layer (using getStyle ). If false the objects will be draw with its how styles.

getUseTranslation()
Return type:

bool

Translation of this layer when drawing it.

isExternal()
Return type:

bool

Is this layer external? No object information will be saved as these objects are in an external file. The rest of the layer information, but, will be saved.

isLayerVisible(zoomFactor)
Parameters:

zoomFactor – float

Return type:

bool

Test the visibility of this layer at a given zoom factor. If the zoom factor is -1 then this information will not be used ( eScale will be considered eAlways )

nbObjects([onlyInThisLabel=false])
Parameters:

onlyInThisLabel – bool

Return type:

int

Returns the number of objects (no layers) in this layer and all its sublayers (if onlyInThisLabel is false).

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

  • includeSubtypes – bool

Remove all the objects of type “type” (or any type than inherits “type”) from this layer. The object is still alive in the model (not deleted, just removed from the drawing list).

If an object is removed all its top objects will be removed too.

resetDrawScale()

Reset the drawing scale. *

restoreExternalData()

Restores all the external data found on this layer and its sublayers. At this moment only GKExternalLayer (CAD but not GIS) and GKImage objects.

selectAll()

Select all the objects in this layer and all the objects that are inside any layer inside this layer (recursively).

setAllowObjectsEdition(avalue)
Parameters:

avalue – bool

Set the objects in the layer editables. See GKLayer::allowObjectEdition

setAsExternal(value)
Parameters:

value – bool

Set this layer as external, no object information will be saved as these objects are in an external file. The rest of the layer information, but, will be saved.

setCS(cs)
Parameters:

cs – str

The coordinate system for this layer. The initial value is empty (so it will look in the geomodel getDefaultCS ).

setDrawMode(amode)
Parameters:

amodeGKLayerDrawMode

Set the draw mode. See getDrawMode .

setDrawScale(afrom, ato)
Parameters:
  • afrom – int

  • ato – int

Set the drawing scale. See getDrawMode .

setInternalName(iname)
Parameters:

iname – str

Set the internal, unique, name for this layer.

setLevel(alevel)
Parameters:

alevel – int

Sets the layer’s level. In order to also update the 2D view objects level in the layer, call the following function instead: * * layer. getModel() .getGeoModel().setLayerLevel( layer, alevel );

setMapMode(value)
Parameters:

value – bool

If true draw this layer (and sub layers as a map)

setNorthing(northing)
Parameters:

northing – bool

If true we are in the northern hemisphere

setRotation(value)
Parameters:

value – float

Rotation of this layer when drawing it, in degrees.

setScale(value)
Parameters:

valueGKPoint

Scale of this layer when drawing it.

setStyle(astyle)
Parameters:

astyleGKDrawStyle

Set the style for this layer.

setTranslation(value)
Parameters:

valueGKPoint

Translation of this layer when drawing it.

setUTMZone(zone)
Parameters:

zone – int

the UTM zone for this layer. If 0 then use the UTM Zone set in the model ( GKModel::getUTMZone )

setUnits(anunits)
Parameters:

anunitsSizeUnits

Set the layer units: It forces the recalculation of the geometry in the shapes using the incrementTick() call.

setUseRotation(value)
Parameters:

value – bool

Rotation of this layer when drawing it.

setUseScale(value)
Parameters:

value – bool

Scale of this layer when drawing it.

setUseStyle(value)
Parameters:

value – bool

Activate or deactivate the use Style option. See getUseStyle .

setUseTranslation(value)
Parameters:

value – bool

Translation of this layer when drawing it.

toDegrees(p)
Parameters:

pGKPoint

Return type:

GKPoint

Converts a point in m to longitude (X) and latitude (Y) using the current UTM Zone and the current coordinate system

toMeters(p)
Parameters:

pGKPoint

Return type:

GKPoint

Converts a point from its coordinate system ( getUnits ) to m

toMeters(value)
Parameters:

value – float

Return type:

float

toMeters(units, p)
Parameters:
Return type:

GKPoint

Converts a point from “units” to m

toMeters(units, value)
Parameters:
Return type:

float

toMeters(p, res)
Parameters:

Converts a set of points from its coordinate system ( getUnits ) to m. The new points are placed in “res”.

toMeters(units, p, res)
Parameters:

Converts a set of points from “units” to m. The new points are placed in “res”.

unloadExternalData()

Unloads all the external data found on this layer and its sublayers. At this moment only GKExternalLayer (CAD but not GIS) and GKImage objects.

useMapMode()
Return type:

bool

If true draw this layer (and sub layers as a map)