]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchAPI/SketchAPI_Sketch.cpp
Salome HOME
Add SketchAPI_Point
[modules/shaper.git] / src / SketchAPI / SketchAPI_Sketch.cpp
index 8d24c1534e739f54b875adf7050afd6981f2fdec..cdac5d4c5912966298d2224773e8fa8f351caf56 100644 (file)
@@ -34,6 +34,7 @@
 #include "SketchAPI_Arc.h"
 #include "SketchAPI_Circle.h"
 #include "SketchAPI_Line.h"
+#include "SketchAPI_Point.h"
 //--------------------------------------------------------------------------------------
 SketchAPI_Sketch::SketchAPI_Sketch(
     const std::shared_ptr<ModelAPI_Feature> & theFeature)
@@ -147,6 +148,30 @@ SketchPtr addSketch(const std::shared_ptr<ModelAPI_Document> & thePart,
   return SketchPtr(new SketchAPI_Sketch(aFeature, ModelHighAPI_Selection("FACE", theExternalName)));
 }
 
+//--------------------------------------------------------------------------------------
+std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(
+    double theX, double theY)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+  return PointPtr(new SketchAPI_Point(aFeature, theX, theY));
+}
+std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(
+    const std::shared_ptr<GeomAPI_Pnt2d> & thePoint)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+  return PointPtr(new SketchAPI_Point(aFeature, thePoint));
+}
+std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const ModelHighAPI_Selection & theExternal)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+  return PointPtr(new SketchAPI_Point(aFeature, theExternal));
+}
+std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const std::string & theExternalName)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Point::ID());
+  return PointPtr(new SketchAPI_Point(aFeature, theExternalName));
+}
+
 //--------------------------------------------------------------------------------------
 std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(double theX1, double theY1, double theX2, double theY2)
 {