]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Circle.h
Salome HOME
It replaces using of direct value "Sketch" to SKETCH_KIND, which is defined in the...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Circle.h
1 // File:        SketchPlugin_Circle.h
2 // Created:     26 May 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef SketchPlugin_Circle_HeaderFile
6 #define SketchPlugin_Circle_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
10 #include <SketchPlugin_Sketch.h>
11
12 /// 2D point - center of the circle
13 const std::string CIRCLE_ATTR_CENTER("CircleCenter");
14 /// Radius of the circle
15 const std::string CIRCLE_ATTR_RADIUS("CircleRadius");
16
17 /**\class SketchPlugin_Circle
18  * \ingroup DataModel
19  * \brief Feature for creation of the new circle in PartSet.
20  */
21 class SketchPlugin_Circle: public SketchPlugin_Feature
22 {
23 public:
24   /// Returns the kind of a feature
25   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
26   {static std::string MY_KIND = "SketchCircle"; return MY_KIND;}
27
28   /// Returns to which group in the document must be added feature
29   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
30   {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
31
32   /// Creates a new part document if needed
33   SKETCHPLUGIN_EXPORT virtual void execute();
34
35   /// Request for initialization of data model of the feature: adding all attributes
36   SKETCHPLUGIN_EXPORT virtual void initAttributes();
37
38   /// Returns the sketch preview
39   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
40
41   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
42   /// \param theFeature sub-feature
43   SKETCHPLUGIN_EXPORT virtual const void addSub(
44     const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
45
46   /// Use plugin manager for features creation
47   SketchPlugin_Circle();
48 };
49
50 #endif