Aimsun Next Scripting: GKLayer Class Reference
Aimsun Next Scripting  22
Public Types | Public Member Functions | List of all members
GKLayer Class Reference
Inheritance diagram for GKLayer:
GKGeoObject GKObject GKBaseObject

Public Types

enum  GKLayerDrawMode { eNever , eAlways , eScale }
 
- Public Types inherited from GKGeoObject
enum  GKGeoContainer { eNothing = 0 , ePartially = 1 , eTotally = 2 }
 
- Public Types inherited from GKObject
enum  IdentifierFormFlag {
  eIdentifierDefault , eIdentifierId , eIdentifierName , eIdentifierExternalId ,
  eIdentifierTypeExternalName , eIdentifierDescription , eIdentifierStandard , eIdentifierStandardWithType ,
  eIdentifierAll
}
 
enum  GKLockType { eNone , eModification , eDelete , eModificationDelete }
 
enum  GKObjectStatus { eNew , eSaved , eModified , eDeleted }
 
typedef QFlags< GKObject::IdentifierFormFlagIdentifierForm
 

Public Member Functions

 GKLayer ()
 
bool canBeModified () const
 
bool canBeEdited () const
 
void setInternalName (const QString &iname)
 
const QString & getInternalName () const
 
GKLayerfindLayer (const QString &byName) const
 
uint nbObjects (bool onlyInThisLabel=false) const
 
void selectAll ()
 
const GKLayerDrawMode getDrawMode () const
 
uint getFromScale () const
 
uint getToScale () const
 
void setDrawMode (const GKLayerDrawMode amode)
 
void setDrawScale (uint afrom, uint ato)
 
bool isLayerVisible (GKCoord zoomFactor) const
 
bool allowObjectsEdition () const
 
void setAllowObjectsEdition (bool avalue)
 
const QSet< GKLayer * > & getLayers () const
 
const QSet< GKGeoObject * > & getObjects () const
 
uint getLevel () const
 
void setLevel (uint alevel)
 
void removeAllObjects (GKType *type)
 
virtual GKBBox getBBox () const
 
bool isExternal () const
 
virtual void restoreExternalData ()
 
virtual void unloadExternalData ()
 
bool getUseStyle () const
 
void setUseStyle (bool value)
 
void setStyle (const GKDrawStyle &astyle)
 
const GKDrawStylegetStyle () const
 
- Public Member Functions inherited from GKGeoObject
 GKGeoObject ()
 
virtual void setSelected (bool newState)
 
virtual bool isSelected () const
 
bool canBeModified () const
 
bool canBeEdited () const
 
virtual bool canBeGrouped () const
 
int getMark () const
 
void setMark (int newMark)
 
void addMark (int newMark)
 
void unmark ()
 
const QVector< int > * getMarks () const
 
uint getNumberOfMarks () const
 
GKLayergetLayer () const
 
void setLayer (GKLayer *alayer)
 
virtual void translate (const GKPoint &delta)
 
virtual void rotate (const GKPoint &center, double angle)
 
virtual void scale (const GKPoint &)
 
virtual GKCoord getAltitude () const
 
virtual void setAltitude (GKCoord value)
 
void addTopObject (GKGeoObject *)
 
QSet< GKGeoObject * > * getTopObjects () const
 
GKGeoObjectgetBottomObject () const
 
void setLabeled (bool value)
 
bool isLabeled () const
 
GKGeoContainer getContainedWay (const GKPoints &points, const GKBBox &bboxPoints) const
 
virtual GKGeoContainer doGetContainedWay (const GKBBox &myBBox, const GKPoints &points, const GKBBox &bboxPoints) const
 
GK::ConnectionType objectConnectionType (const GKGeoObject *object) const
 
QSet< GKObjectConnection * > getConnections () const
 
QSet< GKObjectConnection * > getConnections (const GKGeoObject *) const
 
bool anyConnection (const GKGeoObject *) const
 
virtual void addConnection (GKObjectConnection *)
 
virtual void removeConnection (GKObjectConnection *, GK::ObjectDeletionBehaviour)
 
virtual void changeConnectionObject (GKGeoObject *oldObject, GKGeoObject *newObject, GK::ConnectionType connectionType=GK::eConnectionUndefined)
 
virtual void removeAllConnections (GK::ObjectDeletionBehaviour)
 
virtual bool acceptConnection (GKGeoObject *object) const
 
virtual GKGeoObjectCutCmd * getCutCmd (const GKPoint &from, const GKPoint &to, bool keepConnection)
 
virtual bool exists (quint32 scenarioId) const
 
- Public Member Functions inherited from GKObject
 GKObject ()
 
 GKObject (const GKObject &o)
 
virtual void addedToCatalog ()
 
virtual void removedFromCatalog ()
 
uint getTick () const
 
virtual void increaseTick ()
 
void setTick (uint t)
 
virtual GKObjectclone (bool addItToModel=true) const
 
virtual GKObjectcloneAsTemporary (bool addItToModel=true) const
 
GKFoldergetCreateRootFolder ()
 
GKFoldergetRootFolder () const
 
void setRootFolder (GKFolder *afolder)
 
GKFolderfindFolder (const QString &byName) const
 
QVector< GKFolder * > getParentFolders () const
 
bool isDataValueNull (const GKColumn *attr) const
 
virtual QVariant * getDataValue (const GKColumn *attr, bool *deleteit, const GKContext &context=GKContext::anyContext) const
 
QVariant * getDataValueByID (uint attrId, bool *deleteit, const GKContext &context=GKContext::anyContext) const
 
virtual void setDataValue (const GKColumn *attr, const QVariant &v)
 
void setDataValueByID (uint attrId, const QVariant &v)
 
virtual void setDataValueObject (const GKColumn *attr, const GKObject *obj)
 
void setDataValueObjectByID (uint attrId, const GKObject *obj)
 
virtual void setDataValueDouble (const GKColumn *attr, double v)
 
void setDataValueDoubleByID (uint attrId, double v)
 
virtual double getDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double *deviation=NULL) const
 
double getDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double *deviation=NULL) const
 
bool hasAnyTSWithData () const
 
virtual GKTimeSeriegetDataValueTS (const GKColumn *attr) const
 
GKTimeSeriegetDataValueTSByID (uint attrId) const
 
virtual void setDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, double lowerValue, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setDataValueInSingleTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription)
 
void setDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setAggregatedValueInTS (const GKColumn *attr, double value, double deviation, GKTSDescription *aDescription=NULL)
 
void setAggregatedValueInTSByID (uint attrId, double value, double deviation, GKTSDescription *aDescription=NULL)
 
virtual void clearDataValueTS (const GKColumn *attr, GKTSDescription *aDescription=NULL)
 
void clearDataValueTSByID (uint attrId, GKTSDescription *aDescription=NULL)
 
virtual int getDataValueInt (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
int getDataValueIntByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual double getDataValueDouble (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
double getDataValueDoubleByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QString getDataValueString (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QString getDataValueStringByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual bool getDataValueBool (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
bool getDataValueBoolByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual GKObjectgetDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
GKObjectgetDataValueObjectByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QDate getDataValueDate (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QDate getDataValueDateByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QTime getDataValueTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QTime getDataValueTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QDateTime getDataValueDateTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QDateTime getDataValueDateTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
GKTimeDuration getDataValueTimeDuration (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
GKTimeDuration getDataValueTimeDurationByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
void removeDataValue (const GKColumn *attr)
 
void removeDataValueByID (uint attrId)
 
const QString & getDescription () const
 
void setDescription (const QString &adescription)
 
const QString & getExternalId () const
 
void setExternalId (const QString &anId)
 
virtual GKObjectDelCmd * getDelCmd ()
 
virtual GKObjectConnectionDelCmd * getDelConnectionCmd (GKObject *target)
 
virtual void nonCommandObjectRemoved (GKObject *)
 
virtual void init ()
 
virtual void setId (uint aid, GKModel *model)
 
uint getId () const
 
QUuid getUUID () const
 
virtual void setName (const QString &aname)
 
const QString & getName () const
 
QString getExtendedId (IdentifierForm form=eIdentifierDefault) const
 
QString getNameOrExtendedId (IdentifierForm form=eIdentifierDefault) const
 
virtual const QString & getTypeName () const
 
virtual QString getTypeExternalName () const
 
const GKObjectgetMaster () const
 
GKTypegetType () const
 
virtual void setType (GKType *atype)
 
bool isA (const GKType *atype) const
 
bool isA (const QString &typeName) const
 
virtual void setModel (GKModel *amodel)
 
GKModelgetModel () const
 
virtual void setLock (GKLockType atype)
 
GKLockType getLock () const
 
virtual bool canBeDeleted () const
 
virtual bool canBeModified () const
 
virtual bool canBeEdited () const
 
GKObjectStatus getStatus () const
 
virtual void setStatus (const GKObjectStatus astatus)
 
void notifyStatusChange ()
 
bool isTemporary () const
 
void setTemporary (bool value)
 
bool isExternal () const
 
void setExternal (bool value)
 
virtual void preferencesChanged ()
 
void removeColumn (GKColumn *column)
 
void resetColumn (GKColumn *column)
 
- Public Member Functions inherited from GKBaseObject
 GKBaseObject ()
 
 if (base)
 
virtual uint getId () const =0
 
virtual const QString & getTypeName () const =0
 
virtual QString getTypeExternalName () const =0
 
virtual const GKObjectgetMaster () const =0
 
virtual const QString & getName () const =0
 
virtual const QString & getExternalId () const =0
 
virtual const QString & getDescription () const =0
 
virtual GKModelgetModel () const =0
 
virtual QVariant * getDataValue (const GKColumn *attr, bool *deleteit, const GKContext &context=GKContext::anyContext) const =0
 
virtual QVariant * getDataValueByID (uint attrId, bool *deleteit, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double *deviation=NULL) const =0
 
virtual double getDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double *deviation=NULL) const =0
 
virtual GKTimeSeriegetDataValueTS (const GKColumn *attr) const =0
 
virtual GKTimeSeriegetDataValueTSByID (uint attrId) const =0
 
virtual int getDataValueInt (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual int getDataValueIntByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueDouble (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueDoubleByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QString getDataValueString (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QString getDataValueStringByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual bool getDataValueBool (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual bool getDataValueBoolByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKObjectgetDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKObjectgetDataValueObjectByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDate getDataValueDate (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDate getDataValueDateByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QTime getDataValueTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QTime getDataValueTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDateTime getDataValueDateTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDateTime getDataValueDateTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKTimeDuration getDataValueTimeDuration (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKTimeDuration getDataValueTimeDurationByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 

Additional Inherited Members

- Public Attributes inherited from GKBaseObject
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKBaseObjectbase = (GKBaseObject*)sipCpp
 
 sipType = 0
 
- Static Public Attributes inherited from GKGeoObject
static uint markAtt
 
static uint altitudeAtt
 
static uint numberOfConnectionsAtt
 
static uint layerAtt
 
- Static Public Attributes inherited from GKObject
static uint typeNameAtt
 
static uint typeExternalNameAtt
 
static uint revisedAtt
 
- Static Public Attributes inherited from GKBaseObject
Py_END_ALLOW_THREADS static End uint idAtt
 
static uint nameAtt
 
static uint externalIdAtt
 
static uint descriptionAtt
 

Detailed Description

Aimsun organises objects in layers. The use of layers has a dual role:

Member Enumeration Documentation

◆ GKLayerDrawMode

visibility type. See GKLayer::getDrawMode

Enumerator
eNever 
eAlways 
eScale 

Constructor & Destructor Documentation

◆ GKLayer()

GKLayer::GKLayer ( )

Member Function Documentation

◆ allowObjectsEdition()

bool GKLayer::allowObjectsEdition ( ) const

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

◆ canBeEdited()

bool GKLayer::canBeEdited ( ) const
virtual

Rewritten to return allow the edition of all types of layers. The GKGeoObject::canBeEdited do not allow the edition of objects in external layers but the layer itself must be editable (to change the drawing properties).

Reimplemented from GKGeoObject.

◆ canBeModified()

bool GKLayer::canBeModified ( ) const
virtual

Rewritten to return allow the edition of external folders. The GKGeoObject::canBeModified do not allows the edition of objects in external layers but the layer itself must be editable (to change the drawing properties).

Reimplemented from GKGeoObject.

◆ findLayer()

GKLayer * GKLayer::findLayer ( const QString &  byName) const

Find a layer in this layer using its internal name.

◆ getBBox()

virtual GKBBox GKLayer::getBBox ( ) const
virtual

Calculates the bounding box of this layer as the aggrfated bbox of its objects, taking into account objects in the sub layers.

◆ getDrawMode()

const GKLayerDrawMode GKLayer::getDrawMode ( ) const

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()

uint GKLayer::getFromScale ( ) const

Get the drawing scale. See GKLayer::getDrawMode.

◆ getInternalName()

const QString & GKLayer::getInternalName ( ) const

Get the internal, unique, name for this layer.

◆ getLayers()

const QSet< GKLayer * > & GKLayer::getLayers ( ) const

Returns all the layers in this layer.

◆ getLevel()

uint GKLayer::getLevel ( ) const

Gets the layer's level.

◆ getObjects()

const QSet< GKGeoObject * > & GKLayer::getObjects ( ) const

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

◆ getStyle()

const GKDrawStyle & GKLayer::getStyle ( ) const

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

If the GKDrawStyle's pen attribute is Qt.NoPen the Pen checkbox will be unticked. The rest of options can be checked in: http://doc.qt.io/qt-4.8/qpen.html If the GKDrawStyle's brush attribute is Qt.NoBrush the Brush checkbox will be unticked. The rest of options can be checked in: http://doc.qt.io/qt-4.8/qbrush.html penSize corresponds to the Width line. A value of 0 will untick the option. brushOpacity corresponds to the Opacity Brush line. A negative value will untick the option.

◆ getToScale()

uint GKLayer::getToScale ( ) const

Get the drawing scale. See GKLayer::getDrawMode.

◆ getUseStyle()

bool GKLayer::getUseStyle ( ) const

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

◆ isExternal()

bool GKLayer::isExternal ( ) const

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()

bool GKLayer::isLayerVisible ( GKCoord  zoomFactor) const

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()

uint GKLayer::nbObjects ( bool  onlyInThisLabel = false) const

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

◆ removeAllObjects()

void GKLayer::removeAllObjects ( GKType type)

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.

◆ restoreExternalData()

virtual void GKLayer::restoreExternalData ( )
virtual

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()

void GKLayer::selectAll ( )

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

◆ setAllowObjectsEdition()

void GKLayer::setAllowObjectsEdition ( bool  avalue)

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

◆ setDrawMode()

void GKLayer::setDrawMode ( const GKLayerDrawMode  amode)

Set the draw mode. See GKLayer::getDrawMode.

◆ setDrawScale()

void GKLayer::setDrawScale ( uint  afrom,
uint  ato 
)

Set the drawing scale. See GKLayer::getDrawMode.

◆ setInternalName()

void GKLayer::setInternalName ( const QString &  iname)

Set the internal, unique, name for this layer.

◆ setLevel()

void GKLayer::setLevel ( uint  alevel)

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 );

◆ setStyle()

void GKLayer::setStyle ( const GKDrawStyle astyle)

Set the style for this layer.

If the GKDrawStyle's pen attribute is Qt.NoPen the Pen checkbox will be unticked. The rest of options can be checked in: http://doc.qt.io/qt-4.8/qpen.html If the GKDrawStyle's brush attribute is Qt.NoBrush the Brush checkbox will be unticked. The rest of options can be checked in: http://doc.qt.io/qt-4.8/qbrush.html penSize corresponds to the Width line. A value of 0 will untick the option. brushOpacity corresponds to the Opacity Brush line. A negative value will untick the option.

◆ setUseStyle()

void GKLayer::setUseStyle ( bool  value)

Activate or deactivate the use Style option. See GKLayer::getUseStyle.

◆ unloadExternalData()

virtual void GKLayer::unloadExternalData ( )
virtual

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

© Aimsun SLU
Aimsun ®