make mesh picking working for view providers underneath a Part container

This commit is contained in:
wmayer
2019-11-09 11:16:23 +01:00
parent ac4e23012a
commit f2bd624c63
5 changed files with 9 additions and 9 deletions

View File

@@ -1525,7 +1525,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n)
// By specifying the indexed mesh node 'pcFaceSet' we make sure that the picked point is
// really from the mesh we render and not from any other geometry
Gui::ViewProvider* vp = static_cast<Gui::ViewProvider*>(view->getViewProviderByPath(point->getPath()));
Gui::ViewProvider* vp = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
if (!vp || !vp->getTypeId().isDerivedFrom(ViewProviderMesh::getClassTypeId()))
return;
@@ -1599,7 +1599,7 @@ void ViewProviderMesh::fillHoleCallback(void * ud, SoEventCallback * n)
// By specifying the indexed mesh node 'pcFaceSet' we make sure that the picked point is
// really from the mesh we render and not from any other geometry
Gui::ViewProvider* vp = static_cast<Gui::ViewProvider*>(view->getViewProviderByPath(point->getPath()));
Gui::ViewProvider* vp = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
if (!vp || !vp->getTypeId().isDerivedFrom(ViewProviderMesh::getClassTypeId()))
return;
ViewProviderMesh* that = static_cast<ViewProviderMesh*>(vp);
@@ -1666,7 +1666,7 @@ void ViewProviderMesh::markPartCallback(void * ud, SoEventCallback * n)
// By specifying the indexed mesh node 'pcFaceSet' we make sure that the picked point is
// really from the mesh we render and not from any other geometry
Gui::ViewProvider* vp = static_cast<Gui::ViewProvider*>(view->getViewProviderByPath(point->getPath()));
Gui::ViewProvider* vp = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
if (!vp || !vp->getTypeId().isDerivedFrom(ViewProviderMesh::getClassTypeId()))
return;
ViewProviderMesh* that = static_cast<ViewProviderMesh*>(vp);