1 // File: ModelAPI_AttributeDouble.cxx
3 // Author: Mikhail PONIKAROV
5 #include "Model_AttributeDouble.h"
6 #include <ModelAPI_Feature.h>
7 #include <ModelAPI_Data.h>
11 void Model_AttributeDouble::setValue(const double theValue)
13 if (!myIsInitialized || myReal->Get() != theValue) {
14 myReal->Set(theValue);
15 owner()->data()->sendAttributeUpdated(this);
19 double Model_AttributeDouble::value()
24 Model_AttributeDouble::Model_AttributeDouble(TDF_Label& theLabel)
26 // check the attribute could be already presented in this doc (after load document)
27 myIsInitialized = theLabel.FindAttribute(TDataStd_Real::GetID(), myReal) == Standard_True;
28 if (!myIsInitialized) {
29 // create attribute: not initialized by value yet, just zero
30 myReal = TDataStd_Real::Set(theLabel, 0.);