From: mzn Date: Thu, 6 Nov 2014 10:39:04 +0000 (+0000) Subject: Bug #484: add SMESH groups creation. X-Git-Tag: BR_hydro_v_1_0_4~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf36af4a84d601d8e8c269dc97ed12bc91b5d35f;p=modules%2Fhydro.git Bug #484: add SMESH groups creation. --- diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 3c139f17..5dc58cbb 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -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