1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_WidgetShapeSelector.cpp
4 // Created: 27 Nov 2014
5 // Author: Vitaly Smetannikov
7 #include "PartSet_WidgetConstraintShapeSelector.h"
9 #include <ModelAPI_Session.h>
10 #include <ModelAPI_Validator.h>
12 #include <PartSet_Tools.h>
13 #include <SketchPlugin_Feature.h>
15 bool PartSet_WidgetConstraintShapeSelector::setObject(ObjectPtr theSelectedObject, GeomShapePtr theShape)
17 ObjectPtr aSelectedObject = theSelectedObject;
19 FeaturePtr aFeature = ModelAPI_Feature::feature(aSelectedObject);
21 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
22 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
23 if ((!aSPFeature) && (!theShape->isNull())) {
24 createExternal(theSelectedObject, theShape);
26 if (myExternalObject) {
27 aSelectedObject = myExternalObject;
32 return ModuleBase_WidgetShapeSelector::setObject(aSelectedObject, theShape);