X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_OperationSketch.cpp;h=e57a113b73ebc39cc1a6cd82a708afc48c8c795d;hb=ad247cf594a7a560b656c70c96e1b1a360b8c1c3;hp=4c4aa241db6b01c3237c72cf9789ec955f7ed7ca;hpb=00e166f80c6501ef008ea4c9a1fd57b8c69f0202;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index 4c4aa241d..e57a113b7 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -57,19 +57,11 @@ boost::shared_ptr PartSet_OperationSketch::sketch() const } void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected) + const std::list& /*theSelected*/, + const std::list& theHighlighted) { - myFeatures = theSelected; -} - -void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView, - const std::list& theSelected) -{ - if (theSelected.empty()) - return; - if (!myIsEditMode) { - XGUI_ViewerPrs aPrs = theSelected.front(); + XGUI_ViewerPrs aPrs = theHighlighted.front(); const TopoDS_Shape& aShape = aPrs.shape(); if (!aShape.IsNull()) { setSketchPlane(aShape); @@ -77,13 +69,14 @@ void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_Vi } } else { - if (theSelected.size() == 1) { - boost::shared_ptr aFeature = theSelected.front().feature(); + if (theHighlighted.size() == 1) { + boost::shared_ptr aFeature = theHighlighted.front().feature(); if (aFeature) emit launchOperation(PartSet_OperationEditLine::Type(), aFeature); } + else + myFeatures = theHighlighted; } - myFeatures.clear(); } void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) @@ -100,7 +93,7 @@ void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) } std::map, boost::shared_ptr > - PartSet_OperationSketch::preview() const + PartSet_OperationSketch::subPreview() const { std::map, boost::shared_ptr > aPreviewMap; @@ -122,6 +115,13 @@ std::map, boost::shared_ptr > return aPreviewMap; } +void PartSet_OperationSketch::stopOperation() +{ + PartSet_OperationSketchBase::stopOperation(); + emit featureConstructed(feature(), FM_Hide); + emit closeLocalContext(); +} + void PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape) { if (theShape.IsNull()) @@ -160,5 +160,10 @@ void PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape) boost::dynamic_pointer_cast(aData->attribute(SKETCH_ATTR_DIRY)); aDirY->setValue(aC, anA, aB); boost::shared_ptr aDir = aPlane->direction(); + + flushUpdated(); + + emit featureConstructed(feature(), FM_Hide); + emit closeLocalContext(); emit planeSelected(aDir->x(), aDir->y(), aDir->z()); }