Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSet / PartSet_OperationSketch.cpp
index 48bd5f0e34de92fe5da62a1c6b2285c64155bd27..b583c1e808eabb794953ee6385b88525504316fe 100644 (file)
@@ -30,17 +30,22 @@ PartSet_OperationSketch::~PartSet_OperationSketch()
 {
 }
 
-int PartSet_OperationSketch::getSelectionMode() const
+int PartSet_OperationSketch::getSelectionMode(boost::shared_ptr<ModelAPI_Feature> theFeature) 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,
-                                                const gp_Pnt& theSelectedPoint)
+void PartSet_OperationSketch::setSelectedShapes(const NCollection_List<TopoDS_Shape>& theList)
 {
   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);
@@ -76,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);