00001 00012 #include "AxisTickXML.h" 00013 00014 #include "XmlElement.h" 00015 00016 #include "axes/AxisTick.h" 00017 00018 using std::string; 00019 00020 AxisTickXML:: 00021 AxisTickXML ( XmlController * controller ) 00022 : BaseXML ( "AxisTick", controller ), 00023 m_value ( "value" ), 00024 m_label ( "label" ) 00025 { 00026 } 00027 00028 void 00029 AxisTickXML:: 00030 setAttributes ( XmlElement & tag, 00031 const AxisTick & tick ) 00032 { 00033 double value = tick.value (); 00034 tag.setAttribute ( m_value, value ); 00035 00036 const string & label = tick.content (); 00037 tag.setAttribute ( m_label, label ); 00038 } 00039 00040 void 00041 AxisTickXML:: 00042 setAttributes ( AxisTick * tick, 00043 const XmlElement * element ) 00044 00045 { 00046 double value; 00047 bool ok = element -> attribute ( m_value, value ); 00048 tick -> setValue ( value ); 00049 00050 string label; 00051 ok = element -> attribute ( m_label, label ); 00052 tick -> setContent ( label ); 00053 }