X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FNewGeom%2FNewGeom_Module.h;h=ef0b4eb4ad28d8f2596b7155a7bc70c35c3f0142;hb=1f6b8646d28bdfa596e27e351bbf3bc600a2f236;hp=1440856ff903be33b98a8ea4034e6ab6a1b6ee30;hpb=b96d49472ad23f609343fa158d1d7b96c729ed09;p=modules%2Fshaper.git diff --git a/src/NewGeom/NewGeom_Module.h b/src/NewGeom/NewGeom_Module.h index 1440856ff..ef0b4eb4a 100644 --- a/src/NewGeom/NewGeom_Module.h +++ b/src/NewGeom/NewGeom_Module.h @@ -4,13 +4,17 @@ #define NewGeom_Module_H #include "NewGeom.h" +#include "NewGeom_SalomeViewer.h" #include #include #include +#include -class XGUI_Workshop; +class XGUI_Workshop; +class NewGeom_OCCSelector; +class OCCViewer_Viewer; /** * An implementation of SALOME connector class for implementation of @@ -23,29 +27,27 @@ public: NewGeom_Module(); virtual ~NewGeom_Module(); + //----- LightAPP_Module interface --------------- virtual void initialize( CAM_Application* theApp); virtual void windows( QMap& theWndMap) const; virtual void viewManagers( QStringList& theList) const; + virtual void selectionChanged(); //--- XGUI connector interface ----- - virtual void addFeature(const QString& theWBName, - const QString& theId, - const QString& theTitle, - const QString& theTip, - const QIcon& theIcon, - bool isCheckable = false, - QObject* reciever = 0, - const char* member = 0, - const QKeySequence& theKeys = QKeySequence()); - - virtual void addEditCommand(const QString& theId, - const QString& theTitle, + virtual QAction* addFeature(const QString& theWBName, + const QString& theId, + const QString& theTitle, const QString& theTip, const QIcon& theIcon, - bool isCheckable, - QObject* reciever, - const char* member, - const QKeySequence& theKeys); + const QKeySequence& theKeys = QKeySequence(), + bool isCheckable = false); + + virtual QAction* addEditCommand(const QString& theId, + const QString& theTitle, + const QString& theTip, + const QIcon& theIcon, + const QKeySequence& theKeys, + bool isCheckable); virtual void addEditMenuSeparator(); @@ -55,21 +57,46 @@ public: virtual QAction* command(const QString& theId) const; - //! Returns AIS_InteractiveContext from current OCCViewer - virtual Handle(AIS_InteractiveContext) AISContext() const; + //! Set nested actions dependent on command Id + //! \param theId - the command ID + //! \param theActions - the list of nested actions + virtual void setNestedActions(const QString& theId, const QStringList& theActions); + + //! Returns list of nested actions according to the given command ID + virtual QStringList nestedActions(const QString& theId) const; + + //! Returns interface to Salome viewer + virtual XGUI_SalomeViewer* viewer() const { return myProxyViewer; } + + //! Returns list of defined actions (just by NewGeom module) + virtual QList commandList() const; + + //! Returns list of Ids of defined actions (just by NewGeom module) + virtual QStringList commandIdList() const; public slots: - bool activateModule( SUIT_Study* theStudy); - bool deactivateModule( SUIT_Study* theStudy); + virtual bool activateModule( SUIT_Study* theStudy); + virtual bool deactivateModule( SUIT_Study* theStudy); + +protected slots: + virtual void onViewManagerAdded( SUIT_ViewManager* theMgr ); protected: CAM_DataModel* createDataModel(); private: + NewGeom_OCCSelector* createSelector(SUIT_ViewManager* theMgr); + QStringList myActionsList; XGUI_Workshop* myWorkshop; + + NewGeom_OCCSelector* mySelector; + + NewGeom_SalomeViewer* myProxyViewer; + + QMap myNestedActions; }; #endif