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 "SketchAPI_SketchEntity.h"
18 //--------------------------------------------------------------------------------------
19 class ModelHighAPI_Selection;
20 //--------------------------------------------------------------------------------------
21 /**\class SketchAPI_Line
23 * \brief Interface for Line feature
25 class SketchAPI_Line : public SketchAPI_SketchEntity
28 /// Constructor without values
30 explicit SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature);
31 /// Constructor with values
33 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
34 double theX1, double theY1, double theX2, double theY2);
35 /// Constructor with values
37 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
38 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
39 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
40 /// Constructor with values
42 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
43 const ModelHighAPI_Selection & theExternal);
44 /// Constructor with values
46 SketchAPI_Line(const std::shared_ptr<ModelAPI_Feature> & theFeature,
47 const std::string & theExternalName);
50 virtual ~SketchAPI_Line();
52 INTERFACE_3(SketchPlugin_Line::ID(),
53 startPoint, SketchPlugin_Line::START_ID(), GeomDataAPI_Point2D, /** Start point */,
54 endPoint, SketchPlugin_Line::END_ID(), GeomDataAPI_Point2D, /** End point */,
55 external, SketchPlugin_Line::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
58 /// Set by coordinates
60 void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
64 void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
65 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
69 void setByExternal(const ModelHighAPI_Selection & theExternal);
71 /// Set by external name
73 void setByExternalName(const std::string & theExternalName);
77 void setStartPoint(double theX, double theY);
81 void setStartPoint(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
85 void setEndPoint(double theX, double theY);
89 void setEndPoint(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
92 //! Pointer on Line object
93 typedef std::shared_ptr<SketchAPI_Line> LinePtr;
95 //--------------------------------------------------------------------------------------
96 //--------------------------------------------------------------------------------------
97 #endif /* SRC_SKETCHAPI_SKETCHAPI_LINE_H_ */