Salome HOME
Merge branch 'master' into V9_dev
authorrnv <rnv@opencascade.com>
Wed, 19 Jul 2017 14:56:09 +0000 (17:56 +0300)
committerrnv <rnv@opencascade.com>
Wed, 19 Jul 2017 14:56:09 +0000 (17:56 +0300)
src/MEDCalc/cmp/MEDPresentation.cxx
src/MEDCalc/cmp/MEDPresentationManager_i.cxx
src/MEDCalc/cmp/MEDPresentationManager_i.txx
src/MEDCalc/gui/MEDModule.cxx
src/MEDCouplingCorba_Swig/Client/MEDCouplingClient.i
src/MEDCouplingCorba_Swig/MEDCouplingCorba.i

index 91fb7e781fe92a03145be39da2582bf114641c19..7a7e4cbd39ab91aee67ad040602ffd74d8596a2b 100644 (file)
@@ -124,8 +124,11 @@ MEDPresentation::~MEDPresentation()
 
     oss << "pvs.Hide(" << _objVar <<  ", view=" << getRenderViewVar() << ");";
     execPyLine(oss.str());
-    execPyLine(getRenderViewVar() + ".ResetCamera();");
-    execPyLine("pvs.Render();");
+    // :TRICKY: The two following lines raise an exception when closing MED module
+    //          after sequence: MED - load file - PARAVIS - MED - close SALOME
+    //          (see Mantis #23461)
+    //execPyLine(getRenderViewVar() + ".ResetCamera();");
+    //execPyLine("pvs.Render();");
   }
 }
 
@@ -680,4 +683,3 @@ MEDPresentation::applyCellToPointIfNeeded()
 //  oss << _srcObjVar << ".Function = '" <<  _fieldName << "_0*iHat + " << _fieldName << "_1*jHat + 0.0*zHat';";
 //  pushAndExecPyLine(oss.str()); oss.str("");
 //}
-
index 134ada1b5904a32ed49c12e1ed6208c27e63c3e8..50ed29bb97016431b83089f97123c083871a767b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2017  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
@@ -73,6 +73,7 @@ MEDPresentationManager_i::GenerateID()
 MEDPresentation*
 MEDPresentationManager_i::_getPresentation(MEDPresentation::TypeID presentationID) const
 {
+  STDLOG("Get presentation " << presentationID);
   std::map<MEDPresentation::TypeID, MEDPresentation*>::const_iterator citr = _presentations.find(presentationID);
   if (citr == _presentations.end())
     return NULL;
@@ -271,6 +272,7 @@ MEDPresentationManager_i::updatePointSprite(MEDPresentation::TypeID presentation
 CORBA::Boolean
 MEDPresentationManager_i::removePresentation(MEDPresentation::TypeID presentationID)
 {
+  STDLOG("Remove presentation " << presentationID);
   std::map<MEDPresentation::TypeID, MEDPresentation*>::const_iterator citr = _presentations.find(presentationID);
   if (citr == _presentations.end()) {
     std::cerr << "removePresentation(): presentation not found!!" << std::endl;
@@ -360,6 +362,7 @@ MEDPresentationManager_i::getAllPresentations()
 void
 MEDPresentationManager_i::cleanUp()
 {
+  STDLOG("Cleanup");
   _activeViewPythonId = -1;
   std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator it;
   for (it = _presentations.begin(); it != _presentations.end(); ++it)
index e4b6cf8e9b9897f70d90ed3dfbf883c5bc806610..8aee5e8dab536fe954a2faf3263e447fd03c0c7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2017  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
@@ -61,6 +61,7 @@ MEDPresentationManager_i::_makePresentation(const PresentationParameters params,
     return -1;
   }
 
+  STDLOG("Add new presentation " << newID);
   _presentations.insert( std::pair<MEDPresentation::TypeID, MEDPresentation *>(newID, presentation) );
   presentation->generatePipeline();
 
@@ -78,6 +79,7 @@ template<typename PresentationType, typename PresentationParameters>
 void
 MEDPresentationManager_i::_updatePresentation(MEDPresentation::TypeID presentationID, const PresentationParameters params)
 {
+  STDLOG("Update presentation " << presentationID);
   MEDPresentation* presentation = _getPresentation(presentationID);
   if (!presentation) {
     std::cerr << "_updatePresentation(): presentation not found!!" << std::endl;
index ebadeaa4e3a3ba42a2324f3bb34ccd829d090c56..9e59a5979ef3e8e29a8b105658f5f7e5252e9b28 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2017  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
@@ -62,6 +62,7 @@ MEDModule::MEDModule() :
   _datasourceController(0), _workspaceController(0), _presentationController(0),
   _processingController(0), _pvGuiElements(0)
 {
+  STDLOG("MEDModule::MEDModule()");
   // Note also that we can't use the getApp() function here because
   // the initialize(...) function has not been called yet.
 
@@ -70,6 +71,12 @@ MEDModule::MEDModule() :
 
 MEDModule::~MEDModule()
 {
+  // Clean up engine:
+  STDLOG("MEDModule::~MEDModule(): cleaning up engine side.");
+  _MED_engine->cleanUp();
+  MEDFactoryClient::getFactory()->getPresentationManager()->cleanUp();
+  MEDFactoryClient::getFactory()->getDataManager()->cleanUp();
+
   if (_studyEditor)
     delete _studyEditor;
   if (_datasourceController)
@@ -116,9 +123,13 @@ MEDModule::init()
 void
 MEDModule::initialize( CAM_Application* app )
 {
+  STDLOG("MEDModule::initialize()");
   // call the parent implementation
   SalomeApp_Module::initialize( app );
 
+  if (! getApp()->objectBrowser())
+    getApp()->getWindow(SalomeApp_Application::WT_ObjectBrowser);
+
   getApp()->objectBrowser()->setAutoOpenLevel(5);
 
   if (app && app->desktop()) {
@@ -154,6 +165,7 @@ MEDModule::iconName() const
 void
 MEDModule::windows( QMap<int, int>& theMap ) const
 {
+  STDLOG("MEDModule::windows()");
   // want Object browser, in the left area
   theMap.insert( SalomeApp_Application::WT_ObjectBrowser,
                  Qt::LeftDockWidgetArea );
@@ -193,6 +205,7 @@ MEDModule::createPreferences()
 bool
 MEDModule::activateModule( SUIT_Study* theStudy )
 {
+  STDLOG("MEDModule::activateModule()");
   if ( CORBA::is_nil( _MED_engine ) )
     return false;
 
@@ -222,12 +235,7 @@ MEDModule::activateModule( SUIT_Study* theStudy )
 bool
 MEDModule::deactivateModule( SUIT_Study* theStudy )
 {
- // Clean up engine:
-  STDLOG("MEDModule::deactivateModule(): cleaning up engine side.");
-  _MED_engine->cleanUp();
-  MEDFactoryClient::getFactory()->getPresentationManager()->cleanUp();
-  MEDFactoryClient::getFactory()->getDataManager()->cleanUp();
-
+  STDLOG("MEDModule::deactivateModule()");
   _workspaceController->showDockWidgets(false);
   _presentationController->showDockWidgets(false);
   //this->unsetDockLayout();
index 360f8b7aa84927fdc6fdb0d32994bcc6f2f6916b..10fa8e5ab9a1aa72322bbc5139fd946d644d9397 100644 (file)
@@ -583,6 +583,12 @@ def MEDCouplingDataArrayDoubleIdiv(self,*args):
 def MEDCouplingDataArrayDoubleIpow(self,*args):
     import _MEDCouplingClient
     return _MEDCouplingClient.DataArrayDouble____ipow___(self, self, *args)
+def MEDCouplingFieldIntnew(cls,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.MEDCouplingFieldInt____new___(cls,args)
+def MEDCouplingFieldFloatnew(cls,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.MEDCouplingFieldFloat____new___(cls,args)
 def MEDCouplingFieldDoublenew(cls,*args):
     import _MEDCouplingClient
     return _MEDCouplingClient.MEDCouplingFieldDouble____new___(cls,args)
@@ -625,6 +631,21 @@ def MEDCouplingDataArrayIntIpow(self,*args):
 def MEDCouplingDataArrayBytenew(cls,*args):
     import _MEDCouplingClient
     return _MEDCouplingClient.DataArrayByte____new___(cls,args)
+def MEDCouplingDataArrayFloatnew(cls,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.DataArrayFloat____new___(cls,args)
+def MEDCouplingDataArrayFloatIadd(self,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.DataArrayFloat____iadd___(self, self, *args)
+def MEDCouplingDataArrayFloatIsub(self,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.DataArrayFloat____isub___(self, self, *args)
+def MEDCouplingDataArrayFloatImul(self,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.DataArrayFloat____imul___(self, self, *args)
+def MEDCouplingDataArrayFloatIdiv(self,*args):
+    import _MEDCouplingClient
+    return _MEDCouplingClient.DataArrayFloat____idiv___(self, self, *args)
 def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
     import _MEDCouplingClient
     return _MEDCouplingClient.DataArrayDoubleTuple____iadd___(self, self, *args)
index e4461e1062bbb30c32cdf8d6ee89384ee1550106..a5e7aa5efb04318bac0dbfd815c576b093d75b55 100644 (file)
@@ -333,6 +333,12 @@ def MEDCouplingDataArrayDoubleIdiv(self,*args):
 def MEDCouplingDataArrayDoubleIpow(self,*args):
     import _MEDCouplingCorba
     return _MEDCouplingCorba.DataArrayDouble____ipow___(self, self, *args)
+def MEDCouplingFieldIntnew(cls,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.MEDCouplingFieldInt____new___(cls,args)
+def MEDCouplingFieldFloatnew(cls,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.MEDCouplingFieldFloat____new___(cls,args)
 def MEDCouplingFieldDoublenew(cls,*args):
     import _MEDCouplingCorba
     return _MEDCouplingCorba.MEDCouplingFieldDouble____new___(cls,args)
@@ -375,6 +381,21 @@ def MEDCouplingDataArrayIntIpow(self,*args):
 def MEDCouplingDataArrayBytenew(cls,*args):
     import _MEDCouplingCorba
     return _MEDCouplingCorba.DataArrayByte____new___(cls,args)
+def MEDCouplingDataArrayFloatnew(cls,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.DataArrayFloat____new___(cls,args)
+def MEDCouplingDataArrayFloatIadd(self,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.DataArrayFloat____iadd___(self, self, *args)
+def MEDCouplingDataArrayFloatIsub(self,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.DataArrayFloat____isub___(self, self, *args)
+def MEDCouplingDataArrayFloatImul(self,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.DataArrayFloat____imul___(self, self, *args)
+def MEDCouplingDataArrayFloatIdiv(self,*args):
+    import _MEDCouplingCorba
+    return _MEDCouplingCorba.DataArrayFloat____idiv___(self, self, *args)
 def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
     import _MEDCouplingCorba
     return _MEDCouplingCorba.DataArrayDoubleTuple____iadd___(self, self, *args)