##

ModelTreeWidget.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 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_MODEL_MODELTREEWIDGET_HH_
#define GAZEBO_GUI_MODEL_MODELTREEWIDGET_HH_
#include <mutex>
#include <string>
#include <vector>
#include "gazebo/common/Event.hh"
#include "gazebo/common/KeyEvent.hh"
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class ModelPluginInspector;
class GZ_GUI_VISIBLE ModelTreeWidget : public QWidget
{
Q_OBJECT
public: explicit ModelTreeWidget(QWidget *_parent = 0);
public: ~ModelTreeWidget() = default;
private: void OnDeselectAll(const std::string &_name,
const std::string &_mode);
private: void OnSetSelectedEntity(const std::string &_entityId,
const bool _selected);
private: void OnSetSelectedJoint(const std::string &_jointId,
const bool _selected);
private: void OnSetSelectedModelPlugin(const std::string &_name,
const bool _selected);
private: void DeselectType(const std::string &_type);
private slots: void OnStatic();
private slots: void OnAutoDisable();
private slots: void OnNameChanged(const QString &_name);
private slots: void OnItemDoubleClicked(QTreeWidgetItem *_item,
int _column);
private slots: void OnItemClicked(QTreeWidgetItem *_item, int _column);
private slots: void OnItemSelectionChanged();
private slots: void OnCustomContextMenu(const QPoint &_pt);
private slots: void OnAddModelPlugin();
private slots: void OnModelPluginApply();
private: void OnLinkInserted(const std::string &_linkName);
private: void OnJointInserted(const std::string &_jointId,
const std::string &_jointName, const std::string &_parentName,
const std::string &_childName);
private: void OnModelPluginInserted(const std::string &_modelPluginName);
private: void OnNestedModelInserted(const std::string &_nestedModelName);
private: void OnLinkRemoved(const std::string &_linkId);
private: void OnJointRemoved(const std::string &_jointId);
private: void OnModelPluginRemoved(const std::string &_pluginId);
private: void OnNestedModelRemoved(const std::string &_nestedModelId);
private: void ClearModelTree();
private: void OnJointNameChanged(const std::string &_jointId,
const std::string &_newJointName);
private: void OnSaveModel(const std::string &_saveName);
private: void OnNewModel();
private: void OnModelPropertiesChanged(bool _static, bool _autoDisable);
private: void OnModelNameChanged(const std::string &_name);
private: QTreeWidgetItem *FindItemByData(const std::string &_data,
const QTreeWidgetItem &_parentItem);
private: std::vector<event::ConnectionPtr> connections;
private: QCheckBox *staticCheck;
private: QCheckBox *autoDisableCheck;
private: std::string modelDefaultName;
private: QLineEdit *modelNameEdit;
private: QTreeWidget *modelTreeWidget;
private: QTreeWidgetItem *nestedModelsItem;
private: QTreeWidgetItem *linksItem;
private: QTreeWidgetItem *jointsItem;
private: QTreeWidgetItem *modelPluginsItem;
private: std::recursive_mutex updateMutex;
private: QList<QTreeWidgetItem *> selected;
private: ModelPluginInspector *modelPluginInspector;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::ModelTreeWidget::~ModelTreeWidget
~ModelTreeWidget()=default
Destructor.
system.hh
gazebo::gui::ModelTreeWidget
A widget that displays model properties.
Definition: ModelTreeWidget.hh:41
gazebo::gui::ModelTreeWidget::ModelTreeWidget
ModelTreeWidget(QWidget *_parent=0)
Constructor.
gui
gui
Definition: KeyEventHandler.hh:29
KeyEvent.hh
Event.hh
gazebo::gui::ModelPluginInspector
Inspector for model plugin properties.
Definition: ModelPluginInspector.hh:34