Set empty selected feature to edit line operation in order to it is aborted by this.
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
boost::shared_ptr<ModelAPI_Feature> aFeature;
+ // only first selected shape is processed
if (!aList.IsEmpty()) {
- const TopoDS_Shape& aShape = aList.First();
- aFeature = aDisplayer->GetFeature(aShape);
- aPreviewOp->setSelected(aFeature, aShape);
+ aFeature = aDisplayer->GetFeature(aList.First());
}
+ aPreviewOp->setSelected(aFeature, !aList.IsEmpty() ? aList.First() : TopoDS_Shape());
}
}
}
void PartSet_OperationSketch::setSelected(boost::shared_ptr<ModelAPI_Feature> theFeature,
const TopoDS_Shape& theShape)
{
+ if (theShape.IsNull())
+ return;
+
if (!myIsEditMode) {
setSketchPlane(theShape);
myIsEditMode = true;