Salome HOME
Redisplay sketch features only for the active sketch (on appearance of the "Fully...
[modules/shaper.git] / src / PartSet / PartSet_WidgetPoint2d.cpp
index dc799cef9cd57be39cc2b542faceb8af0ade6af0..9af640db2587e46b0a5c021e4e1fb6771aea32e0 100644 (file)
@@ -343,7 +343,7 @@ bool PartSet_WidgetPoint2D::setPoint(double theX, double theY)
 bool PartSet_WidgetPoint2D::storeValueCustom()
 {
   std::shared_ptr<ModelAPI_Data> aData = myFeature->data();
-  if (!aData) // can be on abort of sketcher element
+  if (!aData || !aData->isValid()) // can be on abort of sketcher element
     return false;
   AttributePoint2DPtr aPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
       aData->attribute(attributeID()));
@@ -442,14 +442,17 @@ QList<QWidget*> PartSet_WidgetPoint2D::getControls() const
   return aControls;
 }
 
+//********************************************************************
+void PartSet_WidgetPoint2D::selectionModes(int& theModuleSelectionModes, QIntList& theModes)
+{
+  theModuleSelectionModes = -1;
+  theModes << TopAbs_VERTEX;
+  theModes << TopAbs_EDGE;
+}
 
+//********************************************************************
 void PartSet_WidgetPoint2D::activateCustom()
 {
-  QIntList aModes;
-  aModes << TopAbs_VERTEX;
-  aModes << TopAbs_EDGE;
-  myWorkshop->activateSubShapesSelection(aModes);
-
   if (!isEditingMode()) {
     FeaturePtr aFeature = feature();
     if (aFeature.get() && aFeature->getKind() == SketchPlugin_Point::ID())
@@ -472,7 +475,6 @@ void PartSet_WidgetPoint2D::deactivate()
     storeValue();
 
   ModuleBase_ModelWidget::deactivate();
-  myWorkshop->deactivateSubShapesSelection();
 }
 
 bool PartSet_WidgetPoint2D::getPoint2d(const Handle(V3d_View)& theView,