415 a_tree.attribute_value(
"name",pname);
417 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style :"
418 <<
" <plotter_style> without name."
423 {styles::style_t sty;
424 sty.push_back(styles::style_item_t(
"tag",
"plotter_style"));
426 {looper _for(a_tree);
427 while(element* _elem = _for.next_element()) {
429 if(_elem->name()==
"copy") {
432 _elem->attribute_value(
"from",from);
434 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style :"
435 <<
" <copy> without from."
440 const styles::style_t* csty = a_styles.find_style(from);
442 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style :"
443 <<
" <copy> : from " << sout(from) <<
" not found."
447 if(csty->size()) a_styles.add_style(pname,*csty);
449 if(styles::is_plotter_style(*csty)) {
451 std::string head = from+
".";
452 std::string::size_type l = head.size();
454 styles sts(a_styles.out());
456 const std::vector<styles::named_style_t>& nss = a_styles.named_styles();
458 const std::string& name = (*it).first;
459 if(name.substr(0,l)==head) {
460 std::string tail = name.substr(l,name.size()-l);
461 const styles::style_t& ssty = (*it).second;
462 if(ssty.size()) sts.add_style(pname+
"."+tail,ssty);
466 a_styles.append(sts);
472 sty.push_back(styles::style_item_t(_elem->name(),_elem->value()));
477 if(sty.size()) a_styles.add_style(pname,sty);}
479 {looper _for(a_tree);
480 while(tree* _tree = _for.next_tree()) {
482 const std::string& tag = _tree->tag_name();
486 _tree->attribute_value(
"name",name);
488 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style :"
489 <<
" <style> without name."
494 {styles::style_t sty;
496 {looper _for2(*_tree);
497 while(element* _elem = _for2.next_element()) {
498 if(_elem->name()==
"copy") {
500 _elem->attribute_value(
"from",from);
502 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style : (2) :"
503 <<
" <copy> without from."
507 const styles::style_t* csty = a_styles.find_style(from);
509 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style : (2) :"
510 <<
" <copy> : from " << sout(from) <<
" not found."
516 sty.push_back(styles::style_item_t(_elem->name(),_elem->value()));
521 std::string path = pname+
"."+name;
522 a_styles.add_style(path,sty);
526 a_styles.out() <<
"tools::sg::gui_viewer::load_plotter_style :"
527 <<
" unexpected tag " << sout(tag) <<
"."