}
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
-
+ myProxyViewer->activateViewer(true);
return isDone;
}
//******************************************************
bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy)
{
+ myProxyViewer->activateViewer(false);
setMenuShown(false);
setToolShown(false);
{
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)));
+ }
+ } else {
+ foreach (SUIT_ViewWindow* aView, aViews) {
+ OCCViewer_ViewFrame* aOCCView = dynamic_cast<OCCViewer_ViewFrame*>(aView);
+ OCCViewer_ViewWindow* aWnd = aOCCView->getView(OCCViewer_ViewFrame::MAIN_VIEW);
+ disconnect((OCCViewer_ViewWindow*)aWnd, SIGNAL(vpTransformationFinished(OCCViewer_ViewWindow::OperationType)),
+ this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType)));
+ }
+ }
+}
\ No newline at end of file
/// by mouse drugging. If this is impossible thet it has to return False.
virtual bool canDragByMouse() const;
+ /// Activate or deactivate viewer
+ /// \param toActivate - activation flag
+ void activateViewer(bool toActivate);
+
private slots:
void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);