1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchAPI_Circle.h
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef SketchAPI_Circle_H_
8 #define SketchAPI_Circle_H_
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
13 #include <GeomDataAPI_Point2D.h>
15 #include <SketchPlugin_Circle.h>
17 class ModelHighAPI_Selection;
19 /// \class FeaturesAPI_Boolean
20 /// \ingroup CPPHighAPI
21 /// \brief Interface for Circle feature.
22 class SketchAPI_Circle: public SketchAPI_SketchEntity
25 /// Constructor without values.
27 explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29 /// Constructor with values.
31 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
36 /// Constructor with values.
38 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
39 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
42 /// Constructor with values.
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);
49 /// Constructor with values.
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);
56 /// Constructor with values.
58 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
59 const ModelHighAPI_Selection& theExternal);
61 /// Constructor with values.
63 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
64 const std::string& theExternalName);
68 virtual ~SketchAPI_Circle();
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 */)
79 /// Set by center and radius.
81 void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
83 /// Set by center and radius.
85 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
87 /// Set by three points.
89 void setByThreePoints(double theX1, double theY1,
90 double theX2, double theY2,
91 double theX3, double theY3);
93 /// Set by three points.
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);
101 void setByExternal(const ModelHighAPI_Selection& theExternal);
103 /// Set by external name.
105 void setByExternalName(const std::string& theExternalName);
109 void setCenter(double theX, double theY);
113 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
117 void setRadius(double theRadius);
121 void setFirstPoint(double theX, double theY);
125 void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
127 /// Set second point.
129 void setSecondPoint(double theX, double theY);
131 /// Set second point.
133 void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
137 void setThirdPoint(double theX, double theY);
141 void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
144 /// Pointer on Circle object.
145 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
147 #endif // SketchAPI_Circle_H_