Walls And Holes  1
MeshView Class Reference

#include <meshview.h>

Inheritance diagram for MeshView:
Collaboration diagram for MeshView:

Public Slots

void scheduleRepaint ()
 Schedules a paintGL() call on the OpenGL thread. More...
 
void makeContextCurrent ()
 
void doneContextCurrent ()
 
void cleanUp ()
 Cleans up all resources. More...
 

Public Member Functions

 MeshView (QWidget *parent=0)
 
 ~MeshView ()
 

Protected Member Functions

void setRenderer (QSharedPointer< AbstractRenderer > renderer)
 Makes the MeshView use a new Renderer. More...
 
void initializeGL () override
 
void paintGL () override
 
void resizeGL (int w, int h) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 
QSharedPointer< AbstractRenderergetCurrentRenderer ()
 This method should ONLY be called on the OpenGL thread. It returns the appropriate renderer to be used, considering the value of mNextRenderer. More...
 

Protected Attributes

QSharedPointer< AbstractRenderermRenderer
 The Renderer object that will be used to draw to the screen. More...
 
QSharedPointer< AbstractRenderermNextRenderer
 nullptr if the Renderer does not need to change, else equal to the new renderer. More...
 
QMutex mRendererMutex
 Mutex for updating the mRenderer variable. This ensures that the mRenderer is not being used when it is changed. More...
 
QMatrix4x4 mProjectionMatrix
 
AbstractMeshViewCameramCamera
 
ToolManagermTools
 
QOpenGLContext * mContext
 The context this MeshView was initialized with. This variable is only stored to disconnect its aboutToBeDestroyed() signal when the MeshView is itself destroyed. This pointer is not owned by the MeshView, but should still be valid in ~MeshView() (although this cannot be guaranteed—darn you, Qt's lack of shared pointers!). More...
 

Friends

class MeshViewContainer
 

Constructor & Destructor Documentation

◆ MeshView()

MeshView::MeshView ( QWidget *  parent = 0)
explicit

◆ ~MeshView()

MeshView::~MeshView ( )

Member Function Documentation

◆ cleanUp

void MeshView::cleanUp ( )
slot

Cleans up all resources.

Here is the caller graph for this function:

◆ doneContextCurrent

void MeshView::doneContextCurrent ( )
slot
Here is the caller graph for this function:

◆ getCurrentRenderer()

QSharedPointer< AbstractRenderer > MeshView::getCurrentRenderer ( )
protected

This method should ONLY be called on the OpenGL thread. It returns the appropriate renderer to be used, considering the value of mNextRenderer.

This function does not lock the mRendererMutex.

Returns
The Renderer that should be used.
Here is the caller graph for this function:

◆ initializeGL()

void MeshView::initializeGL ( )
overrideprotected
Here is the call graph for this function:

◆ makeContextCurrent

void MeshView::makeContextCurrent ( )
slot
Here is the caller graph for this function:

◆ mouseMoveEvent()

void MeshView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mousePressEvent()

void MeshView::mousePressEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mouseReleaseEvent()

void MeshView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ paintGL()

void MeshView::paintGL ( )
overrideprotected
Here is the call graph for this function:

◆ resizeGL()

void MeshView::resizeGL ( int  w,
int  h 
)
overrideprotected

◆ scheduleRepaint

void MeshView::scheduleRepaint ( )
slot

Schedules a paintGL() call on the OpenGL thread.

Here is the caller graph for this function:

◆ setRenderer()

void MeshView::setRenderer ( QSharedPointer< AbstractRenderer renderer)
protected

Makes the MeshView use a new Renderer.

Parameters
rendererThe Renderer that will be used to draw to the screen.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wheelEvent()

void MeshView::wheelEvent ( QWheelEvent *  event)
overrideprotected
Here is the call graph for this function:

Friends And Related Function Documentation

◆ MeshViewContainer

friend class MeshViewContainer
friend

Member Data Documentation

◆ mCamera

AbstractMeshViewCamera* MeshView::mCamera
protected

◆ mContext

QOpenGLContext* MeshView::mContext
protected

The context this MeshView was initialized with. This variable is only stored to disconnect its aboutToBeDestroyed() signal when the MeshView is itself destroyed. This pointer is not owned by the MeshView, but should still be valid in ~MeshView() (although this cannot be guaranteed—darn you, Qt's lack of shared pointers!).

◆ mNextRenderer

QSharedPointer<AbstractRenderer> MeshView::mNextRenderer
protected

nullptr if the Renderer does not need to change, else equal to the new renderer.

◆ mProjectionMatrix

QMatrix4x4 MeshView::mProjectionMatrix
protected

◆ mRenderer

QSharedPointer<AbstractRenderer> MeshView::mRenderer
protected

The Renderer object that will be used to draw to the screen.

◆ mRendererMutex

QMutex MeshView::mRendererMutex
protected

Mutex for updating the mRenderer variable. This ensures that the mRenderer is not being used when it is changed.

◆ mTools

ToolManager* MeshView::mTools
protected

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