Salome HOME
Fix errors and adjust unit tests
[modules/shaper.git] / src / SketchAPI / SketchAPI_Rectangle.h
1 // Name   : SketchAPI_Rectangle.h
2 // Purpose: 
3 //
4 // History:
5 // 17/06/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
8 #define SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "SketchAPI.h"
12
13 #include "SketchAPI_SketchEntity.h"
14 //--------------------------------------------------------------------------------------
15 class ModelHighAPI_Selection;
16 //--------------------------------------------------------------------------------------
17 /**\class SketchAPI_Rectangle
18  * \ingroup CPPHighAPI
19  * \brief Interface for Rectangle feature
20  */
21 class SketchAPI_Rectangle : public SketchAPI_SketchEntity
22 {
23 public:
24   /// Constructor without values
25   SKETCHAPI_EXPORT
26   explicit SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature);
27   /// Constructor with values
28   SKETCHAPI_EXPORT
29   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
30                       double theX1, double theY1, double theX2, double theY2);
31   /// Constructor with values
32   SKETCHAPI_EXPORT
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);
36   /// Destructor
37   SKETCHAPI_EXPORT
38   virtual ~SketchAPI_Rectangle();
39
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 */
44   )
45
46   /// Set by coordinates
47   SKETCHAPI_EXPORT
48   void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
49
50   /// Set by points
51   SKETCHAPI_EXPORT
52   void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
53                    const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
54 };
55
56 //! Pointer on Rectangle object
57 typedef std::shared_ptr<SketchAPI_Rectangle> RectanglePtr;
58
59 //--------------------------------------------------------------------------------------
60 //--------------------------------------------------------------------------------------
61 #endif /* SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_ */