+ aView3d->DepthFitAll();
+ }
+ }
+}
+
+//***************************************
+void NewGeom_SalomeViewer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
+{
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull()) {
+ aContext->AddFilter(theFilter);
+ }
+}
+
+//***************************************
+void NewGeom_SalomeViewer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
+{
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull()) {
+ aContext->RemoveFilter(theFilter);
+ }
+}
+
+//***************************************
+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()
+{
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull()) {
+ aContext->RemoveFilters();
+ }
+}
+
+//***************************************
+void NewGeom_SalomeViewer::update()
+{
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aContext.IsNull()) {
+ aContext->UpdateCurrentViewer();
+ }
+}
+
+//***************************************
+void NewGeom_SalomeViewer::onViewTransformed(OCCViewer_ViewWindow::OperationType theType)
+{
+ emit viewTransformed((int) theType);
+}
+
+//***************************************
+void NewGeom_SalomeViewer::activateViewer(bool toActivate)
+{
+ if (!mySelector || !mySelector->viewer())
+ return;
+ SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager();
+ QVector<SUIT_ViewWindow*> aViews = aMgr->getViews();
+ if (toActivate) {
+ foreach (SUIT_ViewWindow* aView, aViews) {
+ OCCViewer_ViewFrame* aOCCView = dynamic_cast<OCCViewer_ViewFrame*>(aView);
+ OCCViewer_ViewWindow* aWnd = aOCCView->getView(OCCViewer_ViewFrame::MAIN_VIEW);
+ connect(aWnd, SIGNAL(vpTransformationFinished(OCCViewer_ViewWindow::OperationType)),
+ this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType)));