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:
wmayer
2022-12-12 16:41:58 +01:00
parent 79aa19d920
commit 184afd9761
8 changed files with 29 additions and 56 deletions

View File

@@ -326,7 +326,7 @@ void ViewProviderPoints::clipPointsCallback(void *, SoEventCallback * n)
if (clPoly.front() != clPoly.back())
clPoly.push_back(clPoly.front());
std::vector<Gui::ViewProvider*> views = view->getDocument()->getViewProvidersOfType(ViewProviderPoints::getClassTypeId());
std::vector<Gui::ViewProvider*> views = view->getViewProvidersOfType(ViewProviderPoints::getClassTypeId());
for (std::vector<Gui::ViewProvider*>::iterator it = views.begin(); it != views.end(); ++it) {
ViewProviderPoints* that = static_cast<ViewProviderPoints*>(*it);
if (that->getEditingMode() > -1) {