]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 29 Apr 2014 06:05:59 +0000 (10:05 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 29 Apr 2014 06:05:59 +0000 (10:05 +0400)
Conflicts:
src/PartSet/PartSet_Module.cpp

1  2 
src/PartSet/PartSet_Module.cpp
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index 4d0b8867e05f7b09761547a7703032ecae08f3d2,8acf0c38cb12232c1f6dfee1ff79ceb63e266e74..bc383d3019f745a6025c688d96652a46685c3315
@@@ -9,7 -11,8 +11,9 @@@
  #include <XGUI_Viewer.h>
  #include <XGUI_Workshop.h>
  #include <XGUI_OperationMgr.h>
+ #include <XGUI_ViewWindow.h>
 +#include <XGUI_SelectionMgr.h>
+ #include <XGUI_ViewPort.h>
  
  #include <Config_PointerMessage.h>
  #include <Config_ModuleReader.h>
@@@ -136,11 -153,37 +154,37 @@@ void PartSet_Module::onMouseReleased(QP
    ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
    PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
    if (aPreviewOp) {
 -    XGUI_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
 -    if (aViewer) {
 +    XGUI_SelectionMgr* aSelector = myWorkshop->selector();
 +    if (aSelector) {
        NCollection_List<TopoDS_Shape> 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<PartSet_OperationSketchBase*>(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);
+         }
+       }
      }
    }
  }
index 51bc022d5b58210b620cb1434d4b8de9decf2336,127949282264d046762516c3e67a01ff0d1b46b7..2655b569456ab43b28ea6227a5a35987696e4185
@@@ -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<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
 +    boost::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
 +    if (aDocRef)
 +      aMgr->setCurrentDocument(aDocRef->value());
 +  }
 +}
 +
 +//******************************************************
 +void XGUI_Workshop::salomeViewerSelectionChanged()
 +{
 +  emit salomeViewerSelection();
++}
Simple merge