// Copyright (C) 2010, Guy Barrand. All rights reserved. // See the file tools.license for terms. #ifndef tools_sg_plotter_style #define tools_sg_plotter_style #include "../xml/styles" #include "plotter" namespace tools { namespace sg { inline void style_from_res(const xml::styles& a_styles,const std::string& a_path,axis& a_axis,bool a_verbose) { {typedef xml::styles::style_t style_t; const style_t* style = a_styles.find_style(a_path); if(style){ a_axis.set_from_style(a_styles.out(),*style); } else { if(a_verbose) { a_styles.out() << "tools::sg::style_from_res(axis) :" << " style " << sout(a_path) << " not found." << std::endl; } }} a_styles.res_sg_style(a_path+".line_style",a_axis.line_style()); a_styles.res_sg_style(a_path+".ticks_style",a_axis.ticks_style()); a_styles.res_sg_style(a_path+".labels_style",a_axis.labels_style()); a_styles.res_sg_style(a_path+".mag_style",a_axis.mag_style()); a_styles.res_sg_style(a_path+".title_style",a_axis.title_style()); } inline void style_from_res(const xml::styles& a_styles,const std::string& a_path,plotter& a_plotter,bool a_verbose) { //sg::fields of plotter : {typedef xml::styles::style_t style_t; const style_t* _style = a_styles.find_style(a_path); if(_style){ a_plotter.set_from_style(a_styles.out(),*_style); } else { if(a_verbose) { a_styles.out() << "tools::sg::style_from_res :" << " style " << sout(a_path) << " not found." << std::endl; } }} //sg::fields of various xml::styles : a_styles.res_sg_style