From: vsv Date: Tue, 21 Apr 2015 14:31:36 +0000 (+0300) Subject: Provide view transformation signal in Salome viewer X-Git-Tag: V_1.2.0~188 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0eb89d31b37c6e7c1bb6459f06c9ced0cd3960d2;p=modules%2Fshaper.git Provide view transformation signal in Salome viewer --- diff --git a/src/NewGeom/NewGeom_SalomeViewer.cpp b/src/NewGeom/NewGeom_SalomeViewer.cpp index 86e2d8f1b..8bc67c748 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.cpp +++ b/src/NewGeom/NewGeom_SalomeViewer.cpp @@ -3,7 +3,6 @@ #include "NewGeom_SalomeViewer.h" #include "NewGeom_OCCSelector.h" -#include #include #include @@ -231,12 +230,21 @@ void NewGeom_SalomeViewer::onDeleteView(SUIT_ViewWindow*) void NewGeom_SalomeViewer::onViewCreated(SUIT_ViewWindow* theView) { myView->setCurrentView(theView); + + OCCViewer_ViewFrame* aView = dynamic_cast(theView); + + OCCViewer_ViewWindow* aWnd = aView->getView(OCCViewer_ViewFrame::MAIN_VIEW); + if (aWnd) + connect(aWnd, SIGNAL(vpTransformationFinished(OCCViewer_ViewWindow::OperationType)), + this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType))); + emit viewCreated(myView); } //********************************************** -void NewGeom_SalomeViewer::onActivated(SUIT_ViewWindow*) +void NewGeom_SalomeViewer::onActivated(SUIT_ViewWindow* theView) { + myView->setCurrentView(theView); emit activated(myView); } @@ -338,3 +346,9 @@ void NewGeom_SalomeViewer::update() aContext->UpdateCurrentViewer(); } } + +//*************************************** +void NewGeom_SalomeViewer::onViewTransformed(OCCViewer_ViewWindow::OperationType theType) +{ + emit viewTransformed((int) theType); +} diff --git a/src/NewGeom/NewGeom_SalomeViewer.h b/src/NewGeom/NewGeom_SalomeViewer.h index 6dbd6b6df..b02058daa 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.h +++ b/src/NewGeom/NewGeom_SalomeViewer.h @@ -9,6 +9,8 @@ #include #include +#include + #include class SUIT_ViewWindow; @@ -138,6 +140,7 @@ Q_OBJECT void onActivated(SUIT_ViewWindow*); void onSelectionChanged(); + void onViewTransformed(OCCViewer_ViewWindow::OperationType); private: NewGeom_OCCSelector* mySelector; diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index c32ceab8a..cf300615a 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -105,10 +105,11 @@ void XGUI_ViewerProxy::connectToViewer() this, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*))); connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged())); + + connect(aViewer, SIGNAL(viewTransformed(int)), this, SIGNAL(viewTransformed(int))); + connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), this, SIGNAL(contextMenuRequested(QContextMenuEvent*))); - - // TODO: Connect to ViewTransformation signal } else { AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); @@ -300,7 +301,9 @@ bool XGUI_ViewerProxy::canDragByMouse() const } } +//*************************************** void XGUI_ViewerProxy::onViewTransformed(AppElements_ViewWindow::OperationType theType) { emit viewTransformed((int) theType); -} \ No newline at end of file +} +