<parameter name="scalar_bar_vertical_y" value="0.1" />
<parameter name="DisplayMode" value="true" />
<parameter name="auto_update" value="true" />
+ <parameter name="update_limit" value="500000" />
<parameter name="display_mode" value="1" />
<parameter name="auto_groups" value="false"/>
<parameter name="show_result_notification" value="2"/>
return 0;
}
-bool SMESHGUI::automaticUpdate()
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+bool SMESHGUI::automaticUpdate(unsigned int requestedSize, bool* limitExceeded)
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
if ( !resMgr )
return false;
- return resMgr->booleanValue( "SMESH", "auto_update", false );
+ bool autoUpdate = resMgr->booleanValue( "SMESH", "auto_update", false );
+ long updateLimit = resMgr->integerValue( "SMESH", "update_limit", 500000 );
+ bool exceeded = updateLimit > 0 && requestedSize > updateLimit;
+ if ( limitExceeded ) *limitExceeded = autoUpdate && exceeded;
+ return autoUpdate && !exceeded;
}
//=============================================================================
// General tab ------------------------------------------------------------------------
int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) );
- int updateGroup = addPreference( tr( "PREF_GROUP_UPDATE" ), genTab );
- addPreference( tr( "PREF_AUTO_UPDATE" ), updateGroup, LightApp_Preferences::Bool, "SMESH", "auto_update" );
+ int autoUpdate = addPreference( tr( "PREF_AUTO_UPDATE" ), genTab, LightApp_Preferences::Auto, "SMESH", "auto_update" );
+ int lim = addPreference( tr( "PREF_UPDATE_LIMIT" ), autoUpdate, LightApp_Preferences::IntSpin, "SMESH", "update_limit" );
+ setPreferenceProperty( lim, "min", 0 );
+ setPreferenceProperty( lim, "max", 100000000 );
+ setPreferenceProperty( lim, "step", 1000 );
+ setPreferenceProperty( lim, "special", tr( "PREF_UPDATE_LIMIT_NOLIMIT" ) );
int qaGroup = addPreference( tr( "PREF_GROUP_QUALITY" ), genTab );
setPreferenceProperty( qaGroup, "columns", 2 );
bool isActiveStudyLocked();
- static bool automaticUpdate();
+ static bool automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0);
static void Modified( bool = true );
// SHOW MESH
// NPAL16631: if ( getSMESHGUI()->automaticUpdate() )
- if ( !memoryLack && getSMESHGUI()->automaticUpdate() )
+ long newSize = myMesh->NbElements();
+ bool limitExceeded;
+ if ( !memoryLack )
{
- try {
+ if ( getSMESHGUI()->automaticUpdate( newSize, &limitExceeded ) )
+ {
+ try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
+ OCC_CATCH_SIGNALS;
#endif
- SMESH::Update(myIObject, true);
- }
- catch (...) {
+ SMESH::Update(myIObject, true);
+ }
+ catch (...) {
#ifdef _DEBUG_
- MESSAGE ( "Exception thrown during mesh visualization" );
+ MESSAGE ( "Exception thrown during mesh visualization" );
#endif
- if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
- SMESH::OnVisuException();
- }
- else {
- memoryLack = true;
- }
+ if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning?
+ SMESH::OnVisuException();
+ }
+ else {
+ memoryLack = true;
+ }
+ }
}
+ else if ( limitExceeded )
+ {
+ SUIT_MessageBox::warning( desktop(),
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "SMESH_WRN_SIZE_LIMIT_EXCEEDED" ) );
+ }
}
LightApp_SelectionMgr *Sel = selectionMgr();
if ( Sel )
void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
const bool theNoCompError,
SMESH::compute_error_array_var& theCompErrors,
- const bool theNoHypoError,
+ const bool theNoHypoError,
const QString& theHypErrors )
{
bool hasShape = myMesh->HasShapeToMesh();
SMESH::MeshPreviewStruct_var previewData =
gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId);
+
SMESH::MeshPreviewStruct* previewRes = previewData._retn();
if ( previewRes && previewRes->nodesXYZ.length() > 0 )
{
<source>SMESH_WRN_VIEWER_VTK</source>
<translation>Study frame with VTK Viewer must be activated</translation>
</message>
+ <message>
+ <source>SMESH_WRN_SIZE_LIMIT_EXCEEDED</source>
+ <translation>Mesh size limit has been exceeded.
+No automatic update of the presentation has been done.</translation>
+ </message>
<message>
<source>SMESH_WRN_WARNING</source>
<translation>Warning</translation>
<source>PREF_AUTO_UPDATE</source>
<translation>Automatic update</translation>
</message>
+ <message>
+ <source>PREF_UPDATE_LIMIT</source>
+ <translation>Size limit (elements)</translation>
+ </message>
+ <message>
+ <source>PREF_UPDATE_LIMIT_NOLIMIT</source>
+ <translation>No limit</translation>
+ </message>
<message>
<source>PREF_BACKFACE</source>
<translation>Back face</translation>
<source>PREF_GROUP_SELECTION</source>
<translation>Selection</translation>
</message>
- <message>
- <source>PREF_GROUP_UPDATE</source>
- <translation>Update</translation>
- </message>
<message>
<source>PREF_HIGHLIGHT_COLOR</source>
<translation>Highlight color</translation>