]> SALOME platform Git repositories - plugins/hexoticplugin.git/commitdiff
Salome HOME
Merge multi-study removal branch. Before_python3_27062017
authorrnv <rnv@opencascade.com>
Thu, 8 Jun 2017 15:35:20 +0000 (18:35 +0300)
committerrnv <rnv@opencascade.com>
Thu, 8 Jun 2017 15:35:37 +0000 (18:35 +0300)
15 files changed:
doc/salome/examples/hexoticdemo.py
doc/salome/examples/hexoticdemo_vl.py
doc/salome/examples/hexoticsubdom1.py
doc/salome/examples/hexoticsubdom2.py
doc/salome/examples/hexoticsubdom3.py
doc/salome/examples/hexoticsubdom4.py
src/GUI/HexoticPluginGUI_HypothesisCreator.cxx
src/HexoticPlugin/HexoticPlugin_Hexotic.cxx
src/HexoticPlugin/HexoticPlugin_Hexotic.hxx
src/HexoticPlugin/HexoticPlugin_Hexotic_i.cxx
src/HexoticPlugin/HexoticPlugin_Hexotic_i.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx

index f346bb803a80183056e103f81078d3642e422194..f221c72c6f706e234749caf62e17ae6d2c0226fb 100644 (file)
@@ -21,10 +21,10 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # create a sphere
index 2ae8e11cb759007932eaaad9e60ac877993b20c4..c28dc83639cc9ab89893128649b20668b3757ff9 100644 (file)
 
 import salome
 salome.salome_init()
-theStudy = salome.myStudy
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create geometry
 Box_1 = geompy.MakeBoxDXDYDZ(50, 50, 50)
index 8781911393d14d79f0627d59931498acec96943f..c570ec56c6b99ea30e279550cb70470b4b94a566 100644 (file)
@@ -21,11 +21,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 
 # Create geometry: a box cut by a holed sphere
index 500270ae6633e0b5b0baf1e649773b12395f584a..1217806596fba6830a30d04fa2ff91f7a42024d0 100644 (file)
@@ -21,11 +21,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create geometry: a box cut by a holed sphere
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
index ef7cc20328eaf4a08b77a735388ff6963d75e2f6..0f6898e89222a69ecdfd73551bebfda1e5dd9c22 100644 (file)
@@ -21,11 +21,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create geometry: a box cut by a holed sphere
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
index 8683d378eec3fc0831e57a313bc1c6ad4e5750a0..ee3bb5fbc9a3613c059d3a0dfef96a53e179e994 100644 (file)
@@ -21,10 +21,10 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # Create geometry: a box cut by a plane
 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
index be6ab02145adf8a2f80d9feb34d3820b8f13310d..3eee367dc6827644c03d397bc6ec03bf4f84365e 100644 (file)
@@ -741,10 +741,8 @@ bool HexoticPluginGUI_HypothesisCreator::readSizeMapsFromWidgets( HexoticHypothe
 
 GEOM::GEOM_Object_var HexoticPluginGUI_HypothesisCreator::entryToObject( std::string entry) const
 {
-  SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-  SALOMEDS::Study_var myStudy = smeshGen_i->GetCurrentStudy();
   GEOM::GEOM_Object_var aGeomObj;
-  SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
+   SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
   if (!aSObj->_is_nil()) {
     CORBA::Object_var obj = aSObj->GetObject();
     aGeomObj = GEOM::GEOM_Object::_narrow(obj);
index 67481afedafd63f1481b5d5d4f6068e9d33e67ff..2d32c1db284a3cfffbac73f0d2429efa71f1be45 100644 (file)
@@ -91,8 +91,8 @@ static void removeFile( const TCollection_AsciiString& fileName )
  */
 //=============================================================================
 
-HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_3D_Algo(hypId, studyId, gen)
+HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, SMESH_Gen* gen)
+  : SMESH_3D_Algo(hypId, gen)
 {
   MESSAGE("HexoticPlugin_Hexotic::HexoticPlugin_Hexotic");
   _name = "MG-Hexa";
@@ -108,15 +108,6 @@ HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen*
 #endif
   _computeCanceled = false;
   
-  // Copy of what is done in BLSURFPLugin TODO : share the code
-  smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
-  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
-  
-  myStudy = NULL;
-  myStudy = aStudyMgr->GetStudyByID(_studyId);
-  if ( !myStudy->_is_nil() )
-    MESSAGE("myStudy->StudyId() = " << myStudy->StudyId());
 }
 
 //=============================================================================
@@ -905,18 +896,17 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
 TopoDS_Shape HexoticPlugin_Hexotic::entryToShape(std::string entry)
 {
   MESSAGE("HexoticPlugin_Hexotic::entryToShape "<<entry );
-  if ( myStudy->_is_nil() )
-    throw SALOME_Exception("MG-Hexa plugin can't work w/o publishing in the study");
+
   GEOM::GEOM_Object_var aGeomObj;
   TopoDS_Shape S = TopoDS_Shape();
-  SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
+  SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
   if (!aSObj->_is_nil()) {
     CORBA::Object_var obj = aSObj->GetObject();
     aGeomObj = GEOM::GEOM_Object::_narrow(obj);
     aSObj->UnRegister();
   }
   if ( !aGeomObj->_is_nil() )
-    S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+    S = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( aGeomObj.in() );
   return S;
 }
 
index a0b94b7a6cd8b4d6a7292303f0bda29bf4d3f945..065d8aef3512bbcf65d0451072964c7d2c679431 100644 (file)
@@ -53,7 +53,7 @@ class MG_Hexotic_API;
 class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hexotic: public SMESH_3D_Algo
 {
 public:
-  HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen* gen);
+  HexoticPlugin_Hexotic(int hypId, SMESH_Gen* gen);
   virtual ~HexoticPlugin_Hexotic();
 
 #ifdef WITH_BLSURFPLUGIN
@@ -122,10 +122,6 @@ private:
   const BLSURFPlugin_Hypothesis* _blsurfHypo;
 #endif
 
-
-  SALOMEDS::Study_var myStudy;
-  SMESH_Gen_i*        smeshGen_i;
-
 };
 
 #endif
index 17b28410ef4d92b9a5eab8cbd5bb248e34651df5..15c514cf9b9e2696f7c78db6f9224e714bbd0829 100644 (file)
@@ -38,7 +38,6 @@
 //=============================================================================
 
 HexoticPlugin_Hexotic_i::HexoticPlugin_Hexotic_i( PortableServer::POA_ptr thePOA,
-                                                  int                     theStudyId,
                                                   ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -47,7 +46,6 @@ HexoticPlugin_Hexotic_i::HexoticPlugin_Hexotic_i( PortableServer::POA_ptr thePOA
 {
   MESSAGE( "HexoticPlugin_Hexotic_i::HexoticPlugin_Hexotic_i" );
   myBaseImpl = new ::HexoticPlugin_Hexotic( theGenImpl->GetANewId(),
-                                            theStudyId,
                                             theGenImpl );
 }
 
index 34236ebc5677d8e03e62008c90588a643edf5081..bf9cdcf79ec136681ed5221484a5bc1d6c213a43 100644 (file)
@@ -42,7 +42,6 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hexotic_i:
 public:
   // Constructor
   HexoticPlugin_Hexotic_i (PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
                            ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~HexoticPlugin_Hexotic_i();
index 2891afdd040cdb072ffdae03071f5e2989ab1227..1c36c2dedd62b4066c12a1536506dfc428deef4e 100644 (file)
@@ -32,9 +32,8 @@
  *  
  */
 //=============================================================================
-HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, int studyId,
-                                                    SMESH_Gen* gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
+HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, SMESH_Gen* gen)
+  : SMESH_Hypothesis(hypId, gen),
     _hexesMinLevel( GetDefaultHexesMinLevel() ),
     _hexesMaxLevel( GetDefaultHexesMaxLevel() ),
     _minSize( GetDefaultMinSize() ),
index 3c70d9efeb46adf308626b7f1c9e3496252a7e06..d9b20ba0c768bb2ab8a775f156639e57cb057a67 100644 (file)
@@ -51,7 +51,7 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis: public SMESH_Hypothesis
 {
 public:
 
-  HexoticPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
+  HexoticPlugin_Hypothesis(int hypId, SMESH_Gen* gen);
 
   static const char* GetHypType() { return "MG-Hexa Parameters"; }
 
index 48ac1b3e73b700a9c9b957a40e1fd14c804090b6..d94fb994eaf220696dc5111c26f6454223b4b7d7 100644 (file)
 //=============================================================================
 HexoticPlugin_Hypothesis_i::
 HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
-                           ::SMESH_Gen*            theGenImpl)
+                            ::SMESH_Gen*            theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   MESSAGE( "HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i" );
   myBaseImpl = new ::HexoticPlugin_Hypothesis (theGenImpl->GetANewId(),
-                                              theStudyId,
-                                              theGenImpl);
+                                               theGenImpl);
 }
 
 //=============================================================================
index cd625583992277ce1b8103ef38c9287f5c88c51e..8f6c8184f98efb4836c9760f4e76df0ff2bebd7f 100644 (file)
@@ -42,8 +42,7 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
  public:
   // Constructor
   HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                             int                     theStudyId,
-                             ::SMESH_Gen*            theGenImpl);
+                              ::SMESH_Gen*            theGenImpl);
   // Destructor
   virtual ~HexoticPlugin_Hypothesis_i();