Salome HOME
23627: [IMACS] Change group management to have group ID persistent
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
index db1eb65427b98fc70479ed3e9e44720018443c79..cb34600ec9973bc203d0ba64669101f9b9c89d27 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);
 }
@@ -1743,7 +1742,7 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM:
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
   if (valueChanged)
-    SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
+    SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", " << sizeMap << " )";
 }
 
 //=============================================================================
@@ -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();
   }
@@ -2957,7 +2943,6 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theV
   string theVertexEntry = theVertex->GetStudyEntry();
   
   GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
-  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
   string aName;
   
   if (theVertexEntry.empty()) {
@@ -2966,7 +2951,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();
   }
@@ -3025,7 +3010,6 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeomWithGroup(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 (theVertexEntry.empty()) {
@@ -3034,7 +3018,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();
   }
@@ -3067,7 +3051,6 @@ bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr t
   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 (theVertexEntry.empty()) {
@@ -3076,7 +3059,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 +3336,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 +3476,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 +3483,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();
   }
@@ -3860,85 +3842,249 @@ char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
 
 //================================================================================
 /*!
- * \brief Verify whether hypothesis supports given entity type 
+ * \brief Verify whether hypothesis supports given entity type
  * \param type - dimension (see SMESH::Dimension enumeration)
  * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
- * 
+ *
  * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
  */
-//================================================================================  
+//================================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported(SMESH::Dimension type) {
   return type == SMESH::DIM_2D;
 }
 
-//
-// Obsolete methods - To be removed in V7
-//
 
-void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) {
-  this->SetMinSize(theMinSize);
-}
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() {
-  return this->GetMinSize();
-}
-void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) {
-  this->SetMaxSize(theMaxSize);
-}
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() {
-  return this->GetMaxSize();
-}
-void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) {
-  this->SetMinSize(theMinSize);
-}
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() {
-  return this->GetMinSize();
-}
-void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) {
-  this->SetMaxSize(theMaxSize);
-}
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() {
-  return this->GetMaxSize();
-}
-void BLSURFPlugin_Hypothesis_i::SetAngleMeshS(CORBA::Double theValue) {
-  this->SetAngleMesh(theValue);
-}
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() {
-  return this->GetAngleMesh();
-}
-void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double theValue) {
-  this->SetAngleMesh(theValue);
-}
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() {
-  return this->GetAngleMesh();
-}
-void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
-  std::string theValueStr = theValue ? "1" : "0";
-  this->SetOptionValue("respect_geometry",theValueStr.c_str());
-}
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
-  std::string theValueStr = this->GetOptionValue("respect_geometry");
-  if (theValueStr.empty() || theValueStr == "respect")
-    return true;
-  return false;
-}
-void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
-  std::string theValueStr = theValue ? "1" : "0";
-  this->AddPreCADOption("remove_tiny_edges",theValueStr.c_str());
-}
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
-  std::string theValueStr = this->GetPreCADOption("remove_tiny_edges");
-  if (theValueStr == "1")
-    return true;
-  return false;
-}
-void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
-  std::ostringstream theValueStr;
-  theValueStr << theValue;
-  this->AddPreCADOption("tiny_edge_length",theValueStr.str().c_str());
+//================================================================================
+/*!
+ * \brief Return geometry this hypothesis depends on. Return false if there is no geometry parameter
+ */
+//================================================================================
+
+bool
+BLSURFPlugin_Hypothesis_i::getObjectsDependOn( std::vector< std::string > & entryArray,
+                                               std::vector< int >         & subIDArray ) const
+{
+  typedef ::BLSURFPlugin_Hypothesis BH;
+  const BH* impl = static_cast<const BH*>( myBaseImpl );
+
+  {
+    const BH::TSizeMap& sizeMap = impl->_GetSizeMapEntries();
+    BH::TSizeMap::const_iterator entry2size = sizeMap.cbegin();
+    for ( ; entry2size != sizeMap.cend(); ++entry2size )
+      entryArray.push_back( entry2size->first );
+  }
+  {
+    const BH::TSizeMap& sizeMap = impl->_GetAttractorEntries();
+    BH::TSizeMap::const_iterator entry2size = sizeMap.cbegin();
+    for ( ; entry2size != sizeMap.cend(); ++entry2size )
+      entryArray.push_back( entry2size->first );
+  }
+  {
+    const BH::TAttractorMap& classAttractors = impl-> _GetClassAttractorEntries();
+    BH::TAttractorMap::const_iterator entry2size = classAttractors.cbegin();
+    for ( ; entry2size != classAttractors.cend(); ++entry2size )
+      entryArray.push_back( entry2size->first );
+  }
+  {
+    const BH::TFaceEntryEnfVertexListMap& faceEntryEnfVertexListMap = impl->_GetAllEnforcedVerticesByFace();
+    BH::TFaceEntryEnfVertexListMap::const_iterator entry2evList = faceEntryEnfVertexListMap.cbegin();
+    for ( ; entry2evList != faceEntryEnfVertexListMap.cend(); ++entry2evList )
+    {
+      entryArray.push_back( entry2evList->first );
+
+      const BH::TEnfVertexList& evList = entry2evList->second;
+      BH::TEnfVertexList::const_iterator evIt = evList.cbegin();
+      for ( ; evIt != evList.cend(); ++evIt )
+      {
+        const BH::TEnfVertex* ev = *evIt;
+        entryArray.push_back( ev->geomEntry );
+        entryArray.insert( entryArray.end(), ev->faceEntries.cbegin(), ev->faceEntries.cend() );
+      }
+    }
+  }
+  // { // duplicated data of faceEntryEnfVertexListMap
+  //   const BH::TEnfVertexList& enfVertexList = impl->_GetAllEnforcedVertices();
+  //   const BH::TFaceEntryCoordsListMap& faceEntryCoordsListMap = impl->_GetAllCoordsByFace();
+  //   const BH::TFaceEntryEnfVertexEntryListMap& faceEntryEnfVertexEntryListMap = impl->_GetAllEnfV  //   const BH::TEnfVertexEntryEnfVertexMap& enfVertexEntryEnfVertexMap = impl->_GetAllEnforcedVert  // }
+  {
+    const BH::TPreCadPeriodicityVector& preCadFacesPeriodicityVector = impl->_GetPreCadFacesPeriodicityVector();
+    BH::TPreCadPeriodicityVector::const_iterator pcp = preCadFacesPeriodicityVector.cbegin();
+    for ( ; pcp != preCadFacesPeriodicityVector.cend(); ++pcp )
+    {
+      entryArray.push_back( pcp->shape1Entry );
+      entryArray.push_back( pcp->shape2Entry );
+      entryArray.insert( entryArray.end(),
+                         pcp->theSourceVerticesEntries.cbegin(),
+                         pcp->theSourceVerticesEntries.cend() );
+      entryArray.insert( entryArray.end(),
+                         pcp->theTargetVerticesEntries.cbegin(),
+                         pcp->theTargetVerticesEntries.cend() );
+    }
+  }
+  {
+    const BH::TPreCadPeriodicityVector& preCadEdgesPeriodicityVector = impl->_GetPreCadEdgesPeriodicityVector();
+    BH::TPreCadPeriodicityVector::const_iterator pcp = preCadEdgesPeriodicityVector.cbegin();
+    for ( ; pcp != preCadEdgesPeriodicityVector.cend(); ++pcp )
+    {
+      entryArray.push_back( pcp->shape1Entry );
+      entryArray.push_back( pcp->shape2Entry );
+      entryArray.insert( entryArray.end(),
+                         pcp->theSourceVerticesEntries.cbegin(),
+                         pcp->theSourceVerticesEntries.cend() );
+      entryArray.insert( entryArray.end(),
+                         pcp->theTargetVerticesEntries.cbegin(),
+                         pcp->theTargetVerticesEntries.cend() );
+    }
+  }
+  {
+    const BH::THyperPatchList& hyperPatchList = impl->GetHyperPatches();
+    BH::THyperPatchList::const_iterator idSet = hyperPatchList.cbegin();
+    for ( ; idSet != hyperPatchList.cend(); ++idSet )
+    {
+      subIDArray.insert( subIDArray.end(), idSet->cbegin(), idSet->cend() );
+    }
+  }
+  return true;
 }
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() {
-  std::istringstream theValueStr(this->GetPreCADOption("tiny_edge_length"));
-  double result;
-  theValueStr >> result;
-  return result;
+
+//================================================================================
+/*!
+ * \brief Set new geometry instead of that returned by getObjectsDependOn()
+ */
+//================================================================================
+
+bool
+BLSURFPlugin_Hypothesis_i::setObjectsDependOn( std::vector< std::string > & entryArray,
+                                               std::vector< int >         & subIDArray )
+{
+  typedef ::BLSURFPlugin_Hypothesis BH;
+  BH* impl = static_cast<BH*>( myBaseImpl );
+
+  size_t iEnt = 0;
+  {
+    BH::TSizeMap& sizeMapNew = const_cast< BH::TSizeMap& >( impl->_GetSizeMapEntries() );
+    BH::TSizeMap sizeMap;
+    sizeMap.swap( sizeMapNew );
+    BH::TSizeMap::const_iterator entry2size = sizeMap.cbegin();
+    for ( ; entry2size != sizeMap.cend(); ++entry2size, ++iEnt )
+      if ( entryArray[ iEnt ].empty() == entry2size->first.empty() )
+        sizeMapNew[ entryArray[ iEnt ]] =  entry2size->second;
+  }
+  {
+    BH::TSizeMap& sizeMapNew = const_cast< BH::TSizeMap& >( impl->_GetAttractorEntries() );
+    BH::TSizeMap sizeMap;
+    sizeMap.swap( sizeMapNew );
+    BH::TSizeMap::const_iterator entry2size = sizeMap.cbegin();
+    for ( ; entry2size != sizeMap.cend(); ++entry2size, ++iEnt )
+      if ( entryArray[ iEnt ].empty() == entry2size->first.empty() )
+        sizeMapNew[ entryArray[ iEnt ]] =  entry2size->second;
+  }
+  {
+    BH::TAttractorMap& attrMapNew =
+      const_cast< BH::TAttractorMap& > ( impl->_GetClassAttractorEntries() );
+    BH::TAttractorMap attrMap;
+    attrMap.swap( attrMapNew );
+    BH::TAttractorMap::const_iterator entry2size = attrMap.cbegin();
+    for ( ; entry2size != attrMap.cend(); ++entry2size, ++iEnt )
+      if ( entryArray[ iEnt ].empty() == entry2size->first.empty() )
+        attrMapNew.insert( std::make_pair( entryArray[ iEnt ], entry2size->second ));
+      else
+        delete entry2size->second;
+  }
+  {
+    BH::TFaceEntryEnfVertexListMap& faceEntryEnfVertexListMapNew =
+      const_cast< BH::TFaceEntryEnfVertexListMap& >( impl->_GetAllEnforcedVerticesByFace() );
+    BH::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap;
+    faceEntryEnfVertexListMap.swap( faceEntryEnfVertexListMapNew );
+
+    BH::TEnfVertexList& enfVertexList =
+      const_cast< BH::TEnfVertexList& > ( impl->_GetAllEnforcedVertices() );
+    enfVertexList.clear(); // avoid removal
+
+    impl->ClearAllEnforcedVertices();
+
+    BH::TFaceEntryEnfVertexListMap::iterator entry2evList = faceEntryEnfVertexListMap.begin();
+    for ( ; entry2evList != faceEntryEnfVertexListMap.end(); ++entry2evList )
+    {
+      const BH::TEntry& entry = entryArray[ iEnt++ ];
+      bool faceOk = ( entry.empty() == entry2evList->first.empty() );
+
+      BH::TEnfVertexList& evList = entry2evList->second;
+      BH::TEnfVertexList::iterator evIt = evList.begin();
+      for ( ; evIt != evList.end(); ++evIt )
+      {
+        BH::TEnfVertex* ev = *evIt;
+        bool ok = faceOk && ( ev->geomEntry.empty() != entryArray[ iEnt ].empty() );
+        ev->geomEntry = entryArray[ iEnt++ ];
+        BH::TEntryList faceEntriesNew;
+        BH::TEntryList::iterator fEnt = ev->faceEntries.begin();
+        for ( ; fEnt != ev->faceEntries.end(); ++fEnt, ++iEnt )
+        {
+          if ( !entryArray[ iEnt ].empty() )
+            faceEntriesNew.insert( entryArray[ iEnt ]);
+        }
+        if ( ok )
+        {
+          ev->faceEntries.swap( faceEntriesNew );
+          impl->AddEnforcedVertex( entry, ev );
+        }
+        else
+        {
+          delete ev;
+        }
+      }
+    }
+  }
+  {
+    BH::TPreCadPeriodicityVector& preCadPeriodicityVector =
+      const_cast< BH::TPreCadPeriodicityVector&> ( impl->_GetPreCadFacesPeriodicityVector() );
+    BH::TPreCadPeriodicityVector::iterator pcp = preCadPeriodicityVector.begin();
+    for ( ; pcp != preCadPeriodicityVector.end(); ++pcp )
+    {
+      pcp->shape1Entry = entryArray[ iEnt++ ];
+      pcp->shape2Entry = entryArray[ iEnt++ ];
+      for ( size_t i = 0; i < pcp->theSourceVerticesEntries.size(); ++i, iEnt++ )
+        pcp->theSourceVerticesEntries[i] = entryArray[ iEnt ];
+
+      for ( size_t i = 0; i < pcp->theTargetVerticesEntries.size(); ++i, iEnt++ )
+        pcp->theTargetVerticesEntries[i] = entryArray[ iEnt ];
+    }
+  }
+  {
+    BH::TPreCadPeriodicityVector& preCadPeriodicityVector =
+      const_cast< BH::TPreCadPeriodicityVector&> ( impl->_GetPreCadEdgesPeriodicityVector() );
+    BH::TPreCadPeriodicityVector::iterator pcp = preCadPeriodicityVector.begin();
+    for ( ; pcp != preCadPeriodicityVector.end(); ++pcp )
+    {
+      pcp->shape1Entry = entryArray[ iEnt++ ];
+      pcp->shape2Entry = entryArray[ iEnt++ ];
+      for ( size_t i = 0; i < pcp->theSourceVerticesEntries.size(); ++i, iEnt++ )
+        pcp->theSourceVerticesEntries[i] = entryArray[ iEnt ];
+
+      for ( size_t i = 0; i < pcp->theTargetVerticesEntries.size(); ++i, iEnt++ )
+        pcp->theTargetVerticesEntries[i] = entryArray[ iEnt ];
+    }
+  }
+
+  size_t iID = 0;
+  {
+    BH::THyperPatchList& hyperPatchListNew =
+      const_cast< BH::THyperPatchList& >( impl->GetHyperPatches() );
+    BH::THyperPatchList hyperPatchList;
+    hyperPatchList.swap( hyperPatchListNew );
+    BH::THyperPatchList::iterator idSet = hyperPatchList.begin();
+    for ( ; idSet != hyperPatchList.end(); ++idSet )
+    {
+      BH::THyperPatchTags& ids = *idSet;
+      BH::THyperPatchTags idsNew;
+      BH::THyperPatchTags::iterator i = ids.begin();
+      for ( ; i != ids.end(); ++i, ++iID )
+        if ( subIDArray[ iID ] > 0 )
+          idsNew.insert( subIDArray[ iID ]);
+      if ( !idsNew.empty() )
+        hyperPatchListNew.push_back( idsNew );
+    }
+  }
+
+  return ( iEnt == entryArray.size() && iID == subIDArray.size() );
 }