1 // File: Model_AttributeBoolean.cpp
2 // Created: 2 june 2014
3 // Author: Vitaly Smetannikov
5 #include "Model_AttributeBoolean.h"
6 #include <ModelAPI_Feature.h>
7 #include <ModelAPI_Data.h>
11 void Model_AttributeBoolean::setValue(bool theValue)
13 Standard_Boolean aValue = theValue ? Standard_True : Standard_False;
14 if (!myIsInitialized || myBool->Get() != aValue) {
16 owner()->data()->sendAttributeUpdated(this);
20 bool Model_AttributeBoolean::value()
22 return myBool->Get() == Standard_True ;
25 Model_AttributeBoolean::Model_AttributeBoolean(TDF_Label& theLabel)
27 // check the attribute could be already presented in this doc (after load document)
28 myIsInitialized = theLabel.FindAttribute(TDataStd_Integer::GetID(), myBool) == Standard_True;
29 if (!myIsInitialized) {
30 // create attribute: not initialized by value yet, just zero
31 myBool = TDataStd_Integer::Set(theLabel, 0);