From d4446a86c8260fdae7c8caaf81c49741a9ca964d Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 5 Oct 2005 06:25:36 +0000 Subject: [PATCH] All modules must use SVTK package instead VTK --- src/SalomeApp/SalomeApp_Application.cxx | 44 ++++++++++++++----------- src/SalomeApp/resources/SalomeApp.ini | 1 + src/SalomeApp/resources/SalomeApp.xml | 1 + 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index bea59c760..8a5a757fa 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -166,17 +166,17 @@ myPrefs( 0 ) myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, OCCViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, OCCViewer_Viewer::Type() ); myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, OCCViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::PanDown, CTRL+Key_Down, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::ZoomIn, CTRL+Key_Plus, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::ZoomOut, CTRL+Key_Minus, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::ZoomFit, CTRL+Key_Asterisk, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::RotateLeft, ALT+Key_Left, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, VTKViewer_Viewer::Type() ); - myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, VTKViewer_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanLeft, CTRL+Key_Left, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanRight, CTRL+Key_Right, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanUp, CTRL+Key_Up, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::PanDown, CTRL+Key_Down, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomIn, CTRL+Key_Plus, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomOut, CTRL+Key_Minus, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::ZoomFit, CTRL+Key_Asterisk, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateLeft, ALT+Key_Left, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateRight, ALT+Key_Right, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateUp, ALT+Key_Up, SVTK_Viewer::Type() ); + myAccel->setActionKey( SUIT_Accel::RotateDown, ALT+Key_Down, SVTK_Viewer::Type() ); connect( desk, SIGNAL( closing( SUIT_Desktop*, QCloseEvent* ) ), this, SLOT( onDesktopClosing( SUIT_Desktop*, QCloseEvent* ) ) ); @@ -546,7 +546,7 @@ void SalomeApp_Application::onNewWindow() type = OCCViewer_Viewer::Type(); break; case NewVTKViewId: - type = VTKViewer_Viewer::Type(); + type = SVTK_Viewer::Type(); break; } @@ -1128,10 +1128,13 @@ SUIT_ViewManager* SalomeApp_Application::createViewManager( const QString& vmTyp else if ( vmType == SVTK_Viewer::Type() ) { viewMgr = new SVTK_ViewManager( activeStudy(), desktop() ); - SVTK_Viewer* vm = (SVTK_Viewer*)viewMgr->getViewModel(); - vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) ); - vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ) ); - new SalomeApp_VTKSelector((SVTK_Viewer*)viewMgr->getViewModel(),mySelMgr); + SVTK_Viewer* vm = dynamic_cast( viewMgr->getViewModel() ); + if( vm ) + { + vm->setBackgroundColor( resMgr->colorValue( "VTKViewer", "background", vm->backgroundColor() ) ); + vm->setTrihedronSize( resMgr->integerValue( "VTKViewer", "trihedron_size", vm->trihedronSize() ) ); + new SalomeApp_VTKSelector( vm, mySelMgr ); + } } if ( !viewMgr ) @@ -1656,9 +1659,12 @@ void SalomeApp_Application::preferencesChanged( const QString& sec, const QStrin if ( !vm || !vm->inherits( "SVTK_Viewer" ) ) continue; - SVTK_Viewer* vtkVM = (SVTK_Viewer*)vm; - vtkVM->setTrihedronSize( sz ); - vtkVM->Repaint(); + SVTK_Viewer* vtkVM = dynamic_cast( vm ); + if( vtkVM ) + { + vtkVM->setTrihedronSize( sz ); + vtkVM->Repaint(); + } } } diff --git a/src/SalomeApp/resources/SalomeApp.ini b/src/SalomeApp/resources/SalomeApp.ini index 2dae6406e..7e1f31d5e 100644 --- a/src/SalomeApp/resources/SalomeApp.ini +++ b/src/SalomeApp/resources/SalomeApp.ini @@ -11,6 +11,7 @@ Plot2d = $(SUITRoot)/resources GLViewer = $(SUITRoot)/resources OCCViewer = $(SUITRoot)/resources VTKViewer = $(SUITRoot)/resources +SVTK = $(SUITRoot)/resources SalomeApp = $(SUITRoot)/resources GEOM = $(GEOM_ROOT_DIR)/share/salome/resources SMESH = $(SMESH_ROOT_DIR)/share/salome/resources diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index 15a0583bc..9adb52b1a 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -33,6 +33,7 @@ + -- 2.39.2