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 const ModelHighAPI_Selection& theExternal);
45 /// Constructor with values.
47 SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const std::string& theExternalName);
52 virtual ~SketchAPI_Circle();
54 INTERFACE_3(SketchPlugin_Circle::ID(),
55 center, SketchPlugin_Circle::CENTER_ID(),
56 GeomDataAPI_Point2D, /** Center point */,
57 radius, SketchPlugin_Circle::RADIUS_ID(),
58 ModelAPI_AttributeDouble, /** Radius */,
59 external, SketchPlugin_Circle::EXTERNAL_ID(),
60 ModelAPI_AttributeSelection, /** External */)
62 /// Set by center and radius.
64 void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
66 /// Set by center and radius.
68 void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
72 void setByExternal(const ModelHighAPI_Selection& theExternal);
74 /// Set by external name.
76 void setByExternalName(const std::string& theExternalName);
80 void setCenter(double theX, double theY);
84 void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
88 void setRadius(double theRadius);
90 /// Dump wrapped feature
92 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
95 /// Pointer on Circle object.
96 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
98 #endif // SketchAPI_Circle_H_