Salome HOME
Issue #2071 Fatal error when Create box
[modules/shaper.git] / src / SketchAPI / SketchAPI_Circle.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchAPI_Circle.h
4 // Created:     09 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef SketchAPI_Circle_H_
8 #define SketchAPI_Circle_H_
9
10 #include "SketchAPI.h"
11 #include "SketchAPI_SketchEntity.h"
12
13 #include <SketchPlugin_Circle.h>
14
15 class ModelHighAPI_Selection;
16
17 /// \class SketchAPI_Circle
18 /// \ingroup CPPHighAPI
19 /// \brief Interface for Circle feature.
20 class SketchAPI_Circle: public SketchAPI_SketchEntity
21 {
22 public:
23   /// Constructor without values.
24   SKETCHAPI_EXPORT
25   explicit SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature);
26
27   /// Constructor with values.
28   SKETCHAPI_EXPORT
29   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
30                    double theCenterX,
31                    double theCenterY,
32                    double theRadius);
33
34   /// Constructor with values.
35   SKETCHAPI_EXPORT
36   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
37                    const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
38                    double theRadius);
39
40   /// Constructor with values.
41   SKETCHAPI_EXPORT
42   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
43                    const ModelHighAPI_Selection& theExternal);
44
45   /// Constructor with values.
46   SKETCHAPI_EXPORT
47   SketchAPI_Circle(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48                    const std::string& theExternalName);
49
50   /// Destructor.
51   SKETCHAPI_EXPORT
52   virtual ~SketchAPI_Circle();
53
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 */)
61
62   /// Set by center and radius.
63   SKETCHAPI_EXPORT
64   void setByCenterAndRadius(double theCenterX, double theCenterY, double theRadius);
65
66   /// Set by center and radius.
67   SKETCHAPI_EXPORT
68   void setByCenterAndRadius(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter, double theRadius);
69
70   /// Set by external.
71   SKETCHAPI_EXPORT
72   void setByExternal(const ModelHighAPI_Selection& theExternal);
73
74   /// Set by external name.
75   SKETCHAPI_EXPORT
76   void setByExternalName(const std::string& theExternalName);
77
78   /// Set center.
79   SKETCHAPI_EXPORT
80   void setCenter(double theX, double theY);
81
82   /// Set center.
83   SKETCHAPI_EXPORT
84   void setCenter(const std::shared_ptr<GeomAPI_Pnt2d> & theCenter);
85
86   /// Set radius.
87   SKETCHAPI_EXPORT
88   void setRadius(double theRadius);
89
90   /// Dump wrapped feature
91   SKETCHAPI_EXPORT
92   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
93 };
94
95 /// Pointer on Circle object.
96 typedef std::shared_ptr<SketchAPI_Circle> CirclePtr;
97
98 #endif // SketchAPI_Circle_H_