Salome HOME
0023299: [CEA] Finalize multi-study removal
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
index e5c3c0da60a291befb9e128d47a108a9ee2dcac9..8939ad53a26933ce7f3ec0635587b1ac20ef75e4 100644 (file)
@@ -46,11 +46,11 @@ using namespace std;
  *  Constructor
  */
 //=============================================================================
-BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId,
+BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
     ::SMESH_Gen* theGenImpl) :
   SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
   MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
-  myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theStudyId, theGenImpl);
+  myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theGenImpl);
 }
 
 //=============================================================================
@@ -2019,13 +2019,12 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace,
   theAttEntry  = theAttractor->GetStudyEntry();
   
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   string aName;
   
   if (theFaceEntry.empty()) {
     aName = "Face_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2042,7 +2041,7 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace,
     if (theAttractor->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theAttractor->GetEntry();
-    SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theAttractor, aName.c_str());
+    SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(NULL, theAttractor, aName.c_str());
     if (!theSAtt->_is_nil())
       theAttEntry = theSAtt->GetID();
   }
@@ -2064,13 +2063,12 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace
   CORBA::String_var theAttrEntry = theAttractor->GetStudyEntry();
   
   // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  // SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   // string aName;
   
   // if (theFaceEntry.empty()) {
   //   aName = "Face_";
   //   aName += theFace->GetEntry();
-  //   SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+  //   SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
   //   if (!theSFace->_is_nil())
   //     theFaceEntry = theSFace->GetID();
   // }
@@ -2494,14 +2492,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace,
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2532,14 +2529,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr the
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2573,7 +2569,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
   }
 
   //  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
+  //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations();
   //  if (CORBA::is_nil(measureOp))
   //    return false;
   //
@@ -2585,7 +2581,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
   string theVertexEntry = theVertex->GetStudyEntry();
   
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   string aName;
   
   if (theFaceEntry.empty()) {
@@ -2594,7 +2589,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2607,7 +2602,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
     if (theVertex->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -2642,14 +2637,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2682,14 +2676,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Objec
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2726,7 +2719,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
   string theVertexEntry = theVertex->GetStudyEntry();
   
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   string aName;
   
   if (theFaceEntry.empty()) {
@@ -2735,7 +2727,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2748,7 +2740,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
     if (theVertex->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -2783,14 +2775,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
   
 //  if (theFaceEntry.empty()) {
 //    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-//    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
 //    string aName;
 //    if (theFace->GetShapeType() == GEOM::FACE)
 //      aName = "Face_";
 //    if (theFace->GetShapeType() == GEOM::COMPOUND)
 //      aName = "Compound_";
 //    aName += theFace->GetEntry();
-//    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+//    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
 //    if (!theSFace->_is_nil())
 //      theFaceEntry = theSFace->GetID();
 //  }
@@ -2822,14 +2813,13 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2858,14 +2848,13 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFac
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2895,7 +2884,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th
   }
 
   //  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
+  //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations();
   //  if (CORBA::is_nil(measureOp))
   //    return false;
   //
@@ -2907,7 +2896,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th
   std::string theVertexEntry = theVertex->GetStudyEntry();
   
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   string aName;
   
   if (theFaceEntry.empty()) {
@@ -2916,7 +2904,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -2929,7 +2917,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th
     if (theVertex->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theVertex->GetEntry();
-    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
     if (!theSVertex->_is_nil())
       theVertexEntry = theSVertex->GetID();
   }
@@ -2957,14 +2945,13 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF
   
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -3284,14 +3271,13 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Ob
 
   if (theFaceEntry.empty()) {
     GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
     string aName;
     if (theFace->GetShapeType() == GEOM::FACE)
       aName = "Face_";
     if (theFace->GetShapeType() == GEOM::COMPOUND)
       aName = "Compound_";
     aName += theFace->GetEntry();
-    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
     if (!theSFace->_is_nil())
       theFaceEntry = theSFace->GetID();
   }
@@ -3441,7 +3427,6 @@ std::string BLSURFPlugin_Hypothesis_i::PublishIfNeeded(GEOM::GEOM_Object_ptr sha
   string shapeEntry = shape->GetStudyEntry();
 
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   string aName;
 
   // Publish shape if needed
@@ -3449,7 +3434,7 @@ std::string BLSURFPlugin_Hypothesis_i::PublishIfNeeded(GEOM::GEOM_Object_ptr sha
     if (shape->GetShapeType() == theShapeType)
       aName = prefix;
     aName += shape->GetEntry();
-    SALOMEDS::SObject_wrap theSFace1 = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, shape, aName.c_str());
+    SALOMEDS::SObject_wrap theSFace1 = geomGen->PublishInStudy(NULL, shape, aName.c_str());
     if (!theSFace1->_is_nil())
       shapeEntry = theSFace1->GetID();
   }