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 <SketchPlugin_Circle.h>
15 class ModelHighAPI_Selection;
17 /// \class SketchAPI_Circle
18 /// \ingroup CPPHighAPI
19 /// \brief Interface for Circle feature.
20 class SketchAPI_Circle: public SketchAPI_SketchEntity
23 /// Constructor without values.
25 explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
27 /// Constructor with values.
29 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34 /// Constructor with values.
36 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
37 const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
40 /// Constructor with values.
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);
47 /// Constructor with values.
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);
54 /// Constructor with values.
56 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57 const ModelHighAPI_Selection& theExternal);
59 /// Constructor with values.
61 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 const std::string& theExternalName);
66 virtual ~SketchAPI_Circle();
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 */)
77 /// Set by center and radius.
79 void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
81 /// Set by center and radius.
83 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
85 /// Set by three points.
87 void setByThreePoints(double theX1, double theY1,
88 double theX2, double theY2,
89 double theX3, double theY3);
91 /// Set by three points.
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);
99 void setByExternal(const ModelHighAPI_Selection& theExternal);
101 /// Set by external name.
103 void setByExternalName(const std::string& theExternalName);
107 void setCenter(double theX, double theY);
111 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
115 void setRadius(double theRadius);
119 void setFirstPoint(double theX, double theY);
123 void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
125 /// Set second point.
127 void setSecondPoint(double theX, double theY);
129 /// Set second point.
131 void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
135 void setThirdPoint(double theX, double theY);
139 void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
141 /// Dump wrapped feature
143 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
146 /// Pointer on Circle object.
147 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
149 #endif // SketchAPI_Circle_H_