Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_OperationSketch.cpp
index 7eca33e4376d08d47fde5f9426dca70928480d5e..b583c1e808eabb794953ee6385b88525504316fe 100644 (file)
@@ -30,14 +30,12 @@ PartSet_OperationSketch::~PartSet_OperationSketch()
 {
 }
 
-bool PartSet_OperationSketch::isPerformedImmediately() const
+int PartSet_OperationSketch::getSelectionMode(boost::shared_ptr<ModelAPI_Feature> theFeature) const
 {
-  return false;
-}
-
-int PartSet_OperationSketch::getSelectionMode() const
-{
-  return TopAbs_FACE;
+  int aMode = TopAbs_FACE;
+  if (isEditMode())
+    aMode = TopAbs_VERTEX;
+  return aMode;
 }
 
 void PartSet_OperationSketch::setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList)
@@ -45,6 +43,9 @@ void PartSet_OperationSketch::setSelectedShapes(const NCollection_List<TopoDS_Sh
   if (theList.IsEmpty())
     return;
 
+  if (isEditMode())
+    return;
+
   // get selected shape
   const TopoDS_Shape& aShape = theList.First();
   boost::shared_ptr<GeomAPI_Shape> aGShape(new GeomAPI_Shape);
@@ -80,7 +81,7 @@ void PartSet_OperationSketch::setSelectedShapes(const NCollection_List<TopoDS_Sh
   aDirY->setValue(aC, anA, aB);
 
   boost::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
-  emit viewerProjectionChange(aDir->x(), aDir->y(), aDir->z());
+  emit planeSelected(aDir->x(), aDir->y(), aDir->z());
 
   //commit();
   //SketchPlugin_Sketch::setActive(myFeature);