Salome HOME
Issue #1834: Fix length of lines
[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 SketchAPI_Circle
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(),
70               ModelAPI_AttributeString, /** Circle type */,
71               center, SketchPlugin_Circle::CENTER_ID(),
72               GeomDataAPI_Point2D, /** Center point */,
73               radius, SketchPlugin_Circle::RADIUS_ID(),
74               ModelAPI_AttributeDouble, /** Radius */,
75               firstPoint, SketchPlugin_Circle::FIRST_POINT_ID(),
76               GeomDataAPI_Point2D, /** First point */,
77               secondPoint, SketchPlugin_Circle::SECOND_POINT_ID(),
78               GeomDataAPI_Point2D, /** Second point */,
79               thirdPoint, SketchPlugin_Circle::THIRD_POINT_ID(),
80               GeomDataAPI_Point2D, /** Third point */,
81               external, SketchPlugin_Circle::EXTERNAL_ID(),
82               ModelAPI_AttributeSelection, /** External */)
83
84   /// Set by center and radius.
85   SKETCHAPI_EXPORT
86   void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
87
88   /// Set by center and radius.
89   SKETCHAPI_EXPORT
90   void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
91
92   /// Set by three points.
93   SKETCHAPI_EXPORT
94   void setByThreePoints(double theX1, double theY1,
95                         double theX2, double theY2,
96                         double theX3, double theY3);
97
98   /// Set by three points.
99   SKETCHAPI_EXPORT
100   void setByThreePoints(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint1,
101                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint2,
102                         const std::shared_ptr<GeomAPI_Pnt2d>& thePoint3);
103
104   /// Set by external.
105   SKETCHAPI_EXPORT
106   void setByExternal(const ModelHighAPI_Selection& theExternal);
107
108   /// Set by external name.
109   SKETCHAPI_EXPORT
110   void setByExternalName(const std::string& theExternalName);
111
112   /// Set center.
113   SKETCHAPI_EXPORT
114   void setCenter(double theX, double theY);
115
116   /// Set center.
117   SKETCHAPI_EXPORT
118   void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
119
120   /// Set radius.
121   SKETCHAPI_EXPORT
122   void setRadius(double theRadius);
123
124   /// Set first point.
125   SKETCHAPI_EXPORT
126   void setFirstPoint(double theX, double theY);
127
128   /// Set first point.
129   SKETCHAPI_EXPORT
130   void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
131
132   /// Set second point.
133   SKETCHAPI_EXPORT
134   void setSecondPoint(double theX, double theY);
135
136   /// Set second point.
137   SKETCHAPI_EXPORT
138   void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
139
140   /// Set third point.
141   SKETCHAPI_EXPORT
142   void setThirdPoint(double theX, double theY);
143
144   /// Set third point.
145   SKETCHAPI_EXPORT
146   void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
147
148   /// Dump wrapped feature
149   SKETCHAPI_EXPORT
150   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
151 };
152
153 /// Pointer on Circle object.
154 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
155
156 #endif // SketchAPI_Circle_H_