Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) CNRS |
3 |
|
|
// Author: Joseph Mirabel and Heidy Dallard |
4 |
|
|
// |
5 |
|
|
|
6 |
|
|
#ifndef HPP_GUI_JOINTTREEWIDGET_HH |
7 |
|
|
#define HPP_GUI_JOINTTREEWIDGET_HH |
8 |
|
|
|
9 |
|
|
#include <QWidget> |
10 |
|
|
#include <hppwidgetsplugin/hppwidgetsplugin.hh> |
11 |
|
|
|
12 |
|
|
namespace Ui { |
13 |
|
|
class JointTreeWidget; |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
namespace hpp { |
17 |
|
|
namespace gui { |
18 |
|
|
class JointTreeWidget : public QWidget { |
19 |
|
✗ |
Q_OBJECT |
20 |
|
|
|
21 |
|
|
public: |
22 |
|
|
explicit JointTreeWidget(HppWidgetsPlugin* plugin, QWidget* parent = 0); |
23 |
|
|
|
24 |
|
|
virtual ~JointTreeWidget(); |
25 |
|
|
|
26 |
|
|
/// Set the dock widget. |
27 |
|
|
/// \param dock new dock widget |
28 |
|
|
void dockWidget(QDockWidget* dock); |
29 |
|
|
|
30 |
|
|
/// Get the currently selected joint. |
31 |
|
|
std::string selectedJoint() const; |
32 |
|
|
|
33 |
|
|
signals: |
34 |
|
|
|
35 |
|
|
public slots: |
36 |
|
|
/// Display the context menu for a givent joint. |
37 |
|
|
/// \param pos poistion of the joint in the tree |
38 |
|
|
void customContextMenu(const QPoint& pos); |
39 |
|
|
|
40 |
|
|
/// select the joint in the tree. |
41 |
|
|
/// \param jointName name of the joint selected |
42 |
|
|
void selectJoint(const std::string& jointName); |
43 |
|
|
|
44 |
|
|
/// Get the currently selected joint name. |
45 |
|
|
QString getSelectedJoint() const; |
46 |
|
|
|
47 |
|
|
/// Open a dialog to set a joint bounds. |
48 |
|
|
/// \param jointName name of the joint |
49 |
|
|
void openJointBoundDialog(const std::string jointName); |
50 |
|
|
|
51 |
|
|
/// Open a dialog to move a joint. |
52 |
|
|
/// \param jointName name of the joint |
53 |
|
|
void openJointMoveDialog(const std::string jointName); |
54 |
|
|
|
55 |
|
|
/// Call the corba function to move the joint in hpp. |
56 |
|
|
/// \param transform transform to apply |
57 |
|
|
/// \param jointName name of the joint |
58 |
|
|
void moveJoint(hpp::Transform__slice* transform, |
59 |
|
|
std::string const& jointName); |
60 |
|
|
|
61 |
|
|
/// Reload the joint in the tree. |
62 |
|
|
void reload(); |
63 |
|
|
|
64 |
|
|
private slots: |
65 |
|
|
void resize(const QModelIndex index); |
66 |
|
|
|
67 |
|
|
/// Connected to signal "currentChanged" of the selection model of the |
68 |
|
|
/// joint tree view. |
69 |
|
|
void currentJointChanged(const QModelIndex& current, |
70 |
|
|
const QModelIndex& previous); |
71 |
|
|
|
72 |
|
|
private: |
73 |
|
|
void initSearchActions(); |
74 |
|
|
|
75 |
|
|
/// Reset the tree. |
76 |
|
|
void reset(); |
77 |
|
|
|
78 |
|
|
JointTreeItem* buildJointTreeItem(const char* name, CORBA::ULong& rkConfig, |
79 |
|
|
CORBA::ULong& rkVel); |
80 |
|
|
|
81 |
|
|
HppWidgetsPlugin* plugin_; |
82 |
|
|
::Ui::JointTreeWidget* ui_; |
83 |
|
|
|
84 |
|
|
QStandardItemModel* model_; |
85 |
|
|
QDockWidget* dock_; |
86 |
|
|
}; |
87 |
|
|
} // namespace gui |
88 |
|
|
} // namespace hpp |
89 |
|
|
|
90 |
|
|
#endif // HPP_GUI_JOINTTREEWIDGET_HH |
91 |
|
|
|