1 // File : SALOMEDSImpl_AttributeInteger.cxx
2 // Author : Sergey RUIN
8 #include "SALOMEDSImpl_AttributeInteger.hxx"
10 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeInteger, SALOMEDSImpl_GenericAttribute)
11 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeInteger, SALOMEDSImpl_GenericAttribute )
14 //=======================================================================
17 //=======================================================================
18 const Standard_GUID& SALOMEDSImpl_AttributeInteger::GetID ()
20 static Standard_GUID IntegerID ("8CC3E213-C9B4-47e4-8496-DD5E62E22018");
24 Handle(SALOMEDSImpl_AttributeInteger) SALOMEDSImpl_AttributeInteger::Set (const TDF_Label& L, Standard_Integer Val)
26 Handle(SALOMEDSImpl_AttributeInteger) A;
27 if (!L.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID(), A)) {
28 A = new SALOMEDSImpl_AttributeInteger();
36 //=======================================================================
39 //=======================================================================
40 void SALOMEDSImpl_AttributeInteger::SetValue(const Standard_Integer v)
42 if(myValue == v) return;
47 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
50 //=======================================================================
53 //=======================================================================
54 const Standard_GUID& SALOMEDSImpl_AttributeInteger::ID () const { return GetID(); }
57 //=======================================================================
60 //=======================================================================
61 Handle(TDF_Attribute) SALOMEDSImpl_AttributeInteger::NewEmpty () const
63 return new SALOMEDSImpl_AttributeInteger();
66 //=======================================================================
69 //=======================================================================
70 void SALOMEDSImpl_AttributeInteger::Restore(const Handle(TDF_Attribute)& With)
72 myValue = Handle(SALOMEDSImpl_AttributeInteger)::DownCast (With)->Value();
75 //=======================================================================
78 //=======================================================================
79 void SALOMEDSImpl_AttributeInteger::Paste (const Handle(TDF_Attribute)& Into,
80 const Handle(TDF_RelocationTable)& RT) const
82 Handle(SALOMEDSImpl_AttributeInteger)::DownCast(Into)->SetValue(myValue);