gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
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 <gepetto/gui/fwd.hh>
21// This include must be include before any other Qt include for GLDEBUGPROC
22#include <QAction>
23
24namespace gepetto {
25namespace gui {
26class NodeActionBase : public QAction {
27 Q_OBJECT
28
29 public:
30 NodeActionBase(const QString& text, NodePtr_t node, QWidget* parent);
31
32 virtual ~NodeActionBase() {}
33
34 NodePtr_t node() const;
35
36 protected:
37 virtual void act(bool checked) = 0;
38
39 private slots:
40 void _act(bool checked);
41
42 private:
43 NodePtr_t node_;
44};
45
46class NodeAction : public NodeActionBase {
47 public:
56
57 NodeAction(const Type& t, const QString& text, NodePtr_t node,
58 QWidget* parent);
59
60 NodeAction(const Type& t, const QString& text, QWidget* parent);
61
63 NodeAction(const QString& text, NodePtr_t node, OSGWidget* window,
64 QWidget* parent);
65
67 NodeAction(const QString& text, OSGWidget* window, QWidget* parent);
68
69 virtual ~NodeAction() {}
70
71 protected:
72 void act(bool checked);
73
74 private:
75 const Type type_;
76 OSGWidget* window_;
77};
78} // namespace gui
79} // namespace gepetto
80
81#endif // GEPETTO_GUI_NODE_ACTION_HH
Definition node-action.hh:26
virtual ~NodeActionBase()
Definition node-action.hh:32
NodeActionBase(const QString &text, NodePtr_t node, QWidget *parent)
virtual void act(bool checked)=0
Definition node-action.hh:46
NodeAction(const Type &t, const QString &text, NodePtr_t node, QWidget *parent)
void act(bool checked)
Type
Definition node-action.hh:48
@ VISIBILITY_OFF
Definition node-action.hh:50
@ REMOVE_NODE
Definition node-action.hh:54
@ ATTACH_CAMERA_TO_NODE
Definition node-action.hh:53
@ ATTACH_TO_WINDOW
Definition node-action.hh:52
@ VISIBILITY_ON
Definition node-action.hh:49
@ ALWAYS_ON_TOP
Definition node-action.hh:51
NodeAction(const QString &text, OSGWidget *window, QWidget *parent)
Attach camera to node.
virtual ~NodeAction()
Definition node-action.hh:69
NodeAction(const Type &t, const QString &text, QWidget *parent)
NodeAction(const QString &text, NodePtr_t node, OSGWidget *window, QWidget *parent)
Attach to window.
Widget that displays scenes.
Definition osgwidget.hh:44
viewer::NodePtr_t NodePtr_t
Definition fwd.hh:52
Definition action-search-bar.hh:27