1 // File: SketchPlugin_Sketch.h
2 // Created: 27 Mar 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef SketchPlugin_Sketch_HeaderFile
6 #define SketchPlugin_Sketch_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
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");
21 /**\class SketchPlugin_Sketch
23 * \brief Feature for creation of the new part in PartSet.
25 class SketchPlugin_Sketch: public SketchPlugin_Feature
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;}
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;}
36 /// Creates a new part document if needed
37 SKETCHPLUGIN_EXPORT virtual void execute();
39 /// Request for initialization of data model of the feature: adding all attributes
40 SKETCHPLUGIN_EXPORT virtual void initAttributes();
42 /// Returns the sketch preview
43 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
45 /// Use plugin manager for features creation
46 SketchPlugin_Sketch();
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;