X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI.h;h=2092a9f526ec74f7382da45f8b8062b7f09f4386;hb=a55132da45cf8b1c8a83246b8cd79c9414d839bc;hp=32b6b231b64104eb72f363de2c4c6beef4ff3b36;hpb=b2a0aaab64643f9e0a126f3b6c48c99ce3350392;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI.h b/src/SUPERVGUI/SUPERVGUI.h index 32b6b23..2092a9f 100644 --- a/src/SUPERVGUI/SUPERVGUI.h +++ b/src/SUPERVGUI/SUPERVGUI.h @@ -31,30 +31,31 @@ // Acces a l`ihm de SALOME // ----------------------- -#include "QAD_Desktop.h" - - #include "SUPERVGUI_Def.h" #include "SUPERVGUI_Service.h" #include "SUPERVGUI_Main.h" -//#include "SUPERVGUI_Information.h" -#include "SALOMEGUI.h" +#include "SalomeApp_Module.h" +#include "SALOMEDSClient.hxx" + +class SUIT_Study; // Definition de la classe principale du module de supervision // ----------------------------------------------------------- -class SUPERVGUI: public SALOMEGUI { +class SUPERVGUI: public SalomeApp_Module { Q_OBJECT public: - SUPERVGUI( const QString&, QObject* = 0 ); + SUPERVGUI(); virtual ~SUPERVGUI(); - QAD_Desktop* getDesktop(); + static SUPERVGUI* Supervision(); + + virtual void initialize( CAM_Application* ); + virtual QString engineIOR() const; SUPERV_Engine getEngine(); - QAD_Study* getActiveStudy() - { return study; }; + SUIT_Study* getActiveStudy() { return study; } SUPERVGUI_Service* getBrowser(); QCursor getCursor(); @@ -72,33 +73,31 @@ class SUPERVGUI: public SALOMEGUI { void suspendResumeDataflow(); void showComponents(); - void init(QAD_Desktop* parent); SUPERVGUI_Main* getMain(); - bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); - bool SetSettings(QAD_Desktop* parent); - void DefinePopup(QString & theContext, - QString & theParent, - QString & theObject ) ; - bool CustomPopup(QAD_Desktop* parent, - QPopupMenu* popup, - const QString & theContext, - const QString & theParent, - const QString & theObject); - bool ActiveStudyChanged( QAD_Desktop* parent ); - void SupportedViewType (int* buffer, int bufferSize); - - bool isContains(QAD_Study* theStudy, const QString theKey); + bool OnGUIEvent(int theCommandID); + //bool SetSettings(); + //void DefinePopup(QString & theContext, + // QString & theParent, + // QString & theObject ) ; + //bool CustomPopup(QPopupMenu* popup, + // const QString & theContext, + // const QString & theParent, + // const QString & theObject); + bool ActiveStudyChanged(); + //void SupportedViewType (int* buffer, int bufferSize); + + bool isContains(SUIT_Study* theStudy, const QString theKey); void registerGraph(QString theName, SUPERVGUI_Main* theGraph); void unregisterGraph(SUPERVGUI_Main* theGraph); - QAD_StudyFrame* createGraph(); + SUIT_ViewWindow* createGraph(); /** Returns: theIsOwner = true if Selected object belongs to Suipervision. theIsDataflow = true if Selected object is Dataflow */ - void whatIsSelected(const Handle(SALOME_InteractiveObject)& theObj, bool& theIsOwner, bool& theIsDataflow); + void whatIsSelected(const _PTR(SObject)& theObj, bool& theIsOwner, bool& theIsDataflow); /* asv : bug [VSR Bugs and Improvements in Supervisor] 1.8 : when exporting a file, a backup copy of an existing file must be created (in case Export fails..) @@ -108,15 +107,39 @@ class SUPERVGUI: public SALOMEGUI { */ static QString createBackupFile( const QString& theOriginalFileName ); + virtual void windows( QMap& ) const; + + QMap getInterfaceNameMap() const; + + /*! + * \brief The method nullify myInitalViewFrame variable + * to avoid using this view frame once more, it is using + * after add any node into first new dataflow in study. + */ + void nullifyInitialVF() { if ( myInitialViewFrame ) myInitialViewFrame = 0; } + + // mkr : IPAL10825 + QColor getIVFBackgroundColor() { return myIVFBackgroundColor; } + void setIVFBackgroundColor( QColor theColor ) { if ( myInitialViewFrame ) myIVFBackgroundColor = theColor; } + signals: void KillMainThread(bool theValue); private slots: - void setMain(QWidget* w); + void setMain(SUIT_ViewWindow* w); void displayDataflow(); void renameDataflow(); void deleteObject(); - void onGraphClosed(QAD_ViewFrame* ); + void onGraphClosed( SUIT_ViewWindow* ); + void OnGUIEvent(); + + public slots: + virtual bool activateModule( SUIT_Study* ); + virtual bool deactivateModule( SUIT_Study* ); + + protected: + virtual CAM_DataModel* createDataModel(); + virtual LightApp_Selection* createSelection() const; private: void loadEngine(SALOME_NamingService* namingService); @@ -126,11 +149,15 @@ class SUPERVGUI: public SALOMEGUI { // method called from importDataflow(), modifyDataflow(), newDataflow() with // different modes. The behavior of the function is very similar in all 3 cases, // but some differences still exist. These differences are implemented using NEW_DF_MODE param. - bool createDataflow( const NEW_DF_MODE f ); + bool createDataflow( const NEW_DF_MODE f, bool theInitialDF = false ); + + void createSupervAction( const int id, const QString& po_id, const QString& icon_id = QString(""), + const int key = 0, const bool toggle = false ); + + void fillInterfaceNameMap(); static int factory; - QAD_Desktop* desktop; - QAD_Study* study; + SUIT_Study* study; SUPERV_Engine engine; SUPERVGUI_Service* browser; //SUPERVGUI_Information* info; @@ -138,11 +165,12 @@ class SUPERVGUI: public SALOMEGUI { SUPERVGUI_Main* main; // active main QPtrList myGraphList; -}; - + QMap myInterfaceNameMap; -// Acces a l'instance unique de la classe du module de l'interface graphique de la supervision -// ------------------------------------------------------------------------------------------- -extern SUPERVGUI Supervision; + bool myFirstActivation; + bool myAllGraphsClosed; + SUPERVGraph_ViewFrame* myInitialViewFrame; + QColor myIVFBackgroundColor; // mkr : IPAL10825 +}; #endif