Salome HOME
Python 3 porting & Multi-study removing V9_dev V9_0_0
authorrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 12:54:43 +0000 (15:54 +0300)
committerrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 12:54:43 +0000 (15:54 +0300)
20 files changed:
src/GMSHPlugin/GMSHPluginBuilder.py
src/GMSHPlugin/GMSHPlugin_GMSH.cxx
src/GMSHPlugin/GMSHPlugin_GMSH.hxx
src/GMSHPlugin/GMSHPlugin_GMSH_2D.cxx
src/GMSHPlugin/GMSHPlugin_GMSH_2D.hxx
src/GMSHPlugin/GMSHPlugin_GMSH_2D_i.cxx
src/GMSHPlugin/GMSHPlugin_GMSH_2D_i.hxx
src/GMSHPlugin/GMSHPlugin_GMSH_i.cxx
src/GMSHPlugin/GMSHPlugin_GMSH_i.hxx
src/GMSHPlugin/GMSHPlugin_Hypothesis.cxx
src/GMSHPlugin/GMSHPlugin_Hypothesis.hxx
src/GMSHPlugin/GMSHPlugin_Hypothesis_2D.cxx
src/GMSHPlugin/GMSHPlugin_Hypothesis_2D.hxx
src/GMSHPlugin/GMSHPlugin_Hypothesis_2D_i.cxx
src/GMSHPlugin/GMSHPlugin_Hypothesis_2D_i.hxx
src/GMSHPlugin/GMSHPlugin_Hypothesis_i.cxx
src/GMSHPlugin/GMSHPlugin_Hypothesis_i.hxx
src/GMSHPlugin/GMSHPlugin_Mesher.cxx
src/GMSHPlugin/GMSHPlugin_Mesher.hxx
src/GUI/GMSHPluginGUI_HypothesisCreator.cxx

index 10475048950f0c8fcec4b7126ddf01ff95851b41..117181e342ed6be4e38854969fa004a3fb3bbdce 100644 (file)
@@ -45,7 +45,7 @@ class GMSH_Algorithm(Mesh_Algorithm):
     
     def __init__(self, mesh, geom=0):
         Mesh_Algorithm.__init__(self)
-        if noGMSHPlugin: print "Warning: GMSHPlugin module unavailable"
+        if noGMSHPlugin: print("Warning: GMSHPlugin module unavailable")
         self.Create(mesh, geom, self.algoType, "libGMSHEngine.so")
         self.params = None
 
index ecfa7f78a8e3d56131b299fc7ab436d817826fac..84c6ebbbc640d5cf4b5907145b2e9d12a8a89a54 100644 (file)
@@ -37,9 +37,8 @@ using namespace std;
  */
 //=============================================================================
 
-GMSHPlugin_GMSH::GMSHPlugin_GMSH(int hypId, int studyId,
-                                                   SMESH_Gen* gen)
-  : SMESH_3D_Algo(hypId, studyId, gen)
+GMSHPlugin_GMSH::GMSHPlugin_GMSH(int hypId, SMESH_Gen* gen)
+  : SMESH_3D_Algo(hypId, gen)
 {
   MESSAGE("GMSHPlugin_GMSH::GMSHPlugin_GMSH");
   _name = "GMSH";
index 60b03b1db1bd2a8264df6212ed26f97f06ae8f3c..c9376cfbacfd10e04977027747e952348a09676a 100644 (file)
@@ -33,7 +33,7 @@
 class GMSHPLUGIN_EXPORT GMSHPlugin_GMSH: public SMESH_3D_Algo
 {
 public:
-  GMSHPlugin_GMSH(int hypId, int studyId, SMESH_Gen* gen);
+  GMSHPlugin_GMSH(int hypId, SMESH_Gen* gen);
   virtual ~GMSHPlugin_GMSH();
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
index f15598150c0df499aff9fd84b85f3634adf3da39..1c89ab1a86286bfab39e0a729e540109205196d3 100644 (file)
@@ -37,9 +37,8 @@ using namespace std;
  */
 //=============================================================================
 
-GMSHPlugin_GMSH_2D::GMSHPlugin_GMSH_2D(int hypId, int studyId,
-                                               SMESH_Gen* gen)
-  : SMESH_2D_Algo(hypId, studyId, gen)
+GMSHPlugin_GMSH_2D::GMSHPlugin_GMSH_2D(int hypId, SMESH_Gen* gen)
+  : SMESH_2D_Algo(hypId, gen)
 {
   MESSAGE("GMSHPlugin_GMSH_2D::GMSHPlugin_GMSH_2D");
   _name = "GMSH_2D";
index 5e99fa5ea84716f6e10c136016c542e77e815cc3..c4260e7886f1b7b934f806c08a8dce5b83549534 100644 (file)
@@ -33,7 +33,7 @@
 class GMSHPLUGIN_EXPORT GMSHPlugin_GMSH_2D: public SMESH_2D_Algo
 {
 public:
-  GMSHPlugin_GMSH_2D(int hypId, int studyId, SMESH_Gen* gen);
+  GMSHPlugin_GMSH_2D(int hypId, SMESH_Gen* gen);
   virtual ~GMSHPlugin_GMSH_2D();
 
   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
index acba91225bf8b0410081788438497ad61be0622f..9ea8f6dc478b2696b027e85cb19940bf365894d7 100644 (file)
@@ -34,7 +34,6 @@ using namespace std;
 //=============================================================================
 
 GMSHPlugin_GMSH_2D_i::GMSHPlugin_GMSH_2D_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -43,7 +42,6 @@ GMSHPlugin_GMSH_2D_i::GMSHPlugin_GMSH_2D_i( PortableServer::POA_ptr thePOA,
 {
   MESSAGE( "GMSHPlugin_GMSH_2D_i::GMSHPlugin_GMSH_2D_i" );
   myBaseImpl = new ::GMSHPlugin_GMSH_2D( theGenImpl->GetANewId(),
-                                             theStudyId,
                                              theGenImpl );
 }
 
index 18adad75407c75682b22212fbd31e76825686639..e1efa65ec12a6e03965545ba924982c8a5fafb0d 100644 (file)
@@ -38,7 +38,6 @@ class GMSHPLUGIN_EXPORT GMSHPlugin_GMSH_2D_i:
 public:
   // Constructor
   GMSHPlugin_GMSH_2D_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
                             ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~GMSHPlugin_GMSH_2D_i();
index 7978e1dbb87b119f56f2aef1fd93be5c56aae8a5..b4ccea53ae4d48eb412588f26215192600aabf62 100644 (file)
@@ -34,7 +34,6 @@ using namespace std;
 //=============================================================================
 
 GMSHPlugin_GMSH_i::GMSHPlugin_GMSH_i( PortableServer::POA_ptr thePOA,
-                                                        int                     theStudyId,
                                                         ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -43,7 +42,6 @@ GMSHPlugin_GMSH_i::GMSHPlugin_GMSH_i( PortableServer::POA_ptr thePOA,
 {
   MESSAGE( "GMSHPlugin_GMSH_i::GMSHPlugin_GMSH_i" );
   myBaseImpl = new ::GMSHPlugin_GMSH( theGenImpl->GetANewId(),
-                                               theStudyId,
                                                theGenImpl );
 }
 
index bd839ddbc536919c10ff2224407f4d447790046b..4cd133cf991ff347cf87b48b7ce4148abb489f07 100644 (file)
@@ -38,7 +38,6 @@ class GMSHPLUGIN_EXPORT GMSHPlugin_GMSH_i:
 public:
   // Constructor
   GMSHPlugin_GMSH_i( PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~GMSHPlugin_GMSH_i();
index 2b414c9f14bd86a9939342095ec0ed02e5e14547..c8a698ee3fb7166d75f7425acefdbed252b586ee 100644 (file)
@@ -27,9 +27,9 @@
 using namespace std;
 
 
-GMSHPlugin_Hypothesis::GMSHPlugin_Hypothesis (int hypId, int studyId,
+GMSHPlugin_Hypothesis::GMSHPlugin_Hypothesis (int hypId,
                                                   SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
+  : SMESH_Hypothesis(hypId, gen),
     _algo2d         (automatic),
     _algo3d         (frontal3),
     _recomb2DAlgo   (standard),
index dde0eb2ef17d80dcbe16026013cb3db7f1a8a5a9..0fe8db8847c0329f7ef92a3d7163e928e85d2c4f 100644 (file)
@@ -36,7 +36,7 @@ class GMSHPLUGIN_EXPORT GMSHPlugin_Hypothesis: public SMESH_Hypothesis
 {
 public:
 
-  GMSHPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
+  GMSHPlugin_Hypothesis(int hypId, SMESH_Gen * gen);
 
   enum Algo2D
   {
index 72d265bbc408495f73484d2d789c49e867a7c5f5..265811e959bcb66bb7c7385e180b8a055b90630a 100644 (file)
@@ -29,9 +29,8 @@ using namespace std;
  *  
  */
 //=============================================================================
-GMSHPlugin_Hypothesis_2D::GMSHPlugin_Hypothesis_2D (int hypId, int studyId,
-                                                        SMESH_Gen * gen)
-  : GMSHPlugin_Hypothesis(hypId, studyId, gen)
+GMSHPlugin_Hypothesis_2D::GMSHPlugin_Hypothesis_2D (int hypId, SMESH_Gen * gen)
+  : GMSHPlugin_Hypothesis(hypId, gen)
 
 {
   _name = "GMSH_Parameters_2D";
index 2ea7f717e64c33f372977a885a5c2bffaaa184dc..6f2d624facade6680f253ef5d582c5ee14634985 100644 (file)
@@ -33,7 +33,7 @@ class GMSHPLUGIN_EXPORT  GMSHPlugin_Hypothesis_2D: public GMSHPlugin_Hypothesis
 {
 public:
 
-  GMSHPlugin_Hypothesis_2D(int hypId, int studyId, SMESH_Gen * gen);
+  GMSHPlugin_Hypothesis_2D(int hypId, SMESH_Gen * gen);
 
 };
 
index eb9e3ebada8bab5cb55ad57c479b086cc056a6e5..f1c7ea550a0f11565ddf7c60bb30f86a45855462 100644 (file)
@@ -35,17 +35,15 @@ using namespace std;
 //=============================================================================
 GMSHPlugin_Hypothesis_2D_i::
 GMSHPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA,
-                              int                     theStudyId,
                               ::SMESH_Gen*            theGenImpl)
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
-    GMSHPlugin_Hypothesis_i( thePOA, theStudyId, theGenImpl )
+    GMSHPlugin_Hypothesis_i( thePOA, theGenImpl )
 {
   MESSAGE( "GMSHPlugin_Hypothesis_2D_i::GMSHPlugin_Hypothesis_2D_i" );
   if (myBaseImpl)
     delete (::GMSHPlugin_Hypothesis*)myBaseImpl;
   myBaseImpl = new ::GMSHPlugin_Hypothesis_2D (theGenImpl->GetANewId(),
-                                                 theStudyId,
                                                  theGenImpl);
 }
 
index a02c50575093fbc3a1b6cc13e1a84ce8755deb80..52c565e19f60d7696970ca1ad77d77ab009ac28c 100644 (file)
@@ -39,7 +39,6 @@ class GMSHPLUGIN_EXPORT  GMSHPlugin_Hypothesis_2D_i:
  public:
   // Constructor
   GMSHPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA,
-                                int                     theStudyId,
                                 ::SMESH_Gen*            theGenImpl);
   // Destructor
   virtual ~GMSHPlugin_Hypothesis_2D_i();
index 453074b533d5301ba8aa8ac85bac7f69f55b7e57..2fc0a5d8dcf96c2517036544f2d042c9138f369e 100644 (file)
@@ -37,7 +37,6 @@ bool GMSHPlugin_Hypothesis_i::isToSetParameter<double>(double curValue,
 
 GMSHPlugin_Hypothesis_i::
 GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
                            ::SMESH_Gen*            theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA ),
@@ -45,7 +44,6 @@ GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
 {
   MESSAGE( "GMSHPlugin_Hypothesis_i::GMSHPlugin_Hypothesis_i" );
   myBaseImpl = new ::GMSHPlugin_Hypothesis (theGenImpl->GetANewId(),
-                                              theStudyId,
                                               theGenImpl);
 }
 
index 98817aa5c1d9eba61396af29fa21bc6a1ec97fc8..716ad9589b7e9470267e5339cc1f7ba64cd78da2 100644 (file)
@@ -40,7 +40,6 @@ class GMSHPLUGIN_EXPORT GMSHPlugin_Hypothesis_i:
  public:
   // Constructor
   GMSHPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                             int                     theStudyId,
                              ::SMESH_Gen*            theGenImpl);
   // Destructor
   virtual ~GMSHPlugin_Hypothesis_i();
index 6e2ccf18403a965385c715b7c5fe1aa06231a56d..b36bcaf8da6de524620a2e1b526b89d746eb8e68 100644 (file)
@@ -94,7 +94,6 @@ void GMSHPlugin_Mesher::SetParameters(const GMSHPlugin_Hypothesis* hyp)
     _secondOrder     = hyp->GetSecondOrder();
     _useIncomplElem  = hyp->GetUseIncomplElem();
     _is2d            = hyp->GetIs2d();
-    _studyId           = hyp->GetStudyId();
     _compounds       = hyp->GetCompoundOnEntries();
   }
   else
@@ -193,9 +192,6 @@ void GMSHPlugin_Mesher::CreateGmshCompounds()
   MESSAGE("GMSHPlugin_Mesher::CreateGmshCompounds");
   
   SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
-  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
-  SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(_studyId);
   
   OCC_Internals* occgeo = _gModel->getOCCInternals();
   
@@ -203,13 +199,13 @@ void GMSHPlugin_Mesher::CreateGmshCompounds()
   {
     GEOM::GEOM_Object_var aGeomObj;
     TopoDS_Shape geomShape = TopoDS_Shape();
-    SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( (*its).c_str() );
+    SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( (*its).c_str() );
     SALOMEDS::GenericAttribute_var anAttr;
     if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR"))
     {
       SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
       CORBA::String_var aVal = anIOR->Value();
-      CORBA::Object_var obj = myStudy->ConvertIORToObject(aVal);
+      CORBA::Object_var obj = SMESH_Gen_i::getStudyServant()->ConvertIORToObject(aVal);
       aGeomObj = GEOM::GEOM_Object::_narrow(obj);
     }
     if ( !aGeomObj->_is_nil() )
index 6da916462c12eda727891589b361d6167e649c7a..ebbcae668d1797000917f86db94222b0d1b1f80a 100644 (file)
@@ -69,7 +69,6 @@ class GMSHPLUGIN_EXPORT GMSHPlugin_Mesher
   bool Evaluate(MapShapeNbElems& aResMap);
   
  private:
-  int                  _studyId;
   SMESH_Mesh*          _mesh;
   const TopoDS_Shape&  _shape;
   int                  _algo2d;
index 03d85983e2ef6315213ce60bdff6d8303d2a5d6f..fded7663d69de3749b6e54ceae1b0afb0c98027c 100644 (file)
@@ -540,10 +540,8 @@ bool GMSHPluginGUI_HypothesisCreator::readParamsFromWidgets( GmshHypothesisData&
 
 GeomSelectionTools* GMSHPluginGUI_HypothesisCreator::getGeomSelectionTools()
 {
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-  if (myGeomSelectionTools == NULL || myGeomSelectionTools->getMyStudy() != aStudy) {
-    delete myGeomSelectionTools;
-    myGeomSelectionTools = new GeomSelectionTools(aStudy);
+  if (myGeomSelectionTools == NULL) {
+    myGeomSelectionTools = new GeomSelectionTools();
   }
   return myGeomSelectionTools;
 }