1 // File : SALOMEDSImpl_AttributeComment.cxx
2 // Author : Sergey RUIN
8 #include "SALOMEDSImpl_AttributeComment.hxx"
10 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeComment, SALOMEDSImpl_GenericAttribute )
11 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeComment, SALOMEDSImpl_GenericAttribute )
13 //=======================================================================
16 //=======================================================================
17 const Standard_GUID& SALOMEDSImpl_AttributeComment::GetID ()
19 static Standard_GUID CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9");
23 Handle(SALOMEDSImpl_AttributeComment) SALOMEDSImpl_AttributeComment::Set (const TDF_Label& L,
24 const TCollection_ExtendedString& Val)
26 Handle(SALOMEDSImpl_AttributeComment) A;
27 if (!L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID(), A)) {
28 A = new SALOMEDSImpl_AttributeComment();
37 //=======================================================================
40 //=======================================================================
41 void SALOMEDSImpl_AttributeComment::SetValue (const TCollection_ExtendedString& S)
45 if(myString == S) return;
51 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
55 //=======================================================================
58 //=======================================================================
59 const Standard_GUID& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); }
61 //=======================================================================
64 //=======================================================================
65 Handle(TDF_Attribute) SALOMEDSImpl_AttributeComment::NewEmpty () const
67 return new SALOMEDSImpl_AttributeComment();
70 //=======================================================================
73 //=======================================================================
74 void SALOMEDSImpl_AttributeComment::Restore(const Handle(TDF_Attribute)& with)
76 myString = Handle(SALOMEDSImpl_AttributeComment)::DownCast (with)->Value ();
79 //=======================================================================
82 //=======================================================================
84 void SALOMEDSImpl_AttributeComment::Paste (const Handle(TDF_Attribute)& into,
85 const Handle(TDF_RelocationTable)& RT) const
87 Handle(SALOMEDSImpl_AttributeComment)::DownCast (into)->SetValue(myString);