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