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(),
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 */)
84 /// Set by center and radius.
86 void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
88 /// Set by center and radius.
90 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
92 /// Set by three points.
94 void setByThreePoints(double theX1, double theY1,
95 double theX2, double theY2,
96 double theX3, double theY3);
98 /// Set by three points.
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);
106 void setByExternal(const ModelHighAPI_Selection& theExternal);
108 /// Set by external name.
110 void setByExternalName(const std::string& theExternalName);
114 void setCenter(double theX, double theY);
118 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
122 void setRadius(double theRadius);
126 void setFirstPoint(double theX, double theY);
130 void setFirstPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
132 /// Set second point.
134 void setSecondPoint(double theX, double theY);
136 /// Set second point.
138 void setSecondPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
142 void setThirdPoint(double theX, double theY);
146 void setThirdPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
148 /// Dump wrapped feature
150 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
153 /// Pointer on Circle object.
154 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
156 #endif // SketchAPI_Circle_H_