- if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
- // VTK
- VTKViewer_RenderWindowInteractor* myRenderInter= ((VTKViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getRightFrame()->getViewFrame())->getRWInteractor();
- SALOME_ListIteratorOfListIO It(this->mySel->StoredIObjects());
-
- Handle(SALOME_InteractiveObject) FirstIOS = mySel->firstIObject();
- if(!FirstIOS.IsNull()) {
- /* The first time as initialisation */
- if(this->myFirstInit) {
- this->myFirstInit = false;
- float transp = (myRenderInter->GetTransparency(FirstIOS))*10.0;
- this->Slider1->setValue(int(transp));
- return;
- }
- }
-
- QApplication::setOverrideCursor(Qt::waitCursor);
- for(;It.More(); It.Next()) {
- Handle(SALOME_InteractiveObject) IOS = It.Value();
- myRenderInter->SetTransparency(IOS, newValue/10.0);
- }
- myRenderInter->Render();
- QApplication::restoreOverrideCursor();
- }
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+ if ( !app )
+ return;
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+ if ( !aSelMgr )
+ return;
+ SALOME_ListIO selected;
+ aSelMgr->selectedObjects( selected );
+ if ( selected.IsEmpty() )
+ return;