gepetto-viewer  4.13.0
An user-friendly Graphical Interface
tree-item.hh
Go to the documentation of this file.
1 // Copyright (c) 2015-2020, LAAS-CNRS
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of gepetto-viewer.
5 // gepetto-viewer is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // gepetto-viewer is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // gepetto-viewer. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef GEPETTO_GUI_TREEITEM_HH
18 #define GEPETTO_GUI_TREEITEM_HH
19 
20 #include <QDoubleSpinBox>
21 #include <QItemDelegate>
22 #include <QMenu>
23 #include <QPushButton>
24 #include <QSignalMapper>
25 #include <QSlider>
26 #include <QStandardItem>
27 #include <gepetto/gui/fwd.hh>
28 
29 namespace gepetto {
30 namespace gui {
31 class BodyTreeItem : public QObject, public QStandardItem {
32  Q_OBJECT
33 
34  public:
35  BodyTreeItem(QObject* parent, NodePtr_t node);
36  void initialize();
37 
38  virtual QStandardItem* clone() const;
39 
40  virtual int type() const { return QStandardItem::UserType + 1; }
41 
42  NodePtr_t node() const;
43 
44  void populateContextMenu(QMenu* menu);
45 
46  void setParentGroup(const std::string& parent);
47 
48  QWidget* propertyEditors() const { return propertyEditors_; }
49 
50  virtual ~BodyTreeItem();
51 
52  public:
53  void attachToWindow(unsigned int windowID);
54 
55  public slots:
56  void setViewingMode(QString mode);
57  void setVisibilityMode(QString mode);
58  void removeFromGroup();
59  void remove();
60  void removeAll();
61  void addLandmark();
62  void deleteLandmark();
63  QString text() const { return QStandardItem::text(); }
64 
65  signals:
66  void requestInitialize();
67  private slots:
68  void doInitialize();
69 
70  private:
71  NodePtr_t node_;
72  std::string parentGroup_;
73 
74  QWidget* propertyEditors_;
75 
76  friend class VisibilityItem;
77 };
78 } // namespace gui
79 } // namespace gepetto
80 
81 #endif // GEPETTO_GUI_TREEITEM_HH
virtual QStandardItem * clone() const
NodePtr_t node() const
Definition: tree-item.hh:31
BodyTreeItem(QObject *parent, NodePtr_t node)
friend class VisibilityItem
Definition: tree-item.hh:76
void setVisibilityMode(QString mode)
QWidget * propertyEditors() const
Definition: tree-item.hh:48
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:50
Definition: action-search-bar.hh:26
void attachToWindow(unsigned int windowID)
QString text() const
Definition: tree-item.hh:63
virtual int type() const
Definition: tree-item.hh:40
void setParentGroup(const std::string &parent)
void setViewingMode(QString mode)
void populateContextMenu(QMenu *menu)