ogre_tools::wxOgreRenderWindow Class Reference

#include <wx_ogre_render_window.h>

List of all members.

Public Member Functions

virtual void createRenderWindow ()
virtual wxSize DoGetBestSize () const
virtual std::string getOgreHandle () const
Ogre::RenderWindow * getRenderWindow () const
Ogre::Viewport * getViewport () const
void setAutoRender (bool auto_render)
void setCamera (Ogre::Camera *camera)
void setOrthoScale (float scale)
 Set the scale of the orthographic window. Only valid for an orthographic camera.
virtual void setPostRenderCallback (boost::function< void()> func)
virtual void setPreRenderCallback (boost::function< void()> func)
 wxOgreRenderWindow (Ogre::Root *ogre_root, wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSUNKEN_BORDER, const wxValidator &validator=wxDefaultValidator, bool create_render_window=true)
virtual ~wxOgreRenderWindow ()

Protected Member Functions

virtual void onMouseEvents (wxMouseEvent &evt)
virtual void onMove (wxMoveEvent &evt)
virtual void onPaint (wxPaintEvent &evt)
virtual void onSize (wxSizeEvent &evt)
virtual bool Reparent (wxWindowBase *new_parent)
void setCameraAspectRatio ()

Protected Attributes

bool auto_render_
Ogre::Root * ogre_root_
 This control's pointer to the global Ogre::Root.
float ortho_scale_
boost::function< void()> post_render_callback_
 Functor which is called after each render.
boost::function< void()> pre_render_callback_
 Functor which is called before each render.
Ogre::RenderWindow * render_window_
 This control's own render window reference.
Ogre::Viewport * viewport_
 This control's Viewport.

Static Protected Attributes

static unsigned int sm_NextRenderWindowId = 1
 The Id of the next render window.

Private Member Functions

 DECLARE_EVENT_TABLE ()

Detailed Description

wxWidgets Ogre render window widget. Strongly based on the existing wxOgre widget implementation, this one isolates the wx component from Ogre, acting as a simple bind to render inside a wxWidgets window.

Author:
Jesús Alonso Abad 'Kencho', Other contributors (original wxOgre). Heavily modified by Josh Faust

Definition at line 26 of file wx_ogre_render_window.h.


Constructor & Destructor Documentation

ogre_tools::wxOgreRenderWindow::wxOgreRenderWindow ( Ogre::Root *  ogre_root,
wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxSUNKEN_BORDER,
const wxValidator &  validator = wxDefaultValidator,
bool  create_render_window = true 
)

wx-like Constructor.

Parameters:
parent The parent wxWindow component.
id The control id.
pos The default position.
size The default size.
style The default style for this componOgre::SceneManager* scene_manager,ent.
validator A default validator for the component.

Definition at line 22 of file wx_ogre_render_window.cpp.

ogre_tools::wxOgreRenderWindow::~wxOgreRenderWindow (  )  [virtual]

Virtual destructor.

Definition at line 39 of file wx_ogre_render_window.cpp.


Member Function Documentation

void ogre_tools::wxOgreRenderWindow::createRenderWindow (  )  [virtual]

Creates an Ogre render window for this widget.

Definition at line 191 of file wx_ogre_render_window.cpp.

ogre_tools::wxOgreRenderWindow::DECLARE_EVENT_TABLE (  )  [private]
wxSize ogre_tools::wxOgreRenderWindow::DoGetBestSize (  )  const [inline, virtual]

Overrides the default implementation. This override is here for convenience. Returns a symbolic 320x240px size.

Returns:
A size of 320x240 (just a symbolic 4:3 size).

Definition at line 52 of file wx_ogre_render_window.cpp.

std::string ogre_tools::wxOgreRenderWindow::getOgreHandle (  )  const [virtual]

Gets the handle for the render window.

Returns:
The render window handle.

Definition at line 221 of file wx_ogre_render_window.cpp.

Ogre::RenderWindow * ogre_tools::wxOgreRenderWindow::getRenderWindow (  )  const

Gets the associated Ogre render window.

Returns:
The render window used to paint this control.

Definition at line 57 of file wx_ogre_render_window.cpp.

Ogre::Viewport * ogre_tools::wxOgreRenderWindow::getViewport (  )  const

Gets the associated Ogre viewport.

Returns:
The viewport used to render this window.

Definition at line 63 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::onMouseEvents ( wxMouseEvent &  evt  )  [protected, virtual]

Mouse events callback.

Remarks:
Note this will call the specified callback function to process the event.
Parameters:
evt Data regarding the mouse event.

Definition at line 186 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::onMove ( wxMoveEvent &  evt  )  [protected, virtual]

Definition at line 173 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::onPaint ( wxPaintEvent &  evt  )  [protected, virtual]

Painting event callback.

Parameters:
evt Data regarding the painting event.

Definition at line 116 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::onSize ( wxSizeEvent &  evt  )  [protected, virtual]

Resizing events callback.

Parameters:
evt Data regarding the resize event.

Definition at line 146 of file wx_ogre_render_window.cpp.

bool ogre_tools::wxOgreRenderWindow::Reparent ( wxWindowBase *  new_parent  )  [protected, virtual]

Definition at line 258 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::setAutoRender ( bool  auto_render  )  [inline]

Definition at line 102 of file wx_ogre_render_window.h.

void ogre_tools::wxOgreRenderWindow::setCamera ( Ogre::Camera *  camera  ) 

Set the camera associated with this render window's viewport.

Definition at line 68 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::setCameraAspectRatio (  )  [protected]

Sets the aspect ratio on the camera

Definition at line 77 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::setOrthoScale ( float  scale  ) 

Set the scale of the orthographic window. Only valid for an orthographic camera.

Parameters:
scale The scale

Definition at line 98 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::setPostRenderCallback ( boost::function< void()>  func  )  [virtual]

Set a callback which is called after each render

Parameters:
func The callback functor

Definition at line 110 of file wx_ogre_render_window.cpp.

void ogre_tools::wxOgreRenderWindow::setPreRenderCallback ( boost::function< void()>  func  )  [virtual]

Set a callback which is called before each render

Parameters:
func The callback functor

Definition at line 105 of file wx_ogre_render_window.cpp.


Member Data Documentation

Definition at line 144 of file wx_ogre_render_window.h.

This control's pointer to the global Ogre::Root.

Definition at line 36 of file wx_ogre_render_window.h.

Definition at line 143 of file wx_ogre_render_window.h.

boost::function<void ()> ogre_tools::wxOgreRenderWindow::post_render_callback_ [protected]

Functor which is called after each render.

Definition at line 141 of file wx_ogre_render_window.h.

boost::function<void ()> ogre_tools::wxOgreRenderWindow::pre_render_callback_ [protected]

Functor which is called before each render.

Definition at line 140 of file wx_ogre_render_window.h.

Ogre::RenderWindow* ogre_tools::wxOgreRenderWindow::render_window_ [protected]

This control's own render window reference.

Definition at line 33 of file wx_ogre_render_window.h.

unsigned int ogre_tools::wxOgreRenderWindow::sm_NextRenderWindowId = 1 [static, protected]

The Id of the next render window.

Definition at line 42 of file wx_ogre_render_window.h.

Ogre::Viewport* ogre_tools::wxOgreRenderWindow::viewport_ [protected]

This control's Viewport.

Definition at line 39 of file wx_ogre_render_window.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines


ogre_tools
Author(s): Josh Faust
autogenerated on Fri Jan 11 09:10:16 2013