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