add method to get view that contains a given node
This commit is contained in:
@@ -1321,23 +1321,23 @@ MDIView* Document::getActiveView(void) const
|
||||
return active;
|
||||
}
|
||||
|
||||
Gui::MDIView* Document::getViewOfViewProvider(Gui::ViewProvider* vp) const
|
||||
Gui::MDIView* Document::getViewOfNode(SoNode* node) const
|
||||
{
|
||||
std::list<MDIView*> mdis = getMDIViewsOfType(View3DInventor::getClassTypeId());
|
||||
for (std::list<MDIView*>::const_iterator it = mdis.begin(); it != mdis.end(); ++it) {
|
||||
View3DInventor* view = static_cast<View3DInventor*>(*it);
|
||||
SoSearchAction searchAction;
|
||||
searchAction.setNode(vp->getRoot());
|
||||
searchAction.setInterest(SoSearchAction::FIRST);
|
||||
searchAction.apply(view->getViewer()->getSceneGraph());
|
||||
SoPath* selectionPath = searchAction.getPath();
|
||||
if (selectionPath)
|
||||
if (view->getViewer()->searchNode(node))
|
||||
return *it;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Gui::MDIView* Document::getViewOfViewProvider(Gui::ViewProvider* vp) const
|
||||
{
|
||||
return getViewOfNode(vp->getRoot());
|
||||
}
|
||||
|
||||
Gui::MDIView* Document::getEditingViewOfViewProvider(Gui::ViewProvider* vp) const
|
||||
{
|
||||
std::list<MDIView*> mdis = getMDIViewsOfType(View3DInventor::getClassTypeId());
|
||||
|
||||
Reference in New Issue
Block a user