]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchAPI/SketchAPI_IntersectionPoint.cpp
Salome HOME
Add IntersectionPoint
[modules/shaper.git] / src / SketchAPI / SketchAPI_IntersectionPoint.cpp
diff --git a/src/SketchAPI/SketchAPI_IntersectionPoint.cpp b/src/SketchAPI/SketchAPI_IntersectionPoint.cpp
new file mode 100644 (file)
index 0000000..e2e8f88
--- /dev/null
@@ -0,0 +1,62 @@
+// Name   : SketchAPI_IntersectionPoint.cpp
+// Purpose: 
+//
+// History:
+// 15/06/16 - Sergey POKHODENKO - Creation of the file
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI_IntersectionPoint.h"
+//--------------------------------------------------------------------------------------
+#include <GeomAPI_Pnt2d.h>
+//--------------------------------------------------------------------------------------
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+//--------------------------------------------------------------------------------------
+SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
+    const std::shared_ptr<ModelAPI_Feature> & theFeature)
+: SketchAPI_SketchEntity(theFeature)
+{
+  initialize();
+}
+
+SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
+    const std::shared_ptr<ModelAPI_Feature> & theFeature,
+    const ModelHighAPI_Selection & theExternal )
+: SketchAPI_SketchEntity(theFeature)
+{
+  if (initialize()) {
+    setByExternalLine(theExternal);
+  }
+}
+
+SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
+    const std::shared_ptr<ModelAPI_Feature> & theFeature,
+    const std::string & theExternalName )
+: SketchAPI_SketchEntity(theFeature)
+{
+  if (initialize()) {
+    setByExternalLineName(theExternalName);
+  }
+}
+
+SketchAPI_IntersectionPoint::~SketchAPI_IntersectionPoint()
+{
+
+}
+
+//--------------------------------------------------------------------------------------
+void SketchAPI_IntersectionPoint::setByExternalLine(const ModelHighAPI_Selection & theExternalLine)
+{
+  fillAttribute(theExternalLine, externalLine());
+
+  execute();
+}
+
+void SketchAPI_IntersectionPoint::setByExternalLineName(const std::string & theExternalLineName)
+{
+  fillAttribute(ModelHighAPI_Selection("EDGE", theExternalLineName), externalLine());
+
+  execute();
+}
+
+//--------------------------------------------------------------------------------------