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

Public Member Functions

 GKModel ()
 
void initNewModel ()
 
const QString & getDocumentFileName () const
 
QDir getDocumentDirectory () const
 
bool structuredFolders () const
 
bool isStorageFileBased () const
 
bool fork ()
 
bool createRevision (const QString &configName, int newInitialId)
 
void consolidateRevision ()
 
bool isARevision () const
 
void setRevisionFlag (bool set=true)
 
QString getConfigurationName () const
 
QString getBaseNetworkFileName () const
 
const GKCataloggetCatalog () const
 
GKObjectnewObject (const QString &)
 
GKObjectnewObject (GKType *)
 
GKCommandcreateNewCmd (GKType *type) const
 
const GKDataBaseInfogetProjectDatabase () const
 
void setProjectDatabase (const GKDataBaseInfo &adatabase)
 
GKModelLoggetLog ()
 
GKCommandergetCommander ()
 
GKGeoModelgetGeoModel ()
 
void setUnitSystem (GK::UnitSystem)
 
GK::UnitSystem getUnitSystem () const
 
GKCoord distanceGuiToModel (GKCoord) const
 
GKCoord speedGuiToModel (GKCoord) const
 
GKCoord preciseSpeedGuiToModel (GKCoord) const
 
GKCoord accelerationGuiToModel (GKCoord) const
 
GKCoord densityGuiToModel (GKCoord) const
 
GKCoord areaGuiToModel (GKCoord area) const
 
GKCoord temperatureGuiToModel (GKCoord temperature) const
 
GKCoord weightGuiToModel (GKCoord temperature) const
 
GKCoord weightHorsePowerGuiToModel (GKCoord temperature) const
 
GKCoord weightFrontAreaGuiToModel (GKCoord temperature) const
 
GKCoord distanceModelToGui (GKCoord) const
 
GKCoord speedModelToGui (GKCoord) const
 
GKCoord preciseSpeedModelToGui (GKCoord) const
 
GKCoord accelerationModelToGui (GKCoord) const
 
GKCoord densityModelToGui (GKCoord) const
 
GKCoord areaModelToGui (GKCoord area) const
 
GKCoord temperatureModelToGui (GKCoord temperature) const
 
GKCoord weightModelToGui (GKCoord temperature) const
 
GKCoord weightHorsePowerModelToGui (GKCoord temperature) const
 
GKCoord weightFrontAreaModelToGui (GKCoord temperature) const
 
QString distanceName () const
 
QString speedName () const
 
QString preciseSpeedName () const
 
QString accelerationName () const
 
QString densityName () const
 
QString areaName () const
 
QString weightName () const
 
QString weightHorsePowerName () const
 
QString weightFrontAreaName () const
 
GKPreferencesValuessetPreferences ()
 
const GKPreferencesValuesgetPreferences () const
 
void reportError (const QString &, const QString &)
 
bool checkAndFixPath (QString &, const QString &)
 
void removeColumn (GKColumn *, bool)
 
void resetColumn (GKColumn *)
 
const QString & getAuthor () const
 
void setAuthor (const QString &anAuthor)
 
const QDateTime & getCreationTime () const
 
void setCreationTime (const QDateTime &atime)
 
const QDateTime & getLastModificationTime () const
 
void setLastModificationTime (const QDateTime &atime)
 
bool importFile (const QString &fileName, GKLayer *mainLayer, const GKPoint &p, const GKBBox &filterArea)
 
QVector< GKType * > getTypes () const
 
 foreach (GKType *type, sipCpp->getTypes())
 
End GKTypegetTypeCreation (const QString &typeName)
 
GKTypegetType (const QString &typeName) const
 
GKTyperegisterType (const QString &typeName, const QString &superType)
 
GKTyperegisterType (GKType *atype)
 
bool inherits (const QString &typeName, const QString &superType) const
 
void registerColumn (GKColumn *col)
 
void unregisterColumn (GKColumn *col)
 
GKColumngetColumn (uint uniqueID) const
 
GKColumngetColumn (const QString &uniqueName) const
 
uint getNewId ()
 
void setActiveExperiment (GKGenericExperiment *experiment)
 
GKGenericExperimentgetActiveExperiment () const
 
void setActiveReplication (const GKReplication *replication)
 
quint32 getActiveScenarioId () const
 
GKGenericScenariogetActiveScenario () const
 
GKReplicationgetActiveReplication () const
 
void rebuildRealityBasedOnGeometryConfigurations (const GKGenericScenario *iScenario)
 
bool inSimulation () const
 
const GKModelConnectiongetModelConnection () const
 
void setActiveCentroidConfiguration (GKCentroidConfiguration *cenConf)
 
GKCentroidConfigurationgetActiveCentroidConfiguration (bool createIt=false)
 
void setActivePedestrianCentroidConfiguration (GKCentroidConfiguration *cenConf)
 
GKCentroidConfigurationgetActivePedestrianCentroidConfiguration (bool createIt=false)
 
void setIdentifierForm (GKObject::IdentifierForm form)
 
GKObject::IdentifierForm getIdentifierForm () 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
 

Public Attributes

MethodCode sipRes = new QVector<GKType *>()
 
- Public Attributes inherited from GKBaseObject
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKBaseObjectbase = (GKBaseObject*)sipCpp
 
 sipType = 0
 

Additional Inherited Members

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

The entire object model is organized around the GKModel class. This class contains all the objects in a model (in our context a model is a document. For example a CAD map of a city will be the document, or model, in a CAD application).

Each time the user creates or open a new document an instance of GKModel is created. Each time the user saves the document to disk, all the data in the GKModel is saved.

A model is a collection of GKObjects instances (in fact of subclasses of GKObject). A line, a road, an OD matrix... they are instances of a subclass of GKObject. An instance of a GKObject has a unique identifier (assigned when the object is first created and immutable during the live of the object) and a type.

The model contains preferences available using the GKModel::getPreferences method.

GKModel as an object container

The model holds all the data in a catalog (an instance of GKCatalog). This catalog keeps the data organized by type and identifier. It also keeps all the visible geo objects (instances of GKGeoObject sub-classes) in the GKGeoModel. And it can also keep objects inside its root folder.

The main difference between these three types of containers (catalog, geo-model and folder) is that the catalog has all the

objects in the model created using the new commands or the GKSystem::newObject function, either graphical and non-graphical. The geo-model contains only graphical objects that are shown at this moment (a graphical object will not be draw if is not in the geo-model). The root folder willl contain any object (usually non-graphical) that will be shown in the GListViewForModel (see GKFolder).

Object deletion and commands

When an object is deleted all the relationships with it must destroyed too. If the deleted object is the owner of the relationship the solution is simple, this will be done at the object delete command. The problem is when the owner of the relationship is not the deleted object. This owner must be informed of the destruction to react acordly.

As is possible that the deleted object do not know this relationship the GKModel implements a simple mechanist to be informed of when an object is deleted. In fact what is expedted is that the owner of the relationship not only updates it but also support a possible UNDO.

When an object is "interested" in another and the target object is deleted the deleted object will ask the model for all the interested objects (unknowns to it until this moment) and will ask these "interested" objects to generate a GKObjectConnectionDelCmd command (see GKObject::getDelConnectionCmd) with the information that will be deleted or modified to support a possible UNDO.

If the deleted object is removed outside a command (no UNDO will be possible) then the object or editor that deletes it must call GKModel::nonCommandObjectRemoved to inforn any interested objet of this deletion. This method will call then to GKObject::nonCommandObjectRemoved for each interested object.

Constructor & Destructor Documentation

◆ GKModel()

GKModel::GKModel ( )

Member Function Documentation

◆ accelerationGuiToModel()

GKCoord GKModel::accelerationGuiToModel ( GKCoord  ) const

From an acceleration in m/s2 or f/s2 it returns the acceleration in m/s2.

◆ accelerationModelToGui()

GKCoord GKModel::accelerationModelToGui ( GKCoord  ) const

From an acceleration in m/s2 to acceleration in m/s2 or f/s2 depending of the units.

◆ accelerationName()

QString GKModel::accelerationName ( ) const

Returns the accelaration name, either m/s^2 or f/s^2 depending of the units.

◆ areaGuiToModel()

GKCoord GKModel::areaGuiToModel ( GKCoord  area) const

From an area in m2 or sqft returns it in m2.

◆ areaModelToGui()

GKCoord GKModel::areaModelToGui ( GKCoord  area) const

From an area in m2 to m2 or sqft depending of the units.

◆ areaName()

QString GKModel::areaName ( ) const

Returns the area name, either m^2 or sqft depending of the units.

◆ checkAndFixPath()

bool GKModel::checkAndFixPath ( QString &  ,
const QString &   
)

Check if the external file at "location" (path to a file including the file name) can be found. If not it will look in the searchPaths folders to locate the file. If it fails to it will ask the user for the new location (and will add the folder to the searchPaths variable) if the GUI is available.

If the file is found ina location different from the supplied one the variable "location" will be updated with the new file location.

Returns true if the file exists (note that this do not mean that it can be opened) or false otherwise.

description holds a single line description of what is missing. This string will appear as the title of the file dialog used to look for the missing file.

◆ consolidateRevision()

void GKModel::consolidateRevision ( )

Stops current model for being a revision. Most specifically, it clears the configuration name & revision flag (base network information is kept, however)

◆ createNewCmd()

GKCommand * GKModel::createNewCmd ( GKType type) const

Creates a creation cmd for a type. Note that not all the types can have an associated creation command. After creating the command it should be customized (if required) and added to the commander for execution. Upon execution the user can get the created object using GKCommand::createdObject. Example:

cmd = model.createNewCmd( model.getType( "GKCentroid" ))
p = view2d.screen2World( event->pos() )
cmd.setData( GKPoint( 10, 10 ), activeCenConf )
model.getCommander().addCommand( cmd )
A 3D Point usually in m (or feet).
Definition: GKPoint.sip:27

◆ createRevision()

bool GKModel::createRevision ( const QString &  configName,
int  newInitialId 
)

"Forks" the model as a revision. First, saves the base model. Then, it calls fork(), sets revision flag, configuration name and registers the new base ID for newly created objects. To finish, the revision file is saved.

◆ densityGuiToModel()

GKCoord GKModel::densityGuiToModel ( GKCoord  ) const

From a density in veh/km or veh/mi it returns the density in veh/km.

◆ densityModelToGui()

GKCoord GKModel::densityModelToGui ( GKCoord  ) const

From a density in veh/km to density in veh/km or veh/mi depending of the units.

◆ densityName()

QString GKModel::densityName ( ) const

Returns the density name, either veh/km or veh/mi depending of the units.

◆ distanceGuiToModel()

GKCoord GKModel::distanceGuiToModel ( GKCoord  ) const

From a distance in m or feet it returns the distance in m.

◆ distanceModelToGui()

GKCoord GKModel::distanceModelToGui ( GKCoord  ) const

From a distance in m to distance in m or feet depending of the units.

◆ distanceName()

QString GKModel::distanceName ( ) const

Returns the distance name, either km or Milles depending of the units.

◆ foreach()

GKModel::foreach ( GKType type,
sipCpp->  getTypes() 
)
inline

References sipRes.

◆ fork()

bool GKModel::fork ( )

"Forks" the model by storing current filename & UID as the base network information (unless the model is a revision, in which case the base network information is maintained), and then resets UID to a new value.

Called whenever the model is going to be saved under a different filename or when creating a revision, to preserve history.

◆ getActiveCentroidConfiguration()

GKCentroidConfiguration * GKModel::getActiveCentroidConfiguration ( bool  createIt = false)

Returns the active centroid configuration.

◆ getActiveExperiment()

GKGenericExperiment * GKModel::getActiveExperiment ( ) const

In which experiment (if any) is the user working?

◆ getActivePedestrianCentroidConfiguration()

GKCentroidConfiguration * GKModel::getActivePedestrianCentroidConfiguration ( bool  createIt = false)

Returns the active pedestrian configuration. Only available with Legion for Aimsun Simulator.

◆ getActiveReplication()

GKReplication * GKModel::getActiveReplication ( ) const

In which replication (if any) is the user working?

◆ getActiveScenario()

GKGenericScenario * GKModel::getActiveScenario ( ) const

◆ getActiveScenarioId()

quint32 GKModel::getActiveScenarioId ( ) const

In which scenario (if any) is the user working?

◆ getAuthor()

const QString & GKModel::getAuthor ( ) const

Author of this network.

◆ getBaseNetworkFileName()

QString GKModel::getBaseNetworkFileName ( ) const

The base network of this derived network. Empty for a base network.

◆ getCatalog()

const GKCatalog & GKModel::getCatalog ( ) const

Returns the catalog.

◆ getColumn() [1/2]

GKColumn * GKModel::getColumn ( const QString &  uniqueName) const

Get a column by its internal name (that is unique)

◆ getColumn() [2/2]

GKColumn * GKModel::getColumn ( uint  uniqueID) const

Get a column by its id (that is unique)

◆ getCommander()

GKCommander & GKModel::getCommander ( )

Returns the Commander.

◆ getConfigurationName()

QString GKModel::getConfigurationName ( ) const

The configuration name. Empty for a base network.

◆ getCreationTime()

const QDateTime & GKModel::getCreationTime ( ) const

Creation Date.

◆ getDocumentDirectory()

QDir GKModel::getDocumentDirectory ( ) const

Directory of the loaded document. Only usable if GKModel::isStorageFileBased is true.

◆ getDocumentFileName()

const QString & GKModel::getDocumentFileName ( ) const

Path and file name of the loaded document if GKModel::isStorageFileBased. The document URL otherwise.

◆ getGeoModel()

GKGeoModel & GKModel::getGeoModel ( )

Returns the GeoModel

◆ getIdentifierForm()

GKObject::IdentifierForm GKModel::getIdentifierForm ( ) const

◆ getLastModificationTime()

const QDateTime & GKModel::getLastModificationTime ( ) const

Last Modification Date.

◆ getLog()

GKModelLog & GKModel::getLog ( )

Returns the system log.

◆ getModelConnection()

const GKModelConnection & GKModel::getModelConnection ( ) const

Returns the model connection for the active experiment.

◆ getNewId()

uint GKModel::getNewId ( )

◆ getPreferences()

const GKPreferencesValues & GKModel::getPreferences ( ) const

Get the preferences for this model.

◆ getProjectDatabase()

const GKDataBaseInfo & GKModel::getProjectDatabase ( ) const

The database info (but not the database) that holds project external data (Sim Stats, external OD matrices, Real Data Sets values...).

◆ getType()

GKType * GKModel::getType ( const QString &  typeName) const

Get a type by name, if the type do not exist NULL is returned.

◆ getTypeCreation()

End GKType * GKModel::getTypeCreation ( const QString &  typeName)

Get a type by name, if the type do not exist it is created.

◆ getTypes()

QVector< GKType * > GKModel::getTypes ( ) const

Returns all types in this model.

◆ getUnitSystem()

GK::UnitSystem GKModel::getUnitSystem ( ) const

Returns the network units

◆ importFile()

bool GKModel::importFile ( const QString &  fileName,
GKLayer mainLayer,
const GKPoint p,
const GKBBox filterArea 
)

Imports a file into the current model. It look for all the registered filters until it finds one that can load the file (GKFilterDescription::canImport).

Returns true if the file has been imported.

◆ inherits()

bool GKModel::inherits ( const QString &  typeName,
const QString &  superType 
) const

Return true if typeName inherits superType (that is: if "superType" its a super type of "typeName"). If typeName is equal to superType true is returned.

◆ initNewModel()

void GKModel::initNewModel ( )

Init a new created model (not from restore)

◆ inSimulation()

bool GKModel::inSimulation ( ) const

Returns true if the model is currently being simulated and false otherwise

◆ isARevision()

bool GKModel::isARevision ( ) const

Returns true if this network is a revision (of another network)

◆ isStorageFileBased()

bool GKModel::isStorageFileBased ( ) const

Returns true if the document is stored in a file, false for: DB, stream and unkown storage.

◆ newObject() [1/2]

GKObject * GKModel::newObject ( const QString &  )

A method equivalent to this call:

GKSystem.getSystem().newObject( typeName, model )
Class that keeps information about all data that is shared by the documents.
Definition: GKSystem.sip:35
GKObject * newObject(const QString &, GKModel *)
static GKSystem & getSystem()
Singleton !

◆ newObject() [2/2]

GKObject * GKModel::newObject ( GKType )

A method equivalent to this call:

GKSystem.getSystem().newObject( type, model )

◆ preciseSpeedGuiToModel()

GKCoord GKModel::preciseSpeedGuiToModel ( GKCoord  ) const

From a speed in m/s or feet/s it returns the speed in m/s.

◆ preciseSpeedModelToGui()

GKCoord GKModel::preciseSpeedModelToGui ( GKCoord  ) const

From a speed in m/s to speed in m/s or feet/s depending of the units.

◆ preciseSpeedName()

QString GKModel::preciseSpeedName ( ) const

Returns the speed name, either m/s or f/s depending of the units.

◆ rebuildRealityBasedOnGeometryConfigurations()

void GKModel::rebuildRealityBasedOnGeometryConfigurations ( const GKGenericScenario iScenario)

Recreate the reality after a Scenario change.

◆ registerColumn()

void GKModel::registerColumn ( GKColumn col)

Register a columun. The pointer is adopted.

◆ registerType() [1/2]

GKType * GKModel::registerType ( const QString &  typeName,
const QString &  superType 
)

Register a type creating it is needed and assigning to it a super type (that is also created if needed). The just created type is returned.

◆ registerType() [2/2]

GKType * GKModel::registerType ( GKType atype)

Register a type. The pointer is adopted.

◆ removeColumn()

void GKModel::removeColumn ( GKColumn ,
bool   
)

Remove a column from the model. That means that will be removed from the type and from all the objects in the catalog that use it.

Note that only external attributes can be removed.

If keepUsedColumns is true (recommended) columns in triggers and styles will not be removed.

◆ reportError()

void GKModel::reportError ( const QString &  ,
const QString &   
)

Report an error in an operation. This method will write the title and the message in the model log and, if there is a GUI available, it will show a QMessageBox::critical. Use this function to report critical errors.

◆ resetColumn()

void GKModel::resetColumn ( GKColumn )

Removes the value on the column from this object. A time series or a string will be cleared, a scalar value will be set (if a number) to -1, a bool wil be set to false...

Note that only external attributes can be reset.

◆ setActiveCentroidConfiguration()

void GKModel::setActiveCentroidConfiguration ( GKCentroidConfiguration cenConf)

Sets the active centroid configuration.

◆ setActiveExperiment()

void GKModel::setActiveExperiment ( GKGenericExperiment experiment)

Sets the experiment to be working on

◆ setActivePedestrianCentroidConfiguration()

void GKModel::setActivePedestrianCentroidConfiguration ( GKCentroidConfiguration cenConf)

Sets the active pedestrian configuration. Only available with Legion for Aimsun Simulator.

◆ setActiveReplication()

void GKModel::setActiveReplication ( const GKReplication replication)

In which replication (if any) is the user working?

◆ setAuthor()

void GKModel::setAuthor ( const QString &  anAuthor)

Author of this network.

◆ setCreationTime()

void GKModel::setCreationTime ( const QDateTime &  atime)

Creation Date.

◆ setIdentifierForm()

void GKModel::setIdentifierForm ( GKObject::IdentifierForm  form)

◆ setLastModificationTime()

void GKModel::setLastModificationTime ( const QDateTime &  atime)

Last Modification Date.

◆ setPreferences()

GKPreferencesValues & GKModel::setPreferences ( )

Get the preferences for this model for modification.

◆ setProjectDatabase()

void GKModel::setProjectDatabase ( const GKDataBaseInfo adatabase)

The database info (but not the database) that holds project external data (Sim Stats, external OD matrices, Real Data Sets values...).

◆ setRevisionFlag()

void GKModel::setRevisionFlag ( bool  set = true)

Sets revision flag to the given state

◆ setUnitSystem()

void GKModel::setUnitSystem ( GK::UnitSystem  )

Sets the network units type that will be used to present information to the user. Note that units used internally in this application are in Metric system.

◆ speedGuiToModel()

GKCoord GKModel::speedGuiToModel ( GKCoord  ) const

From a speed in km/h or m/h it returns the speed in km/h.

◆ speedModelToGui()

GKCoord GKModel::speedModelToGui ( GKCoord  ) const

From a speed in km/h to speed in km/h or mi/h depending of the units.

◆ speedName()

QString GKModel::speedName ( ) const

Returns the speed name, either km/h or M/h depending of the units.

◆ structuredFolders()

bool GKModel::structuredFolders ( ) const

Returns true if the model uses a fixed folder estructure for projects

◆ temperatureGuiToModel()

GKCoord GKModel::temperatureGuiToModel ( GKCoord  temperature) const

From a temperature in Celsius or Fahrenheit, transform it into Celsius.

◆ temperatureModelToGui()

GKCoord GKModel::temperatureModelToGui ( GKCoord  temperature) const

From a temperature in Celsius, transform it into Celsius or Fahrenheit, depending on the units.

◆ unregisterColumn()

void GKModel::unregisterColumn ( GKColumn col)

Unregister a columns (that will be remove). The pointer is not deleted. This is a responsibility of the caller. See GKModel::removeColumn

Note that only external attributes can be removed.

◆ weightFrontAreaGuiToModel()

GKCoord GKModel::weightFrontAreaGuiToModel ( GKCoord  temperature) const

From a weight/frontal area in kg/m2 or lbs/sq.ft depending of the units to kg/m2.

◆ weightFrontAreaModelToGui()

GKCoord GKModel::weightFrontAreaModelToGui ( GKCoord  temperature) const

From a weight/frontal area in kg/m2 to kg/m2 or lbs/sq.ft depending of the units.

◆ weightFrontAreaName()

QString GKModel::weightFrontAreaName ( ) const

Returns the weight / front area name, either Kg/m^2 or lb/ft^2 depending of the units.

◆ weightGuiToModel()

GKCoord GKModel::weightGuiToModel ( GKCoord  temperature) const

From a weight in kg or lbs depending of the units to kg.

◆ weightHorsePowerGuiToModel()

GKCoord GKModel::weightHorsePowerGuiToModel ( GKCoord  temperature) const

From a weight/horse power in kg/hp or lbs/hp depending of the units to kg/hp.

◆ weightHorsePowerModelToGui()

GKCoord GKModel::weightHorsePowerModelToGui ( GKCoord  temperature) const

From a weight/horse power in kg/hp to kg/hp or lbs/hp depending of the units.

◆ weightHorsePowerName()

QString GKModel::weightHorsePowerName ( ) const

Returns the weight / hore power name, either Kg/hp or lb/hp depending of the units.

◆ weightModelToGui()

GKCoord GKModel::weightModelToGui ( GKCoord  temperature) const

From a weight in kg to kg or lbs depending of the units.

◆ weightName()

QString GKModel::weightName ( ) const

Returns the weight name, either Kg or lb depending of the units.

Member Data Documentation

◆ sipRes

MethodCode GKModel::sipRes = new QVector<GKType *>()

Referenced by foreach().

© Aimsun SLU
Aimsun ®