1 // File : SALOMEDSImpl_AttributeReal.cxx
2 // Author : Sergey RUIN
5 #include "SALOMEDSImpl_AttributeReal.hxx"
9 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeReal, SALOMEDSImpl_GenericAttribute )
10 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeReal, SALOMEDSImpl_GenericAttribute )
12 //=======================================================================
15 //=======================================================================
16 const Standard_GUID& SALOMEDSImpl_AttributeReal::GetID ()
18 static Standard_GUID realID ("1D1992F0-56F4-46b4-8065-CDEA68061CAB");
22 Handle(SALOMEDSImpl_AttributeReal) SALOMEDSImpl_AttributeReal::Set (const TDF_Label& L, const Standard_Real Val)
24 Handle(SALOMEDSImpl_AttributeReal) A;
25 if (!L.FindAttribute(SALOMEDSImpl_AttributeReal::GetID(), A)) {
26 A = new SALOMEDSImpl_AttributeReal();
34 //=======================================================================
37 //=======================================================================
38 void SALOMEDSImpl_AttributeReal::SetValue(const Standard_Real 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_AttributeReal::ID () const
59 //=======================================================================
62 //=======================================================================
63 Handle(TDF_Attribute) SALOMEDSImpl_AttributeReal::NewEmpty () const
65 return new SALOMEDSImpl_AttributeReal();
68 //=======================================================================
71 //=======================================================================
72 void SALOMEDSImpl_AttributeReal::Restore(const Handle(TDF_Attribute)& with)
74 myValue = Handle(SALOMEDSImpl_AttributeReal)::DownCast (with)->Value ();
77 //=======================================================================
80 //=======================================================================
81 void SALOMEDSImpl_AttributeReal::Paste (const Handle(TDF_Attribute)& into,
82 const Handle(TDF_RelocationTable)& RT) const
84 Handle(SALOMEDSImpl_AttributeReal)::DownCast (into)->SetValue(myValue);