From eea45d059cb37f00df6d3630628223554267694d Mon Sep 17 00:00:00 2001 From: abn Date: Thu, 16 Oct 2014 13:11:37 +0200 Subject: [PATCH] Moving resources to GUI. --- resources/CMakeLists.txt | 4 - resources/ParaViewFilters.xml | 215 ----------------------------- resources/ParaViewReaders.xml | 78 ----------- resources/ParaViewSources.xml | 29 ---- resources/ParaViewWriters.xml | 28 ---- src/ENGINE/no_wrap/PARAVIS.py.in | 3 +- src/PVGUI/CMakeLists.txt | 5 +- src/PVGUI/PVGUI_DataModel.cxx | 70 ++++++++++ src/PVGUI/PVGUI_DataModel.h | 46 ++++++ src/PVGUI/PVGUI_Module.cxx | 177 +++++++++++++----------- src/PVGUI/PVGUI_Module.h | 8 +- src/PVGUI/PVGUI_Module_actions.cxx | 5 +- src/PVGUI/PVGUI_Module_widgets.cxx | 19 ++- 13 files changed, 234 insertions(+), 453 deletions(-) delete mode 100755 resources/ParaViewFilters.xml delete mode 100755 resources/ParaViewReaders.xml delete mode 100755 resources/ParaViewSources.xml delete mode 100755 resources/ParaViewWriters.xml create mode 100644 src/PVGUI/PVGUI_DataModel.cxx create mode 100644 src/PVGUI/PVGUI_DataModel.h diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 9dcfd141..4cb6e1c8 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -20,10 +20,6 @@ SET(dist_salomeres_DATA pqAppIcon22.png pqAppIcon16.png - ParaViewFilters.xml - ParaViewReaders.xml - ParaViewSources.xml - ParaViewWriters.xml ) SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVISCatalog.xml.in) diff --git a/resources/ParaViewFilters.xml b/resources/ParaViewFilters.xml deleted file mode 100755 index 22eb6da6..00000000 --- a/resources/ParaViewFilters.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/ParaViewReaders.xml b/resources/ParaViewReaders.xml deleted file mode 100755 index dd88e53a..00000000 --- a/resources/ParaViewReaders.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/ParaViewSources.xml b/resources/ParaViewSources.xml deleted file mode 100755 index b8b3cf8c..00000000 --- a/resources/ParaViewSources.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/ParaViewWriters.xml b/resources/ParaViewWriters.xml deleted file mode 100755 index db7fd3e1..00000000 --- a/resources/ParaViewWriters.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ENGINE/no_wrap/PARAVIS.py.in b/src/ENGINE/no_wrap/PARAVIS.py.in index 1dbc89ff..5a7692c7 100644 --- a/src/ENGINE/no_wrap/PARAVIS.py.in +++ b/src/ENGINE/no_wrap/PARAVIS.py.in @@ -35,7 +35,8 @@ import os #from SALOME_utilities import MESSAGE def MESSAGE(m): - os.system("echo \"%s\" >> /tmp/paravis_log.txt" % m) + pass + #os.system("echo \"%s\" >> /tmp/paravis_log.txt" % m) class PARAVIS_Impl: """ The core implementation (non CORBA, or Study related). diff --git a/src/PVGUI/CMakeLists.txt b/src/PVGUI/CMakeLists.txt index e8a95ccb..4f387fee 100644 --- a/src/PVGUI/CMakeLists.txt +++ b/src/PVGUI/CMakeLists.txt @@ -71,9 +71,7 @@ QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files}) # header files / to be processed by moc SET(_moc_HEADERS PVGUI_Module.h -# PVGUI_ViewManager.h -# PVGUI_ViewModel.h -# PVGUI_ViewWindow.h + PVGUI_DataModel.h PVGUI_ParaViewSettingsPane.h ) @@ -145,6 +143,7 @@ SET(_other_SOURCES PVGUI_Module_widgets.cxx PVGUI_Tools.cxx PVGUI_ParaViewSettingsPane.cxx + PVGUI_DataModel.cxx ) IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) diff --git a/src/PVGUI/PVGUI_DataModel.cxx b/src/PVGUI/PVGUI_DataModel.cxx new file mode 100644 index 00000000..22041e30 --- /dev/null +++ b/src/PVGUI/PVGUI_DataModel.cxx @@ -0,0 +1,70 @@ +// Copyright (C) 2010-2014 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author : Adrien Bruneton (CEA) +// + +#include "PVGUI_DataModel.h" +#include "PVGUI_Module.h" + +#include +#include +#include + +PVGUI_DataModel::PVGUI_DataModel( PVGUI_Module* theModule ): + LightApp_DataModel(theModule) +{} + +PVGUI_DataModel::~PVGUI_DataModel() +{} + +bool PVGUI_DataModel::dumpPython( const QString& path, CAM_Study* std, + bool multiFile, QStringList& listOfFiles) +{ + QString tmpFile("/tmp/kikou.py"); + listOfFiles.push_back(tmpFile); + QFile file(tmpFile); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return false; + + //MESSAGE("[PARAVIS] dumpPython()") + PVGUI_Module * mod = (PVGUI_Module *) getModule(); + QString trace(mod->getTraceString()); + + if (multiFile) + { + QStringList abuffer; + abuffer.push_back(QString("def RebuildData( theStudy ):")); + QStringList lst(trace.split("\n")); + foreach(QString elem, lst) + { + QString s = " " + elem; + abuffer.push_back(s); + } + abuffer.push_back(QString(" pass")); + trace = abuffer.join("\n"); + } + QTextStream out(&file); + out << trace.toStdString().c_str() << "\n"; + out.flush(); + file.close(); + + std::cout << "@@@@@ wrote :\n" < + +#include +#include +#include + +class PVGUI_Module; +class CAM_Study; + +class PVGUI_DataModel: public LightApp_DataModel +{ + Q_OBJECT + +public: + PVGUI_DataModel( PVGUI_Module* theModule ); + virtual ~PVGUI_DataModel(); + + virtual bool dumpPython( const QString&, CAM_Study*, bool, QStringList& ); + +}; + +#endif /* PVGUIDATAMODEL_H_ */ diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 2f055f11..b96cae25 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -20,6 +20,8 @@ // // File : PVGUI_Module.cxx +#define PARAVIS_MODULE_NAME "PARAVIS" + #include // E.A. must be included before Python.h to fix compilation on windows #ifdef HAVE_FINITE #undef HAVE_FINITE // VSR: avoid compilation warning on Linux : "HAVE_FINITE" redefined @@ -41,8 +43,10 @@ #include "PVGUI_ParaViewSettingsPane.h" #include "PVViewer_GUIElements.h" #include "PVViewer_EngineWrapper.h" +#include "PVGUI_DataModel.h" // SALOME Includes +#include #include #include #include @@ -56,7 +60,8 @@ #include #include -#include +#include +#include // should ultimately be a LightApp only #include #include #include @@ -131,6 +136,8 @@ // TO REMOVE: #include +#include + //---------------------------------------------------------------------------- PVGUI_Module* ParavisModule = 0; @@ -203,45 +210,45 @@ PARAVIS_ORB::PARAVIS_Gen_var PVGUI_Module::MyEngine; SALOME module wrapping ParaView GUI. */ -_PTR(SComponent) -ClientFindOrCreateParavisComponent(_PTR(Study) theStudyDocument) -{ - _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("PARAVIS"); - if (!aSComponent) { - _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder(); - aStudyBuilder->NewCommand(); - int aLocked = theStudyDocument->GetProperties()->IsLocked(); - if (aLocked) theStudyDocument->GetProperties()->SetLocked(false); - aSComponent = aStudyBuilder->NewComponent("PARAVIS"); - _PTR(GenericAttribute) anAttr = - aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName"); - _PTR(AttributeName) aName (anAttr); - - ORB_INIT& init = *SINGLETON_::Instance(); - CORBA::ORB_var anORB = init( qApp->argc(), qApp->argv() ); - - SALOME_NamingService *NamingService = new SALOME_NamingService( anORB ); - CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog"); - SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = - SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); - SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "PARAVIS" ); - if (!Comp->_is_nil()) { - aName->SetValue(Comp->componentusername()); - } - - anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap"); - _PTR(AttributePixMap) aPixmap (anAttr); - aPixmap->SetPixMap( "pqAppIcon16.png" ); - - // Create Attribute parameters for future using - anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeParameter"); - - aStudyBuilder->DefineComponentInstance(aSComponent, PVGUI_Module::GetCPPEngine()->GetIOR()); - if (aLocked) theStudyDocument->GetProperties()->SetLocked(true); - aStudyBuilder->CommitCommand(); - } - return aSComponent; -} +//_PTR(SComponent) +//ClientFindOrCreateParavisComponent(_PTR(Study) theStudyDocument) +//{ +// _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("PARAVIS"); +// if (!aSComponent) { +// _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder(); +// aStudyBuilder->NewCommand(); +// int aLocked = theStudyDocument->GetProperties()->IsLocked(); +// if (aLocked) theStudyDocument->GetProperties()->SetLocked(false); +// aSComponent = aStudyBuilder->NewComponent("PARAVIS"); +// _PTR(GenericAttribute) anAttr = +// aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeName"); +// _PTR(AttributeName) aName (anAttr); +// +// ORB_INIT& init = *SINGLETON_::Instance(); +// CORBA::ORB_var anORB = init( qApp->argc(), qApp->argv() ); +// +// SALOME_NamingService *NamingService = new SALOME_NamingService( anORB ); +// CORBA::Object_var objVarN = NamingService->Resolve("/Kernel/ModulCatalog"); +// SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = +// SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); +// SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "PARAVIS" ); +// if (!Comp->_is_nil()) { +// aName->SetValue(Comp->componentusername()); +// } +// +// anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributePixMap"); +// _PTR(AttributePixMap) aPixmap (anAttr); +// aPixmap->SetPixMap( "pqAppIcon16.png" ); +// +// // Create Attribute parameters for future using +// anAttr = aStudyBuilder->FindOrCreateAttribute(aSComponent, "AttributeParameter"); +// +// aStudyBuilder->DefineComponentInstance(aSComponent, PVGUI_Module::GetCPPEngine()->GetIOR()); +// if (aLocked) theStudyDocument->GetProperties()->SetLocked(true); +// aStudyBuilder->CommitCommand(); +// } +// return aSComponent; +//} /*! Clean up function; used to stop ParaView progress events when @@ -259,7 +266,7 @@ void paravisCleanUp() \brief Constructor. Sets the default name for the module. */ PVGUI_Module::PVGUI_Module() - : SalomeApp_Module( "PARAVIS" ), + : SalomeApp_Module( PARAVIS_MODULE_NAME ), mySelectionControlsTb( -1 ), mySourcesMenuId( -1 ), myFiltersMenuId( -1 ), @@ -304,18 +311,21 @@ PVGUI_Module::~PVGUI_Module() delete myInitTimer; } -PARAVIS_ORB::PARAVIS_Gen_var PVGUI_Module::GetCPPEngine() +PVViewer_EngineWrapper * PVGUI_Module::GetEngine() { - // initialize PARAVIS module engine (load, if necessary) - if ( CORBA::is_nil( MyEngine ) ) { - Engines::EngineComponent_var comp = - SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "PARAVIS" ); - MyEngine = PARAVIS_ORB::PARAVIS_Gen::_narrow( comp ); - } - return MyEngine; + return PVViewer_EngineWrapper::GetInstance(); } +/*! + \brief Create data model. + \return module specific data model +*/ +CAM_DataModel* PVGUI_Module::createDataModel() +{ + return new PVGUI_DataModel( this ); +} + pqPVApplicationCore * PVGUI_Module::GetPVApplication() { return PVViewer_ViewManager::GetPVApplication(); @@ -327,7 +337,7 @@ pqPVApplicationCore * PVGUI_Module::GetPVApplication() */ void PVGUI_Module::initialize( CAM_Application* app ) { - SalomeApp_Module::initialize( app ); + LightApp_Module::initialize( app ); // Create ParaViS actions createActions(); @@ -343,12 +353,12 @@ void PVGUI_Module::initialize( CAM_Application* app ) } */ - SalomeApp_Application* anApp = getApp(); + LightApp_Application* anApp = getApp(); SUIT_Desktop* aDesktop = anApp->desktop(); // Initialize ParaView client and associated behaviors // and connect to externally launched pvserver - PVViewer_ViewManager::ParaviewInitApp(aDesktop); + PVViewer_ViewManager::ParaviewInitApp(aDesktop, anApp->logWindow()); myGuiElements = PVViewer_GUIElements::GetInstance(aDesktop); // Remember current state of desktop toolbars @@ -414,7 +424,7 @@ void PVGUI_Module::initialize( CAM_Application* app ) updateMacros(); SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false ); + bool isStop = aResourceMgr->booleanValue( PARAVIS_MODULE_NAME, "stop_trace", false ); if(!isStop) { // Start a timer to schedule asap: @@ -524,11 +534,11 @@ void PVGUI_Module::windows( QMap& m ) const */ void PVGUI_Module::showView( bool toShow ) { - SalomeApp_Application* anApp = getApp(); + LightApp_Application* anApp = getApp(); PVViewer_ViewManager* viewMgr = dynamic_cast( anApp->getViewManager( PVViewer_Viewer::Type(), false ) ); if ( !viewMgr ) { - viewMgr = new PVViewer_ViewManager( anApp->activeStudy(), anApp->desktop() ); + viewMgr = new PVViewer_ViewManager( anApp->activeStudy(), anApp->desktop(), anApp->logWindow() ); anApp->addViewManager( viewMgr ); connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), anApp, SLOT( onCloseView( SUIT_ViewManager* ) ) ); @@ -612,7 +622,7 @@ bool PVGUI_Module::activateModule( SUIT_Study* study ) storeCommonWindowsState(); - bool isDone = SalomeApp_Module::activateModule( study ); + bool isDone = LightApp_Module::activateModule( study ); if ( !isDone ) return false; showView( true ); @@ -653,7 +663,7 @@ bool PVGUI_Module::activateModule( SUIT_Study* study ) if ( myRecentMenuId != -1 ) menuMgr()->show(myRecentMenuId); - ClientFindOrCreateParavisComponent(PARAVIS::GetCStudy(this)); + //ClientFindOrCreateParavisComponent(PARAVIS::GetCStudy(this)); return isDone; } @@ -714,7 +724,7 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) restoreCommonWindowsState(); - return SalomeApp_Module::deactivateModule( study ); + return LightApp_Module::deactivateModule( study ); } @@ -762,7 +772,7 @@ void PVGUI_Module::studyClosed(SUIT_Study* study) { clearParaviewState(); - SalomeApp_Module::studyClosed(study); + LightApp_Module::studyClosed(study); } /*! @@ -774,9 +784,9 @@ void PVGUI_Module::onModelOpened() if(!studyDS) { return; } - - _PTR(SComponent) paravisComp = - studyDS->FindComponent(GetCPPEngine()->ComponentDataType()); + + _PTR(SComponent) paravisComp = + studyDS->FindComponent(PARAVIS_MODULE_NAME); if(!paravisComp) { return; } @@ -796,12 +806,13 @@ void PVGUI_Module::onModelOpened() } /*! - \brief Returns IOR of current engine +\brief Returns IOR of current engine */ QString PVGUI_Module::engineIOR() const { - CORBA::String_var anIOR = GetCPPEngine()->GetIOR(); - return QString(anIOR.in()); +// CORBA::String_var anIOR = GetCPPEngine()->GetIOR(); +// return QString(anIOR.in()); + return QString(""); } /*! @@ -971,18 +982,18 @@ void PVGUI_Module::createPreferences() { // Paraview settings tab int aParaViewSettingsTab = addPreference( tr( "TIT_PVIEWSETTINGS" ) ); - int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, "PARAVIS", ""); + int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, PARAVIS_MODULE_NAME, ""); setPreferenceProperty(aPanel, "content", (qint64)(new PVGUI_ParaViewSettingsPane())); // Paravis settings tab int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) ); - addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "stop_trace"); + addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "stop_trace"); - addPreference( tr( "PREF_NO_EXT_PVSERVER" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "no_ext_pv_server"); + addPreference( tr( "PREF_NO_EXT_PVSERVER" ), aParaVisSettingsTab, LightApp_Preferences::Bool, PARAVIS_MODULE_NAME, "no_ext_pv_server"); int aSaveType = addPreference(tr( "PREF_SAVE_TYPE_LBL" ), aParaVisSettingsTab, LightApp_Preferences::Selector, - "PARAVIS", "savestate_type"); + PARAVIS_MODULE_NAME, "savestate_type"); QList aIndices; QStringList aStrings; aIndices<<0<<1<<2; @@ -998,8 +1009,8 @@ void PVGUI_Module::createPreferences() */ void PVGUI_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle) { - SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle); - + LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle); + // Check if we are in Object Browser SUIT_DataBrowser* ob = getApp()->objectBrowser(); bool isOBClient = (ob && theClient == ob->popupClientType()); @@ -1013,22 +1024,22 @@ void PVGUI_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QS aSelectionMgr->selectedObjects(aListIO); if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) { QString entry = QString(aListIO.First()->getEntry()); - + // Get active study - SalomeApp_Study* activeStudy = + SalomeApp_Study* activeStudy = dynamic_cast(getApp()->activeStudy()); if(!activeStudy) { return; } - // Get SALOMEDS client study + // Get SALOMEDS client study _PTR(Study) studyDS = activeStudy->studyDS(); if(!studyDS) { return; } - QString paravisDataType(GetCPPEngine()->ComponentDataType()); - if(activeStudy && activeStudy->isComponent(entry) && + QString paravisDataType(PARAVIS_MODULE_NAME); + if(activeStudy && activeStudy->isComponent(entry) && activeStudy->componentDataType(entry) == paravisDataType) { // ParaViS module object theMenu->addSeparator(); @@ -1036,12 +1047,12 @@ void PVGUI_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QS } else { // Try to get state object - _PTR(SObject) stateSObj = + _PTR(SObject) stateSObj = studyDS->FindObjectID(entry.toLatin1().constData()); if (!stateSObj) { return; } - + // Check local id _PTR(GenericAttribute) anAttr; if (!stateSObj->FindAttribute(anAttr, "AttributeLocalID")) { @@ -1049,7 +1060,7 @@ void PVGUI_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QS } _PTR(AttributeLocalID) anID(anAttr); - + if (anID->Value() == PVSTATEID) { // Paraview state object theMenu->addSeparator(); @@ -1099,9 +1110,9 @@ void PVGUI_Module::onSaveMultiState() if(!studyDS) { return; } - + _PTR(SComponent) paravisComp = - studyDS->FindComponent(GetCPPEngine()->ComponentDataType()); + studyDS->FindComponent(PARAVIS_MODULE_NAME); if(!paravisComp) { return; } @@ -1267,8 +1278,8 @@ void PVGUI_Module::onDelete() void PVGUI_Module::onPushTraceTimer() { -// MESSAGE("onPushTraceTimer(): Pushing trace to engine..."); - GetCPPEngine()->PutPythonTraceStringToEngine(getTraceString().toStdString().c_str()); + //MESSAGE("onPushTraceTimer(): Pushing trace to engine..."); + GetEngine()->PutPythonTraceStringToEngine(getTraceString().toStdString().c_str()); } /*! diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index c6b608a7..b5e93b96 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -50,6 +50,7 @@ class pqPVApplicationCore; class pqDataRepresentation; class pqRepresentation; class PVViewer_GUIElements; +class PVViewer_EngineWrapper; class PVGUI_Module : public SalomeApp_Module { @@ -145,7 +146,7 @@ public: virtual void initialize( CAM_Application* ); virtual void windows( QMap& ) 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); @@ -164,10 +165,11 @@ public: virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle); - // Get the unwrapped version of the engine - compare with PVViewer_EngineWrapper. - inline static PARAVIS_ORB::PARAVIS_Gen_var GetCPPEngine(); + inline static PVViewer_EngineWrapper * GetEngine(); inline static pqPVApplicationCore * GetPVApplication(); + virtual CAM_DataModel* createDataModel(); + public slots: //void onImportFromVisu(QString theEntry); diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index 42adaf84..69411dae 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include // should ultimately be a LightApp only #include #include @@ -551,7 +551,8 @@ void PVGUI_Module::pvCreateToolBars() QMenu* PVGUI_Module::getMenu( const int id ) { QMenu* res = 0; - SalomeApp_Application* anApp = getApp(); + //SalomeApp_Application* anApp = getApp(); + LightApp_Application* anApp = getApp(); SUIT_Desktop* desk = anApp->desktop(); if ( desk ){ QtxActionMenuMgr* menuMgr = desk->menuMgr(); diff --git a/src/PVGUI/PVGUI_Module_widgets.cxx b/src/PVGUI/PVGUI_Module_widgets.cxx index 8a5c7673..e438a97d 100644 --- a/src/PVGUI/PVGUI_Module_widgets.cxx +++ b/src/PVGUI/PVGUI_Module_widgets.cxx @@ -28,7 +28,7 @@ #include #include -#include +#include // // should ultimately be a LightApp only #include #include @@ -105,6 +105,7 @@ void PVGUI_Module::setupDockWidgets() desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); + desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North); // Pipeline QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "TTL_PIPELINE_BROWSER" ), desk ); @@ -137,7 +138,7 @@ void PVGUI_Module::setupDockWidgets() QWidget* informationWidgetFrame = new QWidget(informationDock); informationWidgetFrame->setObjectName("informationWidgetFrame"); - + QVBoxLayout* verticalLayout_2 = new QVBoxLayout(informationWidgetFrame); verticalLayout_2->setSpacing(0); verticalLayout_2->setContentsMargins(0, 0, 0, 0); @@ -156,7 +157,7 @@ void PVGUI_Module::setupDockWidgets() myDockWidgets[informationDock] = true; - desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North); + desk->tabifyDockWidget(informationDock, propertiesDock); desk->tabifyDockWidget(propertiesDock, pipelineBrowserDock); //propertiesDock->raise(); @@ -263,8 +264,8 @@ void PVGUI_Module::setupDockWidgets() aProgress->setEnabled(true); // Set up the dock window corners to give the vertical docks more room. - desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); - desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); +// desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); +// desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); // Setup the default dock configuration ... statisticsViewDock->hide(); @@ -384,12 +385,15 @@ void PVGUI_Module::storeCommonWindowsState() { // restoreCommonWindowsState() method, and at the moment of the ParaVis activation we call // this method. + //LightApp_Application* anApp = getApp(); SalomeApp_Application* anApp = getApp(); if(!anApp) return; - int begin = SalomeApp_Application::WT_ObjectBrowser; - int end = SalomeApp_Application::WT_NoteBook; +// int begin = SalomeApp_Application::WT_ObjectBrowser; +// int end = SalomeApp_Application::WT_NoteBook; + int begin = LightApp_Application::WT_ObjectBrowser; + int end = LightApp_Application::WT_User; for( int i = begin; i <= end; i++ ) { QWidget* wg = anApp->getWindow(i); if(wg) { @@ -415,6 +419,7 @@ void PVGUI_Module::storeCommonWindowsState() { */ void PVGUI_Module::restoreCommonWindowsState() { SalomeApp_Application* anApp = getApp(); +// LightApp_Application* anApp = getApp(); if(!anApp) return; DockWindowMap::const_iterator it = myCommonMap.begin(); -- 2.39.2