1 // File: ModelAPI_AttributeDouble.cxx
3 // Author: Mikhail PONIKAROV
5 #include "Model_AttributeDouble.h"
6 #include "Model_Events.h"
7 #include <Events_Loop.h>
11 void Model_AttributeDouble::setValue(const double theValue)
13 if (myReal->Get() != theValue) {
14 myReal->Set(theValue);
15 static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
16 Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
17 Events_Loop::loop()->send(aMsg);
21 double Model_AttributeDouble::value()
26 Model_AttributeDouble::Model_AttributeDouble(TDF_Label& theLabel)
28 // check the attribute could be already presented in this doc (after load document)
29 if (!theLabel.FindAttribute(TDataStd_Real::GetID(), myReal)) {
30 // create attribute: not initialized by value yet, just zero
31 myReal = TDataStd_Real::Set(theLabel, 0.);