1 // File: PartSet_FeaturePrs.h
2 // Created: 04 Jun 2014
3 // Author: Natalia ERMOLAEVA
5 #include <PartSet_FeaturePointPrs.h>
6 #include <PartSet_Tools.h>
8 #include <SketchPlugin_Feature.h>
9 #include <SketchPlugin_Sketch.h>
10 #include <SketchPlugin_Point.h>
12 #include <GeomDataAPI_Point2D.h>
14 #include <ModelAPI_Data.h>
15 #include <ModelAPI_Document.h>
16 #include <ModelAPI_AttributeRefAttr.h>
17 #include <ModelAPI_AttributeRefList.h>
19 #include <Precision.hxx>
23 PartSet_FeaturePointPrs::PartSet_FeaturePointPrs(FeaturePtr theSketch)
24 : PartSet_FeaturePrs(theSketch)
28 PartSet_SelectionMode PartSet_FeaturePointPrs::setPoint(double theX, double theY,
29 const PartSet_SelectionMode& theMode)
31 PartSet_SelectionMode aMode = theMode;
35 PartSet_Tools::setFeaturePoint(feature(), theX, theY, POINT_ATTR_COORD);
45 std::string PartSet_FeaturePointPrs::getAttribute(const PartSet_SelectionMode& theMode) const
47 std::string aAttribute;
51 aAttribute = POINT_ATTR_COORD;
59 PartSet_SelectionMode PartSet_FeaturePointPrs::getNextMode(const std::string& theAttribute) const
61 PartSet_SelectionMode aMode;
63 if (theAttribute == POINT_ATTR_COORD)
68 boost::shared_ptr<GeomDataAPI_Point2D> PartSet_FeaturePointPrs::featurePoint
69 (const PartSet_SelectionMode& theMode)
71 std::string aPointArg;
75 aPointArg = POINT_ATTR_COORD;
80 boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
81 boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
82 (aData->attribute(aPointArg));