1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_ConstraintFixed.h
4 // Created: 30 Mar 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_ConstraintFixed_H_
8 #define SketchSolver_ConstraintFixed_H_
10 #include <SketchSolver_Constraint.h>
12 /** \class SketchSolver_ConstraintFixed
14 * \brief Stores data of the Fixed constraint
16 * Fixed constraint may have NULL basic SketchPlugin constraint,
17 * because the Fixed constraint may be temporary for correct moving of objects.
19 class SketchSolver_ConstraintFixed : public SketchSolver_Constraint
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);
27 /// \brief Block or unblock events from this constraint
28 virtual void blockEvents(bool isBlocked);
31 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
32 virtual void process();
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);
40 /// \brief Fixed feature basing on its type
41 /// \param theFeature [in] feature, converted to solver specific format
42 virtual void fixFeature(EntityWrapperPtr theFeature);
45 FeaturePtr myBaseFeature; ///< fixed feature (when it is set, myBaseConstraint should be NULL)
47 ConstraintWrapperPtr myConstraint;
48 std::vector<double> myFixedValues;