]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Arc.h
Salome HOME
Changes in the presentations of features
[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 /// Arc feature kind
13 const std::string SKETCH_ARC_KIND("SketchArc");
14
15 /// Central 2D point of the circle which contains the arc
16 const std::string ARC_ATTR_CENTER("ArcCenter");
17 /// Start 2D point of the arc
18 const std::string ARC_ATTR_START("ArcStartPoint");
19 /// End 2D point of the arc
20 const std::string ARC_ATTR_END("ArcEndPoint");
21
22 /**\class SketchPlugin_Arc
23  * \ingroup DataModel
24  * \brief Feature for creation of the new arc of circle in PartSet.
25  */
26 class SketchPlugin_Arc: public SketchPlugin_Feature
27 {
28 public:
29   /// Returns the kind of a feature
30   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
31   {static std::string MY_KIND = SKETCH_ARC_KIND; return MY_KIND;}
32
33   /// Returns to which group in the document must be added feature
34   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
35   {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
36
37   /// Creates a new part document if needed
38   SKETCHPLUGIN_EXPORT virtual void execute();
39
40   /// Request for initialization of data model of the feature: adding all attributes
41   SKETCHPLUGIN_EXPORT virtual void initAttributes();
42
43   /// Returns the sketch preview
44   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
45
46   /// Returns the AIS preview
47   SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
48                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
49
50   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
51   /// \param theFeature sub-feature
52   SKETCHPLUGIN_EXPORT virtual const void addSub(
53     const FeaturePtr& theFeature) {};
54
55   /// Moves the feature
56   /// \param theDeltaX the delta for X coordinate is moved
57   /// \param theDeltaY the delta for Y coordinate is moved
58   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
59
60   /// Return the distance between the feature and the point
61   /// \param thePoint the point
62   virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
63
64   /// Use plugin manager for features creation
65   SketchPlugin_Arc();
66 };
67
68 #endif