1 // File : SALOMEDSImpl_AttributeFlags.cxx
2 // Author : Sergey LITONIN
5 #include "SALOMEDSImpl_AttributeFlags.hxx"
6 #include <Standard_GUID.hxx>
12 Class : SALOMEDSImpl_AttributeFlags
13 Description : This class is intended for storing different object attributes that
14 have only two states (0 and 1).
17 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeFlags, SALOMEDSImpl_GenericAttribute )
18 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeFlags, SALOMEDSImpl_GenericAttribute )
20 //=======================================================================
21 //function : SALOMEDSImpl_AttributeFlags::GetID
22 //purpose : Get GUID of this attribute
23 //=======================================================================
24 const Standard_GUID& SALOMEDSImpl_AttributeFlags::GetID ()
26 static Standard_GUID SALOMEDSImpl_AttributeFlagsID( "866EEC9F-A517-4cb4-88E6-E208DB8FC96F" );
27 return SALOMEDSImpl_AttributeFlagsID;
30 //=======================================================================
31 //function : SALOMEDSImpl_AttributeFlags::Set
32 //purpose : Set value of the attribute
33 //=======================================================================
34 Handle(SALOMEDSImpl_AttributeFlags) SALOMEDSImpl_AttributeFlags::Set(const TDF_Label& L,
35 const Standard_Integer value )
37 Handle(SALOMEDSImpl_AttributeFlags) A;
38 if ( !L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID(),A ) )
40 A = new SALOMEDSImpl_AttributeFlags();
48 //=======================================================================
49 //function : SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags
50 //purpose : Constructor
51 //=======================================================================
52 SALOMEDSImpl_AttributeFlags::SALOMEDSImpl_AttributeFlags()
53 :SALOMEDSImpl_GenericAttribute("AttributeFlags")
58 SALOMEDSImpl_AttributeFlags::~SALOMEDSImpl_AttributeFlags()
62 //=======================================================================
63 //function : SALOMEDSImpl_AttributeFlags::ID
64 //purpose : Get GUID of this attribute
65 //=======================================================================
66 const Standard_GUID& SALOMEDSImpl_AttributeFlags::ID () const
71 //=======================================================================
72 //function : SALOMEDSImpl_AttributeFlags::NewEmpty
73 //purpose : Create new empty attribute
74 //=======================================================================
76 Handle(TDF_Attribute) SALOMEDSImpl_AttributeFlags::NewEmpty () const
78 return new SALOMEDSImpl_AttributeFlags();
81 //=======================================================================
82 //function : SALOMEDSImpl_AttributeFlags::Restore
83 //purpose : Assign given value to the attribute
84 //=======================================================================
85 void SALOMEDSImpl_AttributeFlags::Restore( const Handle(TDF_Attribute)& with )
87 myValue = Handle(SALOMEDSImpl_AttributeFlags)::DownCast( with )->Get();
91 //=======================================================================
92 //function : SALOMEDSImpl_AttributeFlags::Paste
93 //purpose : Assign internal value to the given attribute
94 //=======================================================================
95 void SALOMEDSImpl_AttributeFlags::Paste(const Handle(TDF_Attribute)& into,
96 const Handle(TDF_RelocationTable)& RT ) const
98 Handle(SALOMEDSImpl_AttributeFlags)::DownCast( into )->Set( myValue );
101 //=======================================================================
102 //function : SALOMEDSImpl_AttributeFlags::Set
103 //purpose : Set value
104 //=======================================================================
105 void SALOMEDSImpl_AttributeFlags::Set( const Standard_Integer v )
111 //=======================================================================
112 //function : SALOMEDSImpl_AttributeFlags::Get
114 //=======================================================================
115 Standard_Integer SALOMEDSImpl_AttributeFlags::Get() const