Salome HOME
0020210: EDF SMESH 976: Update of a smesh group after modification of the associated...
[modules/smesh.git] / src / SMESH_I / SMESH_2smeshpy.cxx
index 0fa541b7d04dbdf6634981c153449efd2f47bdad..9f02764abb4a7dd48aee5ddd85c0578610a8a74c 100644 (file)
@@ -1287,7 +1287,7 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
   }
   else if ( hypType == "NETGEN_SimpleParameters_2D") {
     hyp->SetConvMethodAndType( "Parameters", "NETGEN_2D");
-    hyp->myArgs.Append( "which=SIMPLE" );
+    hyp->myArgs.Append( "which=smesh.SIMPLE" );
   }
   else if ( hypType == "NETGEN_2D3D") { // 1D-2D-3D
     algo->SetConvMethodAndType( "Tetrahedron" , hypType.ToCString());
@@ -1298,7 +1298,7 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th
   }
   else if ( hypType == "NETGEN_SimpleParameters_3D") {
     hyp->SetConvMethodAndType( "Parameters", "NETGEN_2D3D");
-    hyp->myArgs.Append( "which=SIMPLE" );
+    hyp->myArgs.Append( "which=smesh.SIMPLE" );
   }
   else if ( hypType == "NETGEN_2D_ONLY") { // 2D
     algo->SetConvMethodAndType( "Triangle" , hypType.ToCString());
@@ -2107,9 +2107,18 @@ TCollection_AsciiString _pyCommand::GetWord( const TCollection_AsciiString & the
       return theEmptyString; // no word found
     // end
     end = beg + 1;
-    while ( end <= theString.Length() && isWord( theString.Value( end ), dotIsWord))
-      ++end;
-    --end;
+    char begChar = theString.Value( beg );
+    if ( begChar == '"' || begChar == '\'' ) {
+      // end is at the corresponding quoting mark
+      while ( end < theString.Length() &&
+              ( theString.Value( end ) != begChar || theString.Value( end-1 ) == '\\'))
+        ++end;
+    }
+    else {
+      while ( end <= theString.Length() && isWord( theString.Value( end ), dotIsWord))
+        ++end;
+      --end;
+    }
   }
   else {  // search backward
     // end
@@ -2118,9 +2127,18 @@ TCollection_AsciiString _pyCommand::GetWord( const TCollection_AsciiString & the
     if ( end == 0 )
       return theEmptyString; // no word found
     beg = end - 1;
-    while ( beg > 0 && isWord( theString.Value( beg ), dotIsWord))
-      --beg;
-    ++beg;
+    char endChar = theString.Value( end );
+    if ( endChar == '"' || endChar == '\'' ) {
+      // beg is at the corresponding quoting mark
+      while ( beg > 1 &&
+              ( theString.Value( beg ) != endChar || theString.Value( beg-1 ) == '\\'))
+        --beg;
+    }
+    else {
+      while ( beg > 0 && isWord( theString.Value( beg ), dotIsWord))
+        --beg;
+      ++beg;
+    }
   }
   theStartPos = beg;
   //cout << theString << " ---- " << beg << " - " << end << endl;