##

InsertModelWidget.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 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_INSERTMODELWIDGET_HH_
#define GAZEBO_GUI_INSERTMODELWIDGET_HH_
#include <string>
#include <map>
#include <vector>
#include <boost/filesystem.hpp>
#include "gazebo/common/Event.hh"
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
class QTreeWidget;
class QTreeWidgetItem;
class QPushButton;
namespace gazebo
{
namespace common
{
// Forward declaration.
class FuelModelDatabase;
}
namespace gui
{
// Forward declaration.
class InsertModelWidgetPrivate;
class GZ_GUI_VISIBLE InsertModelWidget : public QWidget
{
Q_OBJECT
public: explicit InsertModelWidget(QWidget *_parent = 0);
public: virtual ~InsertModelWidget();
public: bool LocalPathInFileWidget(const std::string &_path);
private: void OnModels(
const std::map<std::string, std::string> &_models);
private: void OnModelUpdateRequest(const std::string &_localPath);
signals: void UpdateFuel(const std::string &_server);
private slots: void OnModelSelection(QTreeWidgetItem *item, int column);
private slots: void Update();
private slots: void OnUpdateFuel(const std::string &_server);
private slots: void OnDirectoryChanged(const QString &_path);
private slots: void HandleButton();
private: static bool IsPathAccessible
(const boost::filesystem::path &_path);
private: void UpdateAllLocalPaths();
private: void UpdateLocalPath(const std::string &_path);
private: void InitializeFuelServers();
private: void PopulateFuelServers();
private: std::vector<event::ConnectionPtr> connections;
private: InsertModelWidgetPrivate *dataPtr;
};
}
}
#endif
gazebo::gui::InsertModelWidget
Definition: InsertModelWidget.hh:46
gazebo::gui::InsertModelWidget::InsertModelWidget
InsertModelWidget(QWidget *_parent=0)
Constructor.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::InsertModelWidget::LocalPathInFileWidget
bool LocalPathInFileWidget(const std::string &_path)
Check if input path is in the fileTreeWidget.
common
common
Definition: FuelModelDatabase.hh:37
system.hh
gazebo::gui::InsertModelWidget::~InsertModelWidget
virtual ~InsertModelWidget()
Destructor.
gui
gui
Definition: KeyEventHandler.hh:29
Event.hh
gazebo::gui::InsertModelWidget::UpdateFuel
void UpdateFuel(const std::string &_server)
A signal to trigger the model population of an Ignition Fuel server.