1 // Name : SketchAPI_Rectangle.h
5 // 17/06/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
8 #define SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
10 //--------------------------------------------------------------------------------------
11 #include "SketchAPI.h"
13 #include "SketchAPI_SketchEntity.h"
14 //--------------------------------------------------------------------------------------
15 class ModelHighAPI_Selection;
16 //--------------------------------------------------------------------------------------
17 /**\class SketchAPI_Rectangle
19 * \brief Interface for Rectangle feature
21 class SketchAPI_Rectangle : public SketchAPI_SketchEntity
24 /// Constructor without values
26 explicit SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature);
27 /// Constructor with values
29 SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
30 double theX1, double theY1, double theX2, double theY2);
31 /// Constructor with values
33 SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
34 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
35 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
38 virtual ~SketchAPI_Rectangle();
40 INTERFACE_3("SketchRectangle",
41 startPoint, "RectStartPoint", GeomDataAPI_Point2D, /** Start point */,
42 endPoint, "RectEndPoint", GeomDataAPI_Point2D, /** End point */,
43 linesList, "RectangleList", ModelAPI_AttributeRefList, /** Lines list */
46 /// Set by coordinates
48 void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
52 void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
53 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
56 //! Pointer on Rectangle object
57 typedef std::shared_ptr<SketchAPI_Rectangle> RectanglePtr;
59 //--------------------------------------------------------------------------------------
60 //--------------------------------------------------------------------------------------
61 #endif /* SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_ */