if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
- myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView->getViewPort()->getView());
+ if ( isSelectionEnabled() )
+ myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView->getViewPort()->getView());
}
{
mySelectionEnabled = isEnabled;
//!! To be done for view windows
+ if ( !myViewManager )
+ return;
+
+ QPtrVector<SUIT_ViewWindow> wins = myViewManager->getViews();
+ for ( int i = 0; i < wins.count(); i++ )
+ {
+ OCCViewer_ViewWindow* win = ::qt_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+ if ( win )
+ win->updateEnabledDrawMode();
+ }
}
//*********************************************************************
{
myMultiSelectionEnabled = isEnable;
//!! To be done for view windows
+ if ( !myViewManager )
+ return;
+
+ QPtrVector<SUIT_ViewWindow> wins = myViewManager->getViews();
+ for ( int i = 0; i < wins.count(); i++ )
+ {
+ OCCViewer_ViewWindow* win = ::qt_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+ if ( win )
+ win->updateEnabledDrawMode();
+ }
}
//*********************************************************************
: SUIT_ViewWindow(theDesktop)
{
myModel = theModel;
- myEnableDrawMode = true;
myRestoreFlag = 0;
+ myEnableDrawMode = false;
+ updateEnabledDrawMode();
}
//****************************************************************
return SUIT_ViewWindow::eventFilter(watched, e);
}
+void OCCViewer_ViewWindow::updateEnabledDrawMode()
+{
+ if ( myModel )
+ myEnableDrawMode = myModel->isSelectionEnabled() && myModel->isMultiSelectionEnabled();
+}
//****************************************************************
void OCCViewer_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)