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::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) const
17 ObjectPtr aSelectedObject = theSelectedObject;
18 GeomShapePtr aShape = theShape;
20 FeaturePtr aFeature = ModelAPI_Feature::feature(aSelectedObject);
22 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
23 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
24 if ((!aSPFeature) && (!theShape->isNull())) {
25 ObjectPtr aObj = PartSet_Tools::createFixedObjectByExternal(theShape->impl<TopoDS_Shape>(),
26 aSelectedObject, mySketch);
28 PartSet_WidgetConstraintShapeSelector* that = (PartSet_WidgetConstraintShapeSelector*) this;
29 aSelectedObject = aObj;
34 return ModuleBase_WidgetShapeSelector::storeAttributeValues(theSelectedObject, theShape);