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