1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_AttributeDouble.cxx
5 // Author: Mikhail PONIKAROV
7 #include "Model_AttributeDouble.h"
8 #include <ModelAPI_Feature.h>
9 #include <ModelAPI_Data.h>
13 void Model_AttributeDouble::setValue(const double theValue)
15 if (!myIsInitialized || myReal->Get() != theValue) {
16 myReal->Set(theValue);
17 owner()->data()->sendAttributeUpdated(this);
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 myIsInitialized = theLabel.FindAttribute(TDataStd_Real::GetID(), myReal) == Standard_True;
30 if (!myIsInitialized) {
31 // create attribute: not initialized by value yet, just zero
32 myReal = TDataStd_Real::Set(theLabel, 0.);