1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_ConstraintDistance.h
4 // Created: 31 Mar 2015
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_ConstraintDistance_H_
8 #define SketchSolver_ConstraintDistance_H_
10 #include "SketchSolver.h"
11 #include <SketchSolver_Constraint.h>
13 /** \class SketchSolver_ConstraintDistance
15 * \brief Convert distance constraint to SolveSpace structure
17 class SketchSolver_ConstraintDistance : public SketchSolver_Constraint
20 SketchSolver_ConstraintDistance(ConstraintPtr theConstraint) :
21 SketchSolver_Constraint(theConstraint),
22 myType(SLVS_C_UNKNOWN),
26 /// \brief Update constraint
27 virtual void update(ConstraintPtr theConstraint = ConstraintPtr());
29 virtual int getType() const
33 /// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
34 virtual void process();
36 /// \brief This method is used in derived objects to check consistence of constraint.
37 /// E.g. the distance between line and point may be signed.
38 virtual void adjustConstraint();
41 int myType; ///< type of constraint (applicable: SLVS_C_PT_PT_DISTANCE, SLVS_C_PT_LINE_DISTANCE)
42 double myPrevValue; ///< previous value of distance (for correct calculation of a distance sign)
43 bool myIsNegative; ///< \c true, if the point if placed rightside of line direction (SLVS_C_PT_LINE_DISTANCE only)