1 // File : SALOMEDSImpl_AttributePersistentRef.cxx
2 // Author : Sergey RUIN
6 #include "SALOMEDSImpl_AttributePersistentRef.hxx"
7 #include <Standard_GUID.hxx>
11 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributePersistentRef, SALOMEDSImpl_GenericAttribute )
12 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributePersistentRef, SALOMEDSImpl_GenericAttribute )
14 //=======================================================================
17 //=======================================================================
19 const Standard_GUID& SALOMEDSImpl_AttributePersistentRef::GetID ()
21 static Standard_GUID SALOMEDSImpl_AttributePersistentRefID ("92888E06-7074-11d5-A690-0800369C8A03");
22 return SALOMEDSImpl_AttributePersistentRefID;
27 //=======================================================================
30 //=======================================================================
32 Handle(SALOMEDSImpl_AttributePersistentRef) SALOMEDSImpl_AttributePersistentRef::Set (const TDF_Label& L,
33 const TCollection_ExtendedString& S)
35 Handle(SALOMEDSImpl_AttributePersistentRef) A;
36 if (!L.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID(),A)) {
37 A = new SALOMEDSImpl_AttributePersistentRef();
46 //=======================================================================
47 //function : constructor
49 //=======================================================================
50 SALOMEDSImpl_AttributePersistentRef::SALOMEDSImpl_AttributePersistentRef()
51 :SALOMEDSImpl_GenericAttribute("AttributePersistentRef")
55 //=======================================================================
58 //=======================================================================
60 const Standard_GUID& SALOMEDSImpl_AttributePersistentRef::ID () const { return GetID(); }
63 //=======================================================================
66 //=======================================================================
67 void SALOMEDSImpl_AttributePersistentRef::SetValue (const TCollection_ExtendedString& S)
71 if(myString == S) return;
77 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
80 //=======================================================================
83 //=======================================================================
85 Handle(TDF_Attribute) SALOMEDSImpl_AttributePersistentRef::NewEmpty () const
87 return new SALOMEDSImpl_AttributePersistentRef();
90 //=======================================================================
93 //=======================================================================
95 void SALOMEDSImpl_AttributePersistentRef::Restore(const Handle(TDF_Attribute)& with)
97 myString = Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast (with)->Value ();
100 //=======================================================================
103 //=======================================================================
105 void SALOMEDSImpl_AttributePersistentRef::Paste (const Handle(TDF_Attribute)& into,
106 const Handle(TDF_RelocationTable)& RT) const
108 Handle(SALOMEDSImpl_AttributePersistentRef)::DownCast (into)->SetValue(myString);