1 // Name : SketchAPI_Point.cpp
5 // 15/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_Point.h"
9 //--------------------------------------------------------------------------------------
10 #include <GeomAPI_Pnt2d.h>
11 //--------------------------------------------------------------------------------------
12 #include <ModelHighAPI_Selection.h>
13 #include <ModelHighAPI_Tools.h>
14 //--------------------------------------------------------------------------------------
15 SketchAPI_Point::SketchAPI_Point(
16 const std::shared_ptr<ModelAPI_Feature> & theFeature)
17 : SketchAPI_SketchEntity(theFeature)
22 SketchAPI_Point::SketchAPI_Point(
23 const std::shared_ptr<ModelAPI_Feature> & theFeature,
24 double theX, double theY)
25 : SketchAPI_SketchEntity(theFeature)
28 setCoordinates(theX, theY);
32 SketchAPI_Point::SketchAPI_Point(
33 const std::shared_ptr<ModelAPI_Feature> & theFeature,
34 const std::shared_ptr<GeomAPI_Pnt2d> & thePoint)
35 : SketchAPI_SketchEntity(theFeature)
38 setCoordinates(thePoint);
42 SketchAPI_Point::SketchAPI_Point(
43 const std::shared_ptr<ModelAPI_Feature> & theFeature,
44 const ModelHighAPI_Selection & theExternal )
45 : SketchAPI_SketchEntity(theFeature)
48 setByExternal(theExternal);
52 SketchAPI_Point::SketchAPI_Point(
53 const std::shared_ptr<ModelAPI_Feature> & theFeature,
54 const std::string & theExternalName )
55 : SketchAPI_SketchEntity(theFeature)
58 setByExternalName(theExternalName);
62 SketchAPI_Point::~SketchAPI_Point()
67 //--------------------------------------------------------------------------------------
68 void SketchAPI_Point::setCoordinates(
69 double theX, double theY)
71 fillAttribute(coordinates(), theX, theY);
76 void SketchAPI_Point::setCoordinates(
77 const std::shared_ptr<GeomAPI_Pnt2d> & thePoint)
79 fillAttribute(thePoint, coordinates());
84 void SketchAPI_Point::setByExternal(const ModelHighAPI_Selection & theExternal)
86 fillAttribute(theExternal, external());
91 void SketchAPI_Point::setByExternalName(const std::string & theExternalName)
93 fillAttribute(ModelHighAPI_Selection("VERTEX", theExternalName), external());
98 //--------------------------------------------------------------------------------------