Salome HOME
93b2ea001f756e2e41b544bb30070f773556c8c1
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMovement.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_ConstraintMovement.h
4 // Created: 15 Jun 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_ConstraintMovement_H_
8 #define SketchSolver_ConstraintMovement_H_
9
10 #include "SketchSolver.h"
11 #include <SketchSolver_ConstraintFixed.h>
12
13 /** \class   SketchSolver_ConstraintMovement
14  *  \ingroup Plugins
15  *  \brief   Stores data to the Fixed constraint for the moved feature only
16  */
17 class SketchSolver_ConstraintMovement : public SketchSolver_ConstraintFixed
18 {
19 private:
20   /// Creates constraint to manage the given constraint from plugin
21   SketchSolver_ConstraintMovement(ConstraintPtr theConstraint)
22     : SketchSolver_ConstraintFixed(theConstraint)
23   {}
24
25 public:
26   /// Creates temporary constraint based on feature
27   SketchSolver_ConstraintMovement(FeaturePtr theFeature)
28     : SketchSolver_ConstraintFixed(theFeature)
29   {}
30
31   /// \brief Tries to remove constraint
32   /// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
33   virtual bool remove();
34
35 protected:
36   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
37   virtual void process();
38
39   /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints
40   /// \param[out] theValue        numerical characteristic of constraint (e.g. distance)
41   /// \param[out] theAttributes   list of attributes to be filled (list of moved entities or attributes)
42   virtual void getAttributes(ParameterWrapperPtr& theValue, std::vector<EntityWrapperPtr>& theAttributes);
43
44 private:
45   std::vector<EntityWrapperPtr> myMovedEntities; ///< list of entities that are moved
46 };
47
48 #endif