Aimsun Next Scripting: GGui Class Reference
Aimsun Next Scripting  22
Public Types | Public Member Functions | Public Attributes | List of all members
GGui Class Reference
Inheritance diagram for GGui:

Public Types

enum  GGuiSaveType { eSave , eSaveAs , eAutoSave }
 
enum  GKMessageType { eInformation , eWarning , eCritical }
 

Public Member Functions

 GGui ()
 
GKModelgetActiveModel () const
 
GViewgetActiveView (GKModel *model=NULL) const
 
GViewWindowgetActiveViewWindow (GKModel *model=NULL) const
 
void invalidateViews ()
 
uint getNumberOfOpenViews (GKModel *model)
 
QDialog * editThis (GView *, GKObject *, GKType *=NULL)
 
GKModelloadNetwork (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 *)
 
GKModelnewDoc (const QString &templateFile, const QString &initialCS)
 
GKModelnewSimpleDoc ()
 
void selectAll ()
 
void inverseSelection ()
 
void showMessage (GKMessageType type, QString title, QString message) const
 
void processEvents (bool allowUserInput, int maxTime)
 
GEditorgetOpenedEditorForTarget (GKObject *obj) const
 

Public Attributes

MethodCode sipRes = sipCpp->save( a0, *a1, a2, QList<quint32>() )
 

Detailed Description

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.

Member Enumeration Documentation

◆ GGuiSaveType

When saving, what type of save operation. The differences are:

  • eSave: stores the network and makes a backup of the old files.
  • eSaveAs: stores the network and, because it is a copy, no backup is done.
  • eAutoSave: stores the net in a tmp file, no backup is done.
Enumerator
eSave 
eSaveAs 
eAutoSave 

◆ GKMessageType

Enumerator
eInformation 
eWarning 
eCritical 

Constructor & Destructor Documentation

◆ GGui()

GGui::GGui ( )

Member Function Documentation

◆ closeDocument()

bool GGui::closeDocument ( GKModel model)

Closes the document. If model is None, closes the current document

◆ editThis()

QDialog * GGui::editThis ( GView ,
GKObject ,
GKType = NULL 
)

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

◆ forceCloseDocument()

bool GGui::forceCloseDocument ( GKModel model)

Closes the document. This command doesn't ask the user for any unsaved data and it cannot be cancelled.

◆ forceQuit()

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.

◆ getActiveModel()

GKModel * GGui::getActiveModel ( ) const

It returns the current model. It can be None (no model opened/created yet)

◆ getActiveView()

GView * GGui::getActiveView ( GKModel model = NULL) const

It gets the current active view (from the topmost view window in the view window stack)

◆ getActiveViewWindow()

GViewWindow * GGui::getActiveViewWindow ( GKModel model = NULL) const

It gets the current active view window (the topmost window in the window stack)

◆ getNumberOfOpenViews()

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.

◆ getOpenedEditorForTarget()

GEditor * GGui::getOpenedEditorForTarget ( GKObject obj) const

Returns a currently opened editor, if any, for "obj" object.

◆ invalidateViews()

void GGui::invalidateViews ( )

Forces a redraw of all the current open views.

◆ inverseSelection()

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.

◆ load()

bool GGui::load ( QString  caption = QString(),
QString  initialFolder = QString() 
)

As for a network to be loaded and call GGui::loadNetwork.

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

◆ newDoc()

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

◆ newSimpleDoc()

GKModel * GGui::newSimpleDoc ( )

Creates a new document (no template is used)

◆ pan()

void GGui::pan ( const GKGeoObject )

Pans the active view (if any) so that "obj" will be centered on it.

◆ print()

End bool GGui::print ( )

Opens the print dialog to print the current view.

◆ processEvents()

void GGui::processEvents ( bool  allowUserInput,
int  maxTime 
)

◆ quit()

bool GGui::quit ( )

Quits the current Aimsun Next application. This command ask the user for any unsaved data. The user can cancel the quit.

◆ save() [1/2]

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.

◆ save() [2/2]

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.

◆ saveAs()

End bool GGui::saveAs ( const QString &  initialFileName)

Saves the current document asking for a new name.

◆ selectAll()

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.

◆ showMessage()

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.

Member Data Documentation

◆ sipRes

MethodCode GGui::sipRes = sipCpp->save( a0, *a1, a2, QList<quint32>() )

© Aimsun SLU
Aimsun ®