From: vsr Date: Mon, 5 Aug 2013 08:35:32 +0000 (+0000) Subject: 0022169: [CEA 750] Chose before visualization mesh element type to display X-Git-Tag: V7_3_0a1~231 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6399cfb3c4e949a0650705221af708de572736cd;p=modules%2Fsmesh.git 0022169: [CEA 750] Chose before visualization mesh element type to display Improve automatic limit exceed warning message --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index ee7675db7..5d3cac68f 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1986,7 +1986,7 @@ bool SMESHGUI::automaticUpdate(unsigned int requestedSize, bool* limitExceeded) */ //============================================================================= bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh, - int* entities, bool* limitExceeded ) + int* entities, bool* limitExceeded, int* hidden ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); if ( !resMgr ) @@ -1999,6 +1999,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh, long requestedSize = theMesh->NbElements(); *entities = SMESH_Actor::eAllEntity; + *hidden = 0; bool exceeded = updateLimit > 0 && requestedSize > updateLimit; @@ -2013,40 +2014,50 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh, long total = 0; if ( nbOdElems > 0 ) { - if ( total + nbOdElems > updateLimit ) + if ( total + nbOdElems > updateLimit ) { *entities = *entities & ~SMESH_Actor::e0DElements; + *hidden = *hidden | SMESH_Actor::e0DElements; + } else exceeded = false; } total += nbOdElems; if ( nbEdges > 0 ) { - if ( total + nbEdges > updateLimit ) + if ( total + nbEdges > updateLimit ) { *entities = *entities & ~SMESH_Actor::eEdges; + *hidden = *hidden | SMESH_Actor::eEdges; + } else exceeded = false; } total += nbEdges; if ( nbFaces > 0 ) { - if ( total + nbFaces > updateLimit ) + if ( total + nbFaces > updateLimit ) { *entities = *entities & ~SMESH_Actor::eFaces; + *hidden = *hidden | SMESH_Actor::eFaces; + } else exceeded = false; } total += nbFaces; if ( nbVolumes > 0 ) { - if ( total + nbVolumes > updateLimit ) + if ( total + nbVolumes > updateLimit ) { *entities = *entities & ~SMESH_Actor::eVolumes; + *hidden = *hidden | SMESH_Actor::eVolumes; + } else exceeded = false; } total += nbVolumes; if ( nbBalls > 0 ) { - if ( total + nbBalls > updateLimit ) + if ( total + nbBalls > updateLimit ) { *entities = *entities & ~SMESH_Actor::eBallElem; + *hidden = *hidden | SMESH_Actor::eBallElem; + } else exceeded = false; } diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 8a38ec5ec..74978853c 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -100,7 +100,7 @@ public : bool isActiveStudyLocked(); static bool automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0); - static bool automaticUpdate( SMESH::SMESH_Mesh_ptr, int*, bool* ); + static bool automaticUpdate( SMESH::SMESH_Mesh_ptr, int*, bool*, int* ); static void Modified( bool = true ); diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index ec8dd9523..0415094f1 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -895,9 +895,10 @@ void SMESHGUI_BaseComputeOp::computeMesh() bool limitExceeded; long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 ); int entities = SMESH_Actor::eAllEntity; + int hidden = 0; if ( !memoryLack ) { - if ( getSMESHGUI()->automaticUpdate( myMesh, &entities, &limitExceeded ) ) + if ( getSMESHGUI()->automaticUpdate( myMesh, &entities, &limitExceeded, &hidden ) ) { try { #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 @@ -913,9 +914,15 @@ void SMESHGUI_BaseComputeOp::computeMesh() if ( limitExceeded ) { + QStringList hiddenMsg; + if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" ); + if ( hidden & SMESH_Actor::eEdges ) hiddenMsg << tr( "SMESH_EDGES" ); + if ( hidden & SMESH_Actor::eFaces ) hiddenMsg << tr( "SMESH_FACES" ); + if ( hidden & SMESH_Actor::eVolumes ) hiddenMsg << tr( "SMESH_VOLUMES" ); + if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" ); SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ) ); + tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ).arg( hiddenMsg.join(", ") ) ); } } catch (...) { diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 0a6dfcf05..a54c3c370 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -1649,6 +1649,10 @@ Do you want to continue ? SMESH_FACE Face + + SMESH_FACES + Faces + SMESH_FEATUREANGLE Feature Angle @@ -2655,6 +2659,10 @@ Consider saving your work before application crash SMESH_VOLUME Volume + + SMESH_VOLUMES + Volumes + SMESH_WARNING Warning @@ -2717,14 +2725,15 @@ Consider saving your work before application crash SMESH_WRN_SIZE_LIMIT_EXCEEDED - No automatic update of the presentation has been done: new mesh size (%1 elements) exceeds current size limit (%2 elements). -Please check preferences of Mesh module. + No automatic update of the presentation has been done: +New mesh size (%1 elements) exceeds current size limit of automatic update (%2 elements). SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED - New mesh sise (%1 elements) exceeds current size limit (%2 elements). -Not all mesh elements are shown. Please check preferences of Mesh module. + New mesh sise (%1 elements) exceeds current size limit of automatic update (%2 elements). +The following elements are not shown: %3. +Use Display Entity menu command to show them. diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index a5e3a690a..eaf5abbf9 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -1677,6 +1677,10 @@ Voulez-vous continuer ? SMESH_FACE Face + + SMESH_FACES + Faces + SMESH_FEATUREANGLE Montrer l'angle @@ -2663,6 +2667,10 @@ Enregistrez votre travail avant que l'application se plante SMESH_VOLUME Volume + + SMESH_VOLUMES + Volumes + SMESH_WARNING Avertissement @@ -2725,14 +2733,16 @@ Enregistrez votre travail avant que l'application se plante SMESH_WRN_SIZE_LIMIT_EXCEEDED - La présentation n'a pas été mise à jour automatiquement: la nouvelle taille du maillage (%1 éléments) dépasse la limite de taille actuelle (%2 éléments). + La présentation n'a pas été mise à jour automatiquement: +la nouvelle taille du maillage (%1 éléments) dépasse la limite de taille actuelle (%2 éléments). Vérifiez la limite dans les préférences du module Mesh. SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED - New mesh sise (%1 elements) exceeds current size limit (%2 elements). -Not all mesh elements are shown. Please check preferences of Mesh module. + New mesh sise (%1 elements) exceeds current size limit of automatic update (%2 elements). +The following elements are not shown: %3. +Use Display Entity menu command to show them.