Salome HOME
Merge multi-study removal branch. Before_python3_27062017
authorrnv <rnv@opencascade.com>
Thu, 8 Jun 2017 14:20:35 +0000 (17:20 +0300)
committerrnv <rnv@opencascade.com>
Thu, 8 Jun 2017 14:20:35 +0000 (17:20 +0300)
18 files changed:
doc/salome/examples/ghs3d_enfmesh.py
doc/salome/examples/ghs3d_enfvert.py
doc/salome/examples/ghs3ddemo.py
src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx
src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx
src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.cxx
src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx
src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx
src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx
src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.cxx
src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.hxx
src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis_i.cxx
src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis_i.hxx
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx

index b6ca8ec69f3b25b0dda1aacb86e5d787963b0a37..ab074348216b7c2b2684c7c1ad6df91b8a32ff6e 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 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()
 
 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
 geompy.addToStudy( box, "box" )
index f8ba666a44ba9fb5f5d698f354dd6e3ed421bb14..75ed204e531e1673043d4cbd284c1ae097a693e8 100644 (file)
@@ -33,11 +33,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
index 41478121a8bf72c9e5b999a9155e6366c19621cd..f28de37b511c7380c0db28d33bce94b84242422e 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 box
 box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
index b792999a4ef54f637f62e010a7f52e5cef207178..fd943e4bdfeac4d8f608f372ef27a2a401c236d9 100644 (file)
@@ -132,8 +132,8 @@ static void removeFile( const TCollection_AsciiString& fileName )
  */
 //=============================================================================
 
-GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_3D_Algo(hypId, studyId, gen), _isLibUsed( false )
+GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, SMESH_Gen* gen)
+  : SMESH_3D_Algo(hypId, gen), _isLibUsed( false )
 {
   _name = Name();
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
@@ -143,14 +143,7 @@ GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen)
   _compatibleHypothesis.push_back( GHS3DPlugin_Hypothesis::GetHypType());
   _compatibleHypothesis.push_back( StdMeshers_ViscousLayers::GetHypType() );
   _requireShape = false; // can work without shape
-
-  _smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-  CORBA::Object_var anObject = _smeshGen_i->GetNS()->Resolve("/myStudyManager");
-  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
-
-  _study = NULL;
-  _study = aStudyMgr->GetStudyByID(_studyId);
-
+  
   _computeCanceled = false;
   _progressAdvance = 1e-4;
 }
@@ -214,18 +207,19 @@ bool GHS3DPlugin_GHS3D::CheckHypothesis ( SMESH_Mesh&         aMesh,
 
 TopoDS_Shape GHS3DPlugin_GHS3D::entryToShape(std::string entry)
 {
-  if ( _study->_is_nil() )
+  if ( SMESH_Gen_i::getStudyServant()->_is_nil() )
     throw SALOME_Exception("MG-Tetra plugin can't work w/o publishing in the study");
+
   GEOM::GEOM_Object_var aGeomObj;
   TopoDS_Shape S = TopoDS_Shape();
-  SALOMEDS::SObject_var aSObj = _study->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 b5f4c8bb97a972a5db671f90c2b1add4576e98ee..b01ea3c5c433dcaa2b38ba152251518a19d25368 100644 (file)
@@ -51,7 +51,7 @@ class GHS3DPlugin_GHS3D: public SMESH_3D_Algo
 {
 public:
 
-  GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen);
+  GHS3DPlugin_GHS3D(int hypId, SMESH_Gen* gen);
   virtual ~GHS3DPlugin_GHS3D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
@@ -100,8 +100,6 @@ private:
   bool                _keepFiles;
   bool                _removeLogOnSuccess;
   bool                _logInStandardOutput;
-  SALOMEDS::Study_var _study;
-  SMESH_Gen_i*        _smeshGen_i;
 
   bool                _isLibUsed;
   double              _progressAdvance;
index 4dc8a18febc4b685d3da64fde1dffc83e4121c44..ba7dbeba937d1ef576079b7c8967a58b780ee9ac 100644 (file)
@@ -45,7 +45,6 @@
 //=============================================================================
 
 GHS3DPlugin_GHS3D_i::GHS3DPlugin_GHS3D_i (PortableServer::POA_ptr thePOA,
-                                          int                     theStudyId,
                                           ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
@@ -53,7 +52,6 @@ GHS3DPlugin_GHS3D_i::GHS3DPlugin_GHS3D_i (PortableServer::POA_ptr thePOA,
        SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::GHS3DPlugin_GHS3D (theGenImpl->GetANewId(),
-                                        theStudyId,
                                         theGenImpl );
 }
 
@@ -94,8 +92,8 @@ SMESH::SMESH_Mesh_ptr GHS3DPlugin_GHS3D_i::importGMFMesh(const char* theGMFFileN
 {
   SMESH_Gen_i* smeshGen = SMESH_Gen_i::GetSMESHGen();
   SMESH::SMESH_Mesh_ptr theMesh = smeshGen->CreateEmptyMesh();
-  smeshGen->RemoveLastFromPythonScript(smeshGen->GetCurrentStudy()->StudyId());
-  SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(), theMesh);
+  smeshGen->RemoveLastFromPythonScript();
+  SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(theMesh);
 #ifdef WINNT
 #define SEP '\\'
 #else
@@ -123,7 +121,6 @@ SMESH::SMESH_Mesh_ptr GHS3DPlugin_GHS3D_i::importGMFMesh(const char* theGMFFileN
 //=============================================================================
 
 GHS3DPlugin_Optimizer_i::GHS3DPlugin_Optimizer_i (PortableServer::POA_ptr thePOA,
-                                                  int                     theStudyId,
                                                   ::SMESH_Gen*            theGenImpl )
   : SALOME::GenericObj_i( thePOA ),
     SMESH_Hypothesis_i( thePOA ),
@@ -131,7 +128,6 @@ GHS3DPlugin_Optimizer_i::GHS3DPlugin_Optimizer_i (PortableServer::POA_ptr thePOA
     SMESH_3D_Algo_i( thePOA )
 {
   myBaseImpl = new ::GHS3DPlugin_Optimizer (theGenImpl->GetANewId(),
-                                            theStudyId,
                                             theGenImpl );
 }
 
index cf779040987583070333391388d0eb7eded6dd3b..9aa51879565172e4a43f810defcd86ffdfeb96e7 100644 (file)
@@ -42,7 +42,6 @@ class GHS3DPlugin_GHS3D_i:
 public:
   // Constructor
   GHS3DPlugin_GHS3D_i (PortableServer::POA_ptr thePOA,
-                       int                     theStudyId,
                        ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~GHS3DPlugin_GHS3D_i();
@@ -63,7 +62,6 @@ class GHS3DPlugin_Optimizer_i:
 public:
   // Constructor
   GHS3DPlugin_Optimizer_i (PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
                            ::SMESH_Gen*            theGenImpl );
 };
 
index eeafd0b39962f3a69f1117bae5b32352f5322da0..f3dbdfd8f4f23044b4e2e4b6872f7962daae8ae9 100644 (file)
@@ -40,8 +40,8 @@ using namespace std;
 //function : GHS3DPlugin_Hypothesis
 //=======================================================================
 
-GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
+GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, SMESH_Gen * gen)
+  : SMESH_Hypothesis(hypId, gen),
   myToMeshHoles(DefaultMeshHoles()),
   myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()),
   myMaximumMemory(-1),
index f2e5a8ae131827fb5d6caf68c1e221181dda3a83..47f8e91ac0e954bdd031246a5a952e3289214da9 100644 (file)
@@ -44,7 +44,7 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis: public SMESH_Hypothesis
 {
 public:
 
-  GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen);
+  GHS3DPlugin_Hypothesis(int hypId, SMESH_Gen * gen);
 
   typedef std::map<std::vector<double>,double> TGHS3DEnforcedVertexCoordsValues;
   typedef std::map<std::string,double> TGHS3DEnforcedVertexEntryValues;
index 2da4c1055d78dd338801c8660d4dac9373f4fd33..21af792e85ad661f628cbbd4db373b5dd1e72e3a 100644 (file)
@@ -45,13 +45,11 @@ using namespace std;
 //=======================================================================
 
 GHS3DPlugin_Hypothesis_i::GHS3DPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
                                                     ::SMESH_Gen*            theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
   myBaseImpl = new ::GHS3DPlugin_Hypothesis (theGenImpl->GetANewId(),
-                                             theStudyId,
                                              theGenImpl);
 }
 
@@ -492,7 +490,6 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVe
   CORBA::Double x = 0, y = 0, z = 0;
   CORBA::Boolean isCompound = false;
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   if (theVertexEntry.empty()) {
     string aName;
     if (theVertex->GetShapeType() == GEOM::VERTEX) {
@@ -503,7 +500,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVe
       isCompound = true;
     }
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -511,7 +508,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVe
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
   if (theVertex->GetShapeType() == GEOM::VERTEX) {
-    GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations( smeshGen->GetCurrentStudy()->StudyId() );
+    GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations();
     if (CORBA::is_nil(measureOp))
       return false;
     
@@ -535,7 +532,6 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_
   CORBA::Double x = 0, y = 0, z = 0;
   CORBA::Boolean isCompound = false;
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   if (theVertexEntry.empty()) {
     string aName;
     if (theVertex->GetShapeType() == GEOM::VERTEX) {
@@ -546,7 +542,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_
       isCompound = true;
     }
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -554,7 +550,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
   if (theVertex->GetShapeType() == GEOM::VERTEX) {
-    GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations( smeshGen->GetCurrentStudy()->StudyId() );
+    GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations();
     if (CORBA::is_nil(measureOp))
       return false;
     
@@ -669,14 +665,13 @@ CORBA::Double GHS3DPlugin_Hypothesis_i::GetEnforcedVertexGeom(GEOM::GEOM_Object_
   string theVertexEntry = theVertex->GetStudyEntry();
   if (theVertexEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theVertex->GetShapeType() == GEOM::VERTEX)
       aName = "Vertex_";
     if (theVertex->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -773,14 +768,13 @@ bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr th
   string theVertexEntry = theVertex->GetStudyEntry();
   if (theVertexEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theVertex->GetShapeType() == GEOM::VERTEX)
       aName = "Vertex_";
     if (theVertex->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -917,7 +911,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo
   }
 
   SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
-  SALOMEDS::SObject_ptr SObj = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(),theSource);
+  SALOMEDS::SObject_ptr SObj = smeshGen->ObjectToSObject(theSource);
 
   SMESH_Mesh_i* theMesh_i = SMESH::DownCast<SMESH_Mesh_i*>( theSource);
   SMESH_Group_i* theGroup_i = SMESH::DownCast<SMESH_Group_i*>( theSource);
index d51500200e045798f496e0e42904ef00be84edeb..3e6a82b8e8c5a8e20b5b72983d77ab07f432f8f9 100644 (file)
@@ -45,7 +45,6 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
  public:
   // Constructor
   GHS3DPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
                             ::SMESH_Gen*            theGenImpl);
   // Destructor
   virtual ~GHS3DPlugin_Hypothesis_i();
index a2ef47547affe2879706650a21fb0f19ac7f1c18..4244affb880932a54796182093bedb4800ffbed2 100644 (file)
@@ -39,8 +39,8 @@
  */
 //================================================================================
 
-GHS3DPlugin_Optimizer::GHS3DPlugin_Optimizer(int hypId, int studyId, SMESH_Gen* gen)
-  : SMESH_3D_Algo(hypId, studyId, gen)
+GHS3DPlugin_Optimizer::GHS3DPlugin_Optimizer(int hypId, SMESH_Gen* gen)
+  : SMESH_3D_Algo(hypId, gen)
 {
   _name = Name();
   _compatibleHypothesis.push_back( GHS3DPlugin_OptimizerHypothesis::GetHypType());
index 94e18c506359570084835032eb180d11a64ae61d..70289236fef2ccd5265d56a5aa9ae455d24a9db3 100644 (file)
@@ -30,7 +30,7 @@ class GHS3DPlugin_OptimizerHypothesis;
 class GHS3DPlugin_Optimizer: public SMESH_3D_Algo
 {
 public:
-  GHS3DPlugin_Optimizer(int hypId, int studyId, SMESH_Gen* gen);
+  GHS3DPlugin_Optimizer(int hypId, SMESH_Gen* gen);
 
   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
                                const TopoDS_Shape& aShape,
index e4e0c65cc85db417a2b5e2b41cc7ce12b1e58da6..d183a140d8343a00e0427a6d4121ef4d71fae6f6 100644 (file)
@@ -24,9 +24,8 @@
 #include <SMESH_Gen.hxx>
 
 GHS3DPlugin_OptimizerHypothesis::GHS3DPlugin_OptimizerHypothesis(int         hypId,
-                                                                 int         studyId,
                                                                  SMESH_Gen * gen)
-  :GHS3DPlugin_Hypothesis( hypId, studyId, gen ),
+  :GHS3DPlugin_Hypothesis( hypId, gen ),
    myOptimization( YES ),
    mySplitOverConstrained( NO ),
    mySmoothOffSlivers( false ),
index 471715896bcb2398132c01d07929d082296e63b9..926c238939d8c470c39fedb984af8727b3300e68 100644 (file)
@@ -28,7 +28,7 @@
 class GHS3DPlugin_OptimizerHypothesis : public GHS3DPlugin_Hypothesis
 {
 public:
-  GHS3DPlugin_OptimizerHypothesis(int hypId, int studyId, SMESH_Gen * gen);
+  GHS3DPlugin_OptimizerHypothesis(int hypId, SMESH_Gen * gen);
 
   // inherited params:
   // 1 - create new nodes
index d2b205ef08422d822c73952f9d8458f529fafea3..bec2bc5ae411887a38e15b1d96fd36426fef1121 100644 (file)
 
 GHS3DPlugin_OptimizerHypothesis_i::
 GHS3DPlugin_OptimizerHypothesis_i (PortableServer::POA_ptr thePOA,
-                                   int                     theStudyId,
                                    ::SMESH_Gen*            theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA ),
-    GHS3DPlugin_Hypothesis_i( thePOA, theStudyId, theGenImpl )
+    GHS3DPlugin_Hypothesis_i( thePOA, theGenImpl )
 {
   int id = myBaseImpl ? myBaseImpl->GetID() : theGenImpl->GetANewId();
   if ( myBaseImpl )
     delete myBaseImpl;
 
-  myBaseImpl = new ::GHS3DPlugin_OptimizerHypothesis( id, theStudyId, theGenImpl );
+  myBaseImpl = new ::GHS3DPlugin_OptimizerHypothesis( id, theGenImpl );
 }
 
 namespace
index 7cffca5bd3fc96d437d6c308f3f0868a548c3e1b..e94ca90aab6d5851c842f6502aba17eea3b70e09 100644 (file)
@@ -41,7 +41,6 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_OptimizerHypothesis_i:
 {
  public:
   GHS3DPlugin_OptimizerHypothesis_i (PortableServer::POA_ptr thePOA,
-                                     int                     theStudyId,
                                      ::SMESH_Gen*            theGenImpl);
   // inherited params:
   // 1 - create new nodes
index 95dd9053be12ee55319ccddac336f410288663db..d163198b0f101d38452a5cb38fbe624ca957bc35 100644 (file)
@@ -313,14 +313,13 @@ GHS3DPluginGUI_HypothesisCreator::~GHS3DPluginGUI_HypothesisCreator()
 }
 
 /**
- * \brief {Get or create the geom selection tool for active study}
+ * \brief {Get or create the geom selection tool for study}
  * */
 GeomSelectionTools* GHS3DPluginGUI_HypothesisCreator::getGeomSelectionTool()
 {
   GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-  if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) {
-    that->GeomToolSelected = new GeomSelectionTools(aStudy);
+  if (that->GeomToolSelected == NULL) {
+    that->GeomToolSelected = new GeomSelectionTools();
   }
   return that->GeomToolSelected;
 }
@@ -778,7 +777,7 @@ void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex()
       return;
     if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
       GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
-      GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
+      GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( );
       if (CORBA::is_nil(measureOp))
         return;
       
@@ -1137,16 +1136,17 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
   int elementType = myEnfMeshConstraint->currentIndex();
   
   
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  _PTR(Study) aStudy = SMESH::getStudy();
   _PTR(SObject) aSObj;
   QString meshEntry = myEnfMeshWdg->GetValue();
   
   if (selEnfMeshes == 1)
   {
     aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
-    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
-    if (!CORBA::is_nil(anObj))
+    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
+    if (!CORBA::is_nil(anObj)) {
       addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
+    }
   }
   else
   {
@@ -1154,7 +1154,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
     QStringListIterator meshEntriesIt (meshEntries);
     while (meshEntriesIt.hasNext()) {
       aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
-      CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
+      CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
       if (!CORBA::is_nil(anObj)) {
         addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
       }
@@ -1219,7 +1219,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex()
     if ( CORBA::is_nil(getGeomEngine()))
       return;
 
-    GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
+    GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( );
     if (CORBA::is_nil(measureOp))
       return;
 
@@ -1734,7 +1734,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
 
     TEnfMeshList::const_iterator itEnfMesh;
 
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
 
     for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
       TEnfMesh* enfMesh = (*itEnfMesh);