1 // File : SALOMEDSImpl_AttributeUAttribute.cxx
2 // Author : Sergey RUIN
6 #include "SALOMEDSImpl_AttributeUserID.hxx"
10 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeUserID, SALOMEDSImpl_GenericAttribute )
11 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeUserID, SALOMEDSImpl_GenericAttribute )
13 Handle(SALOMEDSImpl_AttributeUserID) SALOMEDSImpl_AttributeUserID::Set (const TDF_Label& L, const Standard_GUID& ID)
15 Handle(SALOMEDSImpl_AttributeUserID) A;
16 if (!L.FindAttribute(ID, A)) {
17 A = new SALOMEDSImpl_AttributeUserID();
24 //=======================================================================
27 //=======================================================================
28 const Standard_GUID& SALOMEDSImpl_AttributeUserID::ID() const
32 //=======================================================================
35 //=======================================================================
36 void SALOMEDSImpl_AttributeUserID::SetValue( const Standard_GUID& guid)
39 if(myID == guid) return;
44 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
47 //=======================================================================
50 //=======================================================================
51 Handle(TDF_Attribute) SALOMEDSImpl_AttributeUserID::NewEmpty () const
53 Handle(SALOMEDSImpl_AttributeUserID) A = new SALOMEDSImpl_AttributeUserID();
58 //=======================================================================
61 //=======================================================================
62 void SALOMEDSImpl_AttributeUserID::Restore(const Handle(TDF_Attribute)& with)
64 Handle(SALOMEDSImpl_AttributeUserID) A = Handle(SALOMEDSImpl_AttributeUserID)::DownCast(with);
68 //=======================================================================
71 //=======================================================================
72 void SALOMEDSImpl_AttributeUserID::Paste (const Handle(TDF_Attribute)& into,
73 const Handle(TDF_RelocationTable)& RT) const
75 Handle(SALOMEDSImpl_AttributeUserID) A = Handle(SALOMEDSImpl_AttributeUserID)::DownCast(into);
79 TCollection_AsciiString SALOMEDSImpl_AttributeUserID::Type()
82 char* aUAttrName = new char[60];
84 ID().ToCString(aGUID);
85 sprintf(aUAttrName, "AttributeUserID_%s",aGUID);
87 TCollection_AsciiString ret(aUAttrName);