Commit 5e4518be authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add missing files

parent 470b9b1d
// Copyright (c) 2017, Joseph Mirabel
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
//
// This file is part of gepetto-viewer-corba.
// gepetto-viewer-corba is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// gepetto-viewer-corba is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// gepetto-viewer-corba. If not, see <http://www.gnu.org/licenses/>.
#include <hppwidgetsplugin/joint-action.hh>
#include <hppwidgetsplugin/jointtreewidget.hh>
namespace hpp {
namespace gui {
void JointAction::trigger ()
{
if (jointName_.empty()) {
if (tree_ != NULL)
emit triggered(tree_->selectedJoint());
} else
emit triggered(jointName_);
}
} // namespace gui
} // namespace hpp
#ifndef HPP_GUI_JOINT_ACTION_HH
#define HPP_GUI_JOINT_ACTION_HH
#include <QAction>
namespace hpp {
namespace gui {
class JointTreeWidget;
class JointAction : public QAction
{
Q_OBJECT
public:
JointAction (const QString& actionName, const std::string& jointName, QObject* parent)
: QAction (actionName, parent)
, jointName_ (jointName)
, tree_ (NULL)
{
connect (this, SIGNAL (triggered(bool)), SLOT(trigger()));
}
JointAction (const QString& actionName, JointTreeWidget* tree, QObject* parent)
: QAction (actionName, parent)
, tree_ (tree)
{
connect (this, SIGNAL (triggered(bool)), SLOT(trigger()));
}
signals:
void triggered (const std::string& jointName);
private slots:
void trigger ();
private:
const std::string jointName_;
JointTreeWidget* tree_;
};
} // namespace gui
} // namespace hpp
#endif // HPP_GUI_JOINT_ACTION_HH
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment