SaveDialog Class Reference

Dialog for saving to file. More...

#include <gui/gui.hh>

Inherits QDialog.

Public Types

enum  SaveMode { MODEL, BUILDING }
 Unique identifiers for all dialog modes. More...
 

Public Member Functions

 SaveDialog (int _mode=0, QWidget *_parent=0)
 Constructor. More...
 
 ~SaveDialog ()
 Destructor. More...
 
void AddDirToModelPaths (const std::string &_path)
 Add the parent folder of _path to the model path represented by SystemPaths, notify InsertModelWidget to display the model name in the "Insert Models" tab, and write the parent folder filename to gui.ini. More...
 
void GenerateConfig ()
 Generate the config file. More...
 
std::string GetAuthorEmail () const
 Get the model's author's email. More...
 
std::string GetAuthorName () const
 Get the model's author's name. More...
 
std::string GetDescription () const
 Get the model's description. More...
 
std::string GetFolderNameFromModelName (const std::string &_modelName)
 Helper function to generate a valid folder name from a human-readable model name. More...
 
std::string GetModelName () const
 Get the model name. More...
 
std::string GetSaveLocation () const
 Get the save location. More...
 
std::string GetVersion () const
 Get the model's version. More...
 
bool OnSaveAs ()
 Call to execute the dialog. More...
 
void SaveToConfig ()
 Save config file. More...
 
void SaveToSDF (sdf::SDFPtr _modelSDF)
 Save model to SDF format. More...
 
void SetModelName (const std::string &_name)
 Set the model name. More...
 
void SetSaveLocation (const std::string &_location)
 Set the save location. More...
 

Detailed Description

Dialog for saving to file.

Member Enumeration Documentation

enum SaveMode

Unique identifiers for all dialog modes.

Enumerator
MODEL 

Save model.

BUILDING 

Save building.

Constructor & Destructor Documentation

SaveDialog ( int  _mode = 0,
QWidget *  _parent = 0 
)

Constructor.

Parameters
[in]_modeMode of the dialog.
[in]_parentParent QWidget.
~SaveDialog ( )

Destructor.

Member Function Documentation

void AddDirToModelPaths ( const std::string &  _path)

Add the parent folder of _path to the model path represented by SystemPaths, notify InsertModelWidget to display the model name in the "Insert Models" tab, and write the parent folder filename to gui.ini.

Parameters
[in]_pathPath to be added.
void GenerateConfig ( )

Generate the config file.

std::string GetAuthorEmail ( ) const

Get the model's author's email.

Returns
The author's email.
std::string GetAuthorName ( ) const

Get the model's author's name.

Returns
The author's name.
std::string GetDescription ( ) const

Get the model's description.

Returns
The model's description.
std::string GetFolderNameFromModelName ( const std::string &  _modelName)

Helper function to generate a valid folder name from a human-readable model name.

Parameters
[in]_modelNameHuman-readable model name.
Returns
Folder name.
std::string GetModelName ( ) const

Get the model name.

Returns
The model name.
std::string GetSaveLocation ( ) const

Get the save location.

Returns
Path of the save location.
std::string GetVersion ( ) const

Get the model's version.

Returns
The model's version.
bool OnSaveAs ( )

Call to execute the dialog.

Returns
True if the user accepted the dialog.
void SaveToConfig ( )

Save config file.

void SaveToSDF ( sdf::SDFPtr  _modelSDF)

Save model to SDF format.

Parameters
[in]_modelSDFPointer to the model SDF.
void SetModelName ( const std::string &  _name)

Set the model name.

Parameters
[in]_nameName to set the model to.
void SetSaveLocation ( const std::string &  _location)

Set the save location.

Parameters
[in]_locationLocation to save to.

The documentation for this class was generated from the following file: