Sketcher: Support for detecting expressions in constraints

This commit is contained in:
Abdullah Tahiri
2017-12-17 14:15:32 +01:00
committed by wmayer
parent ad26e922ef
commit d4e8b95197
2 changed files with 11 additions and 0 deletions

View File

@@ -5839,6 +5839,15 @@ int SketchObject::changeConstraintsLocking(bool bLock)
return cntSuccess;
}
bool SketchObject::constraintHasExpression(int constrid)
{
App::ObjectIdentifier spath = this->Constraints.createPath(constrid);
App::PropertyExpressionEngine::ExpressionInfo expr_info = this->getExpression(spath);
return (expr_info.expression != 0);
}
/*!
* \brief SketchObject::port_reversedExternalArcs finds constraints that link to endpoints of external-geometry arcs,

View File

@@ -265,6 +265,8 @@ public:
bool isPointOnCurve(int geoIdCurve, double px, double py);
double calculateConstraintError(int ConstrId);
int changeConstraintsLocking(bool bLock);
/// returns whether a given constraint has an associated expression or not
bool constraintHasExpression(int constrid);
///porting functions
int port_reversedExternalArcs(bool justAnalyze);