Salome HOME
7dc6ef8e9771ed44ca74e2959e066c0b9053a798
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintRigid.h
1 // File:    SketchPlugin_ConstraintRigid.h
2 // Created: 13 Oct 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintRigid_H_
6 #define SketchPlugin_ConstraintRigid_H_
7
8 #include "SketchPlugin.h"
9 #include "SketchPlugin_ConstraintBase.h"
10 #include <SketchPlugin_Sketch.h>
11 #include <list>
12
13 #define FIXING_COLOR "#ffff00"
14
15 /** \class SketchPlugin_ConstraintRigid
16  *  \ingroup DataModel
17  *  \brief Feature for creation of a new constraint which defines immovable object
18  *
19  *  This constraint has one attribute:
20  *  SketchPlugin_Constraint::ENTITY_A() (any object, i.e. point, line, circle, arc)
21  */
22 class SketchPlugin_ConstraintRigid : public SketchPlugin_ConstraintBase
23 {
24  public:
25   /// Length constraint kind
26   inline static const std::string& ID()
27   {
28     static const std::string MY_CONSTRAINT_RIGID_ID("SketchConstraintRigid");
29     return MY_CONSTRAINT_RIGID_ID;
30   }
31   /// \brief Returns the kind of a feature
32   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
33   {
34     static std::string MY_KIND = SketchPlugin_ConstraintRigid::ID();
35     return MY_KIND;
36   }
37
38   /// Returns the AIS preview
39   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
40
41   /// \brief Creates a new part document if needed
42   SKETCHPLUGIN_EXPORT virtual void execute();
43
44   /// \brief Request for initialization of data model of the feature: adding all attributes
45   SKETCHPLUGIN_EXPORT virtual void initAttributes();
46
47   /// \brief Use plugin manager for features creation
48   SketchPlugin_ConstraintRigid();
49 };
50
51 #endif