]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #196: Implemented verification of zero distance in SketchSolver
authornds <natalia.donis@opencascade.com>
Mon, 10 Nov 2014 06:43:40 +0000 (09:43 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 10 Nov 2014 06:43:40 +0000 (09:43 +0300)
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp

index 2e22f0c3214f7db006b79531e8ffcadb27f3bb34..3ad9b6842708241f09163cca00947d61539e21f6 100644 (file)
@@ -123,6 +123,10 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi
   boost::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = boost::dynamic_pointer_cast<
       ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE()));
   double aValue = aValueAttr->value();
+  // Issue #196: checking the positivity of the distance constraint
+  // there is a validator for a distance constraint, that the value should be positive
+  if (aValue <= 0)
+    return AISObjectPtr();
 
   AISObjectPtr anAIS = thePrevious;
   if (!anAIS)