From 47e1c85bc167fcc508761d28a3113b63fdde3d4a Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 14 Jul 2016 16:00:02 +0300 Subject: [PATCH] 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. --- src/PartSet/PartSet_WidgetMultiSelector.cpp | 7 +++++-- src/PartSet/PartSet_WidgetShapeSelector.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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; } } -- 2.39.2