SpaghettiVis
Implementation of 2009 Everts et al. Depth-Dependent Halos: Illustrative Rendering of Dense Line Data
Public Types | Public Slots | Signals | Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GLWidget Class Reference

The GLWidget class This is the main class containing the OpenGL context All interaction with OpenGL happens here. More...

#include <glwidget.h>

Inheritance diagram for GLWidget:
Inheritance graph
[legend]
Collaboration diagram for GLWidget:
Collaboration graph
[legend]

Public Types

enum  RenderMode { NONE, LINES, POINTS }
 RenderMode enum currently only LINES is supported.
 

Public Slots

void cleanup ()
 

Signals

void usedGPUMemoryChanged (float size)
 
void totalGPUMemoryChanged (float size)
 
void fpsChanged (int fps)
 
void graphicsDeviceInfoChanged (QString string)
 

Public Member Functions

 GLWidget (QWidget *parent, MainWindow *mainWindow)
 
void initLineRenderMode (std::vector< std::vector< LineVertex > > *lines)
 set up OpenGL buffers and shaders to render lines More...
 
QImage getImage ()
 getImage More...
 
void updateClipPlaneNormal ()
 updateClipPlaneNormal set the clip plane normal to the current right camera vector this is much easier for the user than setting the clip plane explicitly
 

Public Attributes

float lineTriangleStripWidth
 total width of triangle strip (black line + white halo)
 
float lineWidthPercentageBlack
 percentage of triangle strip drawn black to represent line (rest is white halo)
 
float lineWidthDepthCueingFactor
 how much the black line is drawn thinner with increasing depth
 
float lineHaloMaxDepth
 max depth displacement of halo
 
bool enableClipping
 if enabled, clip beyond a specified clipping plane. note: no real clipping we only discard fragments
 
glm::vec3 clipPlaneNormal
 direction along which to clip. note: no real clipping we only discard fragments
 
float clipPlaneDistance
 distance from origin in direction of clipPlaneNormal beyond which to clip
 
enum GLWidget::RenderMode renderMode
 

Protected Slots

void paintGL () Q_DECL_OVERRIDE
 
void initializeGL () Q_DECL_OVERRIDE
 
void resizeGL (int w, int h) Q_DECL_OVERRIDE
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
void mouseMoveEvent (QMouseEvent *event) Q_DECL_OVERRIDE
 
void keyPressEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
void keyReleaseEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
void wheelEvent (QWheelEvent *event) Q_DECL_OVERRIDE
 

Private Member Functions

void initShaders ()
 
void allocateGPUBufferLineData ()
 
void drawLines ()
 
void calculateFPS ()
 
void printDebugMsg (const QOpenGLDebugMessage &msg)
 

Private Attributes

Camera camera
 
std::vector< std::vector< LineVertex > > * lines
 
size_t nrLines
 
QOpenGLShaderProgram * shaderLinesWithHalos
 
QOpenGLVertexArrayObject vaoLines
 
QOpenGLBuffer vboLines
 
QPoint lastMousePos
 
size_t frameCount = 0
 
size_t fps = 0
 
qint64 previousTimeFPS
 
QElapsedTimer fpsTimer
 
bool GL_NVX_gpu_memory_info_supported = false
 
GLint total_mem_kb = 0
 
GLint cur_avail_mem_kb = 0
 
QTimer paintTimer
 
QOpenGLDebugLogger * logger
 
MainWindowmainWindow
 

Friends

class MainWindow
 make friend since tightly coupled anyway
 

Detailed Description

The GLWidget class This is the main class containing the OpenGL context All interaction with OpenGL happens here.

Member Function Documentation

◆ getImage()

QImage GLWidget::getImage ( )
inline

getImage

Returns
an image snapshot of the current OpenGL framebuffer

◆ initLineRenderMode()

void GLWidget::initLineRenderMode ( std::vector< std::vector< LineVertex > > *  lines)

set up OpenGL buffers and shaders to render lines

Parameters
linesvector of lines (vector of vector of line vertices) each vertex has 8 floats: 3 pos, 3 direction to next, 2 uv for triangle strip texturing we store all three attributes interleaved on single vbo [<posdirectionuv><posdirectionuv>...] NOTE: we store two sequential copies of each vertex (one with v = 0, one with v = 1) to draw lines as triangle strips

Member Data Documentation

◆ lines

std::vector<std::vector<LineVertex> >* GLWidget::lines
private

CPU line vertex data each line vertex has 8 floats: 3 pos, 3 direction to next, 2 uv for triangle strip texturing NOTE: we store two sequential copies of each vertex (one with v = 0, one with v = 1) to draw lines as triangle strips


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