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

Public Member Functions

void render ()
 
 GL_plots_viewer (std::ostream &a_out, const tools::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 ~GL_plots_viewer ()
 
 GL_plots_viewer (const GL_plots_viewer &a_from)
 
GL_plots_vieweroperator= (const GL_plots_viewer &a_from)
 
- 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 Attributes

GL_manager m_gl_mgr
 
- 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)
 
- Protected Member Functions inherited from tools::sg::plots_viewer
void create_sg ()
 

Detailed Description

Definition at line 19 of file GL_plots_viewer.

Constructor & Destructor Documentation

◆ GL_plots_viewer() [1/2]

tools::sg::GL_plots_viewer::GL_plots_viewer ( std::ostream &  a_out,
const tools::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 48 of file GL_plots_viewer.

51  :parent(a_out,a_ttf,a_cols,a_rows,a_width,a_height)
52  ,m_gl_mgr(a_out)
53  {}

◆ ~GL_plots_viewer()

virtual tools::sg::GL_plots_viewer::~GL_plots_viewer ( )
inlinevirtual

Definition at line 54 of file GL_plots_viewer.

54  {
55  //WARNING : nodes may refer m_gl_mgr (to handle gstos/texs), then we have to delete them first.
56  m_sg.clear();
57  m_plots.clear_sg();
58  }

◆ GL_plots_viewer() [2/2]

tools::sg::GL_plots_viewer::GL_plots_viewer ( const GL_plots_viewer a_from)
inline

Definition at line 60 of file GL_plots_viewer.

61  :parent(a_from)
62  ,m_gl_mgr(a_from.m_gl_mgr)
63  {}

Member Function Documentation

◆ operator=()

GL_plots_viewer& tools::sg::GL_plots_viewer::operator= ( const GL_plots_viewer a_from)
inline

Definition at line 64 of file GL_plots_viewer.

64  {
65  parent::operator=(a_from);
66  m_gl_mgr = a_from.m_gl_mgr;
67  return *this;
68  }

◆ render()

void tools::sg::GL_plots_viewer::render ( )
inline

Definition at line 22 of file GL_plots_viewer.

22  {
23  if(!m_ww) return;
24  if(!m_wh) return;
25 
27  m_clear_color.r(),
28  m_clear_color.g(),
29  m_clear_color.b(),
30  m_clear_color.a());
31 
32  GL_action action(m_gl_mgr,m_out,m_ww,m_wh);
33  action.state().m_use_gsto = m_use_gsto;
34 
35  m_sg.render(action);
36  if(!action.end()) { //check that matrices stack are ok.
37  m_out << "exib::sg::GL_plots_viewer :"
38  << " bad gl_action end."
39  << std::endl;
40  }
41 
42  //after_render();
43 
45  }

Member Data Documentation

◆ m_gl_mgr

GL_manager tools::sg::GL_plots_viewer::m_gl_mgr
protected

Definition at line 70 of file GL_plots_viewer.


The documentation for this class was generated from the following file:
tools::sg::viewer::m_wh
unsigned int m_wh
Definition: viewer:172
tools::sg::GL_manager::begin_render
virtual bool begin_render(int a_x, int a_y, unsigned int a_ww, unsigned int a_wh, float a_r, float a_g, float a_b, float a_a, bool a_clear=true)
Definition: GL_manager:32
tools::sg::viewer::m_ww
unsigned int m_ww
Definition: viewer:171
tools::sg::GL_plots_viewer::m_gl_mgr
GL_manager m_gl_mgr
Definition: GL_plots_viewer:70
tools::sg::plots_viewer::m_plots
sg::plots m_plots
Definition: plots_viewer:240
tools::sg::viewer::m_use_gsto
bool m_use_gsto
Definition: viewer:175
tools::colorf::g
float g() const
Definition: colorf:33
tools::sg::group::render
virtual void render(render_action &a_action)
Definition: group:24
tools::sg::viewer::m_sg
group m_sg
Definition: viewer:173
tools::colorf::a
float a() const
Definition: colorf:35
tools::sg::viewer::m_out
std::ostream & m_out
Definition: viewer:169
tools::sg::GL_manager::end_render
virtual void end_render()
Definition: GL_manager:203
tools::sg::group::clear
void clear()
Definition: group:235
tools::colorf::r
float r() const
Definition: colorf:32
tools::sg::plots::clear_sg
void clear_sg()
Definition: plots:919
tools::sg::viewer::m_clear_color
colorf m_clear_color
Definition: viewer:170
tools::colorf::b
float b() const
Definition: colorf:34