1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name : SketchAPI_Rectangle.h
6 // 17/06/16 - Sergey POKHODENKO - Creation of the file
8 #ifndef SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
9 #define SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
11 //--------------------------------------------------------------------------------------
12 #include "SketchAPI.h"
14 #include "SketchAPI_SketchEntity.h"
15 //--------------------------------------------------------------------------------------
16 class ModelHighAPI_Selection;
17 //--------------------------------------------------------------------------------------
18 /**\class SketchAPI_Rectangle
20 * \brief Interface for Rectangle feature
22 class SketchAPI_Rectangle : public SketchAPI_SketchEntity
25 /// Constructor without values
27 explicit SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature);
28 /// Constructor with values
30 SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
31 double theX1, double theY1, double theX2, double theY2);
32 /// Constructor with values
34 SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
35 const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
36 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
39 virtual ~SketchAPI_Rectangle();
41 INTERFACE_3("SketchRectangle",
42 startPoint, "RectStartPoint", GeomDataAPI_Point2D, /** Start point */,
43 endPoint, "RectEndPoint", GeomDataAPI_Point2D, /** End point */,
44 linesList, "RectangleList", ModelAPI_AttributeRefList, /** Lines list */
47 /// Set by coordinates
49 void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
53 void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
54 const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
57 //! Pointer on Rectangle object
58 typedef std::shared_ptr<SketchAPI_Rectangle> RectanglePtr;
60 //--------------------------------------------------------------------------------------
61 //--------------------------------------------------------------------------------------
62 #endif /* SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_ */