-
-/** \class SketchSolver_ConstraintHorizontal
- * \ingroup Plugins
- * \brief Convert Horizontal constraint to SolveSpace structure
- */
-class SketchSolver_ConstraintHorizontal : public SketchSolver_Constraint
-{
-public:
- /// Constructor based on SketchPlugin constraint
- SketchSolver_ConstraintHorizontal(ConstraintPtr theConstraint) :
- SketchSolver_Constraint(theConstraint)
- {}
-
- virtual int getType() const
- { return SLVS_C_HORIZONTAL; }
-};
-
-
-/** \class SketchSolver_ConstraintVertical
- * \ingroup Plugins
- * \brief Convert Vertical constraint to SolveSpace structure
- */
-class SketchSolver_ConstraintVertical : public SketchSolver_Constraint
-{
-public:
- /// Constructor based on SketchPlugin constraint
- SketchSolver_ConstraintVertical(ConstraintPtr theConstraint) :
- SketchSolver_Constraint(theConstraint)
- {}
-
- virtual int getType() const
- { return SLVS_C_VERTICAL; }
-};
-
-
-/** \class SketchSolver_ConstraintRadius
- * \ingroup Plugins
- * \brief Convert Radius constraint to SolveSpace structure
- */
-class SketchSolver_ConstraintRadius : public SketchSolver_Constraint
-{
-public:
- /// Constructor based on SketchPlugin constraint
- SketchSolver_ConstraintRadius(ConstraintPtr theConstraint) :
- SketchSolver_Constraint(theConstraint)
- {}
-
- virtual int getType() const
- { return SLVS_C_DIAMETER; }
-
- virtual void adjustConstraint()
- {
- AttributeDoublePtr aValueAttr = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
- myBaseConstraint->attribute(SketchPlugin_Constraint::VALUE()));
- Slvs_Constraint aConstraint = myStorage->getConstraint(mySlvsConstraints.front());
- aConstraint.valA = 2.0 * aValueAttr->value();
- myStorage->updateConstraint(aConstraint);
- }
-};