]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Minor changes
authorapo <apo@opencascade.com>
Thu, 8 Sep 2005 07:46:36 +0000 (07:46 +0000)
committerapo <apo@opencascade.com>
Thu, 8 Sep 2005 07:46:36 +0000 (07:46 +0000)
src/VISUGUI/VisuGUI_Module.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h

index 065c23b2f8b82aa37be998267577df224636d20b..09da9b3c7d285861acc2fca5d0ebe7865d582f05 100644 (file)
@@ -176,19 +176,20 @@ VisuGUI_Module
   int aMenuId = createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 );
   //createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
 
+  QString aViewerType = VVTK_Viewer::Type();
   SUIT_Accel* accel = getApp()->accel();
-  accel->setActionKey( SUIT_Accel::PanLeft,Key_Left,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::PanRight,Key_Right,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::PanUp,Key_Up,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::PanDown,Key_Down,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::ZoomIn,Key_PageUp,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::ZoomOut,Key_PageDown,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::RotateLeft,CTRL+Key_Left,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::RotateRight,CTRL+Key_Right,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::RotateUp,CTRL+Key_Up,VVTK_Viewer::Type() );
-  accel->setActionKey( SUIT_Accel::RotateDown,CTRL+Key_Down,VVTK_Viewer::Type() );
-  accel->setActionKey( SVTK::PlusSpeedIncrementEvent,Key_Plus,VVTK_Viewer::Type() );
-  accel->setActionKey( SVTK::MinusSpeedIncrementEvent,Key_Minus,VVTK_Viewer::Type() );
+  accel->setActionKey( SUIT_Accel::PanLeft, Key_Left, aViewerType );
+  accel->setActionKey( SUIT_Accel::PanRight, Key_Right, aViewerType );
+  accel->setActionKey( SUIT_Accel::PanUp, Key_Up, aViewerType );
+  accel->setActionKey( SUIT_Accel::PanDown, Key_Down, aViewerType );
+  accel->setActionKey( SUIT_Accel::ZoomIn, Key_PageUp, aViewerType );
+  accel->setActionKey( SUIT_Accel::ZoomOut, Key_PageDown, aViewerType );
+  accel->setActionKey( SUIT_Accel::RotateLeft, CTRL+Key_Left, aViewerType );
+  accel->setActionKey( SUIT_Accel::RotateRight, CTRL+Key_Right, aViewerType );
+  accel->setActionKey( SUIT_Accel::RotateUp, CTRL+Key_Up, aViewerType );
+  accel->setActionKey( SUIT_Accel::RotateDown, CTRL+Key_Down, aViewerType );
+  accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Key_Plus, aViewerType );
+  accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Key_Minus, aViewerType );
 
   connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
 
index a4177ac76652dca0c39bf7965a60c6e9cdc1fc9f..63444a9924fcedc7556df816bb30482ceb2c47a0 100644 (file)
@@ -38,13 +38,13 @@ namespace VISU
   class CutLines_i;
 
   //---------------------------------------------------------------
-  template<class TPrs3d_i, class TDlg>
+  template<class TPrs3d_i, class TViewer, class TDlg>
+  inline
   void
   EditPrs3d(VisuGUI* theModule, 
            VISU::Prs3d_i* thePrs3d)
   {
-    TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d);
-    if (aPrsObject) {
+    if(TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d)){
       TDlg* aDlg = new TDlg (theModule);
       aDlg->initFromPrsObject(aPrsObject);
       if (aDlg->exec()) {
@@ -52,10 +52,11 @@ namespace VISU
          delete aDlg;
          return;
        }
-       RecreateActor(theModule, aPrsObject);
-       if (SVTK_ViewWindow* vw = GetViewWindow(theModule)) {
-         vw->getRenderer()->ResetCameraClippingRange();
-         vw->Repaint();
+       RecreateActor(theModule,aPrsObject);
+       typedef typename TViewer::TViewWindow TViewWindow;
+       if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule,true)){
+         aViewWindow->getRenderer()->ResetCameraClippingRange();
+         aViewWindow->Repaint();
        }
        // Optionally, create table and curves for cut lines
        QApplication::setOverrideCursor(Qt::waitCursor);
@@ -69,9 +70,18 @@ namespace VISU
     }
   }
 
+  template<class TPrs3d_i, class TDlg>
+  inline
+  void
+  EditPrs3d(VisuGUI* theModule, 
+           VISU::Prs3d_i* thePrs3d)
+  {
+    EditPrs3d<TPrs3d_i,SVTK_Viewer,TDlg>(theModule,thePrs3d);
+  }
 
   //---------------------------------------------------------------
   template<class TPrs3d_i>
+  inline
   TPrs3d_i*
   CreatePrs3d(VisuGUI* theModule,
              _PTR(SObject) theTimeStamp,
@@ -100,6 +110,7 @@ namespace VISU
 
   //---------------------------------------------------------------
   template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
+  inline
   bool
   CreatePrs3d(VisuGUI* theModule,
              _PTR(SObject) theTimeStamp,
@@ -166,9 +177,10 @@ namespace VISU
   
   //---------------------------------------------------------------
   template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
+  inline
   void
   CreatePrs3d(VisuGUI* theModule,
-             const bool theIsCreateView = false)
+             const bool theIsCreateView = true)
   {
     if (CheckLock(GetCStudy(GetAppStudy(theModule))))
       return;
@@ -190,9 +202,10 @@ namespace VISU
   }
 
   template<class TPrs3d_i, class TDlg, int IsDlgModal>
+  inline
   void
   CreatePrs3d(VisuGUI* theModule,
-             const bool theIsCreateView = false)
+             const bool theIsCreateView = true)
   {
     CreatePrs3d<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>(theModule,theIsCreateView);
   }