g4tools  5.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::viewplot Class Reference
Inheritance diagram for tools::viewplot:
Inheritance graph
[legend]
Collaboration diagram for tools::viewplot:
Collaboration graph
[legend]

Public Member Functions

 viewplot (std::ostream &a_out, unsigned int a_cols=1, unsigned int a_rows=1, unsigned int a_width=500, unsigned int a_height=500)
 
 viewplot (std::ostream &a_out, const sg::base_freetype &a_ttf, unsigned int a_cols=1, unsigned int a_rows=1, unsigned int a_width=500, unsigned int a_height=500)
 
virtual ~viewplot ()
 
 viewplot (const viewplot &a_from)
 
viewplotoperator= (const viewplot &a_from)
 
void style_from_res (const std::string &a_path, bool a_verbose=false)
 
void set_current_plotter_style (const std::string &a_path, bool a_verbose=false)
 
void set_cols_rows (unsigned int a_cols, unsigned int a_rows)
 
bool write (const std::string &a_file, bool a_anonymous=false)
 
bool open_file (const std::string &a_file, bool a_anonymous=false)
 
bool write_page ()
 
bool close_file ()
 
const xml::stylesstyles () const
 
xml::stylesstyles ()
 
- Public Member Functions inherited from tools::sg::plots_viewer
virtual void set_size (unsigned int a_width, unsigned int a_height)
 
 plots_viewer (std::ostream &a_out, const base_freetype &a_ttf, unsigned int a_cols=1, unsigned int a_rows=1, unsigned int a_width=500, unsigned int a_height=500)
 
virtual ~plots_viewer ()
 
 plots_viewer (const plots_viewer &a_from)
 
plots_vieweroperator= (const plots_viewer &a_from)
 
sg::zb_managerzb_manager ()
 
sg::gl2ps_managergl2ps_manager ()
 
bool write_inzb_png (png_writer a_writer, const std::string &a_file, unsigned int a_width, unsigned int a_height)
 
bool write_inzb_png (png_writer a_writer, const std::string &a_file)
 
bool write_inzb_jpeg (jpeg_writer a_writer, const std::string &a_file, unsigned int a_width, unsigned int a_height, int a_quality=100)
 
bool write_inzb_jpeg (jpeg_writer a_writer, const std::string &a_file, int a_quality=100)
 
bool write_inzb_ps (const std::string &a_file, unsigned int a_width, unsigned int a_height, bool a_anonymous=false)
 
bool write_inzb_ps (const std::string &a_file, bool a_anonymous=false)
 
bool open_inzb_ps_file (const std::string &a_file, bool a_anonymous=false)
 
bool write_inzb_ps_page (unsigned int a_width, unsigned int a_height)
 
bool write_inzb_ps_page ()
 
bool close_inzb_ps_file ()
 
bool write_gl2ps (const std::string &a_file, int a_gl2ps_format, unsigned int a_width, unsigned int a_height)
 
bool write_gl2ps (const std::string &a_file, int a_gl2ps_format)
 
- Public Member Functions inherited from tools::sg::viewer
virtual void * cast (const std::string &a_class) const
 
virtual bool set_cursor_shape (cursor_shape)
 
 viewer (std::ostream &a_out, unsigned int a_width, unsigned int a_height)
 
virtual ~viewer ()
 
 viewer (const viewer &a_from)
 
vieweroperator= (const viewer &a_from)
 
bool set_default_cursor_shape ()
 
groupsg ()
 
const groupsg () const
 
unsigned int width () const
 
unsigned int height () const
 
bool screen2aspect (int a_x, int a_y, float &a_wx, float &a_wy) const
 
void set_clear_color (float a_r, float a_g, float a_b, float a_a=1)
 
void set_clear_color (const colorf &a_color)
 
void get_clear_color (float &a_r, float &a_g, float &a_b, float &a_a)
 
const colorfbackground () const
 
std::ostream & out () const
 
const std::string & out_dir () const
 
void set_produce_out_jpeg (bool a_value)
 
bool produce_out_jpeg () const
 
void set_produce_out_png (bool a_value)
 
bool produce_out_png () const
 
void set_produce_out_file (const std::string &a_file)
 
const std::string & produce_out_file () const
 
void set_produce_out_bpp (unsigned int a_bpp)
 
unsigned int produce_out_bpp () const
 

Protected Member Functions

void style_from_res (const std::string &a_path, sg::plotter &a_plotter, bool a_verbose)
 
- Protected Member Functions inherited from tools::sg::plots_viewer
void create_sg ()
 

Protected Attributes

sg::zb_manager m_mgr
 
wps m_wps
 
sg::dummy_freetype m_ttf
 
xml::styles m_styles
 
- Protected Attributes inherited from tools::sg::plots_viewer
sg::zb_manager m_zb_mgr
 
sg::gl2ps_manager m_gl2ps_mgr
 
ortho m_camera
 
sg::plots m_plots
 
wps m_wps
 
- Protected Attributes inherited from tools::sg::viewer
std::ostream & m_out
 
colorf m_clear_color
 
unsigned int m_ww
 
unsigned int m_wh
 
group m_sg
 
std::string m_out_dir
 
bool m_use_gsto
 
bool m_produce_out_jpeg
 
bool m_produce_out_png
 
std::string m_produce_out_file
 
unsigned int m_produce_out_bpp
 

Additional Inherited Members

- Public Types inherited from tools::sg::plots_viewer
typedef bool(* png_writer) (std::ostream &, const std::string &, unsigned char *, unsigned int, unsigned int, unsigned int)
 
typedef bool(* jpeg_writer) (std::ostream &, const std::string &, unsigned char *, unsigned int, unsigned int, unsigned int, int)
 

Detailed Description

Definition at line 16 of file viewplot.

Constructor & Destructor Documentation

◆ viewplot() [1/3]

tools::viewplot::viewplot ( std::ostream &  a_out,
unsigned int  a_cols = 1,
unsigned int  a_rows = 1,
unsigned int  a_width = 500,
unsigned int  a_height = 500 
)
inline

Definition at line 19 of file viewplot.

22  :parent(a_out,m_ttf,a_cols,a_rows,a_width,a_height)
23  ,m_wps(a_out)
24  ,m_ttf()
25  ,m_styles(a_out)
26  {}

◆ viewplot() [2/3]

tools::viewplot::viewplot ( std::ostream &  a_out,
const sg::base_freetype a_ttf,
unsigned int  a_cols = 1,
unsigned int  a_rows = 1,
unsigned int  a_width = 500,
unsigned int  a_height = 500 
)
inline

Definition at line 27 of file viewplot.

30  :parent(a_out,a_ttf,a_cols,a_rows,a_width,a_height)
31  ,m_wps(a_out)
32  ,m_ttf()
33  ,m_styles(a_out)
34  {}

◆ ~viewplot()

virtual tools::viewplot::~viewplot ( )
inlinevirtual

Definition at line 35 of file viewplot.

35 {}

◆ viewplot() [3/3]

tools::viewplot::viewplot ( const viewplot a_from)
inline

Definition at line 37 of file viewplot.

38  :parent(a_from)
39  ,m_wps(a_from.m_out)
40  ,m_styles(a_from.m_styles)
41  {}

Member Function Documentation

◆ close_file()

bool tools::viewplot::close_file ( )
inline

Definition at line 71 of file viewplot.

71 {return close_inzb_ps_file();}

◆ open_file()

bool tools::viewplot::open_file ( const std::string &  a_file,
bool  a_anonymous = false 
)
inline

Definition at line 69 of file viewplot.

69 {return open_inzb_ps_file(a_file,a_anonymous);}

◆ operator=()

viewplot& tools::viewplot::operator= ( const viewplot a_from)
inline

Definition at line 42 of file viewplot.

42  {
43  parent::operator=(a_from);
44  m_styles = a_from.m_styles;
45  return *this;
46  }

◆ set_cols_rows()

void tools::viewplot::set_cols_rows ( unsigned int  a_cols,
unsigned int  a_rows 
)
inline

Definition at line 59 of file viewplot.

59  {
60  m_plots.cols = a_cols;
61  m_plots.rows = a_rows;
63  }

◆ set_current_plotter_style()

void tools::viewplot::set_current_plotter_style ( const std::string &  a_path,
bool  a_verbose = false 
)
inline

Definition at line 54 of file viewplot.

54  {
55  style_from_res(a_path,m_plots.current_plotter(),a_verbose);
56  }

◆ style_from_res() [1/2]

void tools::viewplot::style_from_res ( const std::string &  a_path,
bool  a_verbose = false 
)
inline

Definition at line 50 of file viewplot.

50  {
51  style_from_res(a_path,m_plots.current_plotter(),a_verbose);
52  }

◆ style_from_res() [2/2]

void tools::viewplot::style_from_res ( const std::string &  a_path,
sg::plotter a_plotter,
bool  a_verbose 
)
inlineprotected

Definition at line 79 of file viewplot.

79  {
80  sg::style_from_res(m_styles,a_path,a_plotter,a_verbose);
81  }

◆ styles() [1/2]

xml::styles& tools::viewplot::styles ( )
inline

Definition at line 76 of file viewplot.

76 {return m_styles;}

◆ styles() [2/2]

const xml::styles& tools::viewplot::styles ( ) const
inline

Definition at line 75 of file viewplot.

75 {return m_styles;}

◆ write()

bool tools::viewplot::write ( const std::string &  a_file,
bool  a_anonymous = false 
)
inline

Definition at line 66 of file viewplot.

66  {
67  return parent::write_inzb_ps(a_file,a_anonymous);
68  }

◆ write_page()

bool tools::viewplot::write_page ( )
inline

Definition at line 70 of file viewplot.

70 {return write_inzb_ps_page();}

Member Data Documentation

◆ m_mgr

sg::zb_manager tools::viewplot::m_mgr
protected

Definition at line 84 of file viewplot.

◆ m_styles

xml::styles tools::viewplot::m_styles
protected

Definition at line 87 of file viewplot.

◆ m_ttf

sg::dummy_freetype tools::viewplot::m_ttf
protected

Definition at line 86 of file viewplot.

◆ m_wps

wps tools::viewplot::m_wps
protected

Definition at line 85 of file viewplot.


The documentation for this class was generated from the following file:
tools::sg::plots::adjust_size
void adjust_size(unsigned int a_ww, unsigned int a_wh)
Definition: plots:271
tools::sg::plots_viewer::open_inzb_ps_file
bool open_inzb_ps_file(const std::string &a_file, bool a_anonymous=false)
Definition: plots_viewer:188
tools::viewplot::style_from_res
void style_from_res(const std::string &a_path, bool a_verbose=false)
Definition: viewplot:50
tools::sg::plots_viewer::m_plots
sg::plots m_plots
Definition: plots_viewer:240
tools::sg::plots::current_plotter
plotter & current_plotter()
Definition: plots:390
tools::sg::plots_viewer::close_inzb_ps_file
bool close_inzb_ps_file()
Definition: plots_viewer:208
tools::sg::plots_viewer::write_inzb_ps
bool write_inzb_ps(const std::string &a_file, unsigned int a_width, unsigned int a_height, bool a_anonymous=false)
Definition: plots_viewer:165
tools::viewplot::m_styles
xml::styles m_styles
Definition: viewplot:87
tools::viewplot::m_ttf
sg::dummy_freetype m_ttf
Definition: viewplot:86
tools::sg::plots_viewer::operator=
plots_viewer & operator=(const plots_viewer &a_from)
Definition: plots_viewer:63
tools::sg::style_from_res
void style_from_res(const xml::styles &a_styles, const std::string &a_path, axis &a_axis, bool a_verbose)
Definition: plotter_style:14
tools::sg::plots_viewer::write_inzb_ps_page
bool write_inzb_ps_page()
Definition: plots_viewer:207
tools::viewplot::m_wps
wps m_wps
Definition: viewplot:85
tools::sg::viewer::height
unsigned int height() const
Definition: viewer:98
tools::sg::viewer::width
unsigned int width() const
Definition: viewer:97
tools::sg::plots::rows
sf< unsigned int > rows
Definition: plots:22
tools::sg::plots::cols
sf< unsigned int > cols
Definition: plots:21