Salome HOME
Issue #2090: Line not selectable when creating an arc by its center
[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  *  Fixed constraint may have NULL basic SketchPlugin constraint,
17  *  because the Fixed constraint may be temporary for correct moving of objects.
18  */
19 class SketchSolver_ConstraintFixed : public SketchSolver_Constraint
20 {
21 public:
22   /// Creates constraint to manage the given constraint from plugin
23   SketchSolver_ConstraintFixed(ConstraintPtr theConstraint);
24   /// Creates temporary constraint based on feature (useful while the feature is being moved)
25   SketchSolver_ConstraintFixed(FeaturePtr theFeature);
26
27   /// \brief Block or unblock events from this constraint
28   virtual void blockEvents(bool isBlocked);
29
30 protected:
31   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
32   virtual void process();
33
34   /// \brief Generate list of attributes of constraint in order useful for constraints
35   /// \param[out] theValue      numerical characteristic of constraint (e.g. distance)
36   /// \param[out] theAttributes list of attributes to be filled
37   virtual void getAttributes(EntityWrapperPtr&              theValue,
38                              std::vector<EntityWrapperPtr>& theAttributes);
39
40   /// \brief Fixed feature basing on its type
41   /// \param theFeature [in]  feature, converted to solver specific format
42   virtual void fixFeature(EntityWrapperPtr theFeature);
43
44 private:
45   FeaturePtr myBaseFeature; ///< fixed feature (when it is set, myBaseConstraint should be NULL)
46
47   ConstraintWrapperPtr myConstraint;
48   std::vector<double> myFixedValues;
49 };
50
51 #endif