1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name : SketchAPI_Line.h
6 // 07/06/16 - Sergey POKHODENKO - Creation of the file
8 #ifndef SRC_SKETCHAPI_SKETCHAPI_LINE_H_
9 #define SRC_SKETCHAPI_SKETCHAPI_LINE_H_
11 //--------------------------------------------------------------------------------------
12 #include "SketchAPI.h"
14 #include <GeomDataAPI_Point2D.h>
16 #include <SketchPlugin_Line.h>
18 #include "SketchAPI_SketchEntity.h"
19 //--------------------------------------------------------------------------------------
20 class ModelHighAPI_Selection;
21 //--------------------------------------------------------------------------------------
22 /**\class SketchAPI_Line
24 * \brief Interface for Line feature
26 class SketchAPI_Line : public SketchAPI_SketchEntity
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(),
55 GeomDataAPI_Point2D, /** Start point */,
56 endPoint, SketchPlugin_Line::END_ID(),
57 GeomDataAPI_Point2D, /** End point */,
58 external, SketchPlugin_Line::EXTERNAL_ID(),
59 ModelAPI_AttributeSelection, /** External */
62 /// Set by coordinates
64 void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
68 void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
69 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
73 void setByExternal(const ModelHighAPI_Selection & theExternal);
75 /// Set by external name
77 void setByExternalName(const std::string & theExternalName);
81 void setStartPoint(double theX, double theY);
85 void setStartPoint(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
89 void setEndPoint(double theX, double theY);
93 void setEndPoint(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
95 /// Dump wrapped feature
97 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
100 //! Pointer on Line object
101 typedef std::shared_ptr<SketchAPI_Line> LinePtr;
103 //--------------------------------------------------------------------------------------
104 //--------------------------------------------------------------------------------------
105 #endif /* SRC_SKETCHAPI_SKETCHAPI_LINE_H_ */