mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 18:20:34 +05:00
0022169: [CEA 750] Chose before visualization mesh element type to display
Improve automatic limit exceed warning message
This commit is contained in:
parent
ef59152514
commit
6399cfb3c4
@ -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;
|
||||
}
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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 (...) {
|
||||
|
@ -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>
|
||||
|
@ -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'angle</translation>
|
||||
@ -2663,6 +2667,10 @@ Enregistrez votre travail avant que l'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'application se plante</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_WRN_SIZE_LIMIT_EXCEEDED</source>
|
||||
<translation>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).
|
||||
<translation>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.
|
||||
</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>
|
||||
|
Loading…
Reference in New Issue
Block a user