From 8023949b941642654850526778c2f4bc05c05701 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 19 May 2008 08:42:37 +0000 Subject: [PATCH] To improve "slider" functionality --- src/VISUGUI/VisuGUI_Slider.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 { -- 2.39.2