Salome HOME
Process history pointer
[modules/shaper.git] / src / NewGeom / NewGeom_SalomeViewer.cpp
index a9b8065198911abc86788bec6f9c0842edaade92..6803bfe8c910d1d64672832c4c29af4d5c6fe480 100644 (file)
@@ -8,6 +8,8 @@
 
 #include <SUIT_ViewManager.h>
 
+#include <SelectMgr_ListIteratorOfListOfFilter.hxx>
+
 #include <QMouseEvent>
 #include <QContextMenuEvent>
 
@@ -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()
 {