#include <CGLSurface.h>
Public Member Functions | |
CGLSurface (QGLFormat &requestFormat, QWidget *parent=0) | |
~CGLSurface () | |
void | Update () |
void | StartAnimate (int ms) |
void | EndAnimate () |
void | EnableThread (bool tf) |
void | EnableOverlay (bool tf) |
void | registerInputHandler (TSmartPointer< IInputHandler > handler) |
void | unregisterInputHandler (TSmartPointer< IInputHandler > handler) |
void | lockGLContext () |
void | unlockGLContext () |
Protected Member Functions | |
virtual void | onInitialize () |
virtual void | onResize () |
virtual void | onDraw () |
virtual void | onOverlayDraw (QPainter *painter) |
virtual void | onAnimate () |
virtual void | onFinishRendering () |
virtual void | onLOG (QString &) |
virtual void | onLOG (const char *) |
virtual void | enterEvent (QEvent *event) |
virtual void | leaveEvent (QEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
Protected Attributes | |
int | oldPosX |
int | dx |
int | oldPosY |
int | dy |
int | viewportWidth |
int | viewportHeight |
Private Member Functions | |
void | Log (const char *txt) |
void | initRendering () |
void | finishRendering () |
void | Render () |
void | resizeEvent (QResizeEvent *event) |
void | paintEvent (QPaintEvent *event) |
void | closeEvent (QCloseEvent *event) |
void | showEvent (QShowEvent *event) |
void | timerEvent (QTimerEvent *) |
Private Attributes | |
Ui::CGLSurface | ui |
CGLRenderThread | renderer |
TSmartPointer< IInputHandler > | pInputHandler |
QMutex | render_mutex |
QWaitCondition | render_condition |
QPainter * | pPainter |
bool | bRenderWithOverlay |
bool | useRenderThread |
bool | initialized |
int | timerID |
Friends | |
class | CGLRenderThread |
Definition at line 30 of file CGLSurface.h.
CGLSurface::CGLSurface | ( | QGLFormat & | requestFormat, | |
QWidget * | parent = 0 | |||
) |
Definition at line 27 of file CGLSurface.cpp.
References bRenderWithOverlay, initialized, pInputHandler, pPainter, ui, and useRenderThread.
CGLSurface::~CGLSurface | ( | ) |
Definition at line 42 of file CGLSurface.cpp.
void CGLSurface::closeEvent | ( | QCloseEvent * | event | ) | [private] |
Definition at line 149 of file CGLSurface.cpp.
References finishRendering(), onFinishRendering(), and renderer.
void CGLSurface::contextMenuEvent | ( | QContextMenuEvent * | event | ) | [protected, virtual] |
void CGLSurface::EnableOverlay | ( | bool | tf | ) |
Definition at line 176 of file CGLSurface.cpp.
References bRenderWithOverlay, lockGLContext(), onInitialize(), Render(), unlockGLContext(), and useRenderThread.
Referenced by VStudioRenderer::ShowPerformance().
void CGLSurface::EnableThread | ( | bool | tf | ) |
Definition at line 59 of file CGLSurface.cpp.
References finishRendering(), initialized, initRendering(), Log(), and useRenderThread.
Referenced by CGLHistogram::CGLHistogram(), and VStudioRenderer::VStudioRenderer().
void CGLSurface::EndAnimate | ( | ) |
Definition at line 56 of file CGLSurface.cpp.
References timerID.
Referenced by VStudioRenderer::ShowPerformance().
void CGLSurface::enterEvent | ( | QEvent * | event | ) | [protected, virtual] |
Definition at line 269 of file CGLSurface.cpp.
void CGLSurface::finishRendering | ( | ) | [private] |
Definition at line 83 of file CGLSurface.cpp.
References render_condition, CGLRenderThread::render_flag, and renderer.
Referenced by closeEvent(), and EnableThread().
void CGLSurface::initRendering | ( | ) | [private] |
Definition at line 76 of file CGLSurface.cpp.
References render_condition, CGLRenderThread::render_flag, and renderer.
Referenced by EnableThread(), and paintEvent().
void CGLSurface::keyPressEvent | ( | QKeyEvent * | event | ) | [protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 280 of file CGLSurface.cpp.
References pInputHandler.
void CGLSurface::keyReleaseEvent | ( | QKeyEvent * | event | ) | [protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 287 of file CGLSurface.cpp.
References pInputHandler.
void CGLSurface::leaveEvent | ( | QEvent * | event | ) | [protected, virtual] |
Definition at line 275 of file CGLSurface.cpp.
void CGLSurface::lockGLContext | ( | ) |
Definition at line 91 of file CGLSurface.cpp.
References render_mutex.
Referenced by CGLProgram::AttachShader(), CGLProgram::Compile(), CGLProgram::CreateShader(), CGLProgram::Detach(), CGLHistogram::DisplayData(), EnableOverlay(), VStudioRenderer::GetOpenglInfo(), CGLProgram::Link(), VStudioRenderer::SetBGColor(), CGLProgram::SetRenderer(), VStudioRenderer::SetVolume(), and VStudioRenderer::ShowPerformance().
void CGLSurface::Log | ( | const char * | txt | ) | [inline, private] |
Definition at line 99 of file CGLSurface.h.
References onLOG().
Referenced by EnableThread(), and paintEvent().
void CGLSurface::mouseMoveEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Reimplemented in CGLHistogram.
Definition at line 298 of file CGLSurface.cpp.
References dx, dy, oldPosX, oldPosY, pInputHandler, and Render().
void CGLSurface::mousePressEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Reimplemented in CGLHistogram.
Definition at line 314 of file CGLSurface.cpp.
References oldPosX, oldPosY, and pInputHandler.
void CGLSurface::mouseReleaseEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Reimplemented in CGLHistogram.
Definition at line 327 of file CGLSurface.cpp.
References pInputHandler.
virtual void CGLSurface::onAnimate | ( | ) | [inline, protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 71 of file CGLSurface.h.
Referenced by timerEvent().
void CGLSurface::onDraw | ( | ) | [protected, virtual] |
Reimplemented in CGLHistogram, and VStudioRenderer.
Definition at line 204 of file CGLSurface.cpp.
References viewportHeight, and viewportWidth.
Referenced by Render(), and CGLRenderThread::run().
void CGLSurface::onFinishRendering | ( | ) | [protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 261 of file CGLSurface.cpp.
Referenced by closeEvent(), and CGLRenderThread::run().
void CGLSurface::onInitialize | ( | ) | [protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 192 of file CGLSurface.cpp.
Referenced by EnableOverlay(), paintEvent(), and CGLRenderThread::run().
virtual void CGLSurface::onLOG | ( | const char * | ) | [inline, protected, virtual] |
virtual void CGLSurface::onLOG | ( | QString & | ) | [inline, protected, virtual] |
Reimplemented in CGLHistogram, and VStudioRenderer.
Definition at line 75 of file CGLSurface.h.
Referenced by Log().
virtual void CGLSurface::onOverlayDraw | ( | QPainter * | painter | ) | [inline, protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 70 of file CGLSurface.h.
Referenced by Render(), and CGLRenderThread::run().
void CGLSurface::onResize | ( | ) | [protected, virtual] |
Reimplemented in VStudioRenderer.
Definition at line 198 of file CGLSurface.cpp.
References viewportHeight, and viewportWidth.
Referenced by paintEvent(), resizeEvent(), and CGLRenderThread::run().
void CGLSurface::paintEvent | ( | QPaintEvent * | event | ) | [private] |
Definition at line 130 of file CGLSurface.cpp.
References initialized, initRendering(), Log(), onInitialize(), onResize(), Render(), renderer, CGLRenderThread::resize_flag, and useRenderThread.
void CGLSurface::registerInputHandler | ( | TSmartPointer< IInputHandler > | handler | ) |
Definition at line 46 of file CGLSurface.cpp.
References pInputHandler.
Referenced by VStudioRenderer::keyPressEvent(), VStudioRenderer::keyReleaseEvent(), VStudioRenderer::ToggleTransform(), and VStudioRenderer::VStudioRenderer().
void CGLSurface::Render | ( | ) | [private] |
Definition at line 161 of file CGLSurface.cpp.
References bRenderWithOverlay, onDraw(), onOverlayDraw(), pPainter, render_condition, and renderer.
Referenced by EnableOverlay(), mouseMoveEvent(), paintEvent(), and Update().
void CGLSurface::resizeEvent | ( | QResizeEvent * | event | ) | [private] |
Definition at line 115 of file CGLSurface.cpp.
References initialized, onResize(), renderer, CGLRenderThread::resize_flag, useRenderThread, viewportHeight, and viewportWidth.
void CGLSurface::showEvent | ( | QShowEvent * | event | ) | [private] |
Definition at line 110 of file CGLSurface.cpp.
void CGLSurface::StartAnimate | ( | int | ms | ) |
Definition at line 55 of file CGLSurface.cpp.
References timerID.
Referenced by VStudioRenderer::ShowPerformance().
void CGLSurface::timerEvent | ( | QTimerEvent * | ) | [inline, private] |
void CGLSurface::unlockGLContext | ( | ) |
Definition at line 99 of file CGLSurface.cpp.
References render_mutex.
Referenced by CGLProgram::AttachShader(), CGLProgram::Compile(), CGLProgram::CreateShader(), CGLProgram::Detach(), CGLHistogram::DisplayData(), EnableOverlay(), VStudioRenderer::GetOpenglInfo(), CGLProgram::Link(), VStudioRenderer::SetBGColor(), CGLProgram::SetRenderer(), VStudioRenderer::SetVolume(), and VStudioRenderer::ShowPerformance().
void CGLSurface::unregisterInputHandler | ( | TSmartPointer< IInputHandler > | handler | ) |
void CGLSurface::Update | ( | ) | [inline] |
Reimplemented in CGLHistogram.
Definition at line 45 of file CGLSurface.h.
References Render().
Referenced by VStudioRenderer::keyPressEvent(), VStudioRenderer::keyReleaseEvent(), VStudio::LoadVolume(), VStudioRenderer::onAnimate(), VStudioRenderer::SaveSnapshot(), and CProperties::UpdateRender().
friend class CGLRenderThread [friend] |
Definition at line 34 of file CGLSurface.h.
bool CGLSurface::bRenderWithOverlay [private] |
Definition at line 133 of file CGLSurface.h.
Referenced by CGLSurface(), EnableOverlay(), Render(), and CGLRenderThread::run().
int CGLSurface::dx [protected] |
Definition at line 79 of file CGLSurface.h.
Referenced by mouseMoveEvent(), and CGLHistogram::mouseMoveEvent().
int CGLSurface::dy [protected] |
Definition at line 79 of file CGLSurface.h.
Referenced by mouseMoveEvent(), and CGLHistogram::mouseMoveEvent().
bool CGLSurface::initialized [private] |
Definition at line 137 of file CGLSurface.h.
Referenced by CGLSurface(), EnableThread(), paintEvent(), resizeEvent(), and CGLRenderThread::run().
int CGLSurface::oldPosX [protected] |
Definition at line 79 of file CGLSurface.h.
Referenced by mouseMoveEvent(), CGLHistogram::mouseMoveEvent(), mousePressEvent(), and CGLHistogram::mousePressEvent().
int CGLSurface::oldPosY [protected] |
Definition at line 79 of file CGLSurface.h.
Referenced by mouseMoveEvent(), CGLHistogram::mouseMoveEvent(), mousePressEvent(), and CGLHistogram::mousePressEvent().
TSmartPointer<IInputHandler> CGLSurface::pInputHandler [private] |
Definition at line 125 of file CGLSurface.h.
Referenced by CGLSurface(), keyPressEvent(), keyReleaseEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), registerInputHandler(), and unregisterInputHandler().
QPainter* CGLSurface::pPainter [private] |
Definition at line 132 of file CGLSurface.h.
Referenced by CGLSurface(), Render(), and CGLRenderThread::run().
QWaitCondition CGLSurface::render_condition [private] |
Definition at line 129 of file CGLSurface.h.
Referenced by finishRendering(), initRendering(), Render(), and CGLRenderThread::run().
QMutex CGLSurface::render_mutex [private] |
Definition at line 128 of file CGLSurface.h.
Referenced by lockGLContext(), CGLRenderThread::run(), and unlockGLContext().
CGLRenderThread CGLSurface::renderer [private] |
Definition at line 124 of file CGLSurface.h.
Referenced by closeEvent(), finishRendering(), initRendering(), paintEvent(), Render(), and resizeEvent().
int CGLSurface::timerID [private] |
Ui::CGLSurface CGLSurface::ui [private] |
bool CGLSurface::useRenderThread [private] |
Definition at line 136 of file CGLSurface.h.
Referenced by CGLSurface(), EnableOverlay(), EnableThread(), paintEvent(), and resizeEvent().
int CGLSurface::viewportHeight [protected] |
Definition at line 91 of file CGLSurface.h.
Referenced by VStudioRenderer::GetViewAspect(), onDraw(), VStudioRenderer::onResize(), onResize(), and resizeEvent().
int CGLSurface::viewportWidth [protected] |
Definition at line 90 of file CGLSurface.h.
Referenced by VStudioRenderer::GetViewAspect(), onDraw(), VStudioRenderer::onResize(), onResize(), and resizeEvent().