InsertModelWidget.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 _INSERT_MODEL_WIDGET_HH_
18 #define _INSERT_MODEL_WIDGET_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 
79  private: static bool IsPathAccessible
80  (const boost::filesystem::path &_path);
81 
83  private: void UpdateAllLocalPaths();
84 
87  private: void UpdateLocalPath(const std::string &_path);
88 
90  private: std::vector<event::ConnectionPtr> connections;
91 
93  private: InsertModelWidgetPrivate *dataPtr;
94  };
95  }
96 }
97 #endif
#define GZ_GUI_VISIBLE
Definition: system.hh:284
Definition: InsertModelWidget.hh:41
Private class attributes for InsertModelWidget.
Definition: InsertModelWidgetPrivate.hh:37