Salome HOME
0022169: [CEA 750] Chose before visualization mesh element type to display
authorvsr <vsr@opencascade.com>
Mon, 5 Aug 2013 08:35:32 +0000 (08:35 +0000)
committervsr <vsr@opencascade.com>
Mon, 5 Aug 2013 08:35:32 +0000 (08:35 +0000)
Improve automatic limit exceed warning message

src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts

index ee7675db7a088e19a7b2496feef8d6eb4166c03d..5d3cac68f37f2c56cc3a460fd5cf7126ad213baf 100644 (file)
@@ -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;
     }
index 8a38ec5ec374d910a608ba6cdb32d42e4f6bc890..74978853cc99abbb48e31b3ce25b321604daf26b 100644 (file)
@@ -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 );
 
index ec8dd9523c348c0906e0ba6b9c4861b1c923f9c4..0415094f1ecd255e4279fc3eaef0dc4b500ae8af 100644 (file)
@@ -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 (...) {
index 0a6dfcf052c7dd0e046d97dd3589faa45c4f2f1e..a54c3c3708cc47da0e3f87faffad8280e67e9099 100644 (file)
@@ -1649,6 +1649,10 @@ Do you want to continue ?</translation>
         <source>SMESH_FACE</source>
         <translation>Face</translation>
     </message>
+    <message>
+        <source>SMESH_FACES</source>
+        <translation>Faces</translation>
+    </message>
     <message>
         <source>SMESH_FEATUREANGLE</source>
         <translation>Feature Angle</translation>
@@ -2655,6 +2659,10 @@ Consider saving your work before application crash</translation>
         <source>SMESH_VOLUME</source>
         <translation>Volume</translation>
     </message>
+    <message>
+        <source>SMESH_VOLUMES</source>
+        <translation>Volumes</translation>
+    </message>
     <message>
         <source>SMESH_WARNING</source>
         <translation>Warning</translation>
@@ -2717,14 +2725,15 @@ Consider saving your work before application crash</translation>
     </message>
     <message>
         <source>SMESH_WRN_SIZE_LIMIT_EXCEEDED</source>
-        <translation>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.
+        <translation>No automatic update of the presentation has been done:
+New mesh size (%1 elements) exceeds current size limit of automatic update (%2 elements).
 </translation>
     </message>
     <message>
         <source>SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED</source>
-        <translation>New mesh sise (%1 elements) exceeds current size limit (%2 elements).
-Not all mesh elements are shown. Please check preferences of Mesh module.
+        <translation>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.
 </translation>
     </message>
     <message>
index a5e3a690af9cbc999b4c10cfcaa15e4acd642f9a..eaf5abbf9f782ed217a891ad8ea9dc820934b110 100755 (executable)
@@ -1677,6 +1677,10 @@ Voulez-vous continuer ?</translation>
         <source>SMESH_FACE</source>
         <translation>Face</translation>
     </message>
+    <message>
+        <source>SMESH_FACES</source>
+        <translation>Faces</translation>
+    </message>
     <message>
         <source>SMESH_FEATUREANGLE</source>
         <translation>Montrer l&apos;angle</translation>
@@ -2663,6 +2667,10 @@ Enregistrez votre travail avant que l&apos;application se plante</translation>
         <source>SMESH_VOLUME</source>
         <translation>Volume</translation>
     </message>
+    <message>
+        <source>SMESH_VOLUMES</source>
+        <translation>Volumes</translation>
+    </message>
     <message>
         <source>SMESH_WARNING</source>
         <translation>Avertissement</translation>
@@ -2725,14 +2733,16 @@ Enregistrez votre travail avant que l&apos;application se plante</translation>
     </message>
     <message>
         <source>SMESH_WRN_SIZE_LIMIT_EXCEEDED</source>
-        <translation>La présentation n&apos;a pas été mise à jour automatiquement: la nouvelle taille du maillage (%1 éléments) dépasse la limite de taille actuelle (%2 éléments).
+        <translation>La présentation n&apos;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.
 </translation>
     </message>
     <message>
         <source>SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED</source>
-        <translation type="unfinished">New mesh sise (%1 elements) exceeds current size limit (%2 elements).
-Not all mesh elements are shown. Please check preferences of Mesh module.
+        <translation type="unfinished">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.
 </translation>
     </message>
     <message>