Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Sketch.h
1 // File:        SketchPlugin_Sketch.h
2 // Created:     27 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef SketchPlugin_Sketch_HeaderFile
6 #define SketchPlugin_Sketch_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
10
11 #include <list>
12
13 /// part reference attribute
14 const std::string PART_ATTR_DOC_REF = "SketchDocument";
15
16 /**\class SketchPlugin_Sketch
17  * \ingroup DataModel
18  * \brief Feature for creation of the new part in PartSet.
19  */
20 class SketchPlugin_Sketch: public SketchPlugin_Feature
21 {
22 public:
23   /// Returns the kind of a feature
24  SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
25   {static std::string MY_KIND = "Sketch"; return MY_KIND;}
26
27   /// Returns to which group in the document must be added feature
28  SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
29   {static std::string MY_GROUP = "Construction"; return MY_GROUP;}
30
31   /// Creates a new part document if needed
32  SKETCHPLUGIN_EXPORT virtual void execute();
33
34   /// Request for initialization of data model of the feature: adding all attributes
35  SKETCHPLUGIN_EXPORT virtual void initAttributes();
36
37   /// Returns the sketch preview
38   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
39
40   /// Use plugin manager for features creation
41   SketchPlugin_Sketch();
42 protected:
43   /// Creates a plane and append it to the list
44   /// \param theX the X normal value
45   /// \param theY the Y normal value
46   /// \param theZ the Z normal value
47   /// \param theShapes the list of result shapes
48   void addPlane(double theX, double theY, double theZ,
49                 std::list<boost::shared_ptr<GeomAPI_Shape> >& theShapes) const;
50
51 };
52
53 #endif