Salome HOME
Renamed SHAPER_CONFIG_FILE to PLUGINS_CONFIG_FILE
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintFillet.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:    SketchPlugin_ConstraintFillet.h
4 // Created: 19 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchPlugin_ConstraintFillet_H_
8 #define SketchPlugin_ConstraintFillet_H_
9
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Sketch.h>
12 #include "SketchPlugin_ConstraintBase.h"
13
14 /** \class SketchPlugin_ConstraintFillet
15  *  \ingroup Plugins
16  *  \brief Feature for creation of a new constraint filleting two objects which have coincident point
17  *
18  *  This constraint has three attributes:
19  *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B() for the filleting objects;
20  *  SketchPlugin_Constraint::VALUE() contains radius of filleting circular arc
21  *
22  *  Also the constraint has attribute SketchPlugin_Constraint::ENTITY_C()
23  *  which contains created list objects forming the fillet
24  */
25 class SketchPlugin_ConstraintFillet : public SketchPlugin_ConstraintBase
26 {
27  public:
28   /// Fillet constraint kind
29   inline static const std::string& ID()
30   {
31     static const std::string MY_CONSTRAINT_FILLET_ID("SketchConstraintFillet");
32     return MY_CONSTRAINT_FILLET_ID;
33   }
34   /// \brief Returns the kind of a feature
35   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
36   {
37     static std::string MY_KIND = SketchPlugin_ConstraintFillet::ID();
38     return MY_KIND;
39   }
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   /// Called on change of any argument-attribute of this object
48   /// \param theID identifier of changed attribute
49   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
50
51   /// Returns the AIS preview
52   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
53
54   /// Reimplemented from ModelAPI_Feature::isMacro().
55   /// \returns true
56   SKETCHPLUGIN_EXPORT virtual bool isMacro() const;
57
58   /// \brief Use plugin manager for features creation
59   SketchPlugin_ConstraintFillet();
60
61   /// \return base points list;
62   SKETCHPLUGIN_EXPORT const std::list<AttributePtr> basePoints() const {return myBasePoints;};
63
64   /// \return base edges list;
65   SKETCHPLUGIN_EXPORT const std::list<FeaturePtr> baseEdges() const {return myBaseEdges;};
66
67   /// \return result edges list;
68   SKETCHPLUGIN_EXPORT const std::list<FeaturePtr> resultEdges() const {return myResultEdges;};
69
70 private:
71   std::list<AttributePtr> myBasePoints; ///< list of base points
72   std::list<FeaturePtr> myBaseEdges;      ///< list of objects the fillet is based
73   std::list<FeaturePtr> myResultEdges;      ///< list of result edges
74   std::list<FeaturePtr> myProducedFeatures; ///< list of constraints provided by the fillet
75   bool myListOfPointsChangedInCode; ///< flag to track that list of points changed in code
76   bool myRadiusChangedByUser; ///< flag to track that radius changed by user
77   bool myRadiusChangedInCode; ///< flag to track that radius changed in code
78 };
79
80 #endif