Salome HOME
Python dump and scripts: removal of references to study, debug print instructions
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.cxx
index 5b291318997f504cdc958227fe59ba12368573f7..3014494d979d8199dbcbf25505f2137994e394d9 100755 (executable)
@@ -212,29 +212,27 @@ QStringList HYDROData_CalculationCase::DumpToPython( const QString&       thePyS
   // Export calculation case
   aResList << QString( "" );
   aResList << "# Export of the calculation case";
-  QString aStudyName = "theStudy";
   QString anEntryVar = aCalculName + "_entry";
-  aResList << QString( "%1 = %2.Export( %3._get_StudyId() )" ).arg( anEntryVar ).arg( aCalculName ).arg( aStudyName );
+  aResList << QString( "%1 = %2.Export()" ).arg( anEntryVar ).arg( aCalculName );
 
   // Get geometry object and print debug information
   aResList << "";
   aResList << "# Get geometry shape and print debug information";
   aResList << "import GEOM";
-  aResList << QString( "print \"Entry:\", %1" ).arg( anEntryVar );
+  aResList << QString( "print (\"Entry:\", %1)" ).arg( anEntryVar );
   QString aGeomShapeName = aCalculName + "_geom";
   aResList << QString( "HYDRO_%1 = salome.IDToObject( str( %2 ) )" ).arg( GetName() ).arg( anEntryVar );
-  aResList << QString( "print \"Geom shape:\", HYDRO_%1" ).arg( GetName() );
-  aResList << QString( "print \"Geom shape name:\", HYDRO_%1.GetName()" ).arg( GetName() );
+  aResList << QString( "print (\"Geom shape:\", HYDRO_%1)" ).arg( GetName() );
+  aResList << QString( "print (\"Geom shape name:\", HYDRO_%1.GetName())" ).arg( GetName() );
 
 
-  //DumpSampleMeshing( aResList, aStudyName, aGeomShapeName, aCalculName+"_mesh" );
+  //DumpSampleMeshing( aResList, aGeomShapeName, aCalculName+"_mesh" );
 
   aResList << QString( "" );
   return aResList;
 }
 
 void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
-                                                   const QString& theStudyName,
                                                    const QString& theGeomShapeName,
                                                    const QString& theMeshName ) const
 {
@@ -244,7 +242,7 @@ void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
   theResList << "from salome.smesh import smeshBuilder";
   theResList << "from salome.geom import geomBuilder";
 
-  theResList << QString( "smesh = smeshBuilder.New( %1 )" ).arg( theStudyName );
+  theResList << QString( "smesh = smeshBuilder.New()" );
   theResList << QString( "%1 = smesh.Mesh( %2 )" ).arg( theMeshName ).arg( theGeomShapeName );
   theResList << QString( "MEFISTO_2D = %1.Triangle( algo=smeshBuilder.MEFISTO )" ).arg( theMeshName );
   theResList << "Max_Element_Area_1 = MEFISTO_2D.MaxElementArea( 10 )";
@@ -262,13 +260,13 @@ void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
 
   theResList << "";
   theResList << "# Greate SMESH groups";
-  theResList << QString( "geompy = geomBuilder.New( %1 )" ).arg( theStudyName );
+  theResList << QString( "geompy = geomBuilder.New()" );
   theResList << QString( "geom_groups = geompy.GetGroups( %1 )" ).arg( theGeomShapeName );
   theResList << QString( "for group in geom_groups:" );
   theResList << QString( "    smesh_group = %1.GroupOnGeom(group, group.GetName(), SMESH.EDGE)" )
                 .arg( theMeshName );
   theResList << QString( "    smesh.SetName(smesh_group, group.GetName())" );
-  theResList << QString( "    print \"SMESH group '%s': %s\" % (smesh_group.GetName(), smesh_group)" );
+  theResList << QString( "    print (\"SMESH group '%s': %s)\" % (smesh_group.GetName(), smesh_group)" );
 }
 
 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const