1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_MODULE_H
24 #define HYDROGUI_MODULE_H
26 #include <LightApp_Module.h>
30 class GraphicsView_Viewer;
32 class SUIT_ViewWindow;
34 class HYDROGUI_DataModel;
35 class HYDROGUI_Displayer;
37 /**\class HYDROGUI_Module
38 *\brief The class representing the HYDROGUI module
40 class HYDROGUI_Module : public LightApp_Module
44 enum CustomEvent { NewViewEvent = QEvent::User + 100 };
48 virtual ~HYDROGUI_Module();
51 * Returns the module study identifier
53 int getStudyId() const;
55 virtual void initialize( CAM_Application* );
56 virtual void windows( QMap<int, int>& ) const;
57 virtual void viewManagers( QStringList& ) const;
59 virtual void contextMenuPopup( const QString&, QMenu*, QString& );
61 virtual void update( const int );
62 virtual void updateCommandsStatus();
64 HYDROGUI_DataModel* getDataModel() const;
65 HYDROGUI_Displayer* getDisplayer() const;
67 GraphicsView_Viewer* getViewer( const int theViewerId ) const;
70 CAM_DataModel* createDataModel();
73 virtual bool activateModule( SUIT_Study* );
74 virtual bool deactivateModule( SUIT_Study* );
77 virtual LightApp_Operation* createOperation( const int ) const;
79 virtual void customEvent( QEvent* );
80 virtual bool eventFilter( QObject*, QEvent* );
85 bool onUndo( int theNumActions );
86 bool onRedo( int theNumActions );
88 virtual void onViewManagerAdded( SUIT_ViewManager* );
89 virtual void onViewManagerRemoved( SUIT_ViewManager* );
90 virtual void onViewCreated( SUIT_ViewWindow* );
93 void updateGV( const bool theIsInit = false,
94 const bool theIsForced = false );
96 void createSelector( SUIT_ViewManager* viewMgr );
98 bool setUpdateEnabled( const bool theState );
99 bool isUpdateEnabled() const;
102 void createActions();
105 void createToolbars();
107 void createUndoRedoActions();
108 void updateUndoRedoControls();
111 QAction* createAction( const int theId, const QString& theSuffix,
112 const QString& theImg = QString::null,
113 const int theKey = 0, const bool isToggle = false,
114 const QString& theSlot = QString::null );
117 HYDROGUI_Displayer* myDisplayer;
119 bool myIsUpdateEnabled;