Gui: fix View3DInventorViewer's getViewProviderByPath, getViewProviderByPathFromTail, getViewProvidersOfType
The View3DInventorViewer only contains the top-level view providers which caused unexpected behaviour when using the three methods above. Thus, in client code they haven't been used any more. Now the methods internally invoke the corresponding methods of the document. This allows it in client code to directly call the appropriate methods again (LoD).
This commit is contained in:
@@ -537,7 +537,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 = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
|
||||
Gui::ViewProvider* vp = view->getViewProviderByPathFromTail(point->getPath());
|
||||
if (vp && vp->getTypeId().isDerivedFrom(ViewProviderInspection::getClassTypeId())) {
|
||||
ViewProviderInspection* that = static_cast<ViewProviderInspection*>(vp);
|
||||
QString info = that->inspectDistance(point);
|
||||
@@ -557,7 +557,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 = view->getDocument()->getViewProviderByPathFromTail(point->getPath());
|
||||
vp = view->getViewProviderByPathFromTail(point->getPath());
|
||||
if (vp && vp->getTypeId().isDerivedFrom(ViewProviderInspection::getClassTypeId())) {
|
||||
ViewProviderInspection* self = static_cast<ViewProviderInspection*>(vp);
|
||||
QString info = self->inspectDistance(point);
|
||||
|
||||
Reference in New Issue
Block a user