1 // File : SALOMEDSImpl_AttributeLocalID.cxx
2 // Author : Sergey RUIN
6 #include "SALOMEDSImpl_AttributeLocalID.hxx"
7 #include <Standard_GUID.hxx>
11 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeLocalID, SALOMEDSImpl_GenericAttribute )
12 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeLocalID, SALOMEDSImpl_GenericAttribute )
14 //=======================================================================
17 //=======================================================================
19 const Standard_GUID& SALOMEDSImpl_AttributeLocalID::GetID ()
21 static Standard_GUID SALOMEDSImpl_AttributeLocalID ("12837196-8F52-11d6-A8A3-0001021E8C7F");
22 return SALOMEDSImpl_AttributeLocalID;
27 //=======================================================================
30 //=======================================================================
32 Handle(SALOMEDSImpl_AttributeLocalID) SALOMEDSImpl_AttributeLocalID::Set (const TDF_Label& L,
33 const Standard_Integer value)
35 Handle(SALOMEDSImpl_AttributeLocalID) A;
36 if (!L.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID(),A)) {
37 A = new SALOMEDSImpl_AttributeLocalID();
46 //=======================================================================
47 //function : constructor
49 //=======================================================================
50 SALOMEDSImpl_AttributeLocalID::SALOMEDSImpl_AttributeLocalID()
51 :SALOMEDSImpl_GenericAttribute("AttributeLocalID")
56 //=======================================================================
59 //=======================================================================
60 void SALOMEDSImpl_AttributeLocalID::SetValue(const Standard_Integer theValue)
68 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
72 //=======================================================================
75 //=======================================================================
77 const Standard_GUID& SALOMEDSImpl_AttributeLocalID::ID () const { return GetID(); }
80 //=======================================================================
83 //=======================================================================
85 Handle(TDF_Attribute) SALOMEDSImpl_AttributeLocalID::NewEmpty () const
87 return new SALOMEDSImpl_AttributeLocalID();
90 //=======================================================================
93 //=======================================================================
95 void SALOMEDSImpl_AttributeLocalID::Restore(const Handle(TDF_Attribute)& with)
97 myValue = Handle(SALOMEDSImpl_AttributeLocalID)::DownCast (with)->Value();
100 //=======================================================================
103 //=======================================================================
105 void SALOMEDSImpl_AttributeLocalID::Paste (const Handle(TDF_Attribute)& into,
106 const Handle(TDF_RelocationTable)& RT) const
108 Handle(SALOMEDSImpl_AttributeLocalID)::DownCast (into)->SetValue(myValue);