Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 2 // See the file tools.license for terms. 3 4 #ifndef tools_viewplot 5 #define tools_viewplot 6 7 #include "sg/plots_viewer" 8 9 #include "sg/dummy_freetype" 10 #include "sg/plotter_style" 11 12 #include "wps" 13 14 namespace tools { 15 16 class viewplot : public sg::plots_viewer { 17 typedef sg::plots_viewer parent; 18 public: 19 viewplot(std::ostream& a_out, 20 unsigned int a_cols = 1,unsigned in 21 unsigned int a_width = 500,unsigned 22 :parent(a_out,m_ttf,a_cols,a_rows,a_width,a_ 23 ,m_wps(a_out) 24 ,m_ttf() 25 ,m_styles(a_out) 26 {} 27 viewplot(std::ostream& a_out,const sg::base_ 28 unsigned int a_cols = 1,unsigned in 29 unsigned int a_width = 500,unsigned 30 :parent(a_out,a_ttf,a_cols,a_rows,a_width,a_ 31 ,m_wps(a_out) 32 ,m_ttf() 33 ,m_styles(a_out) 34 {} 35 virtual ~viewplot() {} 36 public: 37 viewplot(const viewplot& a_from) 38 :parent(a_from) 39 ,m_wps(a_from.m_out) 40 ,m_styles(a_from.m_styles) 41 {} 42 viewplot& operator=(const viewplot& a_from){ 43 parent::operator=(a_from); 44 m_styles = a_from.m_styles; 45 return *this; 46 } 47 public: 48 #ifdef tools_viewplot 49 //deprecated, use set_current_plotter_style( 50 void style_from_res(const std::string& a_pat 51 style_from_res(a_path,m_plots.current_plot 52 } 53 #endif 54 void set_current_plotter_style(const std::st 55 style_from_res(a_path,m_plots.current_plot 56 } 57 58 public: 59 void set_cols_rows(unsigned int a_cols,unsig 60 m_plots.cols = a_cols; 61 m_plots.rows = a_rows; 62 m_plots.adjust_size(width(),height()); 63 } 64 65 //#ifdef tools_viewplot 66 bool write(const std::string& a_file,bool a_ 67 return parent::write_inzb_ps(a_file,a_anon 68 } 69 bool open_file(const std::string& a_file,boo 70 bool write_page() {return write_inzb_ps_page 71 bool close_file() {return close_inzb_ps_file 72 //#endif 73 74 75 const xml::styles& styles() const {return m_ 76 xml::styles& styles() {return m_styles;} 77 78 protected: 79 void style_from_res(const std::string& a_pat 80 sg::style_from_res(m_styles,a_path,a_plott 81 } 82 83 protected: 84 sg::zb_manager m_mgr; 85 wps m_wps; 86 sg::dummy_freetype m_ttf; 87 xml::styles m_styles; 88 }; 89 90 } 91 92 #endif 93