1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_ConstraintAngle.h
4 // Created: 19 August 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_ConstraintAngle_H_
8 #define SketchPlugin_ConstraintAngle_H_
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Sketch.h>
12 #include "SketchPlugin_ConstraintBase.h"
14 /** \class SketchPlugin_ConstraintAngle
16 * \brief Feature for creation of a new constraint fix angle between two lines
18 * This constraint has two attributes:
19 * SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
21 class SketchPlugin_ConstraintAngle : public SketchPlugin_ConstraintBase
24 /// Angle constraint kind
25 inline static const std::string& ID()
27 static const std::string MY_CONSTRAINT_ANGLE_ID("SketchConstraintAngle");
28 return MY_CONSTRAINT_ANGLE_ID;
30 /// \brief Returns the kind of a feature
31 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
33 static std::string MY_KIND = SketchPlugin_ConstraintAngle::ID();
37 /// \brief Creates a new part document if needed
38 SKETCHPLUGIN_EXPORT virtual void execute();
40 /// \brief Request for initialization of data model of the feature: adding all attributes
41 SKETCHPLUGIN_EXPORT virtual void initAttributes();
43 /// Called on change of any argument-attribute of this object
44 /// \param theID identifier of changed attribute
45 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
47 /// Returns the AIS preview
48 SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
50 /// Calculate current value of the angle
51 double calculateAngle();
53 /// \brief Use plugin manager for features creation
54 SketchPlugin_ConstraintAngle();