1 // File : SALOMEDS_AttributeFlags_i.cxx
2 // Author : Sergey RUIN
6 #include "SALOMEDS_AttributeFlags_i.hxx"
7 #include "SALOMEDS.hxx"
12 Class : SALOMEDS_AttributeFlags_i
13 Description : This class is intended for storing different object attributes that
14 have only two states (0 and 1).
18 IS_VISIBLE - is equal to 1 if object is visible in 3D view (0 - overwise).
19 This attribute is valid for active view only.
23 //=======================================================================
24 // function : SALOMEDS_AttributeFlags_i::GetFlags
25 // purpose : Get all flags as integer value
26 //=======================================================================
27 CORBA::Long SALOMEDS_AttributeFlags_i::GetFlags()
29 SALOMEDS::Locker lock;
30 return Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_impl)->Get();
33 //=======================================================================
34 // function : SALOMEDS_AttributeFlags_i::SetFlags
35 // purpose : Set all flags as integer value
36 //=======================================================================
37 void SALOMEDS_AttributeFlags_i::SetFlags( CORBA::Long theFlags )
39 SALOMEDS::Locker lock;
40 Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_impl)->Set( theFlags );
43 //=======================================================================
44 // function : SALOMEDS_AttributeFlags_i::Get
45 // purpose : Get specified flag
46 //=======================================================================
47 CORBA::Boolean SALOMEDS_AttributeFlags_i::Get( CORBA::Long theFlag )
49 SALOMEDS::Locker lock;
50 return Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_impl)->Get() & theFlag ? true : false;
53 //=======================================================================
54 // function : SALOMEDS_AttributeFlags_i::Set
55 // purpose : Set/Unset specified flag
56 //=======================================================================
57 void SALOMEDS_AttributeFlags_i::Set( CORBA::Long theFlag, CORBA::Boolean theValue )
59 SALOMEDS::Locker lock;
60 Handle(SALOMEDSImpl_AttributeFlags) anAttr = Handle(SALOMEDSImpl_AttributeFlags)::DownCast(_impl);
62 anAttr->Set( anAttr->Get() | theFlag );
64 anAttr->Set( anAttr->Get() & ~theFlag );