]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Bug #484: add SMESH groups creation.
authormzn <mzn@opencascade.com>
Thu, 6 Nov 2014 10:39:04 +0000 (10:39 +0000)
committermzn <mzn@opencascade.com>
Thu, 6 Nov 2014 10:39:04 +0000 (10:39 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx

index 3c139f1793e39f57b225b6dd5c16b64cdd99245e..5dc58cbb1bce3c1b114ecdb06d14dba537ec3f2b 100644 (file)
@@ -218,6 +218,7 @@ void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
   theResList << "# Meshing";
   theResList << "import SMESH, SALOMEDS";
   theResList << "from salome.smesh import smeshBuilder";
+  theResList << "from salome.geom import geomBuilder";
 
   theResList << QString( "smesh = smeshBuilder.New( %1 )" ).arg( theStudyName );
   theResList << QString( "%1 = smesh.Mesh( %2 )" ).arg( theMeshName ).arg( theGeomShapeName );
@@ -234,6 +235,16 @@ void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
   theResList << "smesh.SetName( Max_Size_1, 'Max Size_1' )";
   theResList << "smesh.SetName( Max_Element_Area_1, 'Max. Element Area_1' )";
   theResList << QString( "smesh.SetName( %1.GetMesh(), '%1' )" ).arg( theMeshName );
+
+  theResList << "";
+  theResList << "# Greate SMESH groups";
+  theResList << QString( "geompy = geomBuilder.New( %1 )" ).arg( theStudyName );
+  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)" );
 }
 
 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const