Salome HOME
Task 2.4. Ability to modify the radius of circles and arcs of circle with the mouse
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintFixed.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_ConstraintFixed.h
4 // Created: 30 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_ConstraintFixed_H_
8 #define SketchSolver_ConstraintFixed_H_
9
10 #include <SketchSolver_Constraint.h>
11
12 /** \class   SketchSolver_ConstraintFixed
13  *  \ingroup Plugins
14  *  \brief   Stores data of the Fixed constraint
15  */
16 class SketchSolver_ConstraintFixed : public SketchSolver_Constraint
17 {
18 public:
19   /// Creates constraint to manage the given constraint from plugin
20   SketchSolver_ConstraintFixed(ConstraintPtr theConstraint);
21
22   /// \brief Block or unblock events from this constraint
23   virtual void blockEvents(bool isBlocked);
24
25 protected:
26   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
27   virtual void process();
28
29   /// \brief Generate list of attributes of constraint in order useful for constraints
30   /// \param[out] theValue      numerical characteristic of constraint (e.g. distance)
31   /// \param[out] theAttributes list of attributes to be filled
32   virtual void getAttributes(EntityWrapperPtr& , std::vector<EntityWrapperPtr>& )
33   {}
34
35   /// \brief Obtain entity to be fixed
36   virtual EntityWrapperPtr entityToFix();
37
38   /// \brief Create Fixed constraint for the feature basing on its type
39   /// \param theFeature [in]  feature, converted to solver specific format
40   /// \return Fixed constraint
41   virtual ConstraintWrapperPtr fixFeature(EntityWrapperPtr theFeature);
42
43   /// \brief Get list of parameters of current entity
44   static GCS::VEC_pD toParameters(const EntityWrapperPtr& theEntity);
45
46 protected:
47   std::vector<double> myFixedValues;
48 };
49
50 #endif