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