#include <SalomeApp_Application.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Study.h>
#include <QLabel>
#include <QPushButton>
//mySlider->setValue( 5 );
mySlider->setTracking(false);
- mySlider->setTickPosition( QSlider::TicksLeft );
+ mySlider->setTickPosition( QSlider::TicksAbove );
GroupC1Layout->addWidget( mySlider, 1, 0, 1, 3 );
/*************************************************************************/
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if ( !aSelMgr )
return;
+
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+
+ if(!aStudy)
+ return;
+
SALOME_ListIO selected;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() )
SUIT_ViewWindow* window = app->desktop()->activeWindow();
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
-
+ int aMgrId = window->getViewManager()->getGlobalId();
if ( isVTK ) {
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
if ( !vtkVW )
SUIT_OverrideCursor();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
aView->SetTransparency( It.Value(), newValue );
+ aStudy->setObjectProperty( aMgrId , It.Value()->getEntry(), TRANSPARENCY_PROP , newValue );
}
GeometryGUI::Modified();
aView->Repaint();
else if ( isOCC ) {
GEOMBase* gb = new GEOMBase();
- Standard_Boolean found;
Handle(GEOM_AISShape) aisShape;
if ( myFirstInit ) {
+ mySlider->setValue(mySlider->maximum());
myFirstInit = false;
- aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, found );
- if( !found )
+ aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS );
+ if( aisShape.IsNull() )
return;
int transp = int( 100 - ( aisShape->Transparency() * 100.0 ) + 0.5);
mySlider->setValue(transp);
return;
Handle(AIS_InteractiveContext) ic = vm->getAISContext();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
- aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), found );
- if ( found ) {
+ aisShape = gb->ConvertIOinGEOMAISShape( It.Value() );
+ if ( !aisShape.IsNull() ) {
ic->SetTransparency( aisShape, newValue, false );
ic->Redisplay( aisShape, Standard_False, Standard_True );
+ aStudy->setObjectProperty( aMgrId , It.Value()->getEntry(), TRANSPARENCY_PROP , newValue );
}
} // for...
ic->UpdateCurrentViewer();