Salome HOME
Merge changes from 'master' branch.
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
index db1eb65427b98fc70479ed3e9e44720018443c79..eacff525f777dc7351add61a0267f95fd9e09eaa 100644 (file)
@@ -47,13 +47,12 @@ using namespace std;
  */
 //=============================================================================
 BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
-                                                     int                     theStudyId,
                                                      ::SMESH_Gen*            theGenImpl,
                                                      bool                    theHasGEOM) :
   SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA)
 {
   myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(),
-                                             theStudyId,
+                                             
                                              theGenImpl,
                                              theHasGEOM);
 }
@@ -1776,7 +1775,7 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char*
 
 //=============================================================================
 
-void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO à finir
+void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO ?? finir
   throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
@@ -1839,7 +1838,7 @@ char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SAL
 
 // //=============================================================================
 // 
-// // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
+// // TODO coder cette fonction (utilis??e pour savoir si la valeur a chang??
 // // A finir pour le dump
 // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
 //   throw (SALOME::SALOME_Exception)
@@ -2027,13 +2026,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();
   }
@@ -2050,7 +2048,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();
   }
@@ -2070,13 +2068,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();
   // }
@@ -2468,14 +2465,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();
   }
@@ -2503,14 +2499,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();
   }
@@ -2540,7 +2535,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;
   //
@@ -2552,7 +2547,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()) {
@@ -2561,7 +2555,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();
   }
@@ -2574,7 +2568,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();
   }
@@ -2605,14 +2599,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();
   }
@@ -2642,14 +2635,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();
   }
@@ -2682,7 +2674,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()) {
@@ -2691,7 +2682,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();
   }
@@ -2704,7 +2695,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();
   }
@@ -2735,14 +2726,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();
 //  }
@@ -2771,14 +2761,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();
   }
@@ -2804,14 +2793,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();
   }
@@ -2837,7 +2825,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;
   //
@@ -2849,7 +2837,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()) {
@@ -2858,7 +2845,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();
   }
@@ -2871,7 +2858,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();
   }
@@ -2897,14 +2884,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();
   }
@@ -2966,7 +2952,7 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theV
     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();
   }
@@ -3034,7 +3020,7 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeomWithGroup(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();
   }
@@ -3076,7 +3062,7 @@ bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr t
     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();
   }
@@ -3353,7 +3339,7 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup()
  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();
  }
@@ -3493,7 +3479,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
@@ -3501,7 +3486,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();
   }