1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name : SketchAPI_IntersectionPoint.cpp
6 // 16/06/16 - Sergey POKHODENKO - Creation of the file
8 //--------------------------------------------------------------------------------------
9 #include "SketchAPI_IntersectionPoint.h"
10 //--------------------------------------------------------------------------------------
11 #include <GeomAPI_Pnt2d.h>
12 //--------------------------------------------------------------------------------------
13 #include <ModelHighAPI_Dumper.h>
14 #include <ModelHighAPI_Selection.h>
15 #include <ModelHighAPI_Tools.h>
16 //--------------------------------------------------------------------------------------
17 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
18 const std::shared_ptr<ModelAPI_Feature> & theFeature)
19 : SketchAPI_SketchEntity(theFeature)
24 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
25 const std::shared_ptr<ModelAPI_Feature> & theFeature,
26 const ModelHighAPI_Selection & theExternal )
27 : SketchAPI_SketchEntity(theFeature)
30 setByExternalLine(theExternal);
34 SketchAPI_IntersectionPoint::SketchAPI_IntersectionPoint(
35 const std::shared_ptr<ModelAPI_Feature> & theFeature,
36 const std::string & theExternalName )
37 : SketchAPI_SketchEntity(theFeature)
40 setByExternalLineName(theExternalName);
44 SketchAPI_IntersectionPoint::~SketchAPI_IntersectionPoint()
49 //--------------------------------------------------------------------------------------
50 void SketchAPI_IntersectionPoint::setByExternalLine(const ModelHighAPI_Selection & theExternalLine)
52 fillAttribute(theExternalLine, externalLine());
57 void SketchAPI_IntersectionPoint::setByExternalLineName(const std::string & theExternalLineName)
59 fillAttribute(ModelHighAPI_Selection("EDGE", theExternalLineName), externalLine());
64 //--------------------------------------------------------------------------------------
66 void SketchAPI_IntersectionPoint::dump(ModelHighAPI_Dumper& theDumper) const
68 FeaturePtr aBase = feature();
69 const std::string& aSketchName = theDumper.parentName(aBase);
71 AttributeSelectionPtr aLine = externalLine();
72 theDumper << aBase << " = " <<
73 aSketchName << ".addIntersectionPoint(" << aLine << ")" << std::endl;
74 // dump "auxiliary" flag if necessary
75 SketchAPI_SketchEntity::dump(theDumper);