This commit was generated by cvs2git to create tag

'BR-D5-38-2003_D2005-12-19'.

Sprout from master 2005-10-18 14:49:45 UTC smh <smh@opencascade.com> 'Preparation of 3.1.0a2: version ID.'
Cherrypick from BR-D5-38-2003 2005-09-19 11:54:23 UTC apo <apo@opencascade.com> 'Porting to BR-D5-38-2003 branch':
    src/DisplayGUI/DisplayGUI.cxx
    src/GEOMGUI/GeometryGUI_Swig.cxx
    src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
    src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
This commit is contained in:
admin 2005-10-18 14:49:46 +00:00
parent 568c445b1b
commit e285bd2ed1
4 changed files with 109 additions and 120 deletions

View File

@ -30,27 +30,28 @@
#include "GeometryGUI.h" #include "GeometryGUI.h"
#include "GEOM_Displayer.h" #include "GEOM_Displayer.h"
#include <SUIT_Desktop.h> #include "SUIT_Desktop.h"
#include <SUIT_Session.h> #include "SUIT_Session.h"
#include <SUIT_ViewWindow.h> #include "SUIT_ViewWindow.h"
#include <SUIT_OverrideCursor.h> #include "SUIT_OverrideCursor.h"
#include <OCCViewer_ViewManager.h> #include "VTKViewer_ViewWindow.h"
#include <OCCViewer_ViewModel.h> #include "OCCViewer_ViewManager.h"
#include <OCCViewer_ViewWindow.h> #include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewWindow.h"
#include <SALOME_ListIteratorOfListIO.hxx> #include "SALOME_ListIteratorOfListIO.hxx"
#include <SVTK_ViewWindow.h> #include "SVTK_ViewWindow.h"
#include <SVTK_RenderWindowInteractor.h> #include "SVTK_View.h"
#include <SVTK_ViewModel.h> #include "SVTK_ViewModel.h"
#include <SOCC_ViewModel.h> #include "SOCC_ViewModel.h"
#include <SVTK_Prs.h> #include "SVTK_Prs.h"
#include <SOCC_Prs.h> #include "SOCC_Prs.h"
#include <SalomeApp_Application.h> #include "SalomeApp_Application.h"
#include <SalomeApp_SelectionMgr.h> #include "SalomeApp_SelectionMgr.h"
#include <SalomeApp_Study.h> #include "SalomeApp_Study.h"
#include <AIS_ListIteratorOfListOfInteractive.hxx> #include <AIS_ListIteratorOfListOfInteractive.hxx>
@ -103,21 +104,17 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
{ {
myDisplayGUI->InvertDisplayMode(); myDisplayGUI->InvertDisplayMode();
int newMode = myDisplayGUI->GetDisplayMode(); int newMode = myDisplayGUI->GetDisplayMode();
getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") ); SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
getGeometryGUI()->menuMgr()->update(); changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
// SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
break; break;
} }
case 212: // MENU VIEW - DISPLAY ALL case 212: // MENU VIEW - DISPLAY ALL
{ {
getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayAll(); myDisplayGUI->DisplayAll();
break; break;
} }
case 213: // MENU VIEW - DISPLAY ONLY case 213: // MENU VIEW - DISPLAY ONLY
{ {
getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->DisplayOnly(); myDisplayGUI->DisplayOnly();
break; break;
} }
@ -133,7 +130,6 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
} }
case 216: // MENU VIEW - DISPLAY case 216: // MENU VIEW - DISPLAY
{ {
getGeometryGUI()->EmitSignalDeactivateDialog();
myDisplayGUI->Display(); myDisplayGUI->Display();
break; break;
} }
@ -202,7 +198,7 @@ void DisplayGUI::EraseAll()
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() ); SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
SUIT_ViewManager* vman = vw->getViewManager(); SUIT_ViewManager* vman = vw->getViewManager();
if ( vman->getType() == OCCViewer_Viewer::Type() || if ( vman->getType() == OCCViewer_Viewer::Type() ||
vman->getType() == SVTK_Viewer::Type() ) { vman->getType() == VTKViewer_Viewer::Type() ) {
GEOM_Displayer( appStudy ).EraseAll(); GEOM_Displayer( appStudy ).EraseAll();
} }
} }
@ -341,11 +337,9 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
if ( !viewWindow ) if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>( viewWindow ); SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
SVTK_RenderWindowInteractor* myRenderInter = wnd ? wnd->getRWInteractor() : 0; aView->SetDisplayMode( mode );
if( myRenderInter )
myRenderInter->SetDisplayMode( mode );
} }
else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
@ -379,11 +373,9 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
int dispMode = 0; int dispMode = 0;
if ( !viewWindow ) if ( !viewWindow )
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>( viewWindow ); SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
SVTK_RenderWindowInteractor* myRenderInter = wnd ? wnd->getRWInteractor() : 0; dispMode = aView->GetDisplayMode();
if( myRenderInter )
dispMode = myRenderInter->GetDisplayMode();
} }
else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();
@ -424,27 +416,24 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
SALOME_ListIO aList; SALOME_ListIO aList;
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow ); SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
SVTK_RenderWindowInteractor* rwi = vw ? vw->getRWInteractor() : 0; SVTK_View* aView = vw->getView();
if( !rwi )
return;
aSelMgr->selectedObjects( aList ); aSelMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO It( aList ); SALOME_ListIteratorOfListIO It( aList );
for( ;It.More(); It.Next() ) { for( ;It.More(); It.Next() ) {
SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel()); SVTK_Viewer* stvkViewer = (SVTK_Viewer*)(vw->getViewManager()->getViewModel());
SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0; SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) );
if ( vtkPrs && !vtkPrs->IsNull() ) { if ( vtkPrs && !vtkPrs->IsNull() ) {
if ( mode == 0 ) if ( mode == 0 )
rwi->ChangeRepresentationToWireframe( vtkPrs->GetObjects() ); aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
else if ( mode == 1 ) else if ( mode == 1 )
rwi->ChangeRepresentationToSurface( vtkPrs->GetObjects() ); aView->ChangeRepresentationToSurface( vtkPrs->GetObjects() );
} }
} }
rwi->Render(); aView->Repaint();
} }
else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer();

View File

@ -31,20 +31,22 @@
#include "GeometryGUI.h" #include "GeometryGUI.h"
#include <SUIT_Session.h> #include "SUIT_Session.h"
#include <SalomeApp_Application.h> #include "SalomeApp_Application.h"
#include <SalomeApp_Study.h> #include "SalomeApp_Study.h"
#include <SalomeApp_ImportOperation.h> #include "SalomeApp_ImportOperation.h"
#include <OB_Browser.h> #include "OB_Browser.h"
#include <OCCViewer_ViewWindow.h> #include "OCCViewer_ViewWindow.h"
#include <OCCViewer_ViewManager.h> #include "OCCViewer_ViewManager.h"
#include <SOCC_ViewModel.h> #include "SOCC_ViewModel.h"
#include <SVTK_ViewModel.h> #include "VTKViewer_ViewWindow.h"
#include <SVTK_ViewWindow.h> #include "VTKViewer_ViewModel.h"
#include <SVTK_RenderWindowInteractor.h> #include "VTKViewer_RenderWindowInteractor.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_View.h"
#include "GEOM_Actor.h" #include "GEOM_Actor.h"
#include "GEOM_Client.hxx" #include "GEOM_Client.hxx"
@ -52,7 +54,7 @@
#include "GEOM_AssemblyBuilder.h" #include "GEOM_AssemblyBuilder.h"
#include "GEOM_InteractiveObject.hxx" #include "GEOM_InteractiveObject.hxx"
#include <SALOME_Event.hxx> #include "SALOME_Event.hxx"
#include "utilities.h" #include "utilities.h"
@ -96,7 +98,7 @@ inline OCCViewer_Viewer* GetOCCViewer(SUIT_Application* theApp){
inline SVTK_ViewWindow* GetSVTKViewWindow(SUIT_Application* theApp){ inline SVTK_ViewWindow* GetSVTKViewWindow(SUIT_Application* theApp){
SUIT_ViewWindow* window = theApp->desktop()->activeWindow(); SUIT_ViewWindow* window = theApp->desktop()->activeWindow();
if(window && window->getViewManager()->getType() == SVTK_Viewer::Type()) if(window && window->getViewManager()->getType() == VTKViewer_Viewer::Type())
return dynamic_cast<SVTK_ViewWindow*>( window ); return dynamic_cast<SVTK_ViewWindow*>( window );
return 0; return 0;
@ -171,10 +173,9 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
"GEOM", "GEOM",
const_cast<char*>( obj->GetID().c_str())); const_cast<char*>( obj->GetID().c_str()));
if (SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(app)) { if (SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(app)) {
SVTK_View* aView = aViewWindow->getView();
SVTK_RenderWindowInteractor* aRenderInter= svtkViewWindow->getRWInteractor(); int aMode = aView->GetDisplayMode();
int aMode = aRenderInter->GetDisplayMode();
vtkActorCollection* theActors = vtkActorCollection* theActors =
GEOM_AssemblyBuilder::BuildActors(Shape,0,aMode,true); GEOM_AssemblyBuilder::BuildActors(Shape,0,aMode,true);
@ -183,10 +184,9 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry)
GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor); GEOM_Actor* GActor = GEOM_Actor::SafeDownCast(anActor);
GActor->setName(const_cast<char*>(aNameValue.c_str())); GActor->setName(const_cast<char*>(aNameValue.c_str()));
GActor->setIO(anIO); GActor->setIO(anIO);
aRenderInter->Display(GActor); aView->Display(GActor);
} }
aRenderInter->Update(); aView->Repaint();
cout << 8.2 << endl;
} else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) { } else if (OCCViewer_Viewer* occViewer = GetOCCViewer(app)) {
Handle(AIS_InteractiveContext) ic = occViewer->getAISContext(); Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape) aSh =
@ -397,10 +397,10 @@ void GEOM_Swig::setDisplayMode(const char* theEntry, int theMode)
myApp(theApp), myIO(theIO), myParam(theParam) myApp(theApp), myIO(theIO), myParam(theParam)
{} {}
virtual void Execute(){ virtual void Execute(){
if(SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(myApp)){ if(SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(myApp)){
SVTK_RenderWindowInteractor* myRenderInter= svtkViewWindow->getRWInteractor(); SVTK_View* aView = aViewWindow->getView();
myRenderInter->SetDisplayMode(myIO,myParam); aView->SetDisplayMode(myIO,myParam);
myRenderInter->Update(); aView->Repaint();
} }
else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)) { else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)) {
SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occViewer ); SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occViewer );
@ -431,10 +431,10 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue)
myApp(theApp), myIO(theIO), myParam(theParam) myApp(theApp), myIO(theIO), myParam(theParam)
{} {}
virtual void Execute(){ virtual void Execute(){
if(SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(myApp)){ if(SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(myApp)){
SVTK_RenderWindowInteractor* myRenderInter= svtkViewWindow->getRWInteractor(); SVTK_View* aView = aViewWindow->getView();
myRenderInter->SetColor(myIO,myParam); aView->SetColor(myIO,myParam);
myRenderInter->Update(); aView->Repaint();
}else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)){ }else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)){
Handle(AIS_InteractiveContext) ic = occViewer->getAISContext(); Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
AIS_ListOfInteractive List; AIS_ListOfInteractive List;
@ -478,10 +478,10 @@ void GEOM_Swig::setTransparency(const char* theEntry, float transp)
myApp(theApp), myIO(theIO), myParam(theParam) myApp(theApp), myIO(theIO), myParam(theParam)
{} {}
virtual void Execute(){ virtual void Execute(){
if(SVTK_ViewWindow* svtkViewWindow = GetSVTKViewWindow(myApp)){ if(SVTK_ViewWindow* aViewWindow = GetSVTKViewWindow(myApp)){
SVTK_RenderWindowInteractor* myRenderInter= svtkViewWindow->getRWInteractor(); SVTK_View* aView = aViewWindow->getView();
myRenderInter->SetTransparency(myIO,myParam); aView->SetTransparency(myIO,myParam);
myRenderInter->Update(); aView->Repaint();
}else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)) { }else if(OCCViewer_Viewer* occViewer = GetOCCViewer(myApp)) {
SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occViewer ); SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occViewer );
if (soccViewer) if (soccViewer)

View File

@ -38,28 +38,28 @@
#include "GEOM_Actor.h" #include "GEOM_Actor.h"
#include "GEOMBase.h" #include "GEOMBase.h"
#include <SALOME_ListIO.hxx> #include "SALOME_ListIO.hxx"
#include <SALOME_ListIteratorOfListIO.hxx> #include "SALOME_ListIteratorOfListIO.hxx"
#include <SVTK_ViewModel.h> #include "VTKViewer_ViewModel.h"
#include <SVTK_ViewWindow.h> #include "OCCViewer_ViewModel.h"
#include <SVTK_RenderWindowInteractor.h> #include "OCCViewer_ViewWindow.h"
#include <OCCViewer_ViewModel.h> #include "SVTK_ViewWindow.h"
#include <OCCViewer_ViewWindow.h> #include "SVTK_View.h"
#include <SUIT_ViewManager.h> #include "SUIT_ViewManager.h"
#include <SUIT_Application.h> #include "SUIT_Application.h"
#include <SUIT_Desktop.h> #include "SUIT_Desktop.h"
#include <SUIT_ResourceMgr.h> #include "SUIT_ResourceMgr.h"
#include <SUIT_Session.h> #include "SUIT_Session.h"
#include <SUIT_OverrideCursor.h> #include "SUIT_OverrideCursor.h"
#include <SUIT_MessageBox.h> #include "SUIT_MessageBox.h"
#include <SalomeApp_Application.h> #include "SalomeApp_Application.h"
#include <SalomeApp_SelectionMgr.h> #include "SalomeApp_SelectionMgr.h"
#include <SalomeApp_Study.h> #include "SalomeApp_Study.h"
#include <SalomeApp_Module.h> #include "SalomeApp_Module.h"
#include "SALOMEDSClient.hxx" #include "SALOMEDSClient.hxx"
@ -100,7 +100,7 @@ void GEOMToolsGUI::OnSettingsColor()
if( aDialogColor.isValid() ) if( aDialogColor.isValid() )
{ {
QString type = desk->activeWindow()->getViewManager()->getType(); QString type = desk->activeWindow()->getViewManager()->getType();
if( type != OCCViewer_Viewer::Type() && type != SVTK_Viewer::Type() ) if( type != OCCViewer_Viewer::Type() && type != VTKViewer_Viewer::Type() )
MESSAGE("Settings Color is not supported for current Viewer"); MESSAGE("Settings Color is not supported for current Viewer");
resMgr->setValue( "Geometry", "SettingsShadingColor", aDialogColor ); resMgr->setValue( "Geometry", "SettingsShadingColor", aDialogColor );
@ -231,18 +231,18 @@ void GEOMToolsGUI::OnColor()
if ( !selected.IsEmpty() ) { if ( !selected.IsEmpty() ) {
SUIT_ViewWindow* window = app->desktop()->activeWindow(); SUIT_ViewWindow* window = app->desktop()->activeWindow();
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); bool isVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() );
if ( isVTK ) { if ( isVTK ) {
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window ); SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
if ( !vtkVW ) if ( !vtkVW )
return; return;
SVTK_RenderWindowInteractor* rwi = vtkVW->getRWInteractor(); SVTK_View* aView = vtkVW->getView();
QColor initcolor = rwi->GetColor( selected.First() ); QColor initcolor = aView->GetColor( selected.First() );
QColor c = QColorDialog::getColor( QColor(), app->desktop() ); QColor c = QColorDialog::getColor( QColor(), app->desktop() );
if ( c.isValid() ) { if ( c.isValid() ) {
SUIT_OverrideCursor(); SUIT_OverrideCursor();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
rwi->SetColor( It.Value(), c ); aView->SetColor( It.Value(), c );
} }
} }
} // if ( isVTK ) } // if ( isVTK )

View File

@ -30,25 +30,25 @@
#include "GEOMBase.h" #include "GEOMBase.h"
#include "GEOM_AISShape.hxx" #include "GEOM_AISShape.hxx"
#include <SALOME_ListIO.hxx> #include "SALOME_ListIO.hxx"
#include <SALOME_ListIteratorOfListIO.hxx> #include "SALOME_ListIteratorOfListIO.hxx"
#include <SVTK_ViewModel.h> #include "VTKViewer_ViewModel.h"
#include <SVTK_ViewWindow.h> #include "OCCViewer_ViewModel.h"
#include <SVTK_RenderWindowInteractor.h> #include "OCCViewer_ViewWindow.h"
#include <OCCViewer_ViewModel.h> #include "SVTK_ViewWindow.h"
#include <OCCViewer_ViewWindow.h> #include "SVTK_View.h"
#include <SUIT_ViewManager.h> #include "SUIT_ViewManager.h"
#include <SUIT_Application.h> #include "SUIT_Application.h"
#include <SUIT_Desktop.h> #include "SUIT_Desktop.h"
#include <SUIT_ResourceMgr.h> #include "SUIT_ResourceMgr.h"
#include <SUIT_Session.h> #include "SUIT_Session.h"
#include <SUIT_OverrideCursor.h> #include "SUIT_OverrideCursor.h"
#include <SalomeApp_Application.h> #include "SalomeApp_Application.h"
#include <SalomeApp_SelectionMgr.h> #include "SalomeApp_SelectionMgr.h"
#include <qframe.h> #include <qframe.h>
#include <qlabel.h> #include <qlabel.h>
@ -199,25 +199,25 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue )
SUIT_ViewWindow* window = app->desktop()->activeWindow(); SUIT_ViewWindow* window = app->desktop()->activeWindow();
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); bool isVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() );
if ( isVTK ) { if ( isVTK ) {
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window ); SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
if ( !vtkVW ) if ( !vtkVW )
return; return;
SVTK_RenderWindowInteractor* rwi = vtkVW->getRWInteractor(); SVTK_View* aView = vtkVW->getView();
if ( myFirstInit ) { if ( myFirstInit ) {
myFirstInit = false; myFirstInit = false;
float transp = (rwi->GetTransparency(FirstIOS))*10.0; float transp = (aView->GetTransparency(FirstIOS))*10.0;
mySlider->setValue(int(transp)); mySlider->setValue(int(transp));
return; return;
} }
SUIT_OverrideCursor(); SUIT_OverrideCursor();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
rwi->SetTransparency( It.Value(), newValue/10.0 ); aView->SetTransparency( It.Value(), newValue/10.0 );
} }
rwi->Render(); aView->Repaint();
} // if ( isVTK ) } // if ( isVTK )
else if ( isOCC ) { else if ( isOCC ) {