Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintDistance.cpp
index 599cb72e954d034d58537f0eb8dabf97ea51b4b2..6e37f0cbe1094964f924c483b40a5a6007198842 100644 (file)
@@ -43,16 +43,15 @@ void SketchPlugin_ConstraintDistance::execute()
   boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr_B = 
           boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_B));
 
-  AttributeDoublePtr anAttribute =
+  AttributeDoublePtr anAttr_Value =
       boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(aData->attribute(CONSTRAINT_ATTR_VALUE));
-
-  if (anAttr_A && anAttr_B && anAttribute->value() == 0)
+  if (anAttr_A && anAttr_B && !anAttr_Value->isInitialized())
   {
     FeaturePtr aFeature_A = anAttr_A->feature();
     FeaturePtr aFeature_B = anAttr_B->feature();
 
     double aValue = 40; // TODO
-    anAttribute->setValue(aValue);
+    anAttr_Value->setValue(aValue);
   }
 }