Salome HOME
addIntersectionPoint for SketchAPI_Sketch
[modules/shaper.git] / src / SketchAPI / SketchAPI_IntersectionPoint.cpp
1 // Name   : SketchAPI_IntersectionPoint.cpp
2 // Purpose: 
3 //
4 // History:
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
6
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_IntersectionPoint.h"
9 //--------------------------------------------------------------------------------------
10 #include <GeomAPI_Pnt2d.h>
11 //--------------------------------------------------------------------------------------
12 #include <ModelHighAPI_Selection.h>
13 #include <ModelHighAPI_Tools.h>
14 //--------------------------------------------------------------------------------------
15 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
16     const std::shared_ptr<ModelAPI_Feature> & theFeature)
17 : SketchAPI_SketchEntity(theFeature)
18 {
19   initialize();
20 }
21
22 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
23     const std::shared_ptr<ModelAPI_Feature> & theFeature,
24     const ModelHighAPI_Selection & theExternal )
25 : SketchAPI_SketchEntity(theFeature)
26 {
27   if (initialize()) {
28     setByExternalLine(theExternal);
29   }
30 }
31
32 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
33     const std::shared_ptr<ModelAPI_Feature> & theFeature,
34     const std::string & theExternalName )
35 : SketchAPI_SketchEntity(theFeature)
36 {
37   if (initialize()) {
38     setByExternalLineName(theExternalName);
39   }
40 }
41
42 SketchAPI_IntersectionPoint::~SketchAPI_IntersectionPoint()
43 {
44
45 }
46
47 //--------------------------------------------------------------------------------------
48 void SketchAPI_IntersectionPoint::setByExternalLine(const ModelHighAPI_Selection & theExternalLine)
49 {
50   fillAttribute(theExternalLine, externalLine());
51
52   execute();
53 }
54
55 void SketchAPI_IntersectionPoint::setByExternalLineName(const std::string & theExternalLineName)
56 {
57   fillAttribute(ModelHighAPI_Selection("EDGE", theExternalLineName), externalLine());
58
59   execute();
60 }
61
62 //--------------------------------------------------------------------------------------