ModuleBase_WidgetFeature* that = (ModuleBase_WidgetFeature*) this;
//bool isBlocked = that->blockSignals(true);
aRef->setFeature(myFeature);
+ theFeature->execute();
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
//that->blockSignals(isBlocked);
void SketchPlugin_ConstraintDistance::execute()
{
+ boost::shared_ptr<ModelAPI_Data> aData = data();
+
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr_A =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr_B =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_B));
+
+ AttributeDoublePtr anAttribute =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(aData->attribute(CONSTRAINT_ATTR_VALUE));
+
+ if (anAttr_A && anAttr_B && anAttribute->value() == 0)
+ {
+ FeaturePtr aFeature_A = anAttr_A->feature();
+ FeaturePtr aFeature_B = anAttr_B->feature();
+
+ double aValue = 40; // TODO
+ anAttribute->setValue(aValue);
+ }
}
const boost::shared_ptr<GeomAPI_Shape>& SketchPlugin_ConstraintDistance::preview()