Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Viewer Class Referenceabstract

Template for simple GLUT-style viewer applications. More...

#include <mitsuba/hw/viewer.h>

+ Inheritance diagram for mitsuba::Viewer:

Public Member Functions

 Viewer ()
 Construct a new viewer. More...
 
int run (int argc, char **argv)
 Program entry point. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Utility
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

void drawHUD (const std::string &text)
 Draw a heads-up display. More...
 
void redraw ()
 Request that the draw() routine be called. More...
 
virtual void draw ()=0
 To be overwritten by the subclass: main drawing routine. More...
 
virtual bool init (int argc, char **argv)
 To be overwritten (optionally): perform any necessary initializations. More...
 
virtual void shutdown ()
 To be overwritten (optionally): perform any necessary cleanups. More...
 
virtual void keyPressed (const DeviceEvent &event)
 To be overwritten (optionally): handle a key press event. More...
 
virtual void keyReleased (const DeviceEvent &event)
 To be overwritten (optionally): handle a key release event. More...
 
virtual void mouseButtonPressed (const DeviceEvent &event)
 To be overwritten (optionally): handle a mouse button press event. More...
 
virtual void mouseButtonReleased (const DeviceEvent &event)
 To be overwritten (optionally): handle a mouse button release event. More...
 
virtual void mouseMoved (const DeviceEvent &event)
 To be overwritten (optionally): handle a mouse motion event. More...
 
virtual void mouseBeginDrag (const DeviceEvent &event)
 To be overwritten (optionally): handle a mouse begin drag event. More...
 
virtual void mouseDragged (const DeviceEvent &event)
 To be overwritten (optionally): handle a mouse drag event. More...
 
virtual void mouseEndDrag (const DeviceEvent &event)
 To be overwritten (optionally): handle a mouse end drag event. More...
 
virtual void windowResized (const DeviceEvent &event)
 To be overwritten (optionally): handle a window resize event. More...
 
- Protected Member Functions inherited from mitsuba::Utility
virtual ~Utility ()
 Virtual destructor. More...
 
ref< SceneloadScene (const fs::path &fname, const ParameterMap &params=ParameterMap())
 Load a scene from an external file. More...
 
ref< SceneloadSceneFromString (const std::string &content, const ParameterMap &params=ParameterMap())
 Load a scene from a string. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 
- Protected Member Functions inherited from mitsuba::DeviceEventListener
virtual ~DeviceEventListener ()
 Virtual destructor. More...
 

Protected Attributes

ref< Sessionm_session
 
ref< Devicem_device
 
ref< Rendererm_renderer
 
ref< Fontm_font
 
bool m_quit
 
bool m_leaveEventLoop
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 
- Protected Types inherited from mitsuba::Utility
typedef std::map< std::string,
std::string,
SimpleStringOrdering
ParameterMap
 

Detailed Description

Template for simple GLUT-style viewer applications.

This class makes it possible to rapidly prototype simple OpenGL applications, which can be started using the 'mtsutil' launcher.

Constructor & Destructor Documentation

mitsuba::Viewer::Viewer ( )

Construct a new viewer.

Member Function Documentation

virtual void mitsuba::Viewer::draw ( )
protectedpure virtual

To be overwritten by the subclass: main drawing routine.

void mitsuba::Viewer::drawHUD ( const std::string &  text)
protected

Draw a heads-up display.

virtual bool mitsuba::Viewer::init ( int  argc,
char **  argv 
)
protectedvirtual

To be overwritten (optionally): perform any necessary initializations.

The default implementation does nothing and returns true.

Parameters
argcNumber of command line arguments
argvList of command line argument strings
Returns
true upon success. Otherwise, the viewer will quit.
virtual void mitsuba::Viewer::keyPressed ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a key press event.

virtual void mitsuba::Viewer::keyReleased ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a key release event.

virtual void mitsuba::Viewer::mouseBeginDrag ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a mouse begin drag event.

virtual void mitsuba::Viewer::mouseButtonPressed ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a mouse button press event.

virtual void mitsuba::Viewer::mouseButtonReleased ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a mouse button release event.

virtual void mitsuba::Viewer::mouseDragged ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a mouse drag event.

virtual void mitsuba::Viewer::mouseEndDrag ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a mouse end drag event.

virtual void mitsuba::Viewer::mouseMoved ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a mouse motion event.

void mitsuba::Viewer::redraw ( )
inlineprotected

Request that the draw() routine be called.

int mitsuba::Viewer::run ( int  argc,
char **  argv 
)
virtual

Program entry point.

The viewer is initialized by this method – to add custom initialization code, please override init

Implements mitsuba::Utility.

virtual void mitsuba::Viewer::shutdown ( )
protectedvirtual

To be overwritten (optionally): perform any necessary cleanups.

virtual void mitsuba::Viewer::windowResized ( const DeviceEvent event)
protectedvirtual

To be overwritten (optionally): handle a window resize event.

Member Data Documentation

ref<Device> mitsuba::Viewer::m_device
protected
ref<Font> mitsuba::Viewer::m_font
protected
bool mitsuba::Viewer::m_leaveEventLoop
protected
bool mitsuba::Viewer::m_quit
protected
ref<Renderer> mitsuba::Viewer::m_renderer
protected
ref<Session> mitsuba::Viewer::m_session
protected
Class* mitsuba::Viewer::m_theClass
static

The documentation for this class was generated from the following file: