Gui: use SoMouseWheelEvent in navigation styles

This commit is contained in:
DeepSOIC
2020-08-21 03:58:18 +03:00
committed by wwmayer
parent 68848ea9f8
commit b200801ebc
10 changed files with 34 additions and 65 deletions

View File

@@ -37,6 +37,7 @@
#endif
#include <Inventor/sensors/SoTimerSensor.h>
#include "SoMouseWheelEvent.h"
#include <App/Application.h>
#include "NavigationStyle.h"
@@ -284,14 +285,6 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
}
this->button3down = press;
break;
case SoMouseButtonEvent::BUTTON4:
doZoom(viewer->getSoRenderManager()->getCamera(), true, posn);
processed = true;
break;
case SoMouseButtonEvent::BUTTON5:
doZoom(viewer->getSoRenderManager()->getCamera(), false, posn);
processed = true;
break;
default:
break;
}
@@ -396,7 +389,9 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
// If not handled in this class, pass on upwards in the inheritance
// hierarchy.
if ((curmode == NavigationStyle::SELECTION ||
if (ev->isOfType(SoMouseWheelEvent::getClassTypeId()))
processed = inherited::processSoEvent(ev);
else if ((curmode == NavigationStyle::SELECTION ||
newmode == NavigationStyle::SELECTION ||
viewer->isEditing()) && !processed)
processed = inherited::processSoEvent(ev);