]> SALOME platform Git repositories - modules/shaper.git/blob - src/NewGeom/NewGeom_Module.h
Salome HOME
be58a360224af956e984836c986e300de5c4b421
[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
13 class XGUI_Workshop; 
14 class NewGeom_OCCSelector;
15 class OCCViewer_Viewer;
16 /** 
17 * An implementation of SALOME connector class for implementation of
18 * XGUI functionality as a module of SALOME
19 */
20 class NewGeom_EXPORT NewGeom_Module: public LightApp_Module, public XGUI_SalomeConnector
21 {
22   Q_OBJECT
23 public:
24   NewGeom_Module();
25   virtual ~NewGeom_Module();
26
27   //----- LightAPP_Module interface ---------------
28   virtual void initialize( CAM_Application* theApp);
29   virtual void windows( QMap<int, int>& theWndMap) const;
30   virtual void viewManagers( QStringList& theList) const;
31   virtual void selectionChanged();
32
33   //--- XGUI connector interface -----
34   virtual void addFeature(const QString& theWBName,
35                           const QString& theId, 
36                           const QString& theTitle, 
37                           const QString& theTip,
38                           const QIcon& theIcon, 
39                           bool isCheckable = false,
40                           QObject* reciever = 0,
41                           const char* member = 0,
42                           const QKeySequence& theKeys = QKeySequence());
43
44   virtual void addEditCommand(const QString& theId,
45                               const QString& theTitle,
46                               const QString& theTip,
47                               const QIcon& theIcon, 
48                               bool isCheckable,
49                               QObject* reciever,
50                               const char* member,
51                               const QKeySequence& theKeys);
52
53   virtual void addEditMenuSeparator();
54
55   virtual QMainWindow* desktop() const;
56
57   virtual QString commandId(const QAction* theCmd) const;
58
59   virtual QAction* command(const QString& theId) const;
60
61   //! Returns AIS_InteractiveContext from current OCCViewer
62   virtual Handle(AIS_InteractiveContext) AISContext() const;
63
64 public slots:
65   virtual bool activateModule( SUIT_Study* theStudy);
66   virtual bool deactivateModule( SUIT_Study* theStudy);
67
68 protected slots:
69   virtual void onViewManagerAdded( SUIT_ViewManager* theMgr );
70
71 protected:
72   CAM_DataModel* createDataModel();
73
74
75 private:
76   NewGeom_OCCSelector* createSelector(SUIT_ViewManager* theMgr);
77
78   QStringList myActionsList;
79
80   XGUI_Workshop* myWorkshop;
81
82   NewGeom_OCCSelector* mySelector;
83 };
84
85 #endif