From: nds Date: Thu, 14 Jul 2016 13:00:02 +0000 (+0300) Subject: Issue #1618 naming in sketch is broken: external object creation should use the shape... X-Git-Tag: V_2.5.0~192 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=47e1c85bc167fcc508761d28a3113b63fdde3d4a;p=modules%2Fshaper.git Issue #1618 naming in sketch is broken: external object creation should use the shape on the object given as a parameter of this function. Otherwise the linkage to the source result is lost and such a wrong case happens. --- diff --git a/src/PartSet/PartSet_WidgetMultiSelector.cpp b/src/PartSet/PartSet_WidgetMultiSelector.cpp index 13a832a68..f5e368bc9 100755 --- a/src/PartSet/PartSet_WidgetMultiSelector.cpp +++ b/src/PartSet/PartSet_WidgetMultiSelector.cpp @@ -75,7 +75,7 @@ void PartSet_WidgetMultiSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr // there is no a sketch feature is selected, but the shape exists, try to create an exernal object // TODO: unite with the same functionality in PartSet_WidgetShapeSelector if (aSPFeature.get() == NULL) { - theObject = ObjectPtr(); + ObjectPtr anExternalObject = ObjectPtr(); if (myExternalObjectMgr->useExternal()) { GeomShapePtr aShape = theShape; if (!aShape.get()) { @@ -84,7 +84,10 @@ void PartSet_WidgetMultiSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr aShape = aResult->shape(); } if (aShape.get() != NULL && !aShape->isNull()) - theObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate); + anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate); } + /// the object is null if the selected feature is "external"(not sketch entity feature of the + /// current sketch) and it is not created by object manager + theObject = anExternalObject; } } diff --git a/src/PartSet/PartSet_WidgetShapeSelector.cpp b/src/PartSet/PartSet_WidgetShapeSelector.cpp index a502fcdfa..e815b7dc9 100755 --- a/src/PartSet/PartSet_WidgetShapeSelector.cpp +++ b/src/PartSet/PartSet_WidgetShapeSelector.cpp @@ -79,7 +79,7 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr // there is no a sketch feature is selected, but the shape exists, try to create an exernal object // TODO: unite with the same functionality in PartSet_WidgetShapeSelector if (aSPFeature.get() == NULL) { - theObject = ObjectPtr(); + ObjectPtr anExternalObject = ObjectPtr(); if (myExternalObjectMgr->useExternal()) { GeomShapePtr aShape = theShape; if (!aShape.get()) { @@ -88,8 +88,11 @@ void PartSet_WidgetShapeSelector::getGeomSelection(const ModuleBase_ViewerPrsPtr aShape = aResult->shape(); } if (aShape.get() != NULL && !aShape->isNull()) - theObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate); + anExternalObject = myExternalObjectMgr->externalObject(theObject, aShape, sketch(), myIsInValidate); } + /// the object is null if the selected feature is "external"(not sketch entity feature of the + /// current sketch) and it is not created by object manager + theObject = anExternalObject; } }