]> SALOME platform Git repositories - modules/shaper.git/blob - src/NewGeom/NewGeom_Module.h
Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / NewGeom / NewGeom_Module.h
1
2
3 #ifndef NewGeom_Module_H
4 #define NewGeom_Module_H
5
6 #include "NewGeom.h"
7
8 #include <LightApp_Module.h>
9 #include <XGUI_SalomeConnector.h>
10
11 #include <QStringList>
12 #include <QMap>
13
14 class XGUI_Workshop; 
15 class NewGeom_OCCSelector;
16 class OCCViewer_Viewer;
17 /** 
18 * An implementation of SALOME connector class for implementation of
19 * XGUI functionality as a module of SALOME
20 */
21 class NewGeom_EXPORT NewGeom_Module: public LightApp_Module, public XGUI_SalomeConnector
22 {
23   Q_OBJECT
24 public:
25   NewGeom_Module();
26   virtual ~NewGeom_Module();
27
28   //----- LightAPP_Module interface ---------------
29   virtual void initialize( CAM_Application* theApp);
30   virtual void windows( QMap<int, int>& theWndMap) const;
31   virtual void viewManagers( QStringList& theList) const;
32   virtual void selectionChanged();
33
34   //--- XGUI connector interface -----
35   virtual void addFeature(const QString& theWBName,
36                           const QString& theId, 
37                           const QString& theTitle, 
38                           const QString& theTip,
39                           const QIcon& theIcon, 
40                           bool isCheckable = false,
41                           QObject* reciever = 0,
42                           const char* member = 0,
43                           const QKeySequence& theKeys = QKeySequence());
44
45   virtual void addEditCommand(const QString& theId,
46                               const QString& theTitle,
47                               const QString& theTip,
48                               const QIcon& theIcon, 
49                               bool isCheckable,
50                               QObject* reciever,
51                               const char* member,
52                               const QKeySequence& theKeys);
53
54   virtual void addEditMenuSeparator();
55
56   virtual QMainWindow* desktop() const;
57
58   virtual QString commandId(const QAction* theCmd) const;
59
60   virtual QAction* command(const QString& theId) const;
61
62   //! Set nested actions dependent on command Id
63   //! \param theId - the command ID
64   //! \param theActions - the list of nested actions
65   virtual void setNestedActions(const QString& theId, const QStringList& theActions);
66
67   //! Returns list of nested actions according to the given command ID
68   virtual QStringList nestedActions(const QString& theId) const;
69
70   //! Returns AIS_InteractiveContext from current OCCViewer
71   virtual Handle(AIS_InteractiveContext) AISContext() const;
72
73 public slots:
74   virtual bool activateModule( SUIT_Study* theStudy);
75   virtual bool deactivateModule( SUIT_Study* theStudy);
76
77 protected slots:
78   virtual void onViewManagerAdded( SUIT_ViewManager* theMgr );
79
80 protected:
81   CAM_DataModel* createDataModel();
82
83
84 private:
85   NewGeom_OCCSelector* createSelector(SUIT_ViewManager* theMgr);
86
87   QStringList myActionsList;
88
89   XGUI_Workshop* myWorkshop;
90
91   NewGeom_OCCSelector* mySelector;
92
93   QMap<QString, QStringList> myNestedActions;
94 };
95
96 #endif