]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Sketch.h
Salome HOME
Geom attribute: Point
[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 #include <list>
11
12 /// Coefficient A of the sketch plane (Ax+By+Cz+D=0)
13 const std::string SKETCH_ATTR_PLANE_A("PlaneA");
14 /// Coefficient B of the sketch plane
15 const std::string SKETCH_ATTR_PLANE_B("PlaneB");
16 /// Coefficient C of the sketch plane
17 const std::string SKETCH_ATTR_PLANE_C("PlaneC");
18 /// Coefficient D of the sketch plane
19 const std::string SKETCH_ATTR_PLANE_D("PlaneD");
20
21 /**\class SketchPlugin_Sketch
22  * \ingroup DataModel
23  * \brief Feature for creation of the new part in PartSet.
24  */
25 class SketchPlugin_Sketch: public SketchPlugin_Feature
26 {
27 public:
28   /// Returns the kind of a feature
29  SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
30   {static std::string MY_KIND = "Sketch"; return MY_KIND;}
31
32   /// Returns to which group in the document must be added feature
33  SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
34   {static std::string MY_GROUP = "Construction"; return MY_GROUP;}
35
36   /// Creates a new part document if needed
37  SKETCHPLUGIN_EXPORT virtual void execute();
38
39   /// Request for initialization of data model of the feature: adding all attributes
40  SKETCHPLUGIN_EXPORT virtual void initAttributes();
41
42   /// Returns the sketch preview
43   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
44
45   /// Use plugin manager for features creation
46   SketchPlugin_Sketch();
47 protected:
48   /// Creates a plane and append it to the list
49   /// \param theX the X normal value
50   /// \param theY the Y normal value
51   /// \param theZ the Z normal value
52   /// \param theShapes the list of result shapes
53   void addPlane(double theX, double theY, double theZ,
54                 std::list<boost::shared_ptr<GeomAPI_Shape> >& theShapes) const;
55 };
56
57 #endif