InsertModelWidget.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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_INSERTMODELWIDGET_HH_
18 #define GAZEBO_GUI_INSERTMODELWIDGET_HH_
19 
20 
21 #include <string>
22 #include <map>
23 #include <vector>
24 #include <boost/filesystem.hpp>
25 
26 #include "gazebo/common/Event.hh"
27 #include "gazebo/gui/qt.h"
28 #include "gazebo/util/system.hh"
29 
30 class QTreeWidget;
31 class QTreeWidgetItem;
32 class QPushButton;
33 
34 namespace gazebo
35 {
36  namespace gui
37  {
39  class InsertModelWidgetPrivate;
40 
41  class GZ_GUI_VISIBLE InsertModelWidget : public QWidget
42  {
43  Q_OBJECT
44 
46  public: InsertModelWidget(QWidget *_parent = 0);
47 
49  public: virtual ~InsertModelWidget();
50 
52  public: bool LocalPathInFileWidget(const std::string &_path);
53 
57  private: void OnModels(
58  const std::map<std::string, std::string> &_models);
59 
63  private: void OnModelUpdateRequest(const std::string &_localPath);
64 
66  private slots: void OnModelSelection(QTreeWidgetItem *item, int column);
67 
70  private slots: void Update();
71 
74  private slots: void OnDirectoryChanged(const QString &_path);
75 
77  private slots: void HandleButton();
78 
82  private: static bool IsPathAccessible
83  (const boost::filesystem::path &_path);
84 
86  private: void UpdateAllLocalPaths();
87 
90  private: void UpdateLocalPath(const std::string &_path);
91 
93  private: std::vector<event::ConnectionPtr> connections;
94 
96  private: InsertModelWidgetPrivate *dataPtr;
97  };
98  }
99 }
100 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Definition: InsertModelWidget.hh:41