SaveEntityDialog.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef GAZEBO_GUI_SAVEENTITYDIALOG_HH_
18 #define GAZEBO_GUI_SAVEENTITYDIALOG_HH_
19 
20 #include <string>
21 #include <sdf/sdf.hh>
22 #include "gazebo/gui/qt.h"
23 #include "gazebo/util/system.hh"
24 
25 namespace gazebo
26 {
27  namespace gui
28  {
29  class SaveEntityDialogPrivate;
30 
33 
36  class GZ_GUI_VISIBLE SaveEntityDialog : public QDialog
37  {
38  Q_OBJECT
39 
42  public: enum SaveMode {
46  BUILDING
47  };
48 
52  public: SaveEntityDialog(int _mode = 0, QWidget *_parent = 0);
53 
55  public: ~SaveEntityDialog();
56 
59  public: std::string GetModelName() const;
60 
63  public: std::string GetSaveLocation() const;
64 
67  public: void SetModelName(const std::string &_name);
68 
71  public: void SetSaveLocation(const std::string &_location);
72 
75  public: std::string GetAuthorName() const;
76 
79  public: std::string GetAuthorEmail() const;
80 
83  public: std::string GetDescription() const;
84 
87  public: std::string GetVersion() const;
88 
94  public: void AddDirToModelPaths(const std::string &_path);
95 
100  public: std::string GetFolderNameFromModelName(const std::string
101  &_modelName);
102 
105  public: bool OnSaveAs();
106 
108  private slots: void OnBrowse();
109 
111  private slots: void OnCancel();
112 
114  private slots: void OnAcceptSave();
115 
118  private slots: void ModelNameChangedOnDialog(QString _modelName);
119 
121  private: std::string GetTemplateConfigString();
122 
124  public: void GenerateConfig();
125 
127  public: void SaveToConfig();
128 
131  public: void SaveToSDF(sdf::SDFPtr _modelSDF);
132 
135  private slots: void ToggleAdvancedOptions(bool _checked);
136 
139  private: SaveEntityDialogPrivate *dataPtr;
140  };
142  }
143 }
144 
145 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Save model.
Definition: SaveEntityDialog.hh:44
Dialog for saving to file.
Definition: SaveEntityDialog.hh:36
SaveMode
Unique identifiers for all dialog modes.
Definition: SaveEntityDialog.hh:42