1 // File : SALOMEDS_AttributeFlags.cxx
2 // Author : Sergey RUIN
5 #include "SALOMEDS_AttributeFlags.hxx"
7 #include <TCollection_AsciiString.hxx>
8 #include <TCollection_ExtendedString.hxx>
10 SALOMEDS_AttributeFlags::SALOMEDS_AttributeFlags(const Handle(SALOMEDSImpl_AttributeFlags)& theAttr)
11 :SALOMEDS_GenericAttribute(theAttr)
14 SALOMEDS_AttributeFlags::SALOMEDS_AttributeFlags(SALOMEDS::AttributeFlags_ptr theAttr)
15 :SALOMEDS_GenericAttribute(theAttr)
18 SALOMEDS_AttributeFlags::~SALOMEDS_AttributeFlags()
21 int SALOMEDS_AttributeFlags::GetFlags()
24 if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl)->Get();
25 else aValue = SALOMEDS::AttributeFlags::_narrow(_corba_impl)->GetFlags();
29 void SALOMEDS_AttributeFlags::SetFlags(int theFlags)
31 if(_isLocal) Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl)->Set(theFlags);
32 else SALOMEDS::AttributeFlags::_narrow(_corba_impl)->SetFlags(theFlags);
35 bool SALOMEDS_AttributeFlags::Get(int theFlag)
37 return (GetFlags() & theFlag) ? true : false;
40 void SALOMEDS_AttributeFlags::Set(int theFlag, bool theValue)
43 Handle(SALOMEDSImpl_AttributeFlags) anAttr = Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_local_impl);
45 anAttr->Set( anAttr->Get() | theFlag );
47 anAttr->Set( anAttr->Get() & ~theFlag );
49 else SALOMEDS::AttributeFlags::_narrow(_corba_impl)->Set(theFlag, theValue);