From 4cb88409b2f1c9a3ae8b87e575bac8982a561c97 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 5 Nov 2019 15:02:59 +0300 Subject: [PATCH] Fix dump for #17845 [EDF] Modifications of Automatic meshing --- idl/SMESH_Gen.idl | 9 ++++ src/SMESHGUI/SMESHGUI_MeshOp.cxx | 20 ++++++--- src/SMESHGUI/SMESH_msg_fr.ts | 75 +++++++++++++++++++++----------- src/SMESH_I/SMESH_Gen_i.cxx | 40 ++++++++++++++++- src/SMESH_I/SMESH_Gen_i.hxx | 17 +++++--- 5 files changed, 122 insertions(+), 39 deletions(-) diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index 4dbeb2ef0..f612bb08e 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -173,6 +173,15 @@ module SMESH in string theLibName ) raises ( SALOME::SALOME_Exception ); + /*! + * Create a hypothesis and initialize it by average length + */ + SMESH_Hypothesis CreateHypothesisByAverageLength( in string theHypName, + in string theLibName, + in double theAverageLength, + in boolean theQuadDominated) + raises ( SALOME::SALOME_Exception ); + /*! * Return a hypothesis holding parameter values corresponding either to the mesh * existing on the given geometry or to size of the geometry. diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index d1a7d6305..c33a4fe92 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1103,12 +1103,18 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, initParams.way = isSubMesh ? BY_MESH : BY_GEOM; } - SMESH::SMESH_Hypothesis_var hyp = - SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toUtf8().data(), - aServerLib.toUtf8().data(), - aMesh, - aGeomVar, - initParams ); + SMESH::SMESH_Hypothesis_var hyp; + if ( initParams.way == BY_AVERAGE_LENGTH ) + hyp = SMESHGUI::GetSMESHGen()->CreateHypothesisByAverageLength( aHypType.toUtf8().data(), + aServerLib.toUtf8().data(), + initParams.averageLength, + initParams.quadDominated ); + else + hyp = SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toUtf8().data(), + aServerLib.toUtf8().data(), + aMesh, + aGeomVar, + initParams ); if ( hyp->_is_nil() && initParams.way == BY_MESH ) { initParams.way = BY_GEOM; @@ -1898,7 +1904,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName ) HypothesesSet::SetType setType = aHypoSet->getPreferredHypType(); if ( !aHypoSet->getAlgoAvailable( setType )) { - setType = setType == HypothesesSet::ALT ? HypothesesSet::MAIN : HypothesesSet::ALT; + setType = ( setType == HypothesesSet::ALT ) ? HypothesesSet::MAIN : HypothesesSet::ALT; if ( !aHypoSet->getAlgoAvailable( setType )) return; } diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index fc4d2f56f..11c236515 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -53,7 +53,7 @@ GMF_BINARY_FILES_FILTER - Fichier GMF binaires + Fichiers GMF binaires STL_BIN_FILES_FILTER @@ -109,7 +109,7 @@ MIN_ELEM_EDGE - Longueur arête Minimum + Longueur arête minimum ASPECTRATIO_3D_ELEMENTS @@ -189,7 +189,7 @@ EDITERR_NO_MEDIUM_ON_GEOM - Certain noeuds milieux (affichés en magenta) ne sont pas placés + Certain nœuds milieux (affichés en magenta) ne sont pas placés sur la géométrie pour éviter d'obtenir des élements distordus. @@ -234,7 +234,7 @@ DEFLECTION2D_FACES - Deflection 2D + Déflection 2D LENGTH_EDGES @@ -246,15 +246,15 @@ MAX_ELEMENT_LENGTH_2D - Diamètre d'éléments 2D + Diamètre des éléments 2D MAX_ELEMENT_LENGTH_3D - Diamètre Element 3D + Diamètre des éléments 3D DEFLECTION_2D - Deflection 2D + Déflection 2D MEN_ADD @@ -334,7 +334,7 @@ MEN_CONV_TO_QUAD - Convertir vers/de quadratique + Convertir vers/depuis quadratique MEN_2D_FROM_3D @@ -450,7 +450,7 @@ MEN_0D_ON_ALL_NODES - Eléments 0D sur des noeuds + Eléments 0D sur des nœuds MEN_BALL @@ -1183,7 +1183,7 @@ STB_OVERALL_MESH_QUALITY Qualité du maillage global - + STB_SPLIT_TO_TETRA Eclater en tétraèdres @@ -1803,7 +1803,7 @@ Voulez-vous continuer ? SMESH_EXPORT_MED_VERSION_COLLISION - La version MED du fichier "%1" n'est pas connue + La version MED du fichier "%1" n'est pas connue ou ne correspond pas à la version choisie. Ecraser le fichier ? @@ -1855,8 +1855,7 @@ Voulez-vous continuer ? SMESH_FILE_EXISTS Le fichier "%1" existe déjà. -Voulez-vous le réécrire ou y ajouter -les données exportées ? +Voulez-vous le réécrire ou y ajouter les données exportées ? SMESH_FONT_ARIAL @@ -3154,7 +3153,7 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_0D_ON_ALL_NODES - Créer des éléments 0D sur des noeuds + Créer des éléments 0D sur des nœuds STB_ELEMS0D @@ -3846,7 +3845,7 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_0D_ON_ALL_NODES - Créer des éléments 0D sur des noeuds + Créer des éléments 0D sur des nœuds TOP_ELEM0D @@ -4964,7 +4963,7 @@ Ouvrez une fenêtre VTK et essayez de nouveau SMESHGUI_Add0DElemsOnAllNodesDlg CAPTION - Créer des éléments 0D sur des noeuds + Créer des éléments 0D sur des nœuds OBJ_BTN @@ -5407,7 +5406,7 @@ Choisissez un groupe et essayez de nouveau EDIT_SELECTED_NODE_GROUP - Editer le groupe sélectionné de noeuds coïncidents + Editer le groupe sélectionné de nœuds coïncidents EDIT_SELECTED_ELEM_GROUP @@ -5431,7 +5430,7 @@ Choisissez un groupe et essayez de nouveau SEPARATE_CORNERS_AND_MEDIUM - Pas de fusion du coin et des noeuds moyens des cellules quadratiques + Pas de fusion du coin et des nœuds moyens des cellules quadratiques AVOID_MAKING_HOLES @@ -5439,7 +5438,7 @@ Choisissez un groupe et essayez de nouveau KEEP_NODES - Les noeuds à conserver pendant la fusion + Les nœuds à conserver pendant la fusion GROUP_SUBMESH @@ -5533,7 +5532,7 @@ Choisissez un groupe et essayez de nouveau SMESHGUI_ExtrusionDlg EXTRUSION_0D - Extrusion de noeuds + Extrusion de nœuds EXTRUSION_1D @@ -5877,7 +5876,7 @@ Vérifiez la validité des informations données NUMBEROFNODESINELEMENT - Nombre de noeuds dans l'élément + Nombre de nœuds dans l'élément COPY_FROM @@ -6463,6 +6462,30 @@ Indiquez-les et essayez de nouveau CREATE_ALL_GROUPS Créer tous les groupes définis dans la géométrie + + 3D: Tetrahedralization + 3D : Tétraèdres + + + 3D: Mapped Hexahedralization + 3D : Hexaèdres réglés + + + 3D: Free Hexahedralization + 3D : Hexaèdres libres + + + 2D: Triangulation + 2D : Triangles + + + 2D: Mapped Quadrangulation + 2D : Quadrangles réglés + + + 2D: Free Quadrangulation + 2D : Quadrangles libres + SMESHGUI_MeshOp @@ -6525,7 +6548,7 @@ Spécifiez-le et essayez de nouveau MT_HEXAHEDRAL - Hexahèdre + Hexaèdre MT_TETRAHEDRAL @@ -6556,7 +6579,7 @@ Sélectionnez un maillage ou un sous-maillage et essayez de nouveau CONCURRENT_SUBMESH_APPEARS - + L'algorithme assigné a la même priorité que celui assigné à un sous-maillage adjacent; ainsi l'algorithme à utiliser pour mailler la frontière partagée par les deux sous-maillages n'est pas défini. @@ -6588,7 +6611,7 @@ Il est probable que le fichier est corrompu ou contient un autre type de motif ERROR_OF_OPENING - Il est impossible d'ouvrir le fichier. + Il est impossible d'ouvrir le fichier. Vérifiez s'il existe et si vous avez l'autorisation @@ -6638,7 +6661,7 @@ Il est impossible de lire les coordonnées des points dans le fichier ERR_READ_TOO_FEW_POINTS - Il est impossible de charger le motif. + Il est impossible de charger le motif. Il y a trop peu de points dans le fichier @@ -8144,7 +8167,7 @@ en raison de leurs types incompatibles: SUBSHAPES_NOT_FOUND_MSG -Some sub-shapes not found in the new geometry. They are listed +Some sub-shapes not found in the new geometry. They are listed below along with dependent mesh objects that are marked with with red in the Object Browser. diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 2b0e5d30c..3e9465f2e 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -749,6 +749,43 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::CreateHypothesis( const char* theHypNam return hyp._retn(); } +//================================================================================ +/*! + * \brief Return a hypothesis initialized by given average length. + * \param theHypType - hypothesis type name + * \param theLibName - plugin library name + * \param theAverageLength - average length + * \param theQuadDominated - is quad-dominated flag + * \retval SMESH::SMESH_Hypothesis_ptr - the new hypothesis + */ +//================================================================================ + +SMESH::SMESH_Hypothesis_ptr +SMESH_Gen_i::CreateHypothesisByAverageLength( const char* theHypType, + const char* theLibName, + CORBA::Double theAverageLength, + CORBA::Boolean theQuadDominated) + throw ( SALOME::SALOME_Exception ) +{ + SMESH::HypInitParams initParams = { ::SMESH_Hypothesis::BY_AVERAGE_LENGTH, + theAverageLength, theQuadDominated }; + + SMESH::SMESH_Hypothesis_var hyp = + GetHypothesisParameterValues( theHypType, theLibName, + SMESH::SMESH_Mesh::_nil(), + GEOM::GEOM_Object::_nil(), + initParams ); + SALOMEDS::SObject_wrap so = PublishHypothesis( hyp ); + + TPythonDump() << hyp << " = " << this << ".CreateHypothesisByAverageLength( '" + << theHypType << "', '" + << theLibName << "', " + << theAverageLength << ", " + << theQuadDominated << " )"; + + return hyp._retn(); +} + //================================================================================ /*! * \brief Return a hypothesis holding parameter values corresponding either to the mesh @@ -764,7 +801,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::CreateHypothesis( const char* theHypNam //================================================================================ SMESH::SMESH_Hypothesis_ptr -SMESH_Gen_i::GetHypothesisParameterValues (const char* theHypType, +SMESH_Gen_i::GetHypothesisParameterValues( const char* theHypType, const char* theLibName, SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theGeom, @@ -844,6 +881,7 @@ SMESH_Gen_i::GetHypothesisParameterValues (const char* theHypTyp dflts._elemLength = dflts._diagonal / myGen.GetBoundaryBoxSegmentation(); dflts._shape = &shape; } + // let the hypothesis initialize it's values if ( hyp->SetParametersByDefaults( dflts, mesh )) return SMESH::SMESH_Hypothesis::_duplicate( tmpHyp ); diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index ec800b965..693870867 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -163,12 +163,19 @@ public: const char* theLibName) throw ( SALOME::SALOME_Exception ); + SMESH::SMESH_Hypothesis_ptr CreateHypothesisByAverageLength( const char* theHypType, + const char* theLibName, + CORBA::Double theAverageLength, + CORBA::Boolean theQuadDominated) + throw ( SALOME::SALOME_Exception ); + // Return hypothesis of given type holding parameter values of the existing mesh - SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType, - const char* theLibName, - SMESH::SMESH_Mesh_ptr theMesh, - GEOM::GEOM_Object_ptr theGeom, - const SMESH::HypInitParams& theWay) + SMESH::SMESH_Hypothesis_ptr + GetHypothesisParameterValues (const char* theHypType, + const char* theLibName, + SMESH::SMESH_Mesh_ptr theMesh, + GEOM::GEOM_Object_ptr theGeom, + const SMESH::HypInitParams& theWay) throw ( SALOME::SALOME_Exception ); /* -- 2.30.2