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 class SketchSolver_ConstraintFixed : public SketchSolver_Constraint
19 /// Creates constraint to manage the given constraint from plugin
20 SketchSolver_ConstraintFixed(ConstraintPtr theConstraint);
21 #ifndef SUPPORT_NEW_MOVE
22 /// Creates temporary constraint based on feature (useful while the feature is being moved)
23 SketchSolver_ConstraintFixed(FeaturePtr theFeature);
26 /// \brief Block or unblock events from this constraint
27 virtual void blockEvents(bool isBlocked);
29 #ifndef SUPPORT_NEW_MOVE
30 /// \brief Set coordinates of fixed feature to the values where it has been dragged.
31 /// Useful when the feature is being moved.
36 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
37 virtual void process();
39 /// \brief Generate list of attributes of constraint in order useful for constraints
40 /// \param[out] theValue numerical characteristic of constraint (e.g. distance)
41 /// \param[out] theAttributes list of attributes to be filled
42 virtual void getAttributes(EntityWrapperPtr& , std::vector<EntityWrapperPtr>& )
45 #ifdef SUPPORT_NEW_MOVE
46 /// \brief Obtain entity to be fixed
47 virtual EntityWrapperPtr entityToFix();
49 /// \brief Generate list of attributes of constraint in order useful for constraints
50 /// \param[out] theBaseEntity the entity which coordinates should be fixed
51 /// \param[out] theFixedEntity the entity containing fixed values
52 virtual void getAttributes(EntityWrapperPtr& theBaseEntity,
53 EntityWrapperPtr& theFixedEntity);
56 /// \brief Create Fixed constraint for the feature basing on its type
57 /// \param theFeature [in] feature, converted to solver specific format
58 /// \return Fixed constraint
59 virtual ConstraintWrapperPtr fixFeature(EntityWrapperPtr theFeature);
61 #ifndef SUPPORT_NEW_MOVE
64 /// \brief Get list of parameters of current entity
65 static GCS::VEC_pD toParameters(const EntityWrapperPtr& theEntity);
67 #ifdef SUPPORT_NEW_MOVE
71 FeaturePtr myBaseFeature; ///< fixed feature (when it is set, myBaseConstraint should be NULL)
73 ConstraintWrapperPtr myConstraint;
74 EntityWrapperPtr myFixedEntity;
76 std::vector<double> myFixedValues;