From: azv Date: Thu, 3 Mar 2016 09:02:24 +0000 (+0300) Subject: Incorrect attribute when create arc (issue #1355) X-Git-Tag: V_2.2.0~20^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a32720fe5e394f888c203b268a6325cb216f87b7;p=modules%2Fshaper.git Incorrect attribute when create arc (issue #1355) Update arguments verification in tangency constraint. --- diff --git a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp index 0bd02bf0b..299ed53fa 100644 --- a/src/SketchSolver/SketchSolver_ConstraintTangent.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintTangent.cpp @@ -85,9 +85,9 @@ void SketchSolver_ConstraintTangent::getAttributes( return; } - if (myType != CONSTRAINT_TANGENT_CIRCLE_LINE && + if (myType == CONSTRAINT_TANGENT_ARC_LINE && !hasSingleCoincidence(theAttributes[2], theAttributes[3])) - myErrorMsg = SketchSolver_Error::INCORRECT_ATTRIBUTE(); + myErrorMsg = SketchSolver_Error::TANGENCY_FAILED(); if (isSwap) { EntityWrapperPtr aTemp = theAttributes[2]; diff --git a/src/SketchSolver/SketchSolver_Error.h b/src/SketchSolver/SketchSolver_Error.h index 648a3918f..2e1431454 100644 --- a/src/SketchSolver/SketchSolver_Error.h +++ b/src/SketchSolver/SketchSolver_Error.h @@ -65,6 +65,12 @@ class SketchSolver_Error static const std::string MY_ERROR_VALUE("Entity already fixed"); return MY_ERROR_VALUE; } + /// Tangency constraint has been built with wrong attributes (for example, line and arc have two coincident points) + inline static const std::string& TANGENCY_FAILED() + { + static const std::string MY_ERROR_VALUE("Unable to create tangency constraint on given attributes"); + return MY_ERROR_VALUE; + } /// Crash in SolveSpace inline static const std::string& SOLVESPACE_CRASH() {