X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNewGeom%2FNewGeom_SalomeViewer.cpp;h=6803bfe8c910d1d64672832c4c29af4d5c6fe480;hb=21e765709ef191519dc14463ce5ce90c2d62cc04;hp=a9b8065198911abc86788bec6f9c0842edaade92;hpb=a63f4aea8cf064bae8339c926584316f218d98d5;p=modules%2Fshaper.git diff --git a/src/NewGeom/NewGeom_SalomeViewer.cpp b/src/NewGeom/NewGeom_SalomeViewer.cpp index a9b806519..6803bfe8c 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.cpp +++ b/src/NewGeom/NewGeom_SalomeViewer.cpp @@ -8,6 +8,8 @@ #include +#include + #include #include @@ -116,8 +118,8 @@ void NewGeom_SalomeViewer::setSelector(NewGeom_OCCSelector* theSel) this, SLOT(onDeleteView(SUIT_ViewWindow*))); connect(aMgr, SIGNAL(viewCreated(SUIT_ViewWindow*)), this, SLOT(onViewCreated(SUIT_ViewWindow*))); - connect(aMgr, SIGNAL(activated(SUIT_ViewWindow*)), - this, SLOT(onActivated(SUIT_ViewWindow*))); + connect(aMgr, SIGNAL(activated(SUIT_ViewManager*)), + this, SLOT(onActivated(SUIT_ViewManager*))); connect(aMgr, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)), this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*))); @@ -246,9 +248,9 @@ void NewGeom_SalomeViewer::onViewCreated(SUIT_ViewWindow* theView) } //********************************************** -void NewGeom_SalomeViewer::onActivated(SUIT_ViewWindow* theView) +void NewGeom_SalomeViewer::onActivated(SUIT_ViewManager* theMgr) { - myView->setCurrentView(theView); + myView->setCurrentView(theMgr->getActiveView()); emit activated(myView); } @@ -333,6 +335,21 @@ void NewGeom_SalomeViewer::removeSelectionFilter(const Handle(SelectMgr_Filter)& } } +//*************************************** +bool NewGeom_SalomeViewer::hasSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) +{ + bool aFoundFilter = false; + Handle(AIS_InteractiveContext) aContext = AISContext(); + if (!aContext.IsNull()) { + const SelectMgr_ListOfFilter& aFilters = aContext->Filters(); + SelectMgr_ListIteratorOfListOfFilter aIt(aFilters); + for (; aIt.More() && !aFoundFilter; aIt.Next()) { + aFoundFilter = theFilter.Access() == aIt.Value().Access(); + } + } + return aFoundFilter; +} + //*************************************** void NewGeom_SalomeViewer::clearSelectionFilters() {