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);
30 /// \brief Set coordinates of fixed feature to the values where it has been dragged.
31 /// Useful when the feature is being moved.
35 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
36 virtual void process();
38 /// \brief Generate list of attributes of constraint in order useful for constraints
39 /// \param[out] theBaseEntity the entity which coordinates should be fixed
40 /// \param[out] theFixedEntity the entity containing fixed values
41 virtual void getAttributes(EntityWrapperPtr& theBaseEntity,
42 EntityWrapperPtr& theFixedEntity);
44 /// \brief Fixed feature basing on its type
45 /// \param theFeature [in] feature, converted to solver specific format
46 virtual void fixFeature(EntityWrapperPtr theFeature);
49 FeaturePtr myBaseFeature; ///< fixed feature (when it is set, myBaseConstraint should be NULL)
51 ConstraintWrapperPtr myConstraint;
52 std::vector<double> myFixedValues;
53 EntityWrapperPtr myFixedEntity;