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