Aimsun Next Scripting: GKGeoObject Class Reference
Aimsun Next Scripting  22
Public Types | Public Member Functions | Static Public Attributes | List of all members
GKGeoObject Class Reference
Inheritance diagram for GKGeoObject:
GKObject GKBaseObject GKDPoint GKLayer GKPolyline GKRoute GKSectionObject GKCircle GKController GKImage GKNode GKText GKBezierCurve GKExtrudedPolyline GKImage3D GKPedestrianObstacle GKPolygon GKODRoute GKPublicLine GKSubPath GKBusStop GKDetector GKMetering GKPedestrianCrossing GKVMS

Public Types

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

 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
 

Static Public Attributes

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
 

Additional Inherited Members

- Public Attributes inherited from GKBaseObject
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKBaseObjectbase = (GKBaseObject*)sipCpp
 
 sipType = 0
 

Detailed Description

GKGeoObject is the base class for all the objects with a graphical representation. They are stored in layers (GKLayer) and these layers are in the GKGeoModel.

When creating a geo object with its new command, the graphical object will be automatically added to the geo model. When creating a geo object with GKSystem::newObject, it will not be added to the geomodel automatically. It will not be visible util it is added. Add it using the GKGeoModel::add.

Objects are selected by model, what means that a selected object is selected in all the views in where it appears (2D and/or 3D).

An object can have a mark (or more than one) using GKGeoObject::setMark to mark it with a special color and/or shape (depending of the object).

An object can be grouped with other ones in a group (GKGeoObjectGroup). In this case the group and not the individual objects will be manipulated.

An object can have object on top of it (GKGeoObject::getTopObjects). These objects bellows to this bottom object and are translated, rotated and deleted with it.

See also
GKGeoModel, GKLayer

Member Enumeration Documentation

◆ GKGeoContainer

See GKGeoObject::doGetContainedWay

Enumerator
eNothing 
ePartially 
eTotally 

Constructor & Destructor Documentation

◆ GKGeoObject()

GKGeoObject::GKGeoObject ( )

Member Function Documentation

◆ acceptConnection()

virtual bool GKGeoObject::acceptConnection ( GKGeoObject object) const
virtual

Returns true if a connection to this object will be accepted. The current implementation will return true if no other connection to "object" exists (so no repeated connections are allowed).

◆ addConnection()

virtual void GKGeoObject::addConnection ( GKObjectConnection )
virtual

Adds a connection. The connection object is adopted

Reimplemented in GKCentroid.

◆ addMark()

void GKGeoObject::addMark ( int  newMark)

Add a new mark to the object keeping the rest.

◆ addTopObject()

void GKGeoObject::addTopObject ( GKGeoObject )

Over objects: An object can have other object always over it as a section has always over detector. If an object is over another it will be drawn immediately after the "bottom" object because the GKGeoModel (and the associate Views) will take care of this requirement.

This method will call atopObject->setBottomObject( this ) (that is, it will set the bottom object of the top object).

◆ anyConnection()

bool GKGeoObject::anyConnection ( const GKGeoObject ) const

Returns true if there are any connection between this object and target

◆ canBeEdited()

bool GKGeoObject::canBeEdited ( ) const
virtual

Rewritten to return false when this object is in a layer that is external.

Reimplemented from GKObject.

Reimplemented in GKLayer.

◆ canBeGrouped()

virtual bool GKGeoObject::canBeGrouped ( ) const
virtual

Can this object be grouped? Usually true unless it is already grouped.

◆ canBeModified()

bool GKGeoObject::canBeModified ( ) const
virtual

Rewritten to return false when this object is in a layer that either is external or does not allow object editing.

Reimplemented from GKObject.

Reimplemented in GKLayer.

◆ changeConnectionObject()

virtual void GKGeoObject::changeConnectionObject ( GKGeoObject oldObject,
GKGeoObject newObject,
GK::ConnectionType  connectionType = GK::eConnectionUndefined 
)
virtual

Changes all the conections to "from" object to "to" object

◆ doGetContainedWay()

virtual GKGeoContainer GKGeoObject::doGetContainedWay ( const GKBBox myBBox,
const GKPoints points,
const GKBBox bboxPoints 
) const
virtual

If this object is totally inside the polygon (points) it returns eTotally; if this object is totally outside the polygon it returns eNothing; if this object is partially inside and partially outside it returns ePartially. The default implementation does this: if all the corners of the object bounding box are inside points, eTotally if any corner of the object bounding box is inside points, ePartially if any corner of bboxPoints is inside the object bounding box, ePartially else eNothing

Reimplemented in GKPolygon.

◆ exists()

virtual bool GKGeoObject::exists ( quint32  scenarioId) const
virtual

Returns true if this object exists in the scenario. An object can exist in several, all or just one scenario. If scenario is 0 it will return always true. Objects exist or not based on Geometry Configuration settings attached to the Scenario.

An object exists only if its top object exists and if all the required objects exist (for example a turn cannot exist if the required sections are not in the current geometry).

◆ getAltitude()

virtual GKCoord GKGeoObject::getAltitude ( ) const
virtual

Get the altitude of this object (the minimum Z among all the possible Z of the object)

Reimplemented in GKBezierCurve, GKDPoint, GKExtrudedPolygon, and GKExtrudedPolyline.

◆ getBottomObject()

GKGeoObject * GKGeoObject::getBottomObject ( ) const

Any "top" object has one (and only one) object that is "under" it (the bottom object)

◆ getConnections() [1/2]

QSet< GKObjectConnection * > GKGeoObject::getConnections ( ) const

Returns all the connections to this object

◆ getConnections() [2/2]

QSet< GKObjectConnection * > GKGeoObject::getConnections ( const GKGeoObject ) const

Returns all the connections between this object and target

◆ getContainedWay()

GKGeoContainer GKGeoObject::getContainedWay ( const GKPoints points,
const GKBBox bboxPoints 
) const

Deprecated function, use GKGeoObject::doGetContainedWay. The current implementation calls GKGeoObject::doGetContainedWay(getBBox(), points, bboxPoints).

◆ getCutCmd()

virtual GKGeoObjectCutCmd * GKGeoObject::getCutCmd ( const GKPoint from,
const GKPoint to,
bool  keepConnection 
)
virtual

Returns a command for a cut operation. Note that not all the geo objects can be cutted, so they will return None. An object can return None also if it cannot be cutted due to some state (is locked for example). This functions receives the segment uses to cut the object.

Reimplemented in GKSection.

◆ getLayer()

GKLayer * GKGeoObject::getLayer ( ) const

Get the object's layer.

◆ getMark()

int GKGeoObject::getMark ( ) const

Is the object marked?... 0 means that the object is not marked, any value greater than 0 means that is marked.

An object marked appears in a different color Used, for example, to show what sections pertains to a route. A Mark is a integer, allowing to mark different objects with different marks and show all togethers (for examplem mark=1 is they are in a route, mark=0 is they are not, mark=2 is they are in two routes...)

This method returns the first (if any) mark on the object.

◆ getMarks()

const QVector< int > * GKGeoObject::getMarks ( ) const

Gets all the marks of the object. A None vector means no mark.

◆ getNumberOfMarks()

uint GKGeoObject::getNumberOfMarks ( ) const

Returns the number of marks in the object.

◆ getTopObjects()

QSet< GKGeoObject * > * GKGeoObject::getTopObjects ( ) const

Returns all the top objects. Can be None, means no top objects.

◆ isLabeled()

bool GKGeoObject::isLabeled ( ) const

Is this object labeled? See GKGeoObject::setLabeled

◆ isSelected()

virtual bool GKGeoObject::isSelected ( ) const
virtual

Is the object selected?... Note that is selected by model and not by view. This means that a selected object will appear selected in all the view.

◆ objectConnectionType()

GK::ConnectionType GKGeoObject::objectConnectionType ( const GKGeoObject object) const

Returns the connection type of a object with this one (if any). If both objects are not connected it returns eNone.

◆ removeAllConnections()

virtual void GKGeoObject::removeAllConnections ( GK::ObjectDeletionBehaviour  )
virtual

Removes all the connections.

◆ removeConnection()

virtual void GKGeoObject::removeConnection ( GKObjectConnection ,
GK::ObjectDeletionBehaviour   
)
virtual

Removes a connection. The connection object is NOT deleted

◆ rotate()

virtual void GKGeoObject::rotate ( const GKPoint center,
double  angle 
)
virtual

Rotates the object an angle in radians around the center of rotation

Reimplemented in GKDPoint, GKPolygonWithHoles, GKPedestrianCentroid, GKPedestrianLevelChangeObject, and GKPedestrianServicePoint.

◆ scale()

virtual void GKGeoObject::scale ( const GKPoint )
virtual

Scales an object in the X, Y and Z.

Reimplemented in GKPolygonWithHoles.

◆ setAltitude()

virtual void GKGeoObject::setAltitude ( GKCoord  value)
virtual

Changes the altitude of this object setting the minimum Z to "value" (and moving the rest of the points to z = value - getAltitude() ). Function not available for nodes nor for turns as their altitude is automatically calculated based on entry and exits sections.

Reimplemented in GKBezierCurve, and GKDPoint.

◆ setLabeled()

void GKGeoObject::setLabeled ( bool  value)

Sets this object as labeled: a label will appear over it. By default the label contains the ID and name of the object but it can be customized using the geo model preferences. This customization is per type.

The drawer will get the specific label from the G2DDrawer::getObjectLabel method.

◆ setLayer()

void GKGeoObject::setLayer ( GKLayer alayer)

Set the layer of this object. Note that this operation will NOT change the object from a layer to another. In order to do so, use GKGeoModel::changeLayer().

◆ setMark()

void GKGeoObject::setMark ( int  newMark)

Mark an object using the first mark. See getMark for details.

If newMark is 0 then the object will be unmarked.

◆ setSelected()

virtual void GKGeoObject::setSelected ( bool  newState)
virtual

Is the object selected?... Note that is selected by model and not by view. This means that a selected object will appear selected in all the view.

◆ translate()

virtual void GKGeoObject::translate ( const GKPoint delta)
virtual

◆ unmark()

void GKGeoObject::unmark ( )

Removes any mark in the object.

Member Data Documentation

◆ altitudeAtt

uint GKGeoObject::altitudeAtt
static

The altitude attribute (as in GKGeoModel::getAltitude)

◆ layerAtt

uint GKGeoObject::layerAtt
static

The layer attribute (as in GKGeoModel::getLayer)

◆ markAtt

uint GKGeoObject::markAtt
static

The mark attribute (as in GKGeoModel::getMark)

◆ numberOfConnectionsAtt

uint GKGeoObject::numberOfConnectionsAtt
static

The number of connections attribute.

© Aimsun SLU
Aimsun ®