1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_ConstraintParametric.h
4 // Created: 15 Jun 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_ConstraintParametric_H_
8 #define SketchSolver_ConstraintParametric_H_
10 #include "SketchSolver.h"
11 #include <SketchSolver_ConstraintRigid.h>
13 /** \class SketchSolver_ConstraintParametric
15 * \brief Stores data of Rigid (Fixed) constraint for the attribute
16 * which coordinates are given by parametric expression
18 class SketchSolver_ConstraintParametric : public SketchSolver_ConstraintRigid
21 /// Creates constraint to manage the given constraint from plugin
22 SketchSolver_ConstraintParametric()
23 : SketchSolver_ConstraintRigid(ConstraintPtr())
27 /// Creates temporary constraint based on feature
28 SketchSolver_ConstraintParametric(AttributePtr theAttribute);
30 /// \brief Update constraint
31 virtual void update(ConstraintPtr theConstraint = ConstraintPtr());
33 /// \brief Update points coincident with parametric one
34 virtual void refresh();
37 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
38 virtual void process();
40 /// \brief Convert attribute to the entity
41 /// \param[out] theAttributeID identifier of the entity related to the attribute
42 virtual void getAttributes(Slvs_hEntity& theAttributeID);
44 /// \brief This method is used in derived objects to check consistence of constraint.
45 virtual void adjustConstraint();
48 /// \brief Create SolveSpace line with given coordinates
49 /// \return created line
50 Slvs_Entity createLine(double theStartX, double theStartY, double theEndX, double theEndY);
53 AttributePtr myBaseAttribute; ///< attribute given by expression
54 Slvs_hEntity myHorizLineID; ///< identifier of horizontal line, containing the point
55 Slvs_hEntity myVertLineID; ///< identifier of vertical line, containing the point