VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
QMainWindow* theParent,
LightApp_SelectionMgr* theSelectionMgr )
- : QWidget( theParent ),
- myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() ),
- mySelectionMgr( theSelectionMgr )
+ : QWidget( theParent )
+ , myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() )
+ , mySelectionMgr( theSelectionMgr )
+ , myModule( theModule )
{
setWindowTitle( tr("TITLE") );
connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
//----------------------------------------------------------------------------
- connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), myLimitedMemory, SLOT( setEnabled( bool ) ) );
+ connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), this, SLOT( onMemoryModeChanged( bool ) ) );
+ connect( myLimitedMemory, SIGNAL( valueChanged( double ) ), this, SLOT( onMemorySizeChanged( double ) ) );
//----------------------------------------------------------------------------
enableControls( false );
setHidden( false );
}
+
+void VisuGUI_Slider::onMemoryModeChanged( bool )
+{
+ using namespace VISU;
+ SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
+ VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
+
+ if ( myLimitedMemoryButton->isChecked() ) {
+ aCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
+ aCache->SetLimitedMemory( myLimitedMemory->value() );
+ } else
+ aCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
+
+ myLimitedMemory->setEnabled( myLimitedMemoryButton->isChecked() );
+}
+
+
+void VisuGUI_Slider::onMemorySizeChanged( double )
+{
+ onMemoryModeChanged( myLimitedMemoryButton->isChecked() );
+}
+
+
bool VisuGUI_Slider::checkHolderList()
{
THolderList aHolderList;
virtual void onTimeout();
+ void onMemoryModeChanged( bool );
+ void onMemorySizeChanged( double );
+
protected slots:
void onModuleDeactivated();
void onModuleActivated();
private:
LightApp_SelectionMgr* mySelectionMgr;
- VISU::ViewManager_var myViewManager;
+ VISU::ViewManager_var myViewManager;
+ VisuGUI* myModule;
QSlider* mySlider;
QLabel* myFirstTimeStamp;