Salome HOME
updated copyright message
[modules/gui.git] / src / PVViewer / PVViewer_GUIElements.h
1 // Copyright (C) 2014-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author: Adrien Bruneton (CEA)
20
21 #ifndef PVVIEWER_GUIELEMENTS_H
22 #define PVVIEWER_GUIELEMENTS_H
23
24 #include "PVViewer.h"
25
26 #include <QObject>
27 #include <QList>
28
29 class QAction;
30 class QMainWindow;
31 class QMenu;
32 class QToolBar;
33 class pqAnimationTimeToolbar;
34 class pqPipelineBrowserWidget;
35 class pqPipelineModel;
36 class pqPropertiesPanel;
37 class pqVCRToolbar;
38
39 /*!
40  * Some GUI elements of ParaView need to be instanciated in a proper order. This class
41  * holds all of them for the sake of clarity.
42  */
43 class PVVIEWER_EXPORT PVViewer_GUIElements: public QObject
44 {
45   Q_OBJECT
46
47 public:
48   static PVViewer_GUIElements* GetInstance(QMainWindow*);
49
50   pqPropertiesPanel* getPropertiesPanel();
51   pqPipelineBrowserWidget* getPipelineBrowserWidget();
52
53   QMenu* getFiltersMenu();
54   QMenu* getSourcesMenu();
55   QMenu* getMacrosMenu();
56   QMenu* getCatalystMenu();
57
58   pqVCRToolbar* getVCRToolbar();
59   pqAnimationTimeToolbar* getTimeToolbar();
60
61   void setToolBarVisible(bool);
62   void setToolBarEnabled(bool);
63   QList<QToolBar*> getToolbars();
64
65   void setVCRTimeToolBarVisible(bool);
66
67 private:
68   PVViewer_GUIElements(QMainWindow*);
69   virtual ~PVViewer_GUIElements() {}
70
71   static PVViewer_GUIElements* theInstance;
72
73   void buildPVWidgets();
74
75   void publishExistingSources();
76
77   // Widgets
78   pqPropertiesPanel* propertiesPanel;
79   pqPipelineBrowserWidget* pipelineBrowserWidget;
80   pqPipelineModel* pipelineModel;
81
82   // Dummy QMenus receiving ParaView's reaction for automatic add when new sources are added
83   QMenu* sourcesMenu;
84   QMenu* filtersMenu;
85   QMenu* macrosMenu;
86   QMenu* catalystMenu;
87
88   // Toolbars also need to be instanciated early:
89   QToolBar* mainToolBar;
90   pqVCRToolbar* vcrToolbar;
91   pqAnimationTimeToolbar* timeToolbar;
92   QToolBar* colorToolbar;
93   QToolBar* reprToolbar;
94   QToolBar* cameraToolbar;
95   QToolBar* axesToolbar;
96   QToolBar* macrosToolbar;
97   QToolBar* commonToolbar;
98   QToolBar* dataToolbar;
99   
100   QMainWindow* myDesktop;
101   bool myPVWidgetsFlag;
102
103 public:
104   QAction* mainAction;
105   QAction* vcrAction;
106   QAction* timeAction;
107   QAction* colorAction;
108   QAction* reprAction;
109   QAction* cameraAction;
110   QAction* axesAction;
111   QAction* macrosAction;
112   QAction* commonAction;
113   QAction* dataAction;
114 };
115
116 #endif // PVVIEWER_GUIELEMENTS_H