]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintDistance.cpp
index d6e2b0075c7958cdbff8f71c55da53209fbd6f6f..1ff92e3fdb260b0af0aba1b2eb5b5e876e61e512 100644 (file)
@@ -31,16 +31,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);
   }
 }