]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/SketchSolver_ConstraintFixed.h
Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into azv/SketchSolver_Refactoring
[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.h"
11 #include <SketchSolver_Constraint.h>
12
13 /** \class   SketchSolver_ConstraintFixed
14  *  \ingroup Plugins
15  *  \brief   Stores data of the Fixed constraint
16  *
17  *  Fixed constraint may have NULL basic SketchPlugin constraint,
18  *  because the Fixed constraint may be temporary for correct moving of objects.
19  */
20 class SketchSolver_ConstraintFixed : public SketchSolver_Constraint
21 {
22 public:
23   /// Creates constraint to manage the given constraint from plugin
24   SketchSolver_ConstraintFixed(ConstraintPtr theConstraint);
25   /// Creates temporary constraint based on feature (useful while the feature is being moved)
26   SketchSolver_ConstraintFixed(FeaturePtr theFeature);
27
28   /// \brief Block or unblock events from this constraint
29   virtual void blockEvents(bool isBlocked);
30
31 protected:
32   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
33   virtual void process();
34
35   /// \brief Generate list of attributes of constraint in order useful for constraints
36   /// \param[out] theValue      numerical characteristic of constraint (e.g. distance)
37   /// \param[out] theAttributes list of attributes to be filled
38   virtual void getAttributes(EntityWrapperPtr&              theValue,
39                              std::vector<EntityWrapperPtr>& theAttributes);
40
41   /// \brief Fixed feature basing on its type
42   /// \param theFeature [in]  feature, converted to solver specific format
43   virtual void fixFeature(EntityWrapperPtr theFeature);
44
45 private:
46   FeaturePtr myBaseFeature; ///< fixed feature (when it is set, myBaseConstraint should be NULL)
47
48   ConstraintWrapperPtr myConstraint;
49   std::vector<double> myFixedValues;
50 };
51
52 #endif