Salome HOME
Issue #3224: Provide help button for feature dialog boxes
[modules/shaper.git] / src / SketchAPI / SketchAPI_Rectangle.h
1 // Copyright (C) 2014-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_
22
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25
26 #include "SketchAPI_SketchEntity.h"
27 //--------------------------------------------------------------------------------------
28 class ModelHighAPI_Selection;
29 //--------------------------------------------------------------------------------------
30 /**\class SketchAPI_Rectangle
31  * \ingroup CPPHighAPI
32  * \brief Interface for Rectangle feature
33  */
34 class SketchAPI_Rectangle : public SketchAPI_SketchEntity
35 {
36 public:
37   /// Constructor without values
38   SKETCHAPI_EXPORT
39   explicit SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature);
40   /// Constructor with values
41   SKETCHAPI_EXPORT
42   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
43                       double theX1, double theY1, double theX2, double theY2);
44   /// Constructor with values
45   SKETCHAPI_EXPORT
46   SketchAPI_Rectangle(const std::shared_ptr<ModelAPI_Feature> & theFeature,
47                       const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
48                       const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
49   /// Destructor
50   SKETCHAPI_EXPORT
51   virtual ~SketchAPI_Rectangle();
52
53   INTERFACE_3("SketchRectangle",
54               startPoint, "RectStartPoint", GeomDataAPI_Point2D, /** Start point */,
55               endPoint, "RectEndPoint", GeomDataAPI_Point2D, /** End point */,
56               linesList, "RectangleList", ModelAPI_AttributeRefList, /** Lines list */
57   )
58
59   /// Set by coordinates
60   SKETCHAPI_EXPORT
61   void setByCoordinates(double theX1, double theY1, double theX2, double theY2);
62
63   /// Set by points
64   SKETCHAPI_EXPORT
65   void setByPoints(const std::shared_ptr<GeomAPI_Pnt2d> & theStartPoint,
66                    const std::shared_ptr<GeomAPI_Pnt2d> & theEndPoint);
67
68   /// List of lines composing rectangle
69   SKETCHAPI_EXPORT std::list<std::shared_ptr<SketchAPI_SketchEntity> > lines() const;
70 };
71
72 //! Pointer on Rectangle object
73 typedef std::shared_ptr<SketchAPI_Rectangle> RectanglePtr;
74
75 //--------------------------------------------------------------------------------------
76 //--------------------------------------------------------------------------------------
77 #endif /* SRC_SKETCHAPI_SKETCHAPI_RECTANGLE_H_ */