1 // Name : SketchAPI_IntersectionPoint.cpp
5 // 16/06/16 - Sergey POKHODENKO - Creation of the file
7 //--------------------------------------------------------------------------------------
8 #include "SketchAPI_IntersectionPoint.h"
9 //--------------------------------------------------------------------------------------
10 #include <GeomAPI_Pnt2d.h>
11 //--------------------------------------------------------------------------------------
12 #include <ModelHighAPI_Dumper.h>
13 #include <ModelHighAPI_Selection.h>
14 #include <ModelHighAPI_Tools.h>
15 //--------------------------------------------------------------------------------------
16 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
17 const std::shared_ptr<ModelAPI_Feature> & theFeature)
18 : SketchAPI_SketchEntity(theFeature)
23 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
24 const std::shared_ptr<ModelAPI_Feature> & theFeature,
25 const ModelHighAPI_Selection & theExternal )
26 : SketchAPI_SketchEntity(theFeature)
29 setByExternalLine(theExternal);
33 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
34 const std::shared_ptr<ModelAPI_Feature> & theFeature,
35 const std::string & theExternalName )
36 : SketchAPI_SketchEntity(theFeature)
39 setByExternalLineName(theExternalName);
43 SketchAPI_IntersectionPoint::~SketchAPI_IntersectionPoint()
48 //--------------------------------------------------------------------------------------
49 void SketchAPI_IntersectionPoint::setByExternalLine(const ModelHighAPI_Selection & theExternalLine)
51 fillAttribute(theExternalLine, externalLine());
56 void SketchAPI_IntersectionPoint::setByExternalLineName(const std::string & theExternalLineName)
58 fillAttribute(ModelHighAPI_Selection("EDGE", theExternalLineName), externalLine());
63 //--------------------------------------------------------------------------------------
65 void SketchAPI_IntersectionPoint::dump(ModelHighAPI_Dumper& theDumper) const
67 FeaturePtr aBase = feature();
68 const std::string& aSketchName = theDumper.parentName(aBase);
70 AttributeSelectionPtr aLine = externalLine();
71 theDumper << aBase << " = " << aSketchName << ".addIntersectionPoint(" << aLine << ")" << std::endl;
72 // dump "auxiliary" flag if necessary
73 SketchAPI_SketchEntity::dump(theDumper);