VPTissue Reference Manual
ViewerActions.h
Go to the documentation of this file.
1 #ifndef GUI_PROJECTACTIONS_VIEWERACTIONS_H_INCLUDED
2 #define GUI_PROJECTACTIONS_VIEWERACTIONS_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "viewer/IViewerNode.h"
23 
24 #include <QObject>
25 #include <map>
26 #include <memory>
27 #include <vector>
28 
29 class QAction;
30 class QMenu;
31 
32 namespace SimShell {
33 namespace Gui {
34 namespace ProjectActions {
35 
41 class ViewerActions : public QObject
42 {
43  Q_OBJECT
44 public:
47  static std::shared_ptr<ViewerActions> Create(const std::shared_ptr<Viewer::IViewerNode>& root_viewer);
48 
49  virtual ~ViewerActions();
50 
53  QMenu* GetMenu() const;
54 
55 private slots:
56  void SLOT_Toggle(bool);
57 
58 private:
59  ViewerActions(const std::shared_ptr<Viewer::IViewerNode>& root_viewer);
60 
61  QMenu* m_menu;
62  std::map<QObject*, std::shared_ptr<Viewer::IViewerNode>> m_node_map;
63  std::map<QObject*, std::vector<QAction*>> m_children_map;
64 };
65 
66 } // namespace
67 } // namespace
68 } // namespace
69 
70 #endif // end_of_inclde_guard
static std::shared_ptr< ViewerActions > Create(const std::shared_ptr< Viewer::IViewerNode > &root_viewer)
Construct instance of this class.
Given a so-called 'root' viewer instance, constructs a menu representing the hierarchical structure o...
Definition: ViewerActions.h:41
see the online Qt documentation
see the online Qt documentation
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
Interface for IViewerNode.