1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 #include "SketchPlugin_Feature.h"
4 #include "SketchPlugin_Sketch.h"
5 #include <ModelAPI_Document.h>
6 #include <ModelAPI_Data.h>
7 #include <ModelAPI_Object.h>
8 #include <ModelAPI_AttributeRefList.h>
9 #include <ModelAPI_ResultConstruction.h>
11 SketchPlugin_Feature::SketchPlugin_Feature()
16 SketchPlugin_Sketch* SketchPlugin_Feature::sketch()
19 // find sketch that references to this feature
20 const std::set<AttributePtr>& aBackRefs = data()->refsToMe();
21 std::set<AttributePtr>::const_iterator aBackRef = aBackRefs.begin();
22 for(; aBackRef != aBackRefs.end(); aBackRef++) {
23 std::shared_ptr<SketchPlugin_Sketch> aSketch =
24 std::dynamic_pointer_cast<SketchPlugin_Sketch>((*aBackRef)->owner());
26 mySketch = aSketch.get();