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 a31b15217a
commit 67be01f3ac
5 changed files with 9 additions and 9 deletions

View File

@@ -485,7 +485,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n)
n->setHandled();
// check if we have picked one a node of the view provider we are insterested in
Gui::ViewProvider* vp = static_cast<Gui::ViewProvider*>(view->getViewProviderByPath(point->getPath()));
Gui::ViewProvider* vp = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
if (vp && vp->getTypeId().isDerivedFrom(ViewProviderInspection::getClassTypeId())) {
ViewProviderInspection* that = static_cast<ViewProviderInspection*>(vp);
QString info = that->inspectDistance(point);
@@ -505,7 +505,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n)
const SoPickedPointList& pps = action.getPickedPointList();
for (int i=0; i<pps.getLength(); ++i) {
const SoPickedPoint * point = pps[i];
vp = static_cast<Gui::ViewProvider*>(view->getViewProviderByPath(point->getPath()));
vp = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
if (vp && vp->getTypeId().isDerivedFrom(ViewProviderInspection::getClassTypeId())) {
ViewProviderInspection* that = static_cast<ViewProviderInspection*>(vp);
QString info = that->inspectDistance(point);