Salome HOME
23627: [IMACS] Change group management to have group ID persistent
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis_i.cxx
index e5c3c0da60a291befb9e128d47a108a9ee2dcac9..cb34600ec9973bc203d0ba64669101f9b9c89d27 100644 (file)
@@ -46,11 +46,15 @@ using namespace std;
  *  Constructor
  */
 //=============================================================================
-BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId,
-    ::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);
+BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
+                                                     ::SMESH_Gen*            theGenImpl,
+                                                     bool                    theHasGEOM) :
+  SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA)
+{
+  myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(),
+                                             
+                                             theGenImpl,
+                                             theHasGEOM);
 }
 
 //=============================================================================
@@ -60,8 +64,8 @@ BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr the
  *  Destructor
  */
 //=============================================================================
-BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
-  MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
+BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
+{
 }
 
 //=============================================================================
@@ -74,8 +78,8 @@ BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
+void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
@@ -88,8 +92,8 @@ void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
  *  Get PhysicalMesh
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhysicalMesh();
 }
@@ -102,8 +106,8 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
+void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
@@ -116,8 +120,8 @@ void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
  *  Get GeometricMesh
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetGeometricMesh();
 }
@@ -129,8 +133,8 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
  *  Set PhySize
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
+void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhySize(theValue, false);
   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
@@ -143,8 +147,8 @@ void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
  *  Set Relative PhySize
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySizeRel");
+void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhySize(theValue, true);
   SMESH::TPythonDump() << _this() << ".SetPhySizeRel( " << theValue << " )";
@@ -157,8 +161,8 @@ void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
  *  Get PhySize
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhySize();
 }
@@ -170,15 +174,15 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
  *  Returns True if PhySize is relative
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::IsPhySizeRel");
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->IsPhySizeRel();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize)
+{
   if (IsMinSizeRel() || GetMinSize() != theMinSize ) {
     this->GetImpl()->SetMinSize(theMinSize, false);
     SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
@@ -186,8 +190,8 @@ void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize)
+{
   if ( !IsMinSizeRel() || (GetMinSize() != theMinSize) ) {
     this->GetImpl()->SetMinSize(theMinSize, true);
     SMESH::TPythonDump() << _this() << ".SetMinSizeRel( " << theMinSize << " )";
@@ -195,21 +199,20 @@ void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize() {
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize()
+{
   return this->GetImpl()->GetMinSize();
 }
 
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::IsMinSizeRel");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel()
+{
   return this->GetImpl()->IsMinSizeRel();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize)
+{
   if (IsMaxSizeRel() || GetMaxSize() != theMaxSize) {
     this->GetImpl()->SetMaxSize(theMaxSize, false);
     SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
@@ -217,8 +220,8 @@ void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize)
+{
   if ( !IsMaxSizeRel() || (GetMaxSize() != theMaxSize) ) {
     this->GetImpl()->SetMaxSize(theMaxSize, true);
     SMESH::TPythonDump() << _this() << ".SetMaxSizeRel( " << theMaxSize << " )";
@@ -226,15 +229,14 @@ void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize() {
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize()
+{
   return this->GetImpl()->GetMaxSize();
 }
 
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
-//   MESSAGE("BLSURFPlugin_Hypothesis_i::IsMaxSizeRel");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel()
+{
   return this->GetImpl()->IsMaxSizeRel();
 }
 
@@ -246,9 +248,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetUseGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue)
+{
   if ( GetImpl()->GetUseGradation() != bool( theValue ))
   {
     this->GetImpl()->SetUseGradation(theValue);
@@ -264,9 +265,8 @@ void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetUseGradation");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation()
+{
   return this->GetImpl()->GetUseGradation();
 }
 
@@ -277,9 +277,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation() {
  *  Set Gradation
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue)
+{
   this->GetImpl()->SetGradation(theValue);
 
   if ( theValue < 0 )
@@ -295,9 +294,8 @@ void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
  *  Get Gradation
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
+{
   return this->GetImpl()->GetGradation();
 }
 
@@ -308,9 +306,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue)
+{
   if ( GetImpl()->GetUseVolumeGradation() != bool( theValue ))
   {
     this->GetImpl()->SetUseVolumeGradation(theValue);
@@ -326,9 +323,8 @@ void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation()
+{
   return this->GetImpl()->GetUseVolumeGradation();
 }
 
@@ -339,9 +335,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation() {
  *  Set VolumeGradation
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetVolumeGradation");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue)
+{
   this->GetImpl()->SetVolumeGradation(theValue);
   if ( theValue < 0 )
     SetUseVolumeGradation( false );
@@ -356,9 +351,8 @@ void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue) {
  *  Get VolumeGradation
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetVolumeGradation");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation()
+{
   return this->GetImpl()->GetVolumeGradation();
 }
 
@@ -367,27 +361,42 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation() {
  *  BLSURFPlugin_Hypothesis_i::SetQuadAllowed
  *
  *  Set true or false
+ *
+ *  DEPRACATED, kept for python script compatibility
+ *
+ *  TO be removed in Salome 9
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
-  ASSERT(myBaseImpl);
-  this->GetImpl()->SetQuadAllowed(theValue);
-  std::string theValueStr = theValue ? "True" : "False";
-  SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
+void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue)
+{
+  ::BLSURFPlugin_Hypothesis::ElementType theElementType = theValue ?
+                  ::BLSURFPlugin_Hypothesis::QuadrangleDominant : ::BLSURFPlugin_Hypothesis::Triangles;
+  this->GetImpl()->SetElementType(theElementType);
+  SMESH::TPythonDump() << _this() << ".SetElementType( " << theElementType << " )";
 }
 
 //=============================================================================
 /*!
- *  BLSURFPlugin_Hypothesis_i::GetQuadAllowed
+ *  BLSURFPlugin_Hypothesis_i::SetElementType
  *
- *  Get true or false
+ *  Set ElementType
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
-  ASSERT(myBaseImpl);
-  return this->GetImpl()->GetQuadAllowed();
+void BLSURFPlugin_Hypothesis_i::SetElementType(CORBA::Long theValue)
+{
+  this->GetImpl()->SetElementType((::BLSURFPlugin_Hypothesis::ElementType) theValue);
+  SMESH::TPythonDump() << _this() << ".SetElementType( " << theValue << " )";
+}
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetElementType
+ *
+ *  Get ElementType
+ */
+//=============================================================================
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetElementType()
+{
+  return this->GetImpl()->GetElementType();
 }
 
 //=============================================================================
@@ -397,9 +406,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
  *  Set AngleMesh
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMesh");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue)
+{
   this->GetImpl()->SetAngleMesh(theValue);
   SMESH::TPythonDump() << _this() << ".SetAngleMesh( " << theValue << " )";
 }
@@ -411,9 +419,8 @@ void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
  *  Get AngleMesh
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMesh");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh()
+{
   return this->GetImpl()->GetAngleMesh();
 }
 
@@ -424,9 +431,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
  *  Set Chordal Error
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetChordalError");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue)
+{
   this->GetImpl()->SetChordalError(theValue);
   SMESH::TPythonDump() << _this() << ".SetChordalError( " << theValue << " )";
 }
@@ -438,9 +444,8 @@ void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
  *  Get Chordal Error
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetChordalError");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError()
+{
   return this->GetImpl()->GetChordalError();
 }
 
@@ -451,9 +456,8 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropic");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue)
+{
   this->GetImpl()->SetAnisotropic(theValue);
   std::string theValueStr = theValue ? "True" : "False";
   SMESH::TPythonDump() << _this() << ".SetAnisotropic( " << theValueStr.c_str() << " )";
@@ -466,9 +470,8 @@ void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropic");
-  ASSERT(myBaseImpl);
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic()
+{
   return this->GetImpl()->GetAnisotropic();
 }
 
@@ -479,9 +482,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
  *  Set Anisotropic Ratio
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio");
-  ASSERT(myBaseImpl);
+void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue)
+{
   this->GetImpl()->SetAnisotropicRatio(theValue);
   SMESH::TPythonDump() << _this() << ".SetAnisotropicRatio( " << theValue << " )";
 }
@@ -493,9 +495,8 @@ void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
  *  Get Anisotropic Ratio
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio");
-  ASSERT(myBaseImpl);
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio()
+{
   return this->GetImpl()->GetAnisotropicRatio();
 }
 
@@ -508,7 +509,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetRemoveTinyEdges(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -523,7 +523,6 @@ void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetRemoveTinyEdges();
 }
@@ -536,7 +535,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetTinyEdgeLength(theValue);
   SMESH::TPythonDump() << _this() << ".SetTinyEdgeLength( " << theValue << " )";
@@ -550,7 +548,6 @@ void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTinyEdgeLength();
 }
@@ -563,7 +560,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetOptimiseTinyEdges(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -578,7 +574,6 @@ void BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetOptimiseTinyEdges();
 }
@@ -591,7 +586,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetTinyEdgeOptimisationLength(theValue);
   SMESH::TPythonDump() << _this() << ".SetTinyEdgeOptimisationLength( " << theValue << " )";
@@ -605,7 +599,6 @@ void BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength(CORBA::Double theV
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTinyEdgeOptimisationLength();
 }
@@ -618,7 +611,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetCorrectSurfaceIntersection(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -633,7 +625,6 @@ void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection(CORBA::Boolean the
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetCorrectSurfaceIntersection();
 }
@@ -646,7 +637,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetCorrectSurfaceIntersectionMaxCost(theValue);
   SMESH::TPythonDump() << _this() << ".SetCorrectSurfaceIntersectionMaxCost( " << theValue << " )";
@@ -660,7 +650,6 @@ void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost(CORBA::Doub
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetCorrectSurfaceIntersectionMaxCost();
 }
@@ -673,7 +662,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost()
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementRemoval");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetBadElementRemoval(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -688,7 +676,6 @@ void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementRemoval");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetBadElementRemoval();
 }
@@ -701,7 +688,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetBadElementAspectRatio(theValue);
   SMESH::TPythonDump() << _this() << ".SetBadElementAspectRatio( " << theValue << " )";
@@ -715,7 +701,6 @@ void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue)
  */
 //=============================================================================
 CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetBadElementAspectRatio();
 }
@@ -728,7 +713,6 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimizeMesh");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetOptimizeMesh(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -743,7 +727,6 @@ void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimizeMesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetOptimizeMesh();
 }
@@ -756,7 +739,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadraticMesh");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetQuadraticMesh(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -771,7 +753,6 @@ void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadraticMesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetQuadraticMesh();
 }
@@ -788,7 +769,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
 
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
   SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
@@ -802,7 +782,6 @@ void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
  */
 //=============================================================================
 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTopology();
 }
@@ -869,6 +848,21 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetJacobianRectification()
 }
 //=============================================================================
 
+void BLSURFPlugin_Hypothesis_i::SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher )
+{
+  if ( GetUseDeprecatedPatchMesher() != useDeprecatedPatchMesher )
+  {
+    this->GetImpl()->SetUseDeprecatedPatchMesher(useDeprecatedPatchMesher);
+    SMESH::TPythonDump() << _this() << ".SetUseDeprecatedPatchMesher( " << useDeprecatedPatchMesher << " )";
+  }
+}
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseDeprecatedPatchMesher()
+{
+  return this->GetImpl()->GetUseDeprecatedPatchMesher();
+}
+//=============================================================================
+
 void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception)
 {
   if ( GetMaxNumberOfPointsPerPatch() != nb )
@@ -891,6 +885,28 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetMaxNumberOfPointsPerPatch()
 }
 //=============================================================================
 
+void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception)
+{
+  if ( GetMaxNumberOfThreads() != nb )
+  {
+    try {
+      this->GetImpl()->SetMaxNumberOfThreads(nb);
+
+    } catch (const std::invalid_argument& ex) {
+      THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+    } catch (SALOME_Exception& ex) {
+      THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+    }
+    SMESH::TPythonDump() << _this() << ".SetMaxNumberOfThreads( " << nb << " )";
+  }
+}
+//=============================================================================
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetMaxNumberOfThreads()
+{
+  return this->GetImpl()->GetMaxNumberOfThreads();
+}
+//=============================================================================
+
 void BLSURFPlugin_Hypothesis_i::SetRespectGeometry( CORBA::Boolean toRespect )
 {
   if ( GetRespectGeometry() != toRespect )
@@ -1059,6 +1075,51 @@ char* BLSURFPlugin_Hypothesis_i::GetTags()
   return CORBA::string_dup( this->GetImpl()->GetTags().c_str() );
 }
 
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl)
+{
+  ::BLSURFPlugin_Hypothesis::THyperPatchList patchList( hpl.length() );
+  SMESH_Comment hplDump;
+  hplDump << "[";
+  for ( size_t i = 0; i < patchList.size(); ++i )
+  {
+    hplDump << "[ ";
+    BLSURFPlugin::THyperPatch tags = hpl[ i ];
+    for ( CORBA::ULong j = 0; j < tags.length(); ++j )
+    {
+      patchList[ i ].insert( tags[ j ]);
+      hplDump << tags[ j ] << ( j+1 < tags.length() ? ", " : " ]" );
+    }
+    hplDump << ( i+1 < patchList.size() ? "," : "]");
+  }
+  if ( GetImpl()->GetHyperPatches() != patchList )
+  {
+    GetImpl()->SetHyperPatches( patchList );
+    SMESH::TPythonDump() << _this() << ".SetHyperPatches( " << hplDump << " )";
+  }
+}
+
+//=============================================================================
+BLSURFPlugin::THyperPatchList* BLSURFPlugin_Hypothesis_i::GetHyperPatches()
+{
+  const ::BLSURFPlugin_Hypothesis::THyperPatchList& hpl = GetImpl()->GetHyperPatches();
+  BLSURFPlugin::THyperPatchList* resHpl = new BLSURFPlugin::THyperPatchList();
+  resHpl->length( hpl.size() );
+
+  ::BLSURFPlugin_Hypothesis::THyperPatchList::const_iterator hpIt = hpl.begin();
+  for ( int i = 0; hpIt != hpl.end(); ++hpIt, ++i )
+  {
+    const ::BLSURFPlugin_Hypothesis::THyperPatchTags& hp = *hpIt;
+    BLSURFPlugin::THyperPatch& resHp = (*resHpl)[ i ];
+    resHp.length( hp.size() );
+
+    ::BLSURFPlugin_Hypothesis::THyperPatchTags::const_iterator tag = hp.begin();
+    for ( int j = 0; tag != hp.end(); ++tag, ++j )
+      resHp[ j ] = *tag;
+  }
+  return resHpl;
+}
+
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
@@ -1067,7 +1128,6 @@ char* BLSURFPlugin_Hypothesis_i::GetTags()
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADMergeEdges(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1082,39 +1142,10 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADMergeEdges();
 }
 
-//=============================================================================
-/*!
- *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges
- *
- *  Set true or false
- */
-//=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges");
-  ASSERT(myBaseImpl);
-  this->GetImpl()->SetPreCADRemoveTinyUVEdges(theValue);
-  std::string theValueStr = theValue ? "True" : "False";
-  SMESH::TPythonDump() << _this() << ".SetPreCADRemoveTinyUVEdges( " << theValueStr.c_str() << " )";
-}
-
-//=============================================================================
-/*!
- *  BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges
- *
- *  Get true or false
- */
-//=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges");
-  ASSERT(myBaseImpl);
-  return this->GetImpl()->GetPreCADRemoveTinyUVEdges();
-}
-
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces
@@ -1123,7 +1154,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADRemoveDuplicateCADFaces(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1138,7 +1168,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADRemoveDuplicateCADFaces();
 }
@@ -1151,7 +1180,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADProcess3DTopology(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1166,7 +1194,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theVal
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADProcess3DTopology();
 }
@@ -1179,7 +1206,6 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
  */
 //=============================================================================
 void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPreCADDiscardInput(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -1194,7 +1220,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
  */
 //=============================================================================
 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPreCADDiscardInput();
 }
@@ -1221,9 +1246,15 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const cha
     else if ( name == "max_number_of_points_per_patch" )
       SetMaxNumberOfPointsPerPatch( GetImpl()->ToInt( optionValue ));
 
+    else if ( name == "max_number_of_threads" )
+      SetMaxNumberOfThreads( GetImpl()->ToInt( optionValue ));
+
     else if ( name == "rectify_jacobian" )
       SetJacobianRectification( GetImpl()->ToBool( optionValue ));
 
+    else if ( name == "use_deprecated_patch_mesher" )
+      SetUseDeprecatedPatchMesher( GetImpl()->ToBool( optionValue ));
+
     else if ( name == "respect_geometry" )
       SetRespectGeometry( GetImpl()->ToBool( optionValue ));
 
@@ -1352,9 +1383,6 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, con
     else if ( name == "tiny_edge_optimisation_length" )
       SetTinyEdgeOptimisationLength( GetImpl()->ToDbl( optionValue ));
 
-    else if ( name == "remove_tiny_uv_edges" )
-      SetPreCADRemoveTinyUVEdges( GetImpl()->ToBool( optionValue ));
-
     else if ( name == "process_3d_topology" )
       SetPreCADProcess3DTopology( GetImpl()->ToBool( optionValue ));
 
@@ -1507,7 +1535,7 @@ BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAdvancedOptionValues()
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
   for (CORBA::ULong i = 0; i < options.length(); ++i) {
     string name_value_type = options[i].in();
@@ -1535,7 +1563,7 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
   for ( CORBA::ULong i = 0; i < options.length(); ++i) {
     string name_value_type = options[i].in();
@@ -1663,9 +1691,8 @@ char* BLSURFPlugin_Hypothesis_i::GetPreCADOption(const char* optionName)
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
   if ( !entry || !entry[0] )
     THROW_SALOME_CORBA_EXCEPTION( "SetSizeMapEntry(): empty geom entry", SALOME::BAD_PARAM );
   bool valueChanged = false;
@@ -1683,7 +1710,6 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* s
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
   if (valueChanged)
     SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
 }
@@ -1693,7 +1719,6 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* s
 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap)
   throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
   bool valueChanged = false;
   std::ostringstream sizeMapFunction;
   switch (shapeType) {
@@ -1716,17 +1741,15 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM:
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
   if (valueChanged)
-    SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
+    SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", " << sizeMap << " )";
 }
 
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
   bool valueChanged = false;
   try {
     valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
@@ -1746,18 +1769,16 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char*
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
   if (valueChanged)
     SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
 }
 
 //=============================================================================
 
-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);
-  MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
   //bool valueChanged = false;
   try {
     this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
@@ -1772,7 +1793,6 @@ void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
   //if ( valueChanged )
   SMESH::TPythonDump() << _this() << ".SetAttractorGeom( "
                        << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
@@ -1818,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)
@@ -1908,7 +1928,6 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
     double startSize, endSize, infDist, constDist;
     if ( !atIt->second->Empty() ) {
       attEntry = atIt->second->GetAttractorEntry();
-      MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
       std::vector<double> params = atIt->second->GetParameters();
       startSize = params[0];
       endSize = params[1];
@@ -1921,8 +1940,6 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
     result[i].endSize = endSize;
     result[i].infDist = infDist;
     result[i].constDist = constDist;
-    MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
-    MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
   }
   return result._retn();
 }
@@ -1930,7 +1947,7 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
   for ( CORBA::ULong i = 0; i < sizeMaps.length(); ++i) {
     string entry_sizemap = sizeMaps[i].in();
@@ -1962,8 +1979,6 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj,
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
   SetSizeMapEntry(entry.c_str(), sizeMap);
 }
 
@@ -1975,8 +1990,6 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMap(const GEOM::GEOM_Object_ptr G
   GEOM::shape_type shapeType = GeomObj->GetShapeType();
   if (shapeType == GEOM::COMPOUND)
     shapeType = GeomObj->GetMaxShapeType();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
   SetConstantSizeMapEntry(entry.c_str(), shapeType, sizeMap);
 }
 
@@ -1985,8 +1998,6 @@ void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
   UnsetEntry(entry.c_str());
   SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
 }
@@ -1995,8 +2006,6 @@ void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, cons
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
   SetAttractorEntry(entry.c_str(), attractor);
 }
 
@@ -2004,8 +2013,6 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
   ASSERT(myBaseImpl);
   string entry;
   entry = GeomObj->GetStudyEntry();
-  MESSAGE("IDL : GetName : " << GeomObj->GetName());
-  MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
   UnsetEntry(entry.c_str());
   SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
 }
@@ -2019,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();
   }
@@ -2042,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();
   }
@@ -2051,8 +2057,6 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace,
   
   TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
   TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
   SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
 }
 
@@ -2064,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();
   // }
@@ -2078,8 +2081,6 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace
        !theAttrEntry.in() || !theAttrEntry.in()[0] )
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
   GetImpl()->ClearEntry( theFaceEntry.in(), theAttrEntry.in() );
   SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( "
                        << theFace << ", " << theAttractor << " )";
@@ -2095,30 +2096,30 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry,
 
 
 /*
- void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
- {}
 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
 {}
 
- void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
- {}
 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
 {}
 
- void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
- {}
 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
 {}
 
- char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
- {}
 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
 {}
 
- void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
- {
- ASSERT(myBaseImpl);
- this->GetImpl()->UnsetCustomSizeMap(entry);
- SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
- }
 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
 {
 ASSERT(myBaseImpl);
 this->GetImpl()->UnsetCustomSizeMap(entry);
 SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
 }
 
 
- BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
- {}
 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
 {}
 
- */
+*/
 
 // ///////////////////////
 // // ENFORCED VERTICES //
@@ -2131,28 +2132,24 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry,
  *
  */
 BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
-  MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
 
   const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
-      this->GetImpl()->_GetAllEnforcedVerticesByFace();
+    this->GetImpl()->_GetAllEnforcedVerticesByFace();
   resultMap->length(faceEntryEnfVertexListMap.size());
-  MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
   ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
   for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
     BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
-        new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
+      new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
-    MESSAGE("Face Entry: " << mapElement->faceEntry);
 
     _enfVertexList = it_entry->second;
     BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
     enfVertexList->length(_enfVertexList.size());
-    MESSAGE("Number of enf vertex: " << enfVertexList->length());
 
     ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
     ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
@@ -2189,10 +2186,9 @@ BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfor
       msg << "Enforced vertex: \n"
           << "Name: " << enfVertex->name << "\n";
       if (coords->length())
-          msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
       msg << "Geom entry: " << enfVertex->geomEntry << "\n"
           << "Group Name: " << enfVertex->grpName;
-      MESSAGE(msg.str());
 
       enfVertexList[j] = enfVertex;
     }
@@ -2210,17 +2206,14 @@ BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfor
  *
  */
 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
-  MESSAGE("IDL: GetAllEnforcedVertices()");
   ASSERT(myBaseImpl);
   BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
   const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
   resultMap->length(enfVertexList.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
   for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
-    MESSAGE("Enforced Vertex #" << i);
     currentEnfVertex = (*evlIt);
     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
     // Name
@@ -2247,10 +2240,9 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices(
     msg << "Enforced vertex: \n"
         << "Name: " << enfVertex->name << "\n";
     if (coords->length())
-        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
         << "Group Name: " << enfVertex->grpName;
-    MESSAGE(msg.str());
 
     resultMap[i] = enfVertex;
   }
@@ -2265,26 +2257,22 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices(
  *
  */
 BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
-  MESSAGE("IDL: GetAllCoordsByFace()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
 
   const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
   resultMap->length(entryCoordsListMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
   ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
   for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
     BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
-    MESSAGE("Face Entry: " << mapElement->faceEntry);
 
     _coordsList = it_entry->second;
     BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
     coordsList->length(_coordsList.size());
-    MESSAGE("Number of coords: " << coordsList->length());
 
     ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
     for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
@@ -2293,7 +2281,6 @@ BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsBy
       for (CORBA::ULong i=0;i<coords->length();i++)
         coords[i] = (*it_coords)[i];
       coordsList[j] = coords;
-      MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
     }
     mapElement->coordsList = coordsList;
 
@@ -2308,19 +2295,16 @@ BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsBy
  * They are the coords of the "manual" enforced vertices.
  */
 BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
-  MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
   const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
-      this->GetImpl()->_GetAllEnforcedVerticesByCoords();
+    this->GetImpl()->_GetAllEnforcedVerticesByCoords();
   resultMap->length(coordsEnfVertexMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
   for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
-    MESSAGE("Enforced Vertex #" << i);
     currentEnfVertex = (it_coords->second);
     BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
     BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
@@ -2328,7 +2312,6 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert
     for (CORBA::ULong ind=0;ind<coords->length();ind++)
       coords[ind] = it_coords->first[ind];
     mapElement->coords = coords;
-    MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
 
     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
     // Name
@@ -2356,10 +2339,9 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert
     msg << "Enforced vertex: \n"
         << "Name: " << enfVertex->name << "\n";
     if (coords->length())
-        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
         << "Group Name: " << enfVertex->grpName;
-    MESSAGE(msg.str());
 
     resultMap[i] = mapElement;
   }
@@ -2373,34 +2355,29 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert
  *
  */
 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
-  MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
 
   const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
-      this->GetImpl()->_GetAllEnfVertexEntriesByFace();
+    this->GetImpl()->_GetAllEnfVertexEntriesByFace();
   resultMap->length(entryEnfVertexEntryListMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
   ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
       entryEnfVertexEntryListMap.begin();
   for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
     BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
-        new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
+      new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
     mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
-    MESSAGE("Face Entry: " << mapElement->faceEntry);
 
     _enfVertexEntryList = it_entry->second;
     BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
     enfVertexEntryList->length(_enfVertexEntryList.size());
-    MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
 
     ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
     for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
       enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
-      MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
     }
     mapElement->enfVertexEntryList = enfVertexEntryList;
 
@@ -2415,23 +2392,19 @@ BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAll
  * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
  */
 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
-  MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
   ASSERT(myBaseImpl);
 
   BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
   const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
-      this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
+    this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
   resultMap->length(enfVertexEntryEnfVertexMap.size());
-  MESSAGE("Enforced Vertex map size is " << resultMap->length());
 
   ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
   ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
   for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
-    MESSAGE("Enforced Vertex #" << i);
     currentEnfVertex = it_enfVertexEntry->second;
     BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
     mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
-    MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
 
     BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
     // Name
@@ -2458,10 +2431,9 @@ BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnfo
     msg << "Enforced vertex: \n"
         << "Name: " << enfVertex->name << "\n";
     if (coords->length())
-        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
     msg << "Geom entry: " << enfVertex->geomEntry << "\n"
         << "Group Name: " << enfVertex->grpName;
-    MESSAGE(msg.str());
 
     mapElement->enfVertex = enfVertex;
     resultMap[i] = mapElement;
@@ -2479,14 +2451,13 @@ void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
 }
 
 /*!
- * Set/get/unset an enforced vertex on face
+ * Set/get/unset an enforced vertex on face - OBSOLETE
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z) throw (SALOME::SALOME_Exception) {
+                                                  CORBA::Double z) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2494,21 +2465,18 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
   } catch (SALOME_Exception& ex) {
@@ -2520,11 +2488,10 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace,
  * Set/get/unset an enforced vertex with name on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
+                                                       CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2532,22 +2499,19 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
   } catch (SALOME_Exception& ex) {
@@ -2559,21 +2523,19 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr the
  * Set/get/unset an enforced vertex with geom object on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
   }
 
   //  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 +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()) {
@@ -2594,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();
   }
@@ -2607,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();
   }
@@ -2615,9 +2576,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
   string theVertexName = theVertex->GetName();
-  MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
-  MESSAGE("IDL : theVertex->GetName : " << theVertexName);
-  MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
   } catch (SALOME_Exception& ex) {
@@ -2629,12 +2587,11 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF
  * Set an enforced vertex with group name on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
- throw (SALOME::SALOME_Exception)
 throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2642,21 +2599,18 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
   } catch (SALOME_Exception& ex) {
@@ -2669,12 +2623,11 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, 
                                                                 const char* theVertexName, const char* theGroupName)
- throw (SALOME::SALOME_Exception)
 throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2682,21 +2635,18 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
   } catch (SALOME_Exception& ex) {
@@ -2708,17 +2658,15 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Objec
  * Set an enforced vertex with geom entry and group name on face
  */
 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
- throw (SALOME::SALOME_Exception)
 throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2726,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()) {
@@ -2735,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();
   }
@@ -2748,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();
   }
@@ -2756,9 +2703,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
   string theVertexName = theVertex->GetName();
-  MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
-  MESSAGE("IDL : theVertex->GetName : " << theVertexName);
-  MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
   try {
     return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
   } catch (SALOME_Exception& ex) {
@@ -2775,7 +2719,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
 //  ASSERT(myBaseImpl);
 
 //  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-//    MESSAGE("theFace shape type is not FACE or COMPOUND");
 //    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
 //  }
 
@@ -2783,22 +2726,19 @@ 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();
 //  }
 //  if (theFaceEntry.empty())
 //    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
-//  MESSAGE("IDL : GetName : " << theFace->GetName());
-//  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
 //  try {
 //    return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
 //  } catch (SALOME_Exception& ex) {
@@ -2810,11 +2750,10 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object
  * Get the list of all enforced vertices
  */
 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2822,22 +2761,19 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
   try {
     return GetEnforcedVerticesEntry(theFaceEntry.c_str());
   } catch (SALOME_Exception& ex) {
@@ -2846,11 +2782,10 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO
 }
 
 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z) throw (SALOME::SALOME_Exception) {
+                                                    CORBA::Double z) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2858,21 +2793,18 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
 
   try {
     return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
@@ -2882,20 +2814,18 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFac
 }
 
 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
-    throw (SALOME::SALOME_Exception) {
+  throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
   if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
   }
 
   //  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 +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()) {
@@ -2916,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();
   }
@@ -2929,14 +2858,13 @@ 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();
   }
   if (theVertexEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
 
   try {
     return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
@@ -2949,7 +2877,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF
   ASSERT(myBaseImpl);
 
   if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
     THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
   }
 
@@ -2957,22 +2884,19 @@ 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();
   }
   if (theFaceEntry.empty())
     THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
   
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
 
   try {
     return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
@@ -2982,124 +2906,273 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF
 }
 
 /*!
- * Set/get/unset an enforced vertex on geom object given by entry
+ * Set/get/unset an enforced vertex on face - NEW (no face)
  */
-bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
-    throw (SALOME::SALOME_Exception) {
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception)
+{
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
-  bool newValue = false;
-  if (string(theVertexEntry).empty()) {
-    try {
-      ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
-        this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
-      ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
-      coords.push_back(x);
-      coords.push_back(y);
-      coords.push_back(z);
-      if (coordsList.find(coords) == coordsList.end()) {
-        MESSAGE("Coords not found: add it in coordsList");
-        newValue = true;
-      } else {
-        MESSAGE("Coords already found, compare names");
-        ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
-        if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
-          MESSAGE("The names are different: update");
-          //          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
-          newValue = true;
-        }
-        else {
-          MESSAGE("The names are identical");
-        }
-      }
-    } catch (const std::invalid_argument& ex) {
-      // no enforced vertex for entry
-      MESSAGE("Face entry not found : add it to the list");
-      newValue = true;
-    }
-    if (newValue) {
-      if (string(theVertexName).empty()) {
-        if (string(theGroupName).empty())
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
-        else
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
-      }
-      else {
-        if (string(theGroupName).empty())
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
-        else
-          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \""
-                               << theVertexName << "\", \"" << theGroupName << "\")";
-      }
-    }
-  } else {
-    try {
-      ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
-      ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
-      if ( it == enfVertexEntryList.end()) {
-        MESSAGE("Geom entry not found: add it in enfVertexEntryList");
-        newValue = true;
-      }
-      else {
-        MESSAGE("Geom entry already found, compare names");
-        ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
-        if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
-          MESSAGE("The names are different: update");
-//          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
-          newValue = true;
-        }
-        else {
-          MESSAGE("The names are identical");
-        }
-      }
-    } catch (const std::invalid_argument& ex) {
-      // no enforced vertex for entry
-      MESSAGE("Face entry not found : add it to the list");
-      newValue = true;
-    }
-    if (newValue) {
-      if (string(theGroupName).empty())
-        SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
-      else
-        SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
-    }
-  }
-
-  if (newValue)
-    this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
 
-  MESSAGE("IDL : SetEnforcedVertexEntry END");
-  return newValue;
+  try {
+    return SetEnforcedVertexEntry("", x, y, z);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
 }
 
-//Enable internal enforced vertices on specific face if requested by user
-//CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
-//    throw (SALOME::SALOME_Exception) {
-//  ASSERT(myBaseImpl);
-//  try {
-//    return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
-//  } catch (const std::exception& ex) {
-//    std::cout << "Exception: " << ex.what() << std::endl;
-//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-//  }
-//}
-  
-BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
-    throw (SALOME::SALOME_Exception) {
-  ASSERT(myBaseImpl);
-  MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
-
+/*!
+ * Set/get/unset an enforced vertex with name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception)
+{
   try {
-    BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
-    ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
-    vertexList->length(_vList.size());
-    MESSAGE("Number of enforced vertices: " << vertexList->length());
-    ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
-    for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
-      ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
+    return SetEnforcedVertexEntry("", x, y, z, theVertexName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
 
-      BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
+/*!
+ * Set/get/unset an enforced vertex with geom object on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
+  throw (SALOME::SALOME_Exception)
+{
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+  string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  string aName;
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy( NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  string theVertexName = theVertex->GetName();
+  try {
+    return SetEnforcedVertexEntry("", 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  try {
+    return SetEnforcedVertexEntry("", x, y, z, "", "", theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with name and group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, 
+                                                                const char* theVertexName, const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  try {
+    return SetEnforcedVertexEntry("", x, y, z, theVertexName, "", theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with geom entry and group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  string aName;
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy( NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  string theVertexName = theVertex->GetName();
+  try {
+    return SetEnforcedVertexEntry("", 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception)
+{
+  try {
+    return UnsetEnforcedVertexEntry("", x, y, z);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
+  throw (SALOME::SALOME_Exception)
+{
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+  std::string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  string aName;
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy( NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  try {
+    return UnsetEnforcedVertexEntry("", 0, 0, 0, theVertexEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertices() throw (SALOME::SALOME_Exception)
+{
+  try {
+    return UnsetEnforcedVerticesEntry("");
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex on geom object given by entry
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry,
+                                                       CORBA::Double x,
+                                                       CORBA::Double y,
+                                                       CORBA::Double z,
+                                                       const char* theVertexName,
+                                                       const char* theVertexEntry,
+                                                       const char* theGroupName)
+  throw (SALOME::SALOME_Exception)
+{
+  bool newValue = false;
+  if (string(theVertexEntry).empty()) {
+    try {
+      ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
+        this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
+      ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
+      coords.push_back(x);
+      coords.push_back(y);
+      coords.push_back(z);
+      if (coordsList.find(coords) == coordsList.end()) {
+        newValue = true;
+      } else {
+        ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
+        if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
+          newValue = true;
+        }
+      }
+    } catch (const std::invalid_argument& ex) {
+      // no enforced vertex for entry
+      newValue = true;
+    }
+    if (newValue) {
+      if (string(theVertexName).empty()) {
+        if (string(theGroupName).empty())
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertex(" << x << ", " << y << ", " << z << ")";
+        else
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
+      }
+      else {
+        if (string(theGroupName).empty())
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexNamed(" << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
+        else
+          SMESH::TPythonDump() << _this() << ".AddEnforcedVertexNamedWithGroup(" << x << ", " << y << ", " << z << ", \""
+                               << theVertexName << "\", \"" << theGroupName << "\")";
+      }
+    }
+  } else {
+    try {
+      ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
+      ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
+      if ( it == enfVertexEntryList.end()) {
+        newValue = true;
+      }
+      else {
+        ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
+        if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
+          newValue = true;
+        }
+      }
+    } catch (const std::invalid_argument& ex) {
+      // no enforced vertex for entry
+      newValue = true;
+    }
+    if (newValue) {
+      if (string(theGroupName).empty())
+        SMESH::TPythonDump() << _this() << ".AddEnforcedVertexGeom(" << theVertexEntry << ")";
+      else
+        SMESH::TPythonDump() << _this() << ".AddEnforcedVertexGeomWithGroup(" << theVertexEntry << ", \"" << theGroupName << "\")";
+    }
+  }
+
+  if (newValue)
+    this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
+
+  return newValue;
+}
+
+BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
+  throw (SALOME::SALOME_Exception)
+{
+  try {
+    BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
+    ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
+    vertexList->length(_vList.size());
+    ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
+    for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
+      ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
+
+      BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
 
       // Name
       enfVertex->name = CORBA::string_dup(_enfVertex->name.c_str());
@@ -3123,7 +3196,6 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntr
 
       vertexList[i] = enfVertex;
     }
-    MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
     return vertexList._retn();
   } catch (const std::invalid_argument& ex) {
     SALOME::ExceptionStruct ExDescription;
@@ -3138,20 +3210,19 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntr
   }
 }
 
-bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
-    CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception)
+{
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
 
   bool res = false;
   try {
     res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
 
     if (string(theVertexEntry).empty())
-      SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
-          << ")";
+      SMESH::TPythonDump() << "isDone = " << _this() << ".RemoveEnforcedVertex(" << x << ", " << y << ", " << z
+                           << ")";
     else
-      SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
+      SMESH::TPythonDump() << "isDone = " << _this() << ".RemoveEnforcedVertexGeom(" << theVertexEntry << ")";
 
   } catch (const std::invalid_argument& ex) {
     return false;
@@ -3160,44 +3231,21 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntr
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
 
-  MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
   return res;
 }
-
-//bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
-//    CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
-//  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
-//
-//  bool ret = false;
-//
-//  try {
-//    ret = _unsetEnfVertex(theFaceEntry, x, y, z);
-//  } catch (SALOME_Exception& ex) {
-//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-//  }
-//
-//  if (ret)
-//    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
-//        << ")";
-//
-//  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
-//  return ret;
-//}
-
-bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception)
+{
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
 
   try {
     this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
-    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
+    SMESH::TPythonDump() << _this() << ".RemoveEnforcedVertices()";
   } catch (const std::invalid_argument& ex) {
     return false;
   } catch (const std::exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
 
-  MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
   return true;
 }
 
@@ -3208,8 +3256,8 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEn
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
   std::string theValueStr = theValue ? "True" : "False";
@@ -3223,8 +3271,8 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces()
+{
   ASSERT(myBaseImpl);
   return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
 }
@@ -3236,8 +3284,8 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
  *  Set group name
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char*  groupName) {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char*  groupName)
+{
   ASSERT(myBaseImpl);
   this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
   SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
@@ -3250,8 +3298,8 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const cha
  *  Get group name
  */
 //=============================================================================
-char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
+char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup()
+{
   ASSERT(myBaseImpl);
   return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
 }
@@ -3259,125 +3307,115 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
 /*
  * Enable internal enforced vertices on specific face if requested by user
  *
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
+ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
  throw (SALOME::SALOME_Exception)
-{
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
-  try {
-    SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
-  } catch (SALOME_Exception& ex) {
-    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-  }
-}
+ {
+ try {
+ SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
+ } catch (SALOME_Exception& ex) {
+ THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+ }
+ }
 
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
+ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
  throw (SALOME::SALOME_Exception)
-{
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
-
-  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
-    MESSAGE("theFace shape type is not FACE or COMPOUND");
-    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
-  }
-
-  string theFaceEntry = theFace->GetStudyEntry();
-
-  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());
-    if (!theSFace->_is_nil())
-      theFaceEntry = theSFace->GetID();
-  }
-  if (theFaceEntry.empty())
-    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
-
-  MESSAGE("IDL : GetName : " << theFace->GetName());
-  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
-  try {
-    SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
-  } catch (SALOME_Exception& ex) {
-    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-  }
-}
+ {
 
-void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
-    throw (SALOME::SALOME_Exception)
-{
-  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
-  ASSERT(myBaseImpl);
-  try {
-    this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
-    std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
-    if (string(theGroupName).empty())
-      SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
-    else
-      SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
-  } catch (const std::exception& ex) {
-    std::cout << "Exception: " << ex.what() << std::endl;
-    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
-  }
-}
+ if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+ THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+ }
 
-*/
+ string theFaceEntry = theFace->GetStudyEntry();
+
+ 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(NULL, theFace, aName.c_str());
+ if (!theSFace->_is_nil())
+ theFaceEntry = theSFace->GetID();
+ }
+ if (theFaceEntry.empty())
+ THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
 
-/* TODO GROUPS
- char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
- throw (SALOME::SALOME_Exception)
- {
- ASSERT(myBaseImpl);
- MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
  try {
- return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
- }
- catch (const std::invalid_argument& ex) {
- SALOME::ExceptionStruct ExDescription;
- ExDescription.text = ex.what();
- ExDescription.type = SALOME::BAD_PARAM;
- ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
- ExDescription.lineNumber = 1146;
- throw SALOME::SALOME_Exception(ExDescription);
- }
- catch (SALOME_Exception& ex) {
+ SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
+ } catch (SALOME_Exception& ex) {
  THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
  }
- MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
- return 0;
  }
 
-
- void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
+ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
  throw (SALOME::SALOME_Exception)
  {
  ASSERT(myBaseImpl);
- MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
  try {
- this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
- }
- catch (const std::invalid_argument& ex) {
- SALOME::ExceptionStruct ExDescription;
- ExDescription.text = ex.what();
- ExDescription.type = SALOME::BAD_PARAM;
- ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
- ExDescription.lineNumber = 1170;
- throw SALOME::SALOME_Exception(ExDescription);
- }
- catch (SALOME_Exception& ex) {
+ this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
+ std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
+ if (string(theGroupName).empty())
+ SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
+ else
+ SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
+ } catch (const std::exception& ex) {
+ std::cout << "Exception: " << ex.what() << std::endl;
  THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
  }
+ }
 
- SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
- << x << ", " << y << ", " << z << ", '" << groupName << "' )";
+*/
 
- MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
- }
- */
+/* TODO GROUPS
+   char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
+   throw (SALOME::SALOME_Exception)
+   {
+   ASSERT(myBaseImpl);
+   try {
+   return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
+   }
+   catch (const std::invalid_argument& ex) {
+   SALOME::ExceptionStruct ExDescription;
+   ExDescription.text = ex.what();
+   ExDescription.type = SALOME::BAD_PARAM;
+   ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
+   ExDescription.lineNumber = 1146;
+   throw SALOME::SALOME_Exception(ExDescription);
+   }
+   catch (SALOME_Exception& ex) {
+   THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+   }
+   return 0;
+   }
+
+
+   void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
+   throw (SALOME::SALOME_Exception)
+   {
+   ASSERT(myBaseImpl);
+   try {
+   this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
+   }
+   catch (const std::invalid_argument& ex) {
+   SALOME::ExceptionStruct ExDescription;
+   ExDescription.text = ex.what();
+   ExDescription.type = SALOME::BAD_PARAM;
+   ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
+   ExDescription.lineNumber = 1170;
+   throw SALOME::SALOME_Exception(ExDescription);
+   }
+   catch (SALOME_Exception& ex) {
+   THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+   }
+
+   SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
+   << x << ", " << y << ", " << z << ", '" << groupName << "' )";
+
+   }
+*/
 ///////////////////////
 
 ///////////////////////
@@ -3387,7 +3425,6 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFa
 
 std::string BLSURFPlugin_Hypothesis_i::ShapeTypeToString(GEOM::shape_type theShapeType)
 {
-//enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE /*, __max_shape_type=0xffffffff */ };
   std::map<GEOM::shape_type, std::string> MapShapeTypeToString;
   MapShapeTypeToString[GEOM::COMPOUND] = std::string("COMPOUND");
   MapShapeTypeToString[GEOM::COMPSOLID] = std::string("COMPSOLID");
@@ -3408,18 +3445,17 @@ void BLSURFPlugin_Hypothesis_i::CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std
   bool ok = false;
   std::stringstream typesTxt;
   for (std::size_t i=0; i<theShapeTypes.size(); i++)
-    {
-      GEOM::shape_type theShapeType = theShapeTypes[i];
-      if (shape->GetShapeType() == theShapeType)
-        ok = true;
-      typesTxt << ShapeTypeToString(theShapeType);
-      if (i < theShapeTypes.size()-1 )
-        typesTxt << ", ";
-    }
+  {
+    GEOM::shape_type theShapeType = theShapeTypes[i];
+    if (shape->GetShapeType() == theShapeType)
+      ok = true;
+    typesTxt << ShapeTypeToString(theShapeType);
+    if (i < theShapeTypes.size()-1 )
+      typesTxt << ", ";
+  }
   if (!ok){
     std::stringstream msg;
-    msg << "shape shape type is not in" << typesTxt.str();
-    MESSAGE(msg.str());
+    msg << "shape type is not in" << typesTxt.str();
     THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
   }
 }
@@ -3430,7 +3466,6 @@ void BLSURFPlugin_Hypothesis_i::CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM
   if (shape->GetShapeType() != theShapeType) {
     std::stringstream msg;
     msg << "shape shape type is not " << ShapeTypeToString(theShapeType);
-    MESSAGE(msg.str());
     THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
   }
 }
@@ -3441,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
@@ -3449,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();
   }
@@ -3464,26 +3498,26 @@ std::string BLSURFPlugin_Hypothesis_i::FormatVerticesEntries(vector<string> &the
   std::stringstream listEntriesTxt;
 
   if (!theSourceVerticesEntries.empty())
+  {
+    listEntriesTxt << ", [" ;
+    size_t i =0;
+    for (std::vector<std::string>::const_iterator it = theSourceVerticesEntries.begin(); it != theSourceVerticesEntries.end(); it++, i++)
     {
-      listEntriesTxt << ", [" ;
-      size_t i =0;
-      for (std::vector<std::string>::const_iterator it = theSourceVerticesEntries.begin(); it != theSourceVerticesEntries.end(); it++, i++)
-        {
-          if (i>0)
-            listEntriesTxt << ", ";
-          listEntriesTxt << *it;
-        }
+      if (i>0)
+        listEntriesTxt << ", ";
+      listEntriesTxt << *it;
+    }
 
-      listEntriesTxt << "], [" ;
-      i =0;
-      for (std::vector<std::string>::const_iterator it = theTargetVerticesEntries.begin(); it != theTargetVerticesEntries.end(); it++, i++)
-        {
-          if (i>0)
-            listEntriesTxt << ", ";
-          listEntriesTxt << *it;
-        }
-      listEntriesTxt << "]" ;
+    listEntriesTxt << "], [" ;
+    i =0;
+    for (std::vector<std::string>::const_iterator it = theTargetVerticesEntries.begin(); it != theTargetVerticesEntries.end(); it++, i++)
+    {
+      if (i>0)
+        listEntriesTxt << ", ";
+      listEntriesTxt << *it;
     }
+    listEntriesTxt << "]" ;
+  }
   return listEntriesTxt.str();
 }
 
@@ -3498,66 +3532,61 @@ void BLSURFPlugin_Hypothesis_i::ClearPreCadPeriodicityVectors() {
 
 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector()
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector");
   const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
-      this->GetImpl()->_GetPreCadFacesPeriodicityVector();
+    this->GetImpl()->_GetPreCadFacesPeriodicityVector();
 
   BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
 
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector end");
   return periodicityList._retn();
 }
 
 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector()
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector");
   const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
-      this->GetImpl()->_GetPreCadEdgesPeriodicityVector();
+    this->GetImpl()->_GetPreCadEdgesPeriodicityVector();
 
   BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
 
-  MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector end");
   return periodicityList._retn();
 }
 
 // convert a vector preCadPeriodicityVector into TPeriodicityList Corba sequence
 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector)
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence");
   BLSURFPlugin::TPeriodicityList_var periodicityList = new BLSURFPlugin::TPeriodicityList();
 
-    periodicityList->length(preCadPeriodicityVector.size());
+  periodicityList->length(preCadPeriodicityVector.size());
 
-    for (size_t i = 0; i<preCadPeriodicityVector.size(); i++)
-      {
-        ::BLSURFPlugin_Hypothesis::TPreCadPeriodicity preCadPeriodicityVector_i = preCadPeriodicityVector[i];
+  for (size_t i = 0; i<preCadPeriodicityVector.size(); i++)
+  {
+    ::BLSURFPlugin_Hypothesis::TPreCadPeriodicity preCadPeriodicityVector_i = preCadPeriodicityVector[i];
 
-        BLSURFPlugin::TPreCadPeriodicity_var myPreCadPeriodicity = new BLSURFPlugin::TPreCadPeriodicity();
-        myPreCadPeriodicity->shape1Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape1Entry.c_str());
-        myPreCadPeriodicity->shape2Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape2Entry.c_str());
+    BLSURFPlugin::TPreCadPeriodicity_var myPreCadPeriodicity = new BLSURFPlugin::TPreCadPeriodicity();
+    myPreCadPeriodicity->shape1Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape1Entry.c_str());
+    myPreCadPeriodicity->shape2Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape2Entry.c_str());
 
-        BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
-        if (! preCadPeriodicityVector_i.theSourceVerticesEntries.empty())
-          {
-            sourceVertices->length(preCadPeriodicityVector_i.theSourceVerticesEntries.size());
-            for (size_t j=0; j<preCadPeriodicityVector_i.theSourceVerticesEntries.size(); j++)
-              sourceVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theSourceVerticesEntries[j].c_str());
-          }
+    BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
+    if (! preCadPeriodicityVector_i.theSourceVerticesEntries.empty())
+    {
+      sourceVertices->length(preCadPeriodicityVector_i.theSourceVerticesEntries.size());
+      for (size_t j=0; j<preCadPeriodicityVector_i.theSourceVerticesEntries.size(); j++)
+        sourceVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theSourceVerticesEntries[j].c_str());
+    }
 
-        myPreCadPeriodicity->theSourceVerticesEntries = sourceVertices;
+    myPreCadPeriodicity->theSourceVerticesEntries = sourceVertices;
 
-        BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
-        if (! preCadPeriodicityVector_i.theTargetVerticesEntries.empty())
-           {
-            targetVertices->length(preCadPeriodicityVector_i.theTargetVerticesEntries.size());
-             for (size_t j=0; j<preCadPeriodicityVector_i.theTargetVerticesEntries.size(); j++)
-               targetVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theTargetVerticesEntries[j].c_str());
-           }
+    BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
+    if (! preCadPeriodicityVector_i.theTargetVerticesEntries.empty())
+    {
+      targetVertices->length(preCadPeriodicityVector_i.theTargetVerticesEntries.size());
+      for (size_t j=0; j<preCadPeriodicityVector_i.theTargetVerticesEntries.size(); j++)
+        targetVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theTargetVerticesEntries[j].c_str());
+    }
 
-        myPreCadPeriodicity->theTargetVerticesEntries = targetVertices;
+    myPreCadPeriodicity->theTargetVerticesEntries = targetVertices;
 
-        periodicityList[i] = myPreCadPeriodicity;
-      }
+    periodicityList[i] = myPreCadPeriodicity;
+  }
 
 
   return periodicityList._retn();
@@ -3565,7 +3594,7 @@ BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequenc
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
-throw (SALOME::SALOME_Exception)
+  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
   const GEOM::ListOfGO theSourceVertices;
@@ -3575,11 +3604,10 @@ throw (SALOME::SALOME_Exception)
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
-    const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
-throw (SALOME::SALOME_Exception)
+                                                                      const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
+  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
-  MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices");
 
   size_t theLength = theSourceVertices.length();
   if (theLength != theTargetVertices.length())
@@ -3603,27 +3631,24 @@ throw (SALOME::SALOME_Exception)
   GEOM::GEOM_Object_ptr theVtx_i;
   string theEntry_i;
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theSourceVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
-      theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theSourceVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
+    theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string prefix4 = "Target_vertex_";
   BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
   theTargetVerticesEntries->length(theLength);
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theTargetVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
-      theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theTargetVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
+    theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string theFace2Name = theFace2->GetName();
-  MESSAGE("IDL : theFace1->GetName : " << theFace1->GetName());
-  MESSAGE("IDL : theFace2->GetName : " << theFace2->GetName());
-  MESSAGE("IDL : AddPreCadFacesPeriodicity( "<< theFace1Entry << ", " << theFace2Entry <<  ")");
   try {
-      AddPreCadFacesPeriodicityEntry(theFace1Entry.c_str(), theFace2Entry.c_str(),
-          theSourceVerticesEntries, theTargetVerticesEntries);
+    AddPreCadFacesPeriodicityEntry(theFace1Entry.c_str(), theFace2Entry.c_str(),
+                                   theSourceVerticesEntries, theTargetVerticesEntries);
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
@@ -3631,8 +3656,8 @@ throw (SALOME::SALOME_Exception)
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
-    const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
-    throw (SALOME::SALOME_Exception)
+                                                               const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
+  throw (SALOME::SALOME_Exception)
 {
 
   ASSERT(myBaseImpl);
@@ -3640,31 +3665,29 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFa
   // Convert BLSURFPlugin::TEntryList to vector<string>
   vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
   for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
-      theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
-      theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
+    theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
+    theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
   }
 
   string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
 
-  MESSAGE("IDL : AddPreCadFacesPeriodicityEntry(" << theFace1Entry << ", " << theFace2Entry << listEntriesTxt.c_str() << ")");
 
   this->GetImpl()->AddPreCadFacesPeriodicity(theFace1Entry, theFace2Entry,
-      theSourceVerticesEntries, theTargetVerticesEntries);
+                                             theSourceVerticesEntries, theTargetVerticesEntries);
 
   SMESH::TPythonDump pd;
   if (!theSourceVerticesEntries.empty())
-    {
-      pd << _this() << ".AddPreCadFacesPeriodicityWithVertices(" << theFace1Entry << ", " << theFace2Entry;
-      pd << listEntriesTxt.c_str();
-      pd << ")";
-    }
+  {
+    pd << _this() << ".AddPreCadFacesPeriodicityWithVertices(" << theFace1Entry << ", " << theFace2Entry;
+    pd << listEntriesTxt.c_str();
+    pd << ")";
+  }
   else
     pd << _this() << ".AddPreCadFacesPeriodicity(" << theFace1Entry << ", " << theFace2Entry << ")";
-  MESSAGE("IDL : AddPreCadFacesPeriodicityEntry END");
 }
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
-      throw (SALOME::SALOME_Exception)
+  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
   const GEOM::ListOfGO theSourceVertices;
@@ -3673,10 +3696,9 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr
 }
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
-    const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
-      throw (SALOME::SALOME_Exception)
+                                                                      const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
+  throw (SALOME::SALOME_Exception)
 {
-  MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices");
   ASSERT(myBaseImpl);
 
   size_t theLength = theSourceVertices.length();
@@ -3701,27 +3723,24 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM
   GEOM::GEOM_Object_ptr theVtx_i;
   string theEntry_i;
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theSourceVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
-      theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theSourceVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
+    theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string prefix4 = "Target_vertex_";
   BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
   theTargetVerticesEntries->length(theLength);
   for (size_t ind = 0; ind < theLength; ind++) {
-      theVtx_i = theTargetVertices[ind];
-      theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
-      theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
+    theVtx_i = theTargetVertices[ind];
+    theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
+    theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
   }
 
   string theEdge2Name = theEdge2->GetName();
-  MESSAGE("IDL : theEdge1->GetName : " << theEdge1->GetName());
-  MESSAGE("IDL : theEdge2->GetName : " << theEdge2->GetName());
-  MESSAGE("IDL : AddPreCadEdgesPeriodicity( "<< theEdge1Entry << ", " << theEdge2Entry << ")");
   try {
-      AddPreCadEdgesPeriodicityEntry(theEdge1Entry.c_str(), theEdge2Entry.c_str(),
-          theSourceVerticesEntries, theTargetVerticesEntries);
+    AddPreCadEdgesPeriodicityEntry(theEdge1Entry.c_str(), theEdge2Entry.c_str(),
+                                   theSourceVerticesEntries, theTargetVerticesEntries);
   } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
@@ -3729,8 +3748,8 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM
 
 
 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
-    const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
-    throw (SALOME::SALOME_Exception)
+                                                               const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
+  throw (SALOME::SALOME_Exception)
 {
 
   ASSERT(myBaseImpl);
@@ -3738,27 +3757,25 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEd
   // Convert BLSURFPlugin::TEntryList to vector<string>
   vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
   for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
-      theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
-      theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
+    theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
+    theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
   }
 
   string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
 
-  MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry(" << theEdge1Entry << ", " << theEdge2Entry << listEntriesTxt.c_str() << ")");
   this->GetImpl()->AddPreCadEdgesPeriodicity(theEdge1Entry, theEdge2Entry,
-      theSourceVerticesEntries, theTargetVerticesEntries);
+                                             theSourceVerticesEntries, theTargetVerticesEntries);
 
   SMESH::TPythonDump pd;
   if (!theSourceVerticesEntries.empty())
-    {
-      pd << _this() << ".AddPreCadEdgesPeriodicityWithVertices(" << theEdge1Entry << ", " << theEdge2Entry;
-      pd << listEntriesTxt.c_str();
-      pd << ")";
-    }
+  {
+    pd << _this() << ".AddPreCadEdgesPeriodicityWithVertices(" << theEdge1Entry << ", " << theEdge2Entry;
+    pd << listEntriesTxt.c_str();
+    pd << ")";
+  }
   else
     pd << _this() << ".AddPreCadEdgesPeriodicity(" << theEdge1Entry << ", " << theEdge2Entry << ")";
 
-  MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry END");
 }
 
 
@@ -3773,11 +3790,10 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEd
 // void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
 void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
   ASSERT(myBaseImpl);
-  MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
   bool valueChanged/*, modeChanged*/ = false;
   try {
     valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
-//     modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
+    //     modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
     if (valueChanged)// or (!valueChanged && modeChanged))
       this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
   } catch (const std::exception& ex) {
@@ -3785,7 +3801,6 @@ void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
   }
   if (valueChanged)// or (!valueChanged && modeChanged))
     SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
-  MESSAGE("IDL : SetGMFFile END ");
 }
 
 //================================================================================
@@ -3798,7 +3813,6 @@ void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
 //================================================================================  
 char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
   ASSERT(myBaseImpl);
-//   MESSAGE("IDL : GetGMFFile()");
   return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
 }
 
@@ -3812,7 +3826,6 @@ char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
 // //================================================================================  
 // CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
 //   ASSERT(myBaseImpl);
-//   MESSAGE("IDL : GetGMFFileMode()");
 //   return this->GetImpl()->GetGMFFileMode();
 // }
 
@@ -3824,91 +3837,254 @@ char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
  */
 //=============================================================================
 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
   return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
 }
 
 //================================================================================
 /*!
- * \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() );
 }