1 // File : SALOMEDSImpl_AttributePixMap.cxx
2 // Author : Sergey RUIN
5 #include "SALOMEDSImpl_AttributePixMap.hxx"
6 #include <TCollection_ExtendedString.hxx>
7 #include <Standard_GUID.hxx>
11 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributePixMap, SALOMEDSImpl_GenericAttribute )
12 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributePixMap, SALOMEDSImpl_GenericAttribute )
14 //=======================================================================
17 //=======================================================================
19 const Standard_GUID& SALOMEDSImpl_AttributePixMap::GetID ()
21 static Standard_GUID SALOMEDSImpl_AttributePixMapID ("12837187-8F52-11d6-A8A3-0001021E8C7F");
22 return SALOMEDSImpl_AttributePixMapID;
27 //=======================================================================
30 //=======================================================================
32 Handle(SALOMEDSImpl_AttributePixMap) SALOMEDSImpl_AttributePixMap::Set (const TDF_Label& L,
33 const TCollection_ExtendedString& S)
35 Handle(SALOMEDSImpl_AttributePixMap) A;
36 if (!L.FindAttribute(SALOMEDSImpl_AttributePixMap::GetID(),A)) {
37 A = new SALOMEDSImpl_AttributePixMap();
46 //=======================================================================
47 //function : constructor
49 //=======================================================================
50 SALOMEDSImpl_AttributePixMap::SALOMEDSImpl_AttributePixMap()
51 :SALOMEDSImpl_GenericAttribute("AttributePixMap")
56 //=======================================================================
57 //function : SetPixMap
59 //=======================================================================
60 void SALOMEDSImpl_AttributePixMap::SetPixMap (const TCollection_ExtendedString& S)
64 if(myString == S) return;
70 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
73 //=======================================================================
76 //=======================================================================
78 const Standard_GUID& SALOMEDSImpl_AttributePixMap::ID () const { return GetID(); }
81 //=======================================================================
84 //=======================================================================
86 Handle(TDF_Attribute) SALOMEDSImpl_AttributePixMap::NewEmpty () const
88 return new SALOMEDSImpl_AttributePixMap();
91 //=======================================================================
94 //=======================================================================
96 void SALOMEDSImpl_AttributePixMap::Restore(const Handle(TDF_Attribute)& with)
98 myString = Handle(SALOMEDSImpl_AttributePixMap)::DownCast (with)->GetPixMap ();
101 //=======================================================================
104 //=======================================================================
106 void SALOMEDSImpl_AttributePixMap::Paste (const Handle(TDF_Attribute)& into,
107 const Handle(TDF_RelocationTable)& RT) const
109 Handle(SALOMEDSImpl_AttributePixMap)::DownCast (into)->SetPixMap (myString);