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

Classes

class  _glarea
 

Public Member Functions

virtual void close ()
 
 sg_viewer (session &a_session, int a_x=0, int a_y=0, unsigned int a_width=500, unsigned int a_height=500, const std::string &a_title="")
 
virtual ~sg_viewer ()
 
bool has_window () const
 
HWND window () const
 
bool show ()
 
void win_render ()
 
void set_device_interactor (tools::sg::device_interactor *a_interactor)
 
- Public Member Functions inherited from tools::Windows::window
virtual void key_up ()
 
virtual void key_down ()
 
virtual void key_left ()
 
virtual void key_right ()
 
virtual void key_escape ()
 
 window (const char *a_title, int a_x, int a_y, unsigned int a_w, unsigned int a_h, unsigned int a_mask=WS_OVERLAPPEDWINDOW)
 
virtual ~window ()
 
const windowget_me () const
 
windowget_me ()
 
bool key_shift () const
 
HWND hwnd () const
 
void set_client_area_size (unsigned int a_w, unsigned int a_h)
 
void move (unsigned int a_x, unsigned int a_y)
 
void set_focus_hwnd (HWND a_hwnd)
 
HWND focus_hwnd () const
 
- Public Member Functions inherited from tools::sg::GL_viewer
void render ()
 
 GL_viewer (std::ostream &a_out, unsigned int a_width, unsigned int a_height)
 
virtual ~GL_viewer ()
 
 GL_viewer (const GL_viewer &a_from)
 
GL_vieweroperator= (const GL_viewer &a_from)
 
- Public Member Functions inherited from tools::sg::viewer
virtual void * cast (const std::string &a_class) const
 
virtual void set_size (unsigned int a_w, unsigned int a_h)
 
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

 sg_viewer (const sg_viewer &a_from)
 
sg_vieweroperator= (const sg_viewer &a_from)
 
- Protected Member Functions inherited from tools::Windows::window
 window (const window &a_from)
 
windowoperator= (const window &a_from)
 
void get_size (HWND a_hwnd, int &a_w, int &a_h)
 

Protected Attributes

sessionm_session
 
_glarea m_glarea
 
- Protected Attributes inherited from tools::Windows::window
HWND m_hwnd
 
bool m_key_shift
 
bool m_key_ctrl
 
HWND m_focus_hwnd
 
- Protected Attributes inherited from tools::sg::GL_viewer
GL_manager m_gl_mgr
 
- 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

- Static Protected Member Functions inherited from tools::Windows::window
static LRESULT CALLBACK proc (HWND a_hwnd, UINT a_msg, WPARAM a_wparam, LPARAM a_lparam)
 
static void wm__destroy (HWND a_hwnd)
 

Detailed Description

Definition at line 19 of file sg_viewer.

Constructor & Destructor Documentation

◆ sg_viewer() [1/2]

tools::Windows::sg_viewer::sg_viewer ( session a_session,
int  a_x = 0,
int  a_y = 0,
unsigned int  a_width = 500,
unsigned int  a_height = 500,
const std::string &  a_title = "" 
)
inline

Definition at line 25 of file sg_viewer.

29  :parent_window(a_title.c_str(),a_x,a_y,a_width,a_height)
30  ,parent_viewer(a_session.out(),a_width,a_height)
31  ,m_session(a_session)
32  ,m_glarea(m_hwnd,*this)
33  {
35  }

◆ ~sg_viewer()

virtual tools::Windows::sg_viewer::~sg_viewer ( )
inlinevirtual

Definition at line 36 of file sg_viewer.

36 {}

◆ sg_viewer() [2/2]

tools::Windows::sg_viewer::sg_viewer ( const sg_viewer a_from)
inlineprotected

Definition at line 38 of file sg_viewer.

39  :parent_window(a_from)
40  ,parent_viewer(a_from)
41  ,m_session(a_from.m_session)
42  ,m_glarea(a_from.m_glarea)
43  {}

Member Function Documentation

◆ close()

virtual void tools::Windows::sg_viewer::close ( )
inlinevirtual

Reimplemented from tools::Windows::window.

Definition at line 23 of file sg_viewer.

23 {}

◆ has_window()

bool tools::Windows::sg_viewer::has_window ( ) const
inline

Definition at line 49 of file sg_viewer.

49 {return m_hwnd?true:false;} //for SWIG

◆ operator=()

sg_viewer& tools::Windows::sg_viewer::operator= ( const sg_viewer a_from)
inlineprotected

Definition at line 44 of file sg_viewer.

44  {
46  return *this;
47  }

◆ set_device_interactor()

void tools::Windows::sg_viewer::set_device_interactor ( tools::sg::device_interactor a_interactor)
inline

Definition at line 63 of file sg_viewer.

63  { //we do not have ownership.
64  m_glarea.set_device_interactor(a_interactor);
65  }

◆ show()

bool tools::Windows::sg_viewer::show ( )
inline

Definition at line 53 of file sg_viewer.

53  {
54  if(!m_hwnd) return false;
56  return true;
57  }

◆ win_render()

void tools::Windows::sg_viewer::win_render ( )
inline

Definition at line 59 of file sg_viewer.

59 {m_glarea.wm_paint();}

◆ window()

HWND tools::Windows::sg_viewer::window ( ) const
inline

Definition at line 51 of file sg_viewer.

51 {return m_hwnd;}

Member Data Documentation

◆ m_glarea

_glarea tools::Windows::sg_viewer::m_glarea
protected

Definition at line 84 of file sg_viewer.

◆ m_session

session& tools::Windows::sg_viewer::m_session
protected

Definition at line 83 of file sg_viewer.


The documentation for this class was generated from the following file:
tools::Windows::glarea::wm_paint
void wm_paint()
Definition: glarea:176
tools::Windows::session::show_window
void show_window(HWND a_hwnd)
Definition: session:53
tools::Windows::glarea::hwnd
HWND hwnd() const
Definition: glarea:169
tools::Windows::glarea::set_device_interactor
void set_device_interactor(tools::sg::device_interactor *a_interactor)
Definition: glarea:199
tools::Windows::sg_viewer::m_glarea
_glarea m_glarea
Definition: sg_viewer:84
tools::Windows::window::set_focus_hwnd
void set_focus_hwnd(HWND a_hwnd)
Definition: window:137
tools::Windows::window::operator=
window & operator=(const window &a_from)
Definition: window:100
tools::Windows::sg_viewer::m_session
session & m_session
Definition: sg_viewer:83
tools::Windows::window::m_hwnd
HWND m_hwnd
Definition: window:242