1 // Name : SketchAPI_Line.h
5 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_SKETCHAPI_SKETCHAPI_LINE_H_
8 #define SRC_SKETCHAPI_SKETCHAPI_LINE_H_
10 //--------------------------------------------------------------------------------------
11 #include "SketchAPI.h"
13 #include <GeomDataAPI_Point2D.h>
15 #include <SketchPlugin_Line.h>
17 #include <ModelHighAPI_Interface.h>
18 #include <ModelHighAPI_Macro.h>
19 //--------------------------------------------------------------------------------------
20 class ModelHighAPI_Selection;
21 //--------------------------------------------------------------------------------------
22 /**\class SketchAPI_Line
24 * \brief Interface for Line feature
26 class SketchAPI_Line : public ModelHighAPI_Interface
29 /// Constructor without values
31 explicit SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature);
32 /// Constructor with values
34 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
35 double theX1, double theY1, double theX2, double theY2);
36 /// Constructor with values
38 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
39 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
40 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
41 /// Constructor with values
43 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
44 const ModelHighAPI_Selection & theExternal);
45 /// Constructor with values
47 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
48 const std::string & theExternalName);
51 virtual ~SketchAPI_Line();
53 INTERFACE_3(SketchPlugin_Line::ID(),
54 startPoint, SketchPlugin_Line::START_ID(), GeomDataAPI_Point2D, /** Start point */,
55 endPoint, SketchPlugin_Line::END_ID(), GeomDataAPI_Point2D, /** End point */,
56 external, SketchPlugin_Line::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
59 /// Set by coordinates
61 void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
65 void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
66 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
70 void setByExternal(const ModelHighAPI_Selection & theExternal);
72 /// Set by external name
74 void setByExternalName(const std::string & theExternalName);
78 void setStartPoint(double theX, double theY);
82 void setStartPoint(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
86 void setEndPoint(double theX, double theY);
90 void setEndPoint(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
93 //! Pointer on Line object
94 typedef std::shared_ptr<SketchAPI_Line> LinePtr;
96 //--------------------------------------------------------------------------------------
97 //--------------------------------------------------------------------------------------
98 #endif /* SRC_SKETCHAPI_SKETCHAPI_LINE_H_ */