move check for grabbed node and releasing it from ViewProviderDragger::unsetEditViewer to View3DInventorViewer::resetEditingViewProvider
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <Inventor/SoPrimitiveVertex.h>
|
||||
#include <Inventor/SbTesselator.h>
|
||||
#include <Inventor/SbViewportRegion.h>
|
||||
#include <Inventor/SoEventManager.h>
|
||||
#include <Inventor/actions/SoBoxHighlightRenderAction.h>
|
||||
#include <Inventor/actions/SoGetBoundingBoxAction.h>
|
||||
#include <Inventor/actions/SoGetMatrixAction.h>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
# include <GL/gl.h>
|
||||
# endif
|
||||
# include <Inventor/SbBox.h>
|
||||
# include <Inventor/SoEventManager.h>
|
||||
# include <Inventor/actions/SoGetBoundingBoxAction.h>
|
||||
# include <Inventor/actions/SoGetMatrixAction.h>
|
||||
# include <Inventor/actions/SoHandleEventAction.h>
|
||||
@@ -720,6 +721,13 @@ SbBool View3DInventorViewer::setEditingViewProvider(Gui::ViewProvider* p, int Mo
|
||||
void View3DInventorViewer::resetEditingViewProvider()
|
||||
{
|
||||
if (this->editViewProvider) {
|
||||
// In case the event action still has grabbed a node when leaving edit mode
|
||||
// force to release it now
|
||||
SoEventManager* mgr = this->getSoEventManager();
|
||||
SoHandleEventAction* heaction = mgr->getHandleEventAction();
|
||||
if (heaction && heaction->getGrabber())
|
||||
heaction->releaseGrabber();
|
||||
|
||||
this->editViewProvider->unsetEditViewer(this);
|
||||
removeEventCallback(SoEvent::getClassTypeId(), Gui::ViewProvider::eventCallback,this->editViewProvider);
|
||||
this->editViewProvider = 0;
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
# include <Inventor/SoPickedPoint.h>
|
||||
# include <Inventor/actions/SoRayPickAction.h>
|
||||
#endif
|
||||
# include <Inventor/SoEventManager.h>
|
||||
|
||||
/// Here the FreeCAD includes sorted by Base,App,Gui......
|
||||
#include "ViewProviderDragger.h"
|
||||
@@ -179,10 +178,6 @@ void ViewProviderDragger::setEditViewer(Gui::View3DInventorViewer* viewer, int M
|
||||
|
||||
void ViewProviderDragger::unsetEditViewer(Gui::View3DInventorViewer* viewer)
|
||||
{
|
||||
SoEventManager* mgr = viewer->getSoEventManager();
|
||||
SoHandleEventAction* heaction = mgr->getHandleEventAction();
|
||||
if (heaction && heaction->getGrabber())
|
||||
heaction->releaseGrabber();
|
||||
SoFCUnifiedSelection* selection = static_cast<SoFCUnifiedSelection*>(viewer->getSceneGraph());
|
||||
SoNode *child = selection->getChild(0);
|
||||
if (child && child->isOfType(SoPickStyle::getClassTypeId())) {
|
||||
|
||||
Reference in New Issue
Block a user