1 // File : SALOMEDSImpl_AttributeExternalFileDef.cxx
2 // Author : Sergey RUIN
5 #include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
9 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeExternalFileDef, SALOMEDSImpl_GenericAttribute )
10 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeExternalFileDef, SALOMEDSImpl_GenericAttribute )
12 //=======================================================================
15 //=======================================================================
16 const Standard_GUID& SALOMEDSImpl_AttributeExternalFileDef::GetID ()
18 static Standard_GUID SALOMEDSImpl_AttributeExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
19 return SALOMEDSImpl_AttributeExternalFileDefID;
22 //=======================================================================
25 //=======================================================================
26 Handle(SALOMEDSImpl_AttributeExternalFileDef)
27 SALOMEDSImpl_AttributeExternalFileDef::Set (const TDF_Label& L, const TCollection_ExtendedString& S)
30 Handle(SALOMEDSImpl_AttributeExternalFileDef) A;
31 if (!L.FindAttribute(SALOMEDSImpl_AttributeExternalFileDef::GetID(),A)) {
32 A = new SALOMEDSImpl_AttributeExternalFileDef();
41 //=======================================================================
42 //function : constructor
44 //=======================================================================
45 SALOMEDSImpl_AttributeExternalFileDef::SALOMEDSImpl_AttributeExternalFileDef()
46 :SALOMEDSImpl_GenericAttribute("AttributeExternalFileDef")
50 //=======================================================================
53 //=======================================================================
54 void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const TCollection_ExtendedString& S)
58 if(myString == S) return;
64 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
69 //=======================================================================
72 //=======================================================================
73 const Standard_GUID& SALOMEDSImpl_AttributeExternalFileDef::ID () const { return GetID(); }
76 //=======================================================================
79 //=======================================================================
80 Handle(TDF_Attribute) SALOMEDSImpl_AttributeExternalFileDef::NewEmpty () const
82 return new SALOMEDSImpl_AttributeExternalFileDef();
85 //=======================================================================
88 //=======================================================================
89 void SALOMEDSImpl_AttributeExternalFileDef::Restore(const Handle(TDF_Attribute)& with)
91 myString = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast (with)->Value ();
94 //=======================================================================
97 //=======================================================================
98 void SALOMEDSImpl_AttributeExternalFileDef::Paste (const Handle(TDF_Attribute)& into,
99 const Handle(TDF_RelocationTable)& RT) const
101 Handle(SALOMEDSImpl_AttributeExternalFileDef) anAttr = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(into);
102 anAttr->SetValue(myString);