+void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
+ const QString& theStudyName,
+ const QString& theGeomShapeName,
+ const QString& theMeshName ) const
+{
+ 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 );
+ theResList << QString( "MEFISTO_2D = %1.Triangle( algo=smeshBuilder.MEFISTO )" ).arg( theMeshName );
+ theResList << "Max_Element_Area_1 = MEFISTO_2D.MaxElementArea( 10 )";
+ theResList << QString( "Regular_1D = %1.Segment()" ).arg( theMeshName );
+ theResList << "Max_Size_1 = Regular_1D.MaxSize(10)";
+ theResList << QString( "isDone = %1.Compute()" ).arg( theMeshName );
+
+ theResList << "";
+ theResList << "# Set names of Mesh objects";
+ theResList << "smesh.SetName( MEFISTO_2D.GetAlgorithm(), 'MEFISTO_2D' )";
+ theResList << "smesh.SetName( Regular_1D.GetAlgorithm(), 'Regular_1D' )";
+ 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)" );
+}
+