From e21e6368cd11587d73836a802c9d57697892a9c1 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 8 Sep 2005 07:46:36 +0000 Subject: [PATCH] Minor changes --- src/VISUGUI/VisuGUI_Module.cxx | 25 +++++++++++++------------ src/VISUGUI/VisuGUI_Prs3dTools.h | 31 ++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 065c23b2..09da9b3c 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -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*) ) ); diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index a4177ac7..63444a99 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -38,13 +38,13 @@ namespace VISU class CutLines_i; //--------------------------------------------------------------- - template + template + inline void EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d) { - TPrs3d_i* aPrsObject = dynamic_cast(thePrs3d); - if (aPrsObject) { + if(TPrs3d_i* aPrsObject = dynamic_cast(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(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 + inline + void + EditPrs3d(VisuGUI* theModule, + VISU::Prs3d_i* thePrs3d) + { + EditPrs3d(theModule,thePrs3d); + } //--------------------------------------------------------------- template + inline TPrs3d_i* CreatePrs3d(VisuGUI* theModule, _PTR(SObject) theTimeStamp, @@ -100,6 +110,7 @@ namespace VISU //--------------------------------------------------------------- template + inline bool CreatePrs3d(VisuGUI* theModule, _PTR(SObject) theTimeStamp, @@ -166,9 +177,10 @@ namespace VISU //--------------------------------------------------------------- template + 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 + inline void CreatePrs3d(VisuGUI* theModule, - const bool theIsCreateView = false) + const bool theIsCreateView = true) { CreatePrs3d(theModule,theIsCreateView); } -- 2.39.2