1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_ConstraintMovement.h
4 // Created: 15 Jun 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_ConstraintMovement_H_
8 #define SketchSolver_ConstraintMovement_H_
10 #include "SketchSolver.h"
11 #include <SketchSolver_ConstraintRigid.h>
13 #include <GeomDataAPI_Point2D.h>
15 /** \class SketchSolver_ConstraintMovement
17 * \brief Stores data of Rigid (Fixed) constraint for the moved feature only
19 class SketchSolver_ConstraintMovement : public SketchSolver_ConstraintRigid
22 /// Creates constraint to manage the given constraint from plugin
23 SketchSolver_ConstraintMovement(ConstraintPtr theConstraint)
24 : SketchSolver_ConstraintRigid(theConstraint)
28 /// Creates temporary constraint based on feature
29 SketchSolver_ConstraintMovement(FeaturePtr theFeature);
32 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
33 virtual void process();
35 /// \brief Generate list of attributes of constraint in order useful for SolveSpace constraints
36 /// \param[out] theValue numerical characteristic of constraint (e.g. distance)
37 /// \param[out] theAttributes list of attributes to be filled
38 /// \param[out] theIsFullyMoved shows that the feature is moved, in other case only one point of the feature is shifted
39 virtual void getAttributes(double& theValue, std::vector<Slvs_hEntity>& theAttributes, bool& theIsFullyMoved);
42 /// \brief Check the coordinates of point are differ than coordinates of correponding SolveSpace entity
43 bool isMoved(std::shared_ptr<GeomDataAPI_Point2D> thePoint, Slvs_hEntity theEntity);