##

SaveEntityDialog.hh
Go to the documentation of this file.
/*
* Copyright (C) 2013 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_SAVEENTITYDIALOG_HH_
#define GAZEBO_GUI_SAVEENTITYDIALOG_HH_
#include <string>
#include <sdf/sdf.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class SaveEntityDialogPrivate;
class GZ_GUI_VISIBLE SaveEntityDialog : public QDialog
{
Q_OBJECT
public: enum SaveMode {
MODEL,
BUILDING
};
public: SaveEntityDialog(int _mode = 0, QWidget *_parent = 0);
public: ~SaveEntityDialog();
public: std::string GetModelName() const;
public: std::string GetSaveLocation() const;
public: void SetModelName(const std::string &_name);
public: void SetSaveLocation(const std::string &_location);
public: std::string GetAuthorName() const;
public: std::string GetAuthorEmail() const;
public: std::string GetDescription() const;
public: std::string GetVersion() const;
public: void AddDirToModelPaths(const std::string &_path);
public: std::string GetFolderNameFromModelName(const std::string
&_modelName);
public: bool OnSaveAs();
private slots: void OnBrowse();
private slots: void OnCancel();
private slots: void OnAcceptSave();
private slots: void ModelNameChangedOnDialog(QString _modelName);
private: std::string GetTemplateConfigString();
public: void GenerateConfig();
public: void SaveToConfig();
public: void SaveToSDF(sdf::SDFPtr _modelSDF);
private slots: void ToggleAdvancedOptions(bool _checked);
private: SaveEntityDialogPrivate *dataPtr;
};
}
}
#endif
gazebo::gui::SaveEntityDialog::GenerateConfig
void GenerateConfig()
Generate the config file.
gazebo::gui::SaveEntityDialog::GetAuthorName
std::string GetAuthorName() const
Get the model's author's name.
gazebo::gui::SaveEntityDialog::AddDirToModelPaths
void AddDirToModelPaths(const std::string &_path)
Add the parent folder of _path to the model path represented by SystemPaths, notify InsertModelWidget...
gazebo::gui::SaveEntityDialog::MODEL
Save model.
Definition: SaveEntityDialog.hh:44
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::SaveEntityDialog::BUILDING
Save building.
Definition: SaveEntityDialog.hh:46
gazebo::gui::SaveEntityDialog::GetDescription
std::string GetDescription() const
Get the model's description.
system.hh
gazebo::gui::SaveEntityDialog::GetModelName
std::string GetModelName() const
Get the model name.
gazebo::gui::SaveEntityDialog::SetSaveLocation
void SetSaveLocation(const std::string &_location)
Set the save location.
gazebo::gui::SaveEntityDialog
Dialog for saving to file.
Definition: SaveEntityDialog.hh:36
gazebo::gui::SaveEntityDialog::SaveMode
SaveMode
Unique identifiers for all dialog modes.
Definition: SaveEntityDialog.hh:42
gazebo::gui::SaveEntityDialog::OnSaveAs
bool OnSaveAs()
Call to execute the dialog.
gazebo::gui::SaveEntityDialog::SaveToSDF
void SaveToSDF(sdf::SDFPtr _modelSDF)
Save model to SDF format.
gazebo::gui::SaveEntityDialog::~SaveEntityDialog
~SaveEntityDialog()
Destructor.
gazebo::gui::SaveEntityDialog::SaveToConfig
void SaveToConfig()
Save config file.
gazebo::gui::SaveEntityDialog::GetSaveLocation
std::string GetSaveLocation() const
Get the save location.
gazebo::gui::SaveEntityDialog::GetFolderNameFromModelName
std::string GetFolderNameFromModelName(const std::string &_modelName)
Helper function to generate a valid folder name from a human-readable model name.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::SaveEntityDialog::SaveEntityDialog
SaveEntityDialog(int _mode=0, QWidget *_parent=0)
Constructor.
gazebo::gui::SaveEntityDialog::GetAuthorEmail
std::string GetAuthorEmail() const
Get the model's author's email.
gazebo::gui::SaveEntityDialog::SetModelName
void SetModelName(const std::string &_name)
Set the model name.
gazebo::gui::SaveEntityDialog::GetVersion
std::string GetVersion() const
Get the model's version.