X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPVGUI%2FPVGUI_Module.h;h=7fc18892bfdc30b5f88f1f3776fb335d97d6b189;hb=803a5ca2778ff1881295b0e9ae85de8fab6361ca;hp=5c0732ee6a2f5e66b6e5a975db0428861160e730;hpb=567d1f0ea0003a9b7978447cc619bf1ce8e9f79a;p=modules%2Fparavis.git diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index 5c0732ee..7fc18892 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -1,11 +1,11 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2010-2012 CEA/DEN, EDF R&D +// Copyright (C) 2010-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,9 +27,12 @@ #define PVGUI_Module_H #include +#include +#include CORBA_SERVER_HEADER(PVSERVER_Gen) #include #include +#include #include @@ -39,14 +42,14 @@ class QToolBar; class vtkPVMain; class pqOptions; class pqServer; -class pqTabbedMultiViewWidget; class pqMainWindowCore; class vtkEventQtSlotConnect; class pqPythonScriptEditor; class pqPVApplicationCore; class pqDataRepresentation; class pqRepresentation; - +class PVViewer_GUIElements; +class PVViewer_EngineWrapper; class PVGUI_Module : public SalomeApp_Module { @@ -54,84 +57,85 @@ class PVGUI_Module : public SalomeApp_Module //! Menu actions enum { // Menu "File" - OpenFileId, - - LoadStateId, - SaveStateId, - - SaveDataId, - SaveScreenshotId, - ExportId, - - SaveAnimationId, - SaveGeometryId, - - ConnectId, - DisconnectId, - - // Menu "Edit" - UndoId, - RedoId, - - CameraUndoId, - CameraRedoId, - - FindDataId, - ChangeInputId, - IgnoreTimeId, - DeleteId, - DeleteAllId, - - SettingsId, - ViewSettingsId, - - // Menu "View" - FullScreenId, - - // Menu "Animation" - FirstFrameId, - PreviousFrameId, - PlayId, - NextFrameId, - LastFrameId, - LoopId, - - // Menu "Tools" - CreateCustomFilterId, - ManageCustomFiltersId, - CreateLookmarkId, - ManageLinksId, - AddCameraLinkId, - ManagePluginsExtensionsId, - DumpWidgetNamesId, - RecordTestId, - RecordTestScreenshotId, - PlayTestId, - MaxWindowSizeId, - CustomWindowSizeId, - TimerLogId, - OutputWindowId, - PythonShellId, - ShowTraceId, - - // Menu "Help" - AboutParaViewId, - ParaViewHelpId, - EnableTooltipsId, - - // Menu "Window" - "New Window" - ParaViewNewWindowId, - - // "Save state" ParaVis module root object popup - SaveStatePopupId, - - // "Add state" and "Reload state" popups - AddStatePopupId, - CleanAndAddStatePopupId, - - // "Rename" and "Delete" popups (Object Browser) - ParaVisRenameId, - ParaVisDeleteId + OpenFileId, + + LoadStateId, + SaveStateId, + + SaveDataId, + SaveScreenshotId, + ExportId, + + SaveAnimationId, + SaveGeometryId, + + ConnectId, + DisconnectId, + + // Menu "Edit" + UndoId, + RedoId, + + CameraUndoId, + CameraRedoId, + + FindDataId, + ChangeInputId, + IgnoreTimeId, + DeleteId, + DeleteAllId, + + SettingsId, + ViewSettingsId, + + // Menu "View" + FullScreenId, + + // Menu "Animation" + FirstFrameId, + PreviousFrameId, + PlayId, + NextFrameId, + LastFrameId, + LoopId, + + // Menu "Tools" + CreateCustomFilterId, + ManageCustomFiltersId, + CreateLookmarkId, + ManageLinksId, + AddCameraLinkId, + ManagePluginsExtensionsId, + DumpWidgetNamesId, + RecordTestId, + RecordTestScreenshotId, + PlayTestId, + MaxWindowSizeId, + CustomWindowSizeId, + TimerLogId, + OutputWindowId, + PythonShellId, + ShowTraceId, + RestartTraceId, + + // Menu "Help" + AboutParaViewId, + ParaViewHelpId, + EnableTooltipsId, + + // Menu "Window" - "New Window" + ParaViewNewWindowId, + + // "Save state" ParaVis module root object popup + SaveStatePopupId, + + // "Add state" and "Reload state" popups + AddStatePopupId, + CleanAndAddStatePopupId, + + // "Rename" and "Delete" popups (Object Browser) + ParaVisRenameId, + ParaVisDeleteId }; public: @@ -141,9 +145,7 @@ public: virtual void initialize( CAM_Application* ); virtual void windows( QMap& ) const; - pqTabbedMultiViewWidget* getMultiViewManager() const; - - virtual QString engineIOR() const; + virtual QString engineIOR() const; // to be removed when becoming Light void openFile(const char* theName); void executeScript(const char *script); @@ -152,6 +154,8 @@ public: void clearParaviewState(); QString getTraceString(); + void startTrace(); + void stopTrace(); void saveTrace(const char* theName); pqServer* getActiveServer(); @@ -160,12 +164,18 @@ public: virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle); + inline static PVViewer_EngineWrapper * GetEngine(); + inline static PVSERVER_ORB::PVSERVER_Gen_var GetCPPEngine(); // to be removed once light! + inline static pqPVApplicationCore * GetPVApplication(); + + virtual CAM_DataModel* createDataModel(); + void fixAnimationScene(); + public slots: - void onImportFromVisu(QString theEntry); + //void onImportFromVisu(QString theEntry); private: - //! Initialize ParaView if not yet done (once per session) - static bool pvInit(); + void deleteTemporaryFiles(); //! Create actions for ParaView GUI operations void pvCreateActions(); @@ -194,10 +204,6 @@ private: //! Discover help project files from the resources. QString getHelpFileName(); - void deleteTemporaryFiles(); - - //QList getParaViewToolbars(); - //! Create actions for ParaViS void createActions(); @@ -207,9 +213,18 @@ private: //! Load selected state void loadSelectedState(bool toClear); + //! Get list of embedded macros files + QStringList getEmbeddedMacrosList(); + //! update macros state void updateMacros(); + //! store visibility of the common dockable windows (OB, PyConsole, ... etc.) + void storeCommonWindowsState(); + + //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.) + void restoreCommonWindowsState(); + private slots: void showHelpForProxy( const QString&, const QString& ); @@ -223,16 +238,14 @@ private slots: //void showParaViewHelp(); //void showHelp(const QString& url); - void onFinishedAddingServer(pqServer*); - void onDataRepresentationCreated(pqDataRepresentation*); - void onVariableChanged(pqVariableType, const QString); - void onRepresentationChanged(pqRepresentation*); + void onDataRepresentationUpdated(); void onStartProgress(); void onEndProgress(); void onShowTrace(); + void onRestartTrace(); - void onNewParaViewWindow(); +// void onNewParaViewWindow(); void onSaveMultiState(); void onAddState(); @@ -249,14 +262,10 @@ public slots: protected slots: virtual void onModelOpened(); - -protected: - void timerEvent(QTimerEvent *event); + virtual void onPushTraceTimer(); + virtual void onInitTimer(); private: - class pqImplementation; - pqImplementation* Implementation; - int mySelectionControlsTb; int mySourcesMenuId; int myFiltersMenuId; @@ -268,6 +277,10 @@ private: WgMap myDockWidgets; WgMap myToolbars; WgMap myToolbarBreaks; + QList myMenus; + + typedef QMap DockWindowMap; + DockWindowMap myCommonMap; QStringList myTemporaryFiles; @@ -279,7 +292,16 @@ private: int myStateCounter; - static pqPVApplicationCore* MyCoreApp; + //! Single shot timer used to connect to the PVServer, and start the trace. + QTimer * myInitTimer; + + //! Timer used to regularly push the Python trace to the engine. + QTimer * myPushTraceTimer; + + PVViewer_GUIElements * myGuiElements; + + static PVSERVER_ORB::PVSERVER_Gen_var MyEngine; + }; #endif // PVGUI_Module_H