From 1d954dcdc96d30d30d446395408ac7d22192c2cc Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 12 Feb 2010 11:50:56 +0000 Subject: [PATCH] Issue 0020629: EDF 1178 GUI : Keyboard free style in the OCC viewer --- doc/salome/gui/images/image110.png | Bin 0 -> 782 bytes doc/salome/gui/images/occviewer_toolbar.png | Bin 8726 -> 8517 bytes doc/salome/gui/input/occ_3d_viewer.doc | 9 ++ doc/salome/gui/input/vtk_3d_viewer.doc | 9 ++ src/LightApp/LightApp_Application.cxx | 40 ++++++-- src/LightApp/resources/LightApp.xml | 1 + src/OCCViewer/OCCViewer_ViewModel.cxx | 58 ++++++++++- src/OCCViewer/OCCViewer_ViewModel.h | 7 ++ src/OCCViewer/OCCViewer_ViewWindow.cxx | 96 +++++++++++++++--- src/OCCViewer/OCCViewer_ViewWindow.h | 10 +- src/OCCViewer/resources/OCCViewer_images.ts | 4 + src/OCCViewer/resources/OCCViewer_msg_en.ts | 8 ++ .../resources/occ_view_style_switch.png | Bin 0 -> 782 bytes src/SUIT/SUIT_ViewModel.cxx | 48 ++++++--- src/SUIT/SUIT_ViewModel.h | 20 ++-- src/SVTK/resources/SVTK_msg_en.ts | 2 +- src/SalomeApp/resources/SalomeApp.xml | 1 + 17 files changed, 263 insertions(+), 50 deletions(-) create mode 100755 doc/salome/gui/images/image110.png create mode 100755 src/OCCViewer/resources/occ_view_style_switch.png diff --git a/doc/salome/gui/images/image110.png b/doc/salome/gui/images/image110.png new file mode 100755 index 0000000000000000000000000000000000000000..b0a9c807e016446374173db06507c4d237312483 GIT binary patch literal 782 zcmV+p1M&QcP)_#cKcn03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00MGJL_t&-)76tdOB_KM z#(#6Spd0VpfEGCmvA8QN6zl}WN))tA<0mj5z%P}`P7WeSG(`kO1uZN@(GX77^KLJ< zx3jZ5JCnlPq48hRC2uwJ!26p&&-226S+}>hc5Q9Vo}8T6zwH&>g|&C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zUl<$MvuBYdEeSyejlWba9pUDd5${zf+bOoIn(%j>Ke1@ul-T7ln=6gjEcl=0FTGI* z6NwKu=|cv3$`BM#pm%;*j8c4c1HE5jK8V8ywBbTS(jU&5(cXyEh6!87oM#W12DrX~ z>hi=cN69JHkSPy+-X*ouqB|XgtY)|Z1nZhg_v^*cvx2>x;#|y8pz$~g^dd0mq zPIURD3?G3sC+zpEF3#vvYD$s-mDCcX5Xb~MDB0rgi-+Ceu}8+-+(l{>H>W*+lk+V& z?$3hw_Q|4>$z+{-|1J?f^3PZk08)*%-|pZ^gSEm!a+oNKLz0(ER0w>%g!J9l&T0A( z)oqSBs%Lh_Vl7b=mOaShQV+YwSxm?MNGH&O8Ci27vnn#uGUG*-ojdgT4pvR|5~%zY z4~MlhR(e$nOzn1MtxZxt9;a%;Gsxc=-Z8rRq-)kkKXY-NVOc4#o*u>h;1QU}5?1qN zeGCd#R4U}0sO{10Qy+z-K6-guhv~LabNmP6PKOP5^zXIkh0*k6V2+B}i z$;(HS7gW_A?m3Ve-_P@x8@gd{c(8VXgo!Ehq-aEi9JncI?dCM|iw50x+L-x9!yL80 zyWdN1LwbDfM08LKBCOzT`>MxhmNl3wCCT)(i2XFKU;I&!L#WY91HjZ;4cr#WYvE!v zLqQLV1`j`hcH@mNsG8D$>xcCXz`(Aa@}C1}EXJ9$7O)Ti98V{D*z}*)tuK2>P4J z7|8?BUFPcXr(TYkUlxahu%K05v|<(Un%t@tzovO}+&(zzqf+g@{HI?Z_22@3$sW;& z6d>fIbl>FgjeN}?$CftlA?mrL2&i+-*Z!7(?0#u;l#l)s5QN0OwZ8xL(VFQ}UJxLP
+\image html image110.png +\n
Interaction style switch - allows to switch between standard and +"keyboard free" interaction styles. "Keyboard free" style allow to process all +view transformations without using keyboard (only by mouse) and perform selection +in view by pressing "S" key. By default, rotation in this mode is performed by +left mouse button, panning - by middle mouse button, zooming - by left and middle +mouse buttons pressed simultaneously.
+
+ \image html image88.png \n
Show/Hide Trihedron - shows or hides coordinate axes.

diff --git a/doc/salome/gui/input/vtk_3d_viewer.doc b/doc/salome/gui/input/vtk_3d_viewer.doc index fbbd88850..8c4361de8 100644 --- a/doc/salome/gui/input/vtk_3d_viewer.doc +++ b/doc/salome/gui/input/vtk_3d_viewer.doc @@ -15,6 +15,15 @@ button. or jpeg image format.
+\image html image110.png +\n
Interaction style switch - allows to switch between standard and +"keyboard free" interaction styles. "Keyboard free" style allow to process all +view transformations without using keyboard (only by mouse) and perform selection +in view by pressing "S" key. By default, rotation in this mode is performed by +left mouse button, panning - by middle mouse button, zooming - by left and middle +mouse buttons pressed simultaneously.
+
+ \image html image88.png \n
Show/Hide Trihedron - shows or hides coordinate axes.

diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 8257b5f33..02a85782a 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1349,6 +1349,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType u = resMgr->integerValue( "OCCViewer", "iso_number_u", u ); v = resMgr->integerValue( "OCCViewer", "iso_number_v", v ); vm->setIsos( u, v ); + vm->setInteractionStyle( resMgr->integerValue( "OCCViewer", "navigation_mode", vm->interactionStyle() ) ); viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr ); } @@ -1914,6 +1915,19 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "min", 0, isoV ); pref->setItemProperty( "max", 100000, isoV ); + int occStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), occGroup, + LightApp_Preferences::Selector, "OCCViewer", "navigation_mode" ); + QStringList aStyleModeList; + aStyleModeList.append( tr("PREF_STANDARD_STYLE") ); + aStyleModeList.append( tr("PREF_KEYFREE_STYLE") ); + + QList aModeIndexesList; + aModeIndexesList.append(0); + aModeIndexesList.append(1); + + pref->setItemProperty( "strings", aStyleModeList, occStyleMode ); + pref->setItemProperty( "indexes", aModeIndexesList, occStyleMode ); + // VTK Viewer int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame ); pref->setItemProperty( "columns", 2, vtkGen ); @@ -1924,10 +1938,6 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) aProjModeList.append( tr("PREF_ORTHOGRAPHIC") ); aProjModeList.append( tr("PREF_PERSPECTIVE") ); - QList aModeIndexesList; - aModeIndexesList.append(0); - aModeIndexesList.append(1); - pref->setItemProperty( "strings", aProjModeList, vtkProjMode ); pref->setItemProperty( "indexes", aModeIndexesList, vtkProjMode ); @@ -1944,9 +1954,6 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) int vtkStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), vtkGen, LightApp_Preferences::Selector, "VTKViewer", "navigation_mode" ); - QStringList aStyleModeList; - aStyleModeList.append( tr("PREF_STANDARD_STYLE") ); - aStyleModeList.append( tr("PREF_KEYFREE_STYLE") ); pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode ); pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode ); @@ -2180,6 +2187,25 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString } #endif +#ifndef DISABLE_OCCVIEWER + if ( sec == QString( "OCCViewer" ) && param == QString( "navigation_mode" ) ) + { + int mode = resMgr->integerValue( "OCCViewer", "navigation_mode", 0 ); + QList lst; + viewManagers( OCCViewer_Viewer::Type(), lst ); + QListIterator it( lst ); + while ( it.hasNext() ) + { + SUIT_ViewModel* vm = it.next()->getViewModel(); + if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) ) + continue; + + OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm; + occVM->setInteractionStyle( mode ); + } + } +#endif + #ifndef DISABLE_VTKVIEWER if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) ) { diff --git a/src/LightApp/resources/LightApp.xml b/src/LightApp/resources/LightApp.xml index 42ea7105b..706db084f 100644 --- a/src/LightApp/resources/LightApp.xml +++ b/src/LightApp/resources/LightApp.xml @@ -118,6 +118,7 @@ +
diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 9e9753410..f931e0cdf 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,9 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTri myAISContext->Deactivate(myTrihedron); } + // set interaction style to standard + myInteractionStyle = 0; + // selection mySelectionEnabled = true; myMultiSelectionEnabled = true; @@ -153,6 +157,7 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view ) if ( view ) { view->initLayout(); view->initSketchers(); + view->setInteractionStyle( interactionStyle() ); OCCViewer_ViewPort3d* vp3d = view->getViewPort(); if ( vp3d ) @@ -187,6 +192,9 @@ void OCCViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) connect(theViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)), this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*))); + + connect(theViewManager, SIGNAL(keyPress(SUIT_ViewWindow*, QKeyEvent*)), + this, SLOT(onKeyPress(SUIT_ViewWindow*, QKeyEvent*))); } } @@ -228,9 +236,11 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t if (theEvent->button() != Qt::LeftButton) return; if (!theWindow->inherits("OCCViewer_ViewWindow")) return; + OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow; + if (!aView || aView->interactionStyle() != SUIT_ViewModel::STANDARD) + return; myEndPnt.setX(theEvent->x()); myEndPnt.setY(theEvent->y()); - OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow; bool aHasShift = (theEvent->modifiers() & Qt::ShiftModifier); if (!aHasShift) emit deselection(); @@ -270,6 +280,52 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t emit selectionChanged(); } +/*! + SLOT: called on key press, processes selection in "key free" interaction style +*/ +void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEvent) +{ + if (!mySelectionEnabled) return; + if (theEvent->key() != Qt::Key_S) return; + if (!theWindow->inherits("OCCViewer_ViewWindow")) return; + + OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow; + if (!aView || aView->interactionStyle() != SUIT_ViewModel::KEY_FREE) + return; + + emit deselection(); + myAISContext->Select(); + + emit selectionChanged(); +} + +/*! + \return interaction style +*/ +int OCCViewer_Viewer::interactionStyle() const +{ + return myInteractionStyle; +} + +/*! + Sets interaction style: 0 - standard, 1 - keyboard free interaction + \param theStyle - new interaction style +*/ +void OCCViewer_Viewer::setInteractionStyle( const int theStyle ) +{ + myInteractionStyle = theStyle; + //!! To be done for view windows + if ( !myViewManager ) + return; + + QVector wins = myViewManager->getViews(); + for ( int i = 0; i < (int)wins.count(); i++ ) + { + OCCViewer_ViewWindow* win = ::qobject_cast( wins.at( i ) ); + if ( win ) + win->setInteractionStyle( theStyle ); + } +} /*! Sets selection enabled status diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index 9bf960ef9..40c4e495f 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -33,6 +33,7 @@ #include #include +class QKeyEvent; class QMouseEvent; class SUIT_ViewWindow; @@ -124,6 +125,9 @@ public: Handle(AIS_InteractiveContext) getAISContext() const { return myAISContext; } Handle(AIS_Trihedron) getTrihedron() const { return myTrihedron; } + int interactionStyle() const; + void setInteractionStyle( const int ); + void enableSelection(bool isEnabled); bool isSelectionEnabled() const { return mySelectionEnabled; } @@ -156,6 +160,7 @@ protected slots: void onMousePress(SUIT_ViewWindow*, QMouseEvent*); void onMouseMove(SUIT_ViewWindow*, QMouseEvent*); void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*); + void onKeyPress(SUIT_ViewWindow*, QKeyEvent*); void onDumpView(); void onChangeBgColor(); @@ -169,6 +174,8 @@ private: viewAspectList myViewAspects; + int myInteractionStyle; + bool mySelectionEnabled; bool myMultiSelectionEnabled; diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 7bef0551e..65f1bc061 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -214,6 +215,8 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop* theDesktop, mypSketcher = 0; myCurSketch = -1; + + myInteractionStyle = SUIT_ViewModel::STANDARD; } /*! @@ -255,17 +258,18 @@ void OCCViewer_ViewWindow::initLayout() \return type of the operation */ OCCViewer_ViewWindow::OperationType -OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent ) +OCCViewer_ViewWindow::getButtonState( QMouseEvent* theEvent, int theInteractionStyle ) { OperationType aOp = NOTHING; - if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ZOOM]) && - (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ZOOM]) ) + SUIT_ViewModel::InteractionStyle aStyle = (SUIT_ViewModel::InteractionStyle)theInteractionStyle; + if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::ZOOM]) && + (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::ZOOM]) ) aOp = ZOOMVIEW; - else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::PAN]) && - (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::PAN]) ) + else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::PAN]) && + (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::PAN]) ) aOp = PANVIEW; - else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[SUIT_ViewModel::ROTATE]) && - (theEvent->button() == SUIT_ViewModel::myButtonMap[SUIT_ViewModel::ROTATE]) ) + else if( (theEvent->modifiers() == SUIT_ViewModel::myStateMap[aStyle][SUIT_ViewModel::ROTATE]) && + (theEvent->buttons() == SUIT_ViewModel::myButtonMap[aStyle][SUIT_ViewModel::ROTATE]) ) aOp = ROTATE; return aOp; @@ -315,6 +319,10 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e ) } return true; + case QEvent::KeyPress: + emit keyPressed(this, (QKeyEvent*) e); + return true; + default: break; } @@ -339,6 +347,17 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) { myStartX = theEvent->x(); myStartY = theEvent->y(); + int anInteractionStyle = interactionStyle(); + + // in "key free" interaction style zoom operation is activated by two buttons (simultaneously pressed), + // which are assigned for pan and rotate - these operations are activated immediately after pressing + // of the first button, so it is necessary to switch to zoom when the second button is pressed + bool aSwitchToZoom = false; + if ( anInteractionStyle == SUIT_ViewModel::KEY_FREE && + ( myOperation == PANVIEW || myOperation == ROTATE ) ) { + aSwitchToZoom = getButtonState( theEvent, anInteractionStyle ) == ZOOMVIEW; + } + switch ( myOperation ) { case WINDOWFIT: if ( theEvent->button() == Qt::LeftButton ) @@ -356,20 +375,24 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent ) break; case PANVIEW: - if ( theEvent->button() == Qt::LeftButton ) + if ( aSwitchToZoom ) + activateZoom(); + else if ( theEvent->button() == Qt::LeftButton ) emit vpTransformationStarted ( PANVIEW ); break; case ROTATE: - if ( theEvent->button() == Qt::LeftButton ) { - myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint); - emit vpTransformationStarted ( ROTATE ); - } + if ( aSwitchToZoom ) + activateZoom(); + else if ( theEvent->button() == Qt::LeftButton ) { + myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint); + emit vpTransformationStarted ( ROTATE ); + } break; default: /* Try to activate a transformation */ - switch ( getButtonState(theEvent) ) { + switch ( getButtonState(theEvent, anInteractionStyle) ) { case ZOOMVIEW: activateZoom(); break; @@ -743,7 +766,9 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent ) { int aState = theEvent->modifiers(); int aButton = theEvent->buttons(); - if ( aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) { + int anInteractionStyle = interactionStyle(); + if ( anInteractionStyle == SUIT_ViewModel::STANDARD && + aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) { myDrawRect = myEnableDrawMode; if ( myDrawRect ) { drawRect(); @@ -755,7 +780,8 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent ) } } } - else if ( aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) { + else if ( anInteractionStyle == SUIT_ViewModel::STANDARD && + aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) { OCCViewer_ViewSketcher* sketcher = 0; QList::Iterator it; for ( it = mySketchers.begin(); it != mySketchers.end() && !sketcher; ++it ) @@ -1099,6 +1125,14 @@ void OCCViewer_ViewWindow::createActions() aAction->setStatusTip(tr("DSC_AMBIENT")); connect(aAction, SIGNAL(triggered()), this, SLOT(onAmbientToogle())); toolMgr()->registerAction( aAction, AmbientId ); + + // Switch between interaction styles + aAction = new QtxAction(tr("MNU_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ), + tr( "MNU_STYLE_SWITCH" ), 0, this); + aAction->setStatusTip(tr("DSC_STYLE_SWITCH")); + aAction->setCheckable(true); + connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool))); + toolMgr()->registerAction( aAction, SwitchInteractionStyleId ); } /*! @@ -1109,6 +1143,7 @@ void OCCViewer_ViewWindow::createToolBar() int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false ); toolMgr()->append( DumpId, tid ); + toolMgr()->append( SwitchInteractionStyleId, tid ); if( myModel->trihedronActivated() ) toolMgr()->append( TrihedronShowId, tid ); @@ -1425,6 +1460,37 @@ void OCCViewer_ViewWindow::onTrihedronShow() myModel->toggleTrihedron(); } +/*! + \brief Switches "keyboard free" interaction style on/off +*/ +void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool on ) +{ + myInteractionStyle = on ? (int)SUIT_ViewModel::KEY_FREE : (int)SUIT_ViewModel::STANDARD; + + // update action state if method is called outside + QtxAction* a = dynamic_cast( toolMgr()->action( SwitchInteractionStyleId ) ); + if ( a->isChecked() != on ) + a->setChecked( on ); +} + +/*! + \brief Get current interaction style + \return interaction style +*/ +int OCCViewer_ViewWindow::interactionStyle() const +{ + return myInteractionStyle; +} + +/*! + \brief Set current interaction style + \param theStyle interaction style +*/ +void OCCViewer_ViewWindow::setInteractionStyle( const int theStyle ) +{ + onSwitchInteractionStyle( theStyle == (int)SUIT_ViewModel::KEY_FREE ); +} + /*! \brief Dump view window contents to the pixmap. \return pixmap containing all scene rendered in the window diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index b9c736756..15fd3b61a 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -49,7 +49,7 @@ public: enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, ChangeRotationPointId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId, - TrihedronShowId, AxialScaleId, AmbientId }; + TrihedronShowId, AxialScaleId, AmbientId, SwitchInteractionStyleId }; enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE, PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW, @@ -84,6 +84,9 @@ public: OCCViewer_ViewSketcher* getSketcher( const int ); void activateSketching( int ); + + int interactionStyle() const; + void setInteractionStyle( const int ); public slots: void onFrontView(); @@ -109,6 +112,7 @@ public slots: void onRestoreView(); void onTrihedronShow(); void setRestoreFlag(); + void onSwitchInteractionStyle( bool on ); void activateSetRotationGravity(); void activateSetRotationSelected( double theX, double theY, double theZ ); @@ -151,7 +155,7 @@ protected: void createActions(); void createToolBar(); - virtual OperationType getButtonState(QMouseEvent* theEvent); + virtual OperationType getButtonState(QMouseEvent* theEvent, int theInteractionStyle); viewAspect getViewParams() const; @@ -203,6 +207,8 @@ private: QtxAction* mySetRotationPointAction; QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band + + int myInteractionStyle; }; #ifdef WIN32 diff --git a/src/OCCViewer/resources/OCCViewer_images.ts b/src/OCCViewer/resources/OCCViewer_images.ts index 895d4198a..843e89684 100644 --- a/src/OCCViewer/resources/OCCViewer_images.ts +++ b/src/OCCViewer/resources/OCCViewer_images.ts @@ -116,5 +116,9 @@ ICON_OCCVIEWER_AMBIENT occ_view_ambient.png + + ICON_OCCVIEWER_STYLE_SWITCH + occ_view_style_switch.png + diff --git a/src/OCCViewer/resources/OCCViewer_msg_en.ts b/src/OCCViewer/resources/OCCViewer_msg_en.ts index c2fecf77b..6e88f1909 100644 --- a/src/OCCViewer/resources/OCCViewer_msg_en.ts +++ b/src/OCCViewer/resources/OCCViewer_msg_en.ts @@ -236,6 +236,14 @@ MNU_AMBIENT Toogle keep only ambient light + + DSC_STYLE_SWITCH + Interaction style switch + + + MNU_STYLE_SWITCH + Interaction style switch + OCC_IMAGE_FILES Images Files (*.bmp *.png *.jpg *.jpeg) diff --git a/src/OCCViewer/resources/occ_view_style_switch.png b/src/OCCViewer/resources/occ_view_style_switch.png new file mode 100755 index 0000000000000000000000000000000000000000..b0a9c807e016446374173db06507c4d237312483 GIT binary patch literal 782 zcmV+p1M&QcP)_#cKcn03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00MGJL_t&-)76tdOB_KM z#(#6Spd0VpfEGCmvA8QN6zl}WN))tA<0mj5z%P}`P7WeSG(`kO1uZN@(GX77^KLJ< zx3jZ5JCnlPq48hRC2uwJ!26p&&-226S+}>hc5Q9Vo}8T6zwH&>g|&CRQc8PpaKPc= zAtNIr3=a>Zl%iIvQ7)I6nVAuP3_LwOwU?Kd%+Ai@x-P9&3&+WkWrj4>?CtFVu(Y)F z2r9&#l)En;9UZZ_xQOezB#Gkco6qO3mwd0?5Hy=qDiw?|?Ck73`xOs>j^h9jh9N4J z1nrcMpDfic4UCDoxw&C_dYU+nIX^$QuL8T*w${?=L=3*kh?5o$DI8 z&-3s+k9VaJ0E~e+mObFu*cjW}+bE@MUtgbi^2uqMJ{bh9Goq-2Qi@zIhcO1NHRI#s z?C$QqZp!b6NGXw0qP0eAO&EsM>vde$LoB+2u@iHQl0kB2qAD?m;U~Klu|@dL=Xf7K|mOWWLbvRnnI!Q@+`O8ZM(j{&fMG_tyT+T3|W?; zltM~Lnx;68gAjuK{e4zfR~Z@_65R|x0s>rIT-a*0N~KaEpU StatesMap; - typedef QMap ButtonsMap; + typedef QMap StatesMap; + typedef QMap ButtonsMap; + + typedef QMap InteractionStyle2StatesMap; + typedef QMap InteractionStyle2ButtonsMap; SUIT_ViewModel(); virtual ~SUIT_ViewModel(); @@ -63,17 +67,17 @@ public: virtual void contextMenuPopup( QMenu* ) {} - static void setHotButton( HotOperation theOper, Qt::KeyboardModifier theState, - Qt::MouseButton theButton ); - static void getHotButton( HotOperation theOper, Qt::KeyboardModifier& theState, - Qt::MouseButton& theButton ); + static void setHotButton( InteractionStyle theInteractionStyle, HotOperation theOper, + Qt::KeyboardModifiers theState, Qt::MouseButtons theButton ); + static void getHotButton( InteractionStyle theInteractionStyle, HotOperation theOper, + Qt::KeyboardModifiers& theState, Qt::MouseButtons& theButton ); protected: SUIT_ViewManager* myViewManager; public: - static StatesMap myStateMap; - static ButtonsMap myButtonMap; + static InteractionStyle2StatesMap myStateMap; + static InteractionStyle2ButtonsMap myButtonMap; }; #ifdef WIN32 diff --git a/src/SVTK/resources/SVTK_msg_en.ts b/src/SVTK/resources/SVTK_msg_en.ts index a747d7b2b..ea331dcb4 100644 --- a/src/SVTK/resources/SVTK_msg_en.ts +++ b/src/SVTK/resources/SVTK_msg_en.ts @@ -202,7 +202,7 @@ DSC_SVTK_STYLE_SWITCH - Interactiion style switch + Interaction style switch MNU_SVTK_STYLE_SWITCH diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index 38ab2e1a1..75dd79a4a 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -125,6 +125,7 @@ +
-- 2.39.2