1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeBoolean.cpp
4 // Created: 2 june 2014
5 // Author: Vitaly Smetannikov
7 #include "Model_AttributeBoolean.h"
8 #include <ModelAPI_Feature.h>
9 #include <ModelAPI_Data.h>
11 void Model_AttributeBoolean::setValue(bool theValue)
13 Standard_Integer aValue = theValue ? 1 : 0;
14 if (!myIsInitialized || myBool->Get() != aValue) {
16 myBool = TDataStd_Integer::Set(myLab, 0);
18 owner()->data()->sendAttributeUpdated(this);
22 bool Model_AttributeBoolean::value()
24 return myIsInitialized && myBool->Get() == 1;
27 Model_AttributeBoolean::Model_AttributeBoolean(TDF_Label& theLabel)
33 void Model_AttributeBoolean::reinit()
35 // check the attribute could be already presented in this doc (after load document)
36 myIsInitialized = myLab.FindAttribute(TDataStd_Integer::GetID(), myBool) == Standard_True;