Canvas Class Reference
Provides a generic Canvas interface, shared between OpenGL canvases and pixel-based canvases. More...
#include <Canvas.h>

Public Member Functions | |
| virtual void | redraw ()=0 |
Constructors | |
| Canvas (Gui *gui, unsigned width=(480), unsigned height=(480)) | |
| virtual | ~Canvas () |
Saving | |
| virtual bool | save (const char *fileName)=0 |
Interaction/Visualization interface | |
| virtual void | init () |
| virtual void | registerInteractionListener (InteractionListener *listener) |
| virtual void | unregisterInteractionListener (InteractionListener *listener) |
Accessors | |
| virtual bool | supportsOpenGL () const =0 |
| virtual QWidget * | getQWidget ()=0 |
| Gui * | getGui () const |
| Renderer * | getRenderer () |
| Camera * | getCamera () |
| Scene * | getScene () |
Mutators | |
| virtual void | setRenderer (Renderer *renderer) |
| void | setGui (Gui *gui) |
Canvas dimensions | |
| unsigned | getWidth () const |
| unsigned | getHeight () const |
Protected Member Functions | |
Interaction/Visualization interface to children | |
| virtual void | mousePressed (QMouseEvent *event) |
| virtual void | mouseReleased (QMouseEvent *event) |
| virtual void | mouseMoved (QMouseEvent *event) |
| virtual void | keyPressed (QKeyEvent *event) |
| virtual void | keyReleased (QKeyEvent *event) |
Protected Attributes | |
| Gui * | m_gui |
| Renderer * | m_renderer |
| unsigned | m_width |
| unsigned | m_height |
| bool | m_initted |
| ListenerList | m_interactionListeners |
Friends | |
| class | InteractionListener |
Detailed Description
Provides a generic Canvas interface, shared between OpenGL canvases and pixel-based canvases.
- Date:
- Fall 2008
- Date:
- Fall 2008
Definition at line 29 of file Canvas.h.
Constructor & Destructor Documentation
| Canvas::Canvas | ( | Gui * | gui, | |
| unsigned | width = (480), |
|||
| unsigned | height = (480) | |||
| ) |
Definition at line 18 of file Canvas.cpp.
| Canvas::~Canvas | ( | ) | [virtual] |
Definition at line 25 of file Canvas.cpp.
Member Function Documentation
| virtual bool Canvas::save | ( | const char * | fileName | ) | [pure virtual] |
Attempts to saver this canvas' image to the specified file
- Returns:
- whether or not the save was successful
Implemented in ImageCanvas, and OpenGLCanvas.
| void Canvas::init | ( | ) | [virtual] |
| void Canvas::registerInteractionListener | ( | InteractionListener * | listener | ) | [virtual] |
Definition at line 52 of file Canvas.cpp.
| void Canvas::unregisterInteractionListener | ( | InteractionListener * | listener | ) | [virtual] |
Definition at line 65 of file Canvas.cpp.
| virtual bool Canvas::supportsOpenGL | ( | ) | const [pure virtual] |
- Returns:
- true iff this Canvas supports OpenGL
- See also:
- also OpenGLCanvas
Implemented in ImageCanvas, and OpenGLCanvas.
| virtual QWidget* Canvas::getQWidget | ( | ) | [pure virtual] |
| void Canvas::setRenderer | ( | Renderer * | renderer | ) | [virtual] |
Definition at line 48 of file Canvas.cpp.
| virtual void Canvas::redraw | ( | ) | [pure virtual] |
Implemented in ImageCanvas, and OpenGLCanvas.
| void Canvas::mousePressed | ( | QMouseEvent * | event | ) | [protected, virtual] |
Definition at line 82 of file Canvas.cpp.
| void Canvas::mouseReleased | ( | QMouseEvent * | event | ) | [protected, virtual] |
Definition at line 93 of file Canvas.cpp.
| void Canvas::mouseMoved | ( | QMouseEvent * | event | ) | [protected, virtual] |
Definition at line 104 of file Canvas.cpp.
| void Canvas::keyPressed | ( | QKeyEvent * | event | ) | [protected, virtual] |
Definition at line 115 of file Canvas.cpp.
| void Canvas::keyReleased | ( | QKeyEvent * | event | ) | [protected, virtual] |
Definition at line 126 of file Canvas.cpp.
Friends And Related Function Documentation
friend class InteractionListener [friend] |
Member Data Documentation
Gui* Canvas::m_gui [protected] |
Renderer* Canvas::m_renderer [protected] |
unsigned Canvas::m_width [protected] |
unsigned Canvas::m_height [protected] |
bool Canvas::m_initted [protected] |
ListenerList Canvas::m_interactionListeners [protected] |
The documentation for this class was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6