From: vsv Date: Tue, 29 Apr 2014 06:05:59 +0000 (+0400) Subject: Merge branch 'master' of newgeom:newgeom X-Git-Tag: V_0.2~109^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8396394eba586fc212fe4cb3e1e838a54ebf4ffe;p=modules%2Fshaper.git Merge branch 'master' of newgeom:newgeom Conflicts: src/PartSet/PartSet_Module.cpp --- 8396394eba586fc212fe4cb3e1e838a54ebf4ffe diff --cc src/PartSet/PartSet_Module.cpp index 4d0b8867e,8acf0c38c..bc383d301 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@@ -9,7 -11,8 +11,9 @@@ #include #include #include + #include +#include + #include #include #include @@@ -136,11 -153,37 +154,37 @@@ void PartSet_Module::onMouseReleased(QP ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation(); PartSet_OperationSketchBase* aPreviewOp = dynamic_cast(anOperation); if (aPreviewOp) { - XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); - if (aViewer) { + XGUI_SelectionMgr* aSelector = myWorkshop->selector(); + if (aSelector) { NCollection_List aList; - aViewer->getSelectedShapes(aList); - XGUI_ViewWindow* aWindow = aViewer->activeViewWindow(); + aSelector->selectedShapes(aList); - aPreviewOp->setSelectedShapes(aList); ++ XGUI_ViewWindow* aWindow = myWorkshop->mainWindow()->viewer()->activeViewWindow(); + if (aWindow) { + Handle(V3d_View) aView3d = aWindow->viewPort()->getView(); + if ( !aView3d.IsNull() ) { + gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(thePoint, aView3d); + aPreviewOp->setSelectedShapes(aList, aPoint); + } + } + } + } + } + + void PartSet_Module::onMouseMoved(QPoint thePoint) + { + ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation(); + PartSet_OperationSketchBase* aPreviewOp = dynamic_cast(anOperation); + if (aPreviewOp) { + XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); + if (aViewer) { + XGUI_ViewWindow* aWindow = aViewer->activeViewWindow(); + if (aWindow) { + Handle(V3d_View) aView3d = aWindow->viewPort()->getView(); + if ( !aView3d.IsNull() ) { + gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(thePoint, aView3d); + aPreviewOp->setMouseMovePoint(aPoint); + } + } } } } diff --cc src/XGUI/XGUI_Workshop.cpp index 51bc022d5,127949282..2655b5694 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@@ -59,8 -60,8 +60,9 @@@ XGUI_Workshop::XGUI_Workshop(XGUI_Salom // So, displayer will be created on demand. mySelector = new XGUI_SelectionMgr(this); + connect(mySelector, SIGNAL(selectionChanged()), this, SLOT(changeCurrentDocument())); myOperationMgr = new XGUI_OperationMgr(this); + myActionsMgr = new XGUI_ActionsMgr(this); connect(myOperationMgr, SIGNAL(operationStarted()), this, SLOT(onOperationStarted())); connect(myOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)), this, SLOT(onOperationStopped(ModuleBase_Operation*))); @@@ -610,25 -608,3 +609,25 @@@ XGUI_Displayer* XGUI_Workshop::displaye } return myDisplayer; } + +//****************************************************** +void XGUI_Workshop::changeCurrentDocument() +{ + QFeatureList aFeatures = objectBrowser()->selectedFeatures(); + + // Set current document + if (aFeatures.size() > 0) { + FeaturePtr aFeature = aFeatures.first(); + + boost::shared_ptr aMgr = ModelAPI_PluginManager::get(); + boost::shared_ptr aDocRef = aFeature->data()->docRef("PartDocument"); + if (aDocRef) + aMgr->setCurrentDocument(aDocRef->value()); + } +} + +//****************************************************** +void XGUI_Workshop::salomeViewerSelectionChanged() +{ + emit salomeViewerSelection(); - } ++}