Salome HOME
ENV: Windows porting.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributePixMap.cxx
1 //  File   : SALOMEDS_AttributePixMap.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #include "SALOMEDS_AttributePixMap.hxx"
6
7 #include <string>
8 #include <TCollection_AsciiString.hxx> 
9 #include <TCollection_ExtendedString.hxx>
10
11 SALOMEDS_AttributePixMap::SALOMEDS_AttributePixMap(const Handle(SALOMEDSImpl_AttributePixMap)& theAttr)
12 :SALOMEDS_GenericAttribute(theAttr)
13 {}
14
15 SALOMEDS_AttributePixMap::SALOMEDS_AttributePixMap(SALOMEDS::AttributePixMap_ptr theAttr)
16 :SALOMEDS_GenericAttribute(theAttr)
17 {}
18
19 SALOMEDS_AttributePixMap::~SALOMEDS_AttributePixMap()
20 {}
21
22 bool SALOMEDS_AttributePixMap::HasPixMap()
23 {
24   bool ret;
25   if(_isLocal) ret = Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->HasPixMap();
26   else ret = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->HasPixMap();
27   return ret;
28 }
29
30 std::string SALOMEDS_AttributePixMap::GetPixMap()
31 {
32   std::string aValue;
33   if(_isLocal) 
34     aValue = TCollection_AsciiString(Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->GetPixMap()).ToCString();
35   else aValue = SALOMEDS::AttributePixMap::_narrow(_corba_impl)->GetPixMap();
36   return aValue;
37 }
38  
39 void SALOMEDS_AttributePixMap::SetPixMap(const std::string& value)
40 {
41   CheckLocked();
42   if(_isLocal) Handle(SALOMEDSImpl_AttributePixMap)::DownCast(_local_impl)->SetPixMap((char*)value.c_str());
43   else SALOMEDS::AttributePixMap::_narrow(_corba_impl)->SetPixMap(value.c_str());
44 }