Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into SketchSolver
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintPerpendicular.h
1 // File:    SketchPlugin_ConstraintPerpendicular.h
2 // Created: 26 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintPerpendicular_HeaderFile
6 #define SketchPlugin_ConstraintPerpendicular_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Constraint.h"
11
12 /// Perpendicular constraint kind
13 const std::string SKETCH_CONSTRAINT_PERPENDICULAR_KIND("SketchConstraintPerpendicular");
14
15 /** \class SketchPlugin_ConstraintPerpendicular
16  *  \ingroup DataModel
17  *  \brief Feature for creation of a new constraint for perpendicularity of two lines
18  *
19  *  These constraint has two attributes:
20  *  CONSTRAINT_ATTR_ENTITY_A and CONSTRAINT_ATTR_ENTITY_B
21  */
22 class SketchPlugin_ConstraintPerpendicular: public SketchPlugin_Constraint
23 {
24 public:
25   /// \brief Returns the kind of a feature
26   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
27   {static std::string MY_KIND = SKETCH_CONSTRAINT_PERPENDICULAR_KIND; return MY_KIND;}
28
29   /// \brief Returns to which group in the document must be added feature
30   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
31   {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
32
33   /// \brief Creates a new part document if needed
34   SKETCHPLUGIN_EXPORT virtual void execute();
35
36   /// \brief Request for initialization of data model of the feature: adding all attributes
37   SKETCHPLUGIN_EXPORT virtual void initAttributes();
38
39   /// \brief Returns the sketch preview
40   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
41
42   /// \brief Use plugin manager for features creation
43   SketchPlugin_ConstraintPerpendicular();
44 };
45
46 #endif