Salome HOME
b4332c67553898e49db83fed180a4f378381739e
[modules/shaper.git] / src / SketchAPI / SketchAPI_Circle.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchAPI_Circle.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef SketchAPI_Circle_H_
8 #define SketchAPI_Circle_H_
9
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
12
13 #include <SketchPlugin_Circle.h>
14
15 class ModelHighAPI_Selection;
16
17 /// \class FeaturesAPI_Boolean
18 /// \ingroup CPPHighAPI
19 /// \brief Interface for Circle feature.
20 class SketchAPI_Circle: public SketchAPI_SketchEntity
21 {
22 public:
23   /// Constructor without values.
24   SKETCHAPI_EXPORT
25   explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
26
27   /// Constructor with values.
28   SKETCHAPI_EXPORT
29   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
30                    double theCenterX,
31                    double theCenterY,
32                    double theRadius);
33
34   /// Constructor with values.
35   SKETCHAPI_EXPORT
36   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
37                    const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
38                    double theRadius);
39
40   /// Constructor with values.
41   SKETCHAPI_EXPORT
42   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
43                    double theX1, double theY1,
44                    double theX2, double theY2,
45                    double theX3, double theY3);
46
47   /// Constructor with values.
48   SKETCHAPI_EXPORT
49   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50                    const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
51                    const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
52                    const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
53
54   /// Constructor with values.
55   SKETCHAPI_EXPORT
56   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57                    const ModelHighAPI_Selection& theExternal);
58
59   /// Constructor with values.
60   SKETCHAPI_EXPORT
61   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                    const std::string& theExternalName);
63
64   /// Destructor.
65   SKETCHAPI_EXPORT
66   virtual ~SketchAPI_Circle();
67
68   INTERFACE_7(SketchPlugin_Circle::ID(),
69               circleType, SketchPlugin_Circle::CIRCLE_TYPE(), ModelAPI_AttributeString, /** Circle type */,
70               center, SketchPlugin_Circle::CENTER_ID(), GeomDataAPI_Point2D, /** Center point */,
71               radius, SketchPlugin_Circle::RADIUS_ID(), ModelAPI_AttributeDouble, /** Radius */,
72               firstPoint, SketchPlugin_Circle::FIRST_POINT_ID(), GeomDataAPI_Point2D, /** First point */,
73               secondPoint, SketchPlugin_Circle::SECOND_POINT_ID(), GeomDataAPI_Point2D, /** Second point */,
74               thirdPoint, SketchPlugin_Circle::THIRD_POINT_ID(), GeomDataAPI_Point2D, /** Third point */,
75               external, SketchPlugin_Circle::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */)
76
77   /// Set by center and radius.
78   SKETCHAPI_EXPORT
79   void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
80
81   /// Set by center and radius.
82   SKETCHAPI_EXPORT
83   void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
84
85   /// Set by three points.
86   SKETCHAPI_EXPORT
87   void setByThreePoints(double theX1, double theY1,
88                         double theX2, double theY2,
89                         double theX3, double theY3);
90
91   /// Set by three points.
92   SKETCHAPI_EXPORT
93   void setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
94                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
95                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
96
97   /// Set by external.
98   SKETCHAPI_EXPORT
99   void setByExternal(const ModelHighAPI_Selection& theExternal);
100
101   /// Set by external name.
102   SKETCHAPI_EXPORT
103   void setByExternalName(const std::string& theExternalName);
104
105   /// Set center.
106   SKETCHAPI_EXPORT
107   void setCenter(double theX, double theY);
108
109   /// Set center.
110   SKETCHAPI_EXPORT
111   void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
112
113   /// Set radius.
114   SKETCHAPI_EXPORT
115   void setRadius(double theRadius);
116
117   /// Set first point.
118   SKETCHAPI_EXPORT
119   void setFirstPoint(double theX, double theY);
120
121   /// Set first point.
122   SKETCHAPI_EXPORT
123   void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
124
125   /// Set second point.
126   SKETCHAPI_EXPORT
127   void setSecondPoint(double theX, double theY);
128
129   /// Set second point.
130   SKETCHAPI_EXPORT
131   void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
132
133   /// Set third point.
134   SKETCHAPI_EXPORT
135   void setThirdPoint(double theX, double theY);
136
137   /// Set third point.
138   SKETCHAPI_EXPORT
139   void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
140 };
141
142 /// Pointer on Circle object.
143 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
144
145 #endif // SketchAPI_Circle_H_