Aimsun Next Scripting
22
|
Public Types | |
enum | GGuiSaveType { eSave , eSaveAs , eAutoSave } |
enum | GKMessageType { eInformation , eWarning , eCritical } |
Public Member Functions | |
GGui () | |
GKModel * | getActiveModel () const |
GView * | getActiveView (GKModel *model=NULL) const |
GViewWindow * | getActiveViewWindow (GKModel *model=NULL) const |
void | invalidateViews () |
uint | getNumberOfOpenViews (GKModel *model) |
QDialog * | editThis (GView *, GKObject *, GKType *=NULL) |
GKModel * | loadNetwork (const QString &fn, bool isATemplate=false, bool checkLocks=true, const QStringList &aditionalPaths=QStringList()) |
bool | load (QString caption=QString(), QString initialFolder=QString()) |
bool | save () |
bool | save (GKModel *model, const QString &fn, GGuiSaveType saveType) |
End bool | saveAs (const QString &initialFileName) |
End bool | print () |
bool | closeDocument (GKModel *model) |
bool | forceCloseDocument (GKModel *model) |
bool | quit () |
void | forceQuit () |
void | pan (const GKGeoObject *) |
GKModel * | newDoc (const QString &templateFile, const QString &initialCS) |
GKModel * | newSimpleDoc () |
void | selectAll () |
void | inverseSelection () |
void | showMessage (GKMessageType type, QString title, QString message) const |
void | processEvents (bool allowUserInput, int maxTime) |
GEditor * | getOpenedEditorForTarget (GKObject *obj) const |
Public Attributes | |
MethodCode | sipRes = sipCpp->save( a0, *a1, a2, QList<quint32>() ) |
It includes a menu bar, one or more tool bars, 2D and 3D Views and a collection of side windows (log, project, legend, 3D info, system...)
It is created automatically when Aimsun Next starts in GUI mode. This object doesn't exist in Aimsun Server mode.
After creating the GUI no document exists yet.
enum GGui::GGuiSaveType |
enum GGui::GKMessageType |
GGui::GGui | ( | ) |
bool GGui::closeDocument | ( | GKModel * | model | ) |
Closes the document. If model is None, closes the current document
It opens a suitable editor for object "obj". This function calls editorAdded automatically. It is possible also to all an editor by type (when obj is None and editionByType is not). In this case the editor target will be None (but the model and the gui will not, as the view is set correctly when calling this method).
bool GGui::forceCloseDocument | ( | GKModel * | model | ) |
Closes the document. This command doesn't ask the user for any unsaved data and it cannot be cancelled.
void GGui::forceQuit | ( | ) |
Quits the current Aimsun Next application. This command doesn't ask the user for any unsaved data and it cannot be cancelled.
GKModel * GGui::getActiveModel | ( | ) | const |
It returns the current model. It can be None (no model opened/created yet)
It gets the current active view (from the topmost view window in the view window stack)
GViewWindow * GGui::getActiveViewWindow | ( | GKModel * | model = NULL | ) | const |
It gets the current active view window (the topmost window in the window stack)
uint GGui::getNumberOfOpenViews | ( | GKModel * | model | ) |
Returns the number of open views for a given model. If model is None, returns the number of open views for all the models.
Returns a currently opened editor, if any, for "obj" object.
void GGui::invalidateViews | ( | ) |
Forces a redraw of all the current open views.
void GGui::inverseSelection | ( | ) |
Inverses the current selection. Objects selected will be unselected and objects unselecteds will be selected. Note that a drawer can refuse a selection, so this command will not affected it.
bool GGui::load | ( | QString | caption = QString() , |
QString | initialFolder = QString() |
||
) |
As for a network to be loaded and call GGui::loadNetwork.
GKModel * GGui::loadNetwork | ( | const QString & | fn, |
bool | isATemplate = false , |
||
bool | checkLocks = true , |
||
const QStringList & | aditionalPaths = QStringList() |
||
) |
Load a network from file "fn". If isATemplate is true (a new document using a template) no error will be given to the user if something goes wrong as GGui::newDoc will report the error.
GKModel * GGui::newDoc | ( | const QString & | templateFile, |
const QString & | initialCS | ||
) |
Creates a new document. The template will be used as the new document calling GGui::loadNetwork. If no template can be used or if templateFile is "_none_" it will call GGui::newSimpleDoc.
If templateFile is empty it will use the first valid template (usually the English one).
If initialCS is empty we will default to EPSG:32601
GKModel * GGui::newSimpleDoc | ( | ) |
Creates a new document (no template is used)
void GGui::pan | ( | const GKGeoObject * | ) |
Pans the active view (if any) so that "obj" will be centered on it.
End bool GGui::print | ( | ) |
Opens the print dialog to print the current view.
void GGui::processEvents | ( | bool | allowUserInput, |
int | maxTime | ||
) |
bool GGui::quit | ( | ) |
Quits the current Aimsun Next application. This command ask the user for any unsaved data. The user can cancel the quit.
bool GGui::save | ( | ) |
Return true if the model can be saved in its current file (look for file and dir permisions) It also makes a copy of the file (if exists) renaming the original file adding the ".old" extensions. If a problem happens it returns false and shows a dialog informing of the problem.
bool GGui::save | ( | GKModel * | model, |
const QString & | fn, | ||
GGuiSaveType | saveType | ||
) |
Return true if the model can be saved in the selected file (look for file and dir permisions) It also makes a copy of the file (if exists) renaming the original file adding the ".old" extensions. If a problem happens it return false and shows a dialog informing of the problem.
End bool GGui::saveAs | ( | const QString & | initialFileName | ) |
Saves the current document asking for a new name.
void GGui::selectAll | ( | ) |
Select all the geo objects. This command uses the current view in order to know which objects can be selected. Note that a drawer can make non selectable an object and that this setting is per view and not per model. This is the reason because the current view is used.
If no current view is available nothing is selected.
void GGui::showMessage | ( | GKMessageType | type, |
QString | title, | ||
QString | message | ||
) | const |
Show a critical message to the user. If we are in hiden mode (see GKSystem::getInHideMode) the message will appear in the log. If we are in normal mode (the default) it will appear in a dialog and in the log.
MethodCode GGui::sipRes = sipCpp->save( a0, *a1, a2, QList<quint32>() ) |