From: apo Date: Mon, 19 May 2008 08:42:37 +0000 (+0000) Subject: To improve "slider" functionality X-Git-Tag: TG_VISU_2008_2008-06-26~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8023949b941642654850526778c2f4bc05c05701;p=modules%2Fvisu.git To improve "slider" functionality --- diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index 61460891..0abea289 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -401,6 +401,19 @@ void VisuGUI_Slider::enableControls( bool on ) if( a_current_index <= mySlider->maximum() ) mySlider->setMaximum( aLength-1 ); + + using namespace VISU; + SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) ); + VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy ); + + long aMb = 1024 * 1024; + double aLimitedMemory = aCache->GetLimitedMemory(); + myLimitedMemory->setValue( aLimitedMemory ); + + double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb; + double anUsedMemory = aCache->GetMemorySize(); + double aLimitedMemoryMax = max( anUsedMemory + aFreeMemory, aLimitedMemory ); + myLimitedMemory->setMaximum( aLimitedMemoryMax ); } else {