GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/gui/node-action.hh Lines: 0 2 0.0 %
Date: 2020-05-14 11:23:33 Branches: 0 0 - %

Line Branch Exec Source
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
22
#include <QAction>
23
24
namespace gepetto {
25
  namespace gui {
26
    class 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
46
    class NodeAction : public NodeActionBase {
47
      public:
48
        enum Type {
49
          VISIBILITY_ON,
50
          VISIBILITY_OFF,
51
          ALWAYS_ON_TOP,
52
          ATTACH_TO_WINDOW,
53
          ATTACH_CAMERA_TO_NODE,
54
          REMOVE_NODE
55
        };
56
57
        NodeAction(const Type& t, const QString& text, NodePtr_t node, QWidget* parent);
58
59
        NodeAction(const Type& t, const QString& text, QWidget* parent);
60
61
        /// Attach to window
62
        NodeAction(const QString& text, NodePtr_t node, OSGWidget* window, QWidget* parent);
63
64
        /// Attach camera to node
65
        NodeAction(const QString& text, OSGWidget* window, QWidget* parent);
66
67
        virtual ~NodeAction () {}
68
69
      protected:
70
        void act(bool checked);
71
72
      private:
73
        const Type type_;
74
        OSGWidget* window_;
75
    };
76
  }
77
}
78
79
#endif // GEPETTO_GUI_NODE_ACTION_HH