Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_OperationSketch.cpp
index fdb56312b0aa0462f86fa5f147e7ca7bb8f349b4..6deab5b2801ddc8ff68401fefd96e418e62be863 100644 (file)
@@ -48,20 +48,9 @@ PartSet_OperationSketch::~PartSet_OperationSketch()
 {
 }
 
-std::list<int> PartSet_OperationSketch::getSelectionModes(ObjectPtr theFeature) const
+CompositeFeaturePtr PartSet_OperationSketch::sketch() const
 {
-  std::list<int> aModes;
-  if (!hasSketchPlane())
-    aModes.push_back(TopAbs_FACE);
-  else
-    aModes = PartSet_OperationSketchBase::getSelectionModes(theFeature);
-
-  return aModes;
-}
-
-FeaturePtr PartSet_OperationSketch::sketch() const
-{
-  return feature();
+  return boost::dynamic_pointer_cast<ModelAPI_CompositeFeature>(feature());
 }
 
 void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
@@ -154,8 +143,10 @@ void PartSet_OperationSketch::stopOperation()
 {
   PartSet_OperationSketchBase::stopOperation();
   emit featureConstructed(feature(), FM_Hide);
-  emit closeLocalContext();
+}
 
+void PartSet_OperationSketch::afterCommitOperation()
+{
   FeaturePtr aFeature = feature();
   std::list<ResultPtr> aResults = aFeature->results();
   std::list<ResultPtr>::const_iterator aIt;
@@ -240,7 +231,6 @@ void PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape)
   flushUpdated();
 
   emit featureConstructed(feature(), FM_Hide);
-  emit closeLocalContext();
   emit planeSelected(aDir->x(), aDir->y(), aDir->z());
 }