Aimsun Next Scripting
22
|
Public Member Functions | |
GKFolder () | |
void | setInternalName (const QString &) |
const QString & | getInternalName () const |
GKFolder * | findFolder (const QString &) const |
void | setRoot (GKObject *) |
GKObject * | getRoot () const |
GKObject * | getAbsoluteRoot () const |
const GKFolderContents & | getContents () const |
void | append (GKObject *) |
void | remove (GKObject *) |
QVector< GKType * > | getContentsTypes (bool staticOn=true, bool mesoOn=true, bool microOn=true, bool travelDemand=true) const |
bool | contains (const GKObject *) const |
int | __contains__ (GKObject *) const |
End GKFolder * | createFolder (const QString &aname, const QString &ainternalName, bool showOnlyConts=false) |
void | clear () |
void | deepClear () |
bool | canBeRenamed () const |
void | setCanBeRenamed (bool) |
bool | showOnlyContents () const |
void | setShowOnlyContents (bool) |
int | __len__ () |
End GKObject * | operator[] (int) |
if ((a0=sipConvertFromSequenceIndex(a0, len))< 0) | |
for (GKFolderContents::const_iterator iter=sipCpp->getContents().begin();iter !=sipCpp->getContents().end();iter++, pos++) | |
![]() | |
GKObject () | |
GKObject (const GKObject &o) | |
virtual void | addedToCatalog () |
virtual void | removedFromCatalog () |
uint | getTick () const |
virtual void | increaseTick () |
void | setTick (uint t) |
virtual GKObject * | clone (bool addItToModel=true) const |
virtual GKObject * | cloneAsTemporary (bool addItToModel=true) const |
GKFolder * | getCreateRootFolder () |
GKFolder * | getRootFolder () const |
void | setRootFolder (GKFolder *afolder) |
GKFolder * | findFolder (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 GKTimeSerie * | getDataValueTS (const GKColumn *attr) const |
GKTimeSerie * | getDataValueTSByID (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 GKObject * | getDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const |
GKObject * | getDataValueObjectByID (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 GKObject * | getMaster () const |
GKType * | getType () const |
virtual void | setType (GKType *atype) |
bool | isA (const GKType *atype) const |
bool | isA (const QString &typeName) const |
virtual void | setModel (GKModel *amodel) |
GKModel * | getModel () 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) |
![]() | |
GKBaseObject () | |
if (base) | |
virtual uint | getId () const =0 |
virtual const QString & | getTypeName () const =0 |
virtual QString | getTypeExternalName () const =0 |
virtual const GKObject * | getMaster () const =0 |
virtual const QString & | getName () const =0 |
virtual const QString & | getExternalId () const =0 |
virtual const QString & | getDescription () const =0 |
virtual GKModel * | getModel () 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 GKTimeSerie * | getDataValueTS (const GKColumn *attr) const =0 |
virtual GKTimeSerie * | getDataValueTSByID (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 GKObject * | getDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0 |
virtual GKObject * | getDataValueObjectByID (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 = sipCpp -> contains( a0 ) |
MethodCode int | len |
len = sipCpp -> getContents().size() | |
else | |
![]() | |
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKBaseObject * | base = (GKBaseObject*)sipCpp |
sipType = 0 | |
Additional Inherited Members | |
![]() | |
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::IdentifierFormFlag > | IdentifierForm |
![]() | |
static uint | typeNameAtt |
static uint | typeExternalNameAtt |
static uint | revisedAtt |
![]() | |
Py_END_ALLOW_THREADS static End uint | idAtt |
static uint | nameAtt |
static uint | externalIdAtt |
static uint | descriptionAtt |
GKFolder is a list of objects (GKObject) or folders (GKFolder) contained in an object (GKObject). Every GKObject can contain a folder, called the root folder. This root folder can contain objects and folders (that can contain objects and folder, and so on).
Folders must be registered in the system before using it. See GKSystem::registerFolder
Object folders allow the developer to include information to an object without modifying it. They are similar to the GKColumn and GKType mechanism (called Extensible Object Model) but unrelated (the GKObject::getDataValue and GKObject::setDataValue operations cannot be applied to these folders).
The main advantage is that the GUI class GListViewForModel can list in a browser the content of the GKModel folders and that these contents can be modified at run time. This allows us the addition of non-graphical object to the model (in one of GKModel's folder) that will be graphically represented (as items in the GListViewForModel widget). This representation will allow the user the selection and manipulation of these objects (double click to open its editor or using the context menu to issue commands).
A GKFolder has a name (GKFolder::getName) and an internal name (GKFolder::getInternalName). The internal name identifies the folder uniquely among all the other folders in the system. It's up to the developer to give a unique name to the folder.
Each folder has a root (the object owner of the folder) if it is not a subfolder. If it is a subfolder then the root is a folder and the final object owner can be read using the getAbsoluteRoot method.
In order to create a folder in an object that is not a folder, use the following code:
The method GKObject::getCreateRootFolder returns the root folder for the object. Since a root folder is optional, maybe the root folder has not been created yet, so instead of using the GKObject::getRootFolder method that can return None, we use the GKObject::getCreateRootFolder method that will create the root folder if needed.
And in order to create a folder in a folder, use the following code:
Where, in both examples:
Note that GKFolder derivates from GKObject. A folder contains a list of GKObject and some of these will be GKFolder ; in order to determinate if they are folder or non folders, use the following code:
The developer must create the folder before inserting any object. The folder to be created depends of the object to be inserted. Check the class documentation for the folder external and internal name.
For example, to add a new centroid configuration, in Python:
GKFolder::GKFolder | ( | ) |
int GKFolder::__contains__ | ( | GKObject * | ) | const |
int GKFolder::__len__ | ( | ) |
void GKFolder::append | ( | GKObject * | ) |
Adds an object to this folder
bool GKFolder::canBeRenamed | ( | ) | const |
Returns true if the name of this folder can be renamed (true by default)
void GKFolder::clear | ( | ) |
Clears the folder (objects inside the folder are not deleted just removed from the folder).
bool GKFolder::contains | ( | const GKObject * | ) | const |
Returns true if obj is in this folder.
End GKFolder * GKFolder::createFolder | ( | const QString & | aname, |
const QString & | ainternalName, | ||
bool | showOnlyConts = false |
||
) |
Creates a subfolder. First it checks if the folder is already here (using the internalName) and if so a pointer to the already existing folder is returned, if not a new one is created.
void GKFolder::deepClear | ( | ) |
Clears the folder and deletes all the objects inside.
GKFolder * GKFolder::findFolder | ( | const QString & | ) | const |
Finds a subfolder of this folder by its internal name.
|
inline |
References sipRes.
GKObject * GKFolder::getAbsoluteRoot | ( | ) | const |
Returns the first non folder object that is a root: if the root is not a folder it will return the root. If the root is a folder it will return the getAbsoluteRoot of this folder.
const GKFolderContents & GKFolder::getContents | ( | ) | const |
Gets the content of the folder: a list with objects and folders.
QVector< GKType * > GKFolder::getContentsTypes | ( | bool | staticOn = true , |
bool | mesoOn = true , |
||
bool | microOn = true , |
||
bool | travelDemand = true |
||
) | const |
Returns the type of objects that this folder can contain. Since this information is optional a None can be returned.
const QString & GKFolder::getInternalName | ( | ) | const |
Gets the internal folder name.
GKObject * GKFolder::getRoot | ( | ) | const |
Gets the root of this folder: a folder if it is a subfolder or an object it is a root folder.
|
inline |
End GKObject * GKFolder::operator[] | ( | int | ) |
void GKFolder::remove | ( | GKObject * | ) |
Removes an object from this folder
void GKFolder::setCanBeRenamed | ( | bool | ) |
Set the _canBeRenamed property for this folder.
void GKFolder::setInternalName | ( | const QString & | ) |
Sets the internal (and unique) folder name.
void GKFolder::setRoot | ( | GKObject * | ) |
Sets the root of this folder. It is done automatically by GKFolder::createFolder.
void GKFolder::setShowOnlyContents | ( | bool | ) |
Set the _showOnlyContents property for this folder.
bool GKFolder::showOnlyContents | ( | ) | const |
If true, when listing this folder in the GListViewForModel widget only its contents will appear and not the list itself and the contents as children of the folder. False by default.
GKFolder::else |
MethodCode int GKFolder::len |
GKFolder::len = sipCpp -> getContents().size() |