SaveEntityDialog 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

 SaveEntityDialog (int _mode=0, QWidget *_parent=0)
 Constructor. More...
 
 ~SaveEntityDialog ()
 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

◆ SaveMode

enum SaveMode

Unique identifiers for all dialog modes.

Enumerator
MODEL 

Save model.

BUILDING 

Save building.

Constructor & Destructor Documentation

◆ SaveEntityDialog()

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

Constructor.

Parameters
[in]_modeMode of the dialog.
[in]_parentParent QWidget.

◆ ~SaveEntityDialog()

Destructor.

Member Function Documentation

◆ AddDirToModelPaths()

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.

◆ GenerateConfig()

void GenerateConfig ( )

Generate the config file.

◆ GetAuthorEmail()

std::string GetAuthorEmail ( ) const

Get the model's author's email.

Returns
The author's email.

◆ GetAuthorName()

std::string GetAuthorName ( ) const

Get the model's author's name.

Returns
The author's name.

◆ GetDescription()

std::string GetDescription ( ) const

Get the model's description.

Returns
The model's description.

◆ GetFolderNameFromModelName()

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.

◆ GetModelName()

std::string GetModelName ( ) const

Get the model name.

Returns
The model name.

◆ GetSaveLocation()

std::string GetSaveLocation ( ) const

Get the save location.

Returns
Path of the save location.

◆ GetVersion()

std::string GetVersion ( ) const

Get the model's version.

Returns
The model's version.

◆ OnSaveAs()

bool OnSaveAs ( )

Call to execute the dialog.

Returns
True if the user accepted the dialog.

◆ SaveToConfig()

void SaveToConfig ( )

Save config file.

◆ SaveToSDF()

void SaveToSDF ( sdf::SDFPtr  _modelSDF)

Save model to SDF format.

Parameters
[in]_modelSDFPointer to the model SDF.

◆ SetModelName()

void SetModelName ( const std::string &  _name)

Set the model name.

Parameters
[in]_nameName to set the model to.

◆ SetSaveLocation()

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: