]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
All modules must use SVTK package instead VTK
authorasl <asl@opencascade.com>
Wed, 5 Oct 2005 06:25:36 +0000 (06:25 +0000)
committerasl <asl@opencascade.com>
Wed, 5 Oct 2005 06:25:36 +0000 (06:25 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/resources/SalomeApp.ini
src/SalomeApp/resources/SalomeApp.xml

index bea59c7603257d5e999185d434138344df04726a..8a5a757fa467fed41f4cdb1b68e8a4cab443b609 100644 (file)
@@ -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<SVTK_Viewer*>( 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<SVTK_Viewer*>( vm );
+      if( vtkVM )
+      {
+       vtkVM->setTrihedronSize( sz );
+       vtkVM->Repaint();
+      }
     }
   }
 
index 2dae6406e00a32cd30e3c1ef72056ceac40e19f2..7e1f31d5e603e95b8d8c357610fe66c8b2d3365f 100644 (file)
@@ -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
index 15a0583bc2274c41c469b6b045bfd4cdcdb30ba9..9adb52b1a284aadfb053407d5af5837a731584ea 100644 (file)
@@ -33,6 +33,7 @@
     <parameter name="GLViewer"     value="${SUITRoot}/resources"/>
     <parameter name="OCCViewer"    value="${SUITRoot}/resources"/>
     <parameter name="VTKViewer"    value="${SUITRoot}/resources"/>
+    <parameter name="SVTK"         value="${SUITRoot}/resources"/>
     <parameter name="SalomeApp"    value="${SUITRoot}/resources"/>
     <parameter name="OB"           value="${SUITRoot}/resources"/>
     <parameter name="CAM"          value="${SUITRoot}/resources"/>