Salome HOME
SketchSolver Refactoring: Eliminate SolveSpace as a sketch solver.
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintCoincidence.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_ConstraintCoincidence.h
4 // Created: 29 Mar 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_ConstraintCoincidence_H_
8 #define SketchSolver_ConstraintCoincidence_H_
9
10 #include "SketchSolver.h"
11 #include <SketchSolver_Constraint.h>
12
13 /** \class   SketchSolver_ConstraintCoincidence
14  *  \ingroup Plugins
15  *  \brief   Convert coincidence constraint to SolveSpace structure
16  */
17 class SketchSolver_ConstraintCoincidence : public SketchSolver_Constraint
18 {
19 public:
20   /// Constructor based on SketchPlugin constraint
21   SketchSolver_ConstraintCoincidence(ConstraintPtr theConstraint) :
22       SketchSolver_Constraint(theConstraint),
23       myInSolver(false)
24   {}
25
26   /// \brief Notify this object about the feature is changed somewhere
27   virtual void notify(const FeaturePtr&      theFeature,
28                       PlaneGCSSolver_Update* theUpdater) override;
29
30 protected:
31   /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
32   virtual void process() override;
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) override;
39
40 protected:
41   bool myInSolver; ///< shows the constraint is added to the solver
42 };
43
44 #endif