1 // File: Model_AttributeBoolean.cpp
2 // Created: 2 june 2014
3 // Author: Vitaly Smetannikov
5 #include "Model_AttributeBoolean.h"
6 #include "Model_Events.h"
7 #include <Events_Loop.h>
11 void Model_AttributeBoolean::setValue(bool theValue)
13 Standard_Boolean aValue = theValue ? Standard_True : Standard_False;
14 if (myBool->Get() != aValue) {
16 static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
17 Model_FeatureUpdatedMessage aMsg(owner(), anEvent);
18 Events_Loop::loop()->send(aMsg);
22 bool Model_AttributeBoolean::value()
24 return myBool->Get() == Standard_True;
27 Model_AttributeBoolean::Model_AttributeBoolean(TDF_Label& theLabel)
29 // check the attribute could be already presented in this doc (after load document)
30 if (!theLabel.FindAttribute(TDataStd_Integer::GetID(), myBool)) {
31 // create attribute: not initialized by value yet, just zero
32 myBool = TDataStd_Integer::Set(theLabel, 0);