Salome HOME
0022172: [CEA 790] create the groups corresponding to domains
authoreap <eap@opencascade.com>
Fri, 24 May 2013 11:57:38 +0000 (11:57 +0000)
committereap <eap@opencascade.com>
Fri, 24 May 2013 11:57:38 +0000 (11:57 +0000)
Fix dump of AddHypothesis() in the case w/o geometry

src/SMESH_I/SMESH_Mesh_i.cxx

index 12f82ab43173534c85601049a10eb2c055abd6ae..0e0e82a6b1d453d30b72f4824d1f2a5055af5e87 100644 (file)
@@ -583,13 +583,13 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr
   if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
 
   // Update Python script
   if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
 
   // Update Python script
-  if(_impl->HasShapeToMesh()) {
+  //if(_impl->HasShapeToMesh()) {
     TPythonDump() << "status = " << _this() << ".AddHypothesis( "
                   << aSubShapeObject << ", " << anHyp << " )";
     TPythonDump() << "status = " << _this() << ".AddHypothesis( "
                   << aSubShapeObject << ", " << anHyp << " )";
-  }
-  else {
-    TPythonDump() << "status = " << _this() << ".AddHypothesis( "<< anHyp << " )";
-  }
+  // }
+  // else {
+  //   TPythonDump() << "status = " << _this() << ".AddHypothesis( "<< anHyp << " )";
+  // }
   
   return ConvertHypothesisStatus(status);
 }
   
   return ConvertHypothesisStatus(status);
 }
@@ -1109,30 +1109,27 @@ SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception)
 
   // Python Dump
   TPythonDump aPythonDump;
 
   // Python Dump
   TPythonDump aPythonDump;
-  if ( !_mapGroups.empty() ) // (IMP13463) avoid "SyntaxError: can't assign to []"
+  if ( !_mapGroups.empty() )
+  {
     aPythonDump << "[ ";
     aPythonDump << "[ ";
-
-  try {
-    aList->length( _mapGroups.size() );
-    int i = 0;
-    map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.begin();
-    for ( ; it != _mapGroups.end(); it++ ) {
-      if ( CORBA::is_nil( it->second )) continue;
-      aList[i++] = SMESH::SMESH_GroupBase::_duplicate( it->second );
-      // Python Dump
-      if (i > 1) aPythonDump << ", ";
-      aPythonDump << it->second;
+    try {
+      aList->length( _mapGroups.size() );
+      int i = 0;
+      map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.begin();
+      for ( ; it != _mapGroups.end(); it++ ) {
+        if ( CORBA::is_nil( it->second )) continue;
+        aList[i++] = SMESH::SMESH_GroupBase::_duplicate( it->second );
+        // Python Dump
+        if (i > 1) aPythonDump << ", ";
+        aPythonDump << it->second;
+      }
+      aList->length( i );
+    }
+    catch(SALOME_Exception & S_ex) {
+      THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
     }
     }
-    aList->length( i );
-  }
-  catch(SALOME_Exception & S_ex) {
-    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
-  }
-
-  // Update Python script
-  if ( !_mapGroups.empty() ) // (IMP13463) avoid "SyntaxError: can't assign to []"
     aPythonDump << " ] = " << _this() << ".GetGroups()";
     aPythonDump << " ] = " << _this() << ".GetGroups()";
-
+  }
   return aList._retn();
 }
 
   return aList._retn();
 }