gepetto-viewer  4.13.0
An user-friendly Graphical Interface
node-action.hh
Go to the documentation of this file.
1 // Copyright (c) 2015-2018, 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_NODE_ACTION_HH
18 #define GEPETTO_GUI_NODE_ACTION_HH
19 
20 #include <QAction>
21 #include <gepetto/gui/fwd.hh>
22 
23 namespace gepetto {
24 namespace gui {
25 class NodeActionBase : public QAction {
26  Q_OBJECT
27 
28  public:
29  NodeActionBase(const QString& text, NodePtr_t node, QWidget* parent);
30 
31  virtual ~NodeActionBase() {}
32 
33  NodePtr_t node() const;
34 
35  protected:
36  virtual void act(bool checked) = 0;
37 
38  private slots:
39  void _act(bool checked);
40 
41  private:
42  NodePtr_t node_;
43 };
44 
45 class NodeAction : public NodeActionBase {
46  public:
47  enum Type {
54  };
55 
56  NodeAction(const Type& t, const QString& text, NodePtr_t node,
57  QWidget* parent);
58 
59  NodeAction(const Type& t, const QString& text, QWidget* parent);
60 
62  NodeAction(const QString& text, NodePtr_t node, OSGWidget* window,
63  QWidget* parent);
64 
66  NodeAction(const QString& text, OSGWidget* window, QWidget* parent);
67 
68  virtual ~NodeAction() {}
69 
70  protected:
71  void act(bool checked);
72 
73  private:
74  const Type type_;
75  OSGWidget* window_;
76 };
77 } // namespace gui
78 } // namespace gepetto
79 
80 #endif // GEPETTO_GUI_NODE_ACTION_HH
virtual ~NodeAction()
Definition: node-action.hh:68
Definition: node-action.hh:53
NodeAction(const Type &t, const QString &text, NodePtr_t node, QWidget *parent)
void act(bool checked)
virtual void act(bool checked)=0
Definition: node-action.hh:25
Definition: node-action.hh:48
Type
Definition: node-action.hh:47
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:50
Definition: action-search-bar.hh:26
Definition: node-action.hh:51
Definition: node-action.hh:50
Definition: node-action.hh:45
virtual ~NodeActionBase()
Definition: node-action.hh:31
Definition: node-action.hh:49
NodeActionBase(const QString &text, NodePtr_t node, QWidget *parent)
Widget that displays scenes.
Definition: osgwidget.hh:43