Salome HOME
addIntersectionPoint for SketchAPI_Sketch
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 16 Jun 2016 11:37:06 +0000 (14:37 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 17 Jun 2016 11:41:11 +0000 (14:41 +0300)
src/SketchAPI/SketchAPI_IntersectionPoint.cpp
src/SketchAPI/SketchAPI_IntersectionPoint.h
src/SketchAPI/SketchAPI_Sketch.cpp
src/SketchAPI/SketchAPI_Sketch.h

index e2e8f88c73a8f44de2dc82613a6ff82d6c09ddaf..75ddb603ce5d90885d4bd94a725be5efa345c1d2 100644 (file)
@@ -2,7 +2,7 @@
 // Purpose: 
 //
 // History:
-// 15/06/16 - Sergey POKHODENKO - Creation of the file
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
 
 //--------------------------------------------------------------------------------------
 #include "SketchAPI_IntersectionPoint.h"
index bf5ce37e28602070434fbd3eb6135b4d58bcecd5..7f0bdfbd86fbb4502cedb33f64a3c75b68353c45 100644 (file)
@@ -2,7 +2,7 @@
 // Purpose: 
 //
 // History:
-// 15/06/16 - Sergey POKHODENKO - Creation of the file
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
 
 #ifndef SRC_SKETCHAPI_SKETCHAPI_INTERSECTIONPOINT_H_
 #define SRC_SKETCHAPI_SKETCHAPI_INTERSECTIONPOINT_H_
index 5f51c2592b71cfba4298d1c57a42299356f7a9a1..4accfa347f7b3ff542a119b81dcff82ff84e0827 100644 (file)
@@ -33,6 +33,7 @@
 //--------------------------------------------------------------------------------------
 #include "SketchAPI_Arc.h"
 #include "SketchAPI_Circle.h"
+#include "SketchAPI_IntersectionPoint.h"
 #include "SketchAPI_Line.h"
 #include "SketchAPI_Mirror.h"
 #include "SketchAPI_Point.h"
@@ -175,6 +176,20 @@ std::shared_ptr<SketchAPI_Point> SketchAPI_Sketch::addPoint(const std::string &
   return PointPtr(new SketchAPI_Point(aFeature, theExternalName));
 }
 
+//--------------------------------------------------------------------------------------
+std::shared_ptr<SketchAPI_IntersectionPoint> SketchAPI_Sketch::addIntersectionPoint(
+    const ModelHighAPI_Selection & theExternal)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID());
+  return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternal));
+}
+std::shared_ptr<SketchAPI_IntersectionPoint> SketchAPI_Sketch::addIntersectionPoint(
+    const std::string & theExternalName)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID());
+  return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternalName));
+}
+
 //--------------------------------------------------------------------------------------
 std::shared_ptr<SketchAPI_Line> SketchAPI_Sketch::addLine(double theX1, double theY1, double theX2, double theY2)
 {
index 3e77725be5ecd8ae70982c691a151f86d9641d0f..2f7694921e7c0c1574946c6f7f3cc31b7ec56986 100644 (file)
@@ -26,6 +26,7 @@ class ModelHighAPI_RefAttr;
 class ModelHighAPI_Selection;
 class SketchAPI_Arc;
 class SketchAPI_Circle;
+class SketchAPI_IntersectionPoint;
 class SketchAPI_Line;
 class SketchAPI_Mirror;
 class SketchAPI_Point;
@@ -89,6 +90,13 @@ public:
   SKETCHAPI_EXPORT
   std::shared_ptr<SketchAPI_Point> addPoint(const std::string & theExternalName);
 
+  /// Add intersection point
+  SKETCHAPI_EXPORT
+  std::shared_ptr<SketchAPI_IntersectionPoint> addIntersectionPoint(const ModelHighAPI_Selection & theExternal);
+  /// Add point
+  SKETCHAPI_EXPORT
+  std::shared_ptr<SketchAPI_IntersectionPoint> addIntersectionPoint(const std::string & theExternalName);
+
   /// Add line
   SKETCHAPI_EXPORT
   std::shared_ptr<SketchAPI_Line> addLine(