2 #ifndef NewGeom_Module_H
3 #define NewGeom_Module_H
6 #include "NewGeom_SalomeViewer.h"
8 #include <LightApp_Module.h>
9 #include <XGUI_SalomeConnector.h>
11 #include <QStringList>
15 class NewGeom_OCCSelector;
16 class OCCViewer_Viewer;
19 * An implementation of SALOME connector class for implementation of
20 * XGUI functionality as a module of SALOME
22 class NewGeom_EXPORT NewGeom_Module : public LightApp_Module, public XGUI_SalomeConnector
27 virtual ~NewGeom_Module();
29 //----- LightAPP_Module interface ---------------
30 virtual void initialize(CAM_Application* theApp);
31 virtual void windows(QMap<int, int>& theWndMap) const;
32 virtual void viewManagers(QStringList& theList) const;
33 virtual void selectionChanged();
35 //--- XGUI connector interface -----
36 virtual QAction* addFeature(const QString& theWBName, const QString& theId,
37 const QString& theTitle, const QString& theTip, const QIcon& theIcon,
38 const QKeySequence& theKeys = QKeySequence(),
39 bool isCheckable = false);
41 virtual QAction* addEditCommand(const QString& theId, const QString& theTitle,
42 const QString& theTip, const QIcon& theIcon,
43 const QKeySequence& theKeys, bool isCheckable);
45 virtual void addEditMenuSeparator();
47 virtual QMainWindow* desktop() const;
49 virtual QString commandId(const QAction* theCmd) const;
51 virtual QAction* command(const QString& theId) const;
53 //! Set nested actions dependent on command Id
54 //! \param theId - the command ID
55 //! \param theActions - the list of nested actions
56 virtual void setNestedActions(const QString& theId, const QStringList& theActions);
58 //! Returns list of nested actions according to the given command ID
59 virtual QStringList nestedActions(const QString& theId) const;
61 //! Set the document kind of the action by the given command Id
62 //! \param theId - the command ID
63 //! \param theKind - the document kind
64 virtual void setDocumentKind(const QString& theId, const QString& theKind);
66 //! Returns the document kind of the action by the given command ID
67 virtual QString documentKind(const QString& theId) const;
69 //! Returns interface to Salome viewer
70 virtual ModuleBase_IViewer* viewer() const
75 //! Returns list of defined actions (just by NewGeom module)
76 virtual QList<QAction*> commandList() const;
78 //! Returns list of Ids of defined actions (just by NewGeom module)
79 virtual QStringList commandIdList() const;
81 virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle);
83 virtual void createPreferences();
84 virtual void preferencesChanged(const QString& theSection, const QString& theParam);
86 XGUI_Workshop* workshop() const { return myWorkshop; }
88 void setIsOpened(bool theOpened) { myIsOpened = theOpened; }
91 virtual bool activateModule(SUIT_Study* theStudy);
92 virtual bool deactivateModule(SUIT_Study* theStudy);
95 virtual void onViewManagerAdded(SUIT_ViewManager* theMgr);
96 void onDefaultPreferences();
99 CAM_DataModel* createDataModel();
102 NewGeom_OCCSelector* createSelector(SUIT_ViewManager* theMgr);
104 QStringList myActionsList;
106 XGUI_Workshop* myWorkshop;
108 NewGeom_OCCSelector* mySelector;
110 NewGeom_SalomeViewer* myProxyViewer;
112 QMap<QString, QStringList> myNestedActions;
113 QMap<QString, QString> myDocumentType;
116 bool myIsStorePositions;