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

The MainWindow class. More...

#include <mainwindow.h>

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

Classes

struct  FileType
 

Public Slots

void displayTotalGPUMemory (float size)
 
void displayUsedGPUMemory (float size)
 
void displayFPS (int fps)
 
void displayGraphicsDeviceInfo (QString string)
 

Public Member Functions

 MainWindow (QWidget *parent=0)
 
GLWidgetgetGLWidget ()
 

Protected Slots

void openFileAction ()
 File dialog to open data files.
 
void closeAction ()
 
void renderModeChanged (int index)
 
void on_generateTestDataButton_clicked ()
 
void on_spinBoxLineTriangleStripWidth_valueChanged (double value)
 
void on_spinBoxLineWidthPercentageBlack_valueChanged (double value)
 
void on_spinBoxLineWidthDepthCueingFactor_valueChanged (double value)
 
void on_spinBoxLineHaloMaxDepth_valueChanged (double value)
 
void on_pushButtonRestoreDefaults_clicked ()
 
void on_checkBoxEnableClipping_clicked (bool checked)
 
void on_pushButtonSetClipPlaneNormal_clicked ()
 
void on_horizontalSliderClipPlaneDistance_valueChanged (int value)
 
glm::vec3 randomPosInBoundingBox (glm::vec3 boundingBoxMin, glm::vec3 boundingBoxMax)
 generate a random position within an axis-aligned bounding box More...
 
void generateTestData (int numVertices, glm::vec3 boundingBoxMin, glm::vec3 boundingBoxMax)
 generate vertices along smooth lines within given bounding box More...
 
bool loadTRKData (QString &filename)
 Load TrackVis Tractography Track Line Data. More...
 
void generateAdditionalLineVertexData (std::vector< glm::vec3 > linePositions)
 generate additional line vertex data (directions and uv) from line positions More...
 

Private Types

enum  DataType { TRK }
 

Private Attributes

Ui::MainWindow * ui
 
struct MainWindow::FileType fileType
 
GLWidgetglWidget
 
std::vector< std::vector< LineVertex > > datasetLines
 

Detailed Description

The MainWindow class.

Class related to the MainWindow Qt User Interface. Contains a GLWidget for OpenGL Drawing.

Member Function Documentation

◆ generateAdditionalLineVertexData

void MainWindow::generateAdditionalLineVertexData ( std::vector< glm::vec3 >  linePositions)
protectedslot

generate additional line vertex data (directions and uv) from line positions

Parameters
linePositionsx,y,z coords of line points

take x,y,z line points as input and store line vertices, each vertex consists of 8 floats: 3 position, 3 direction to next vertex, 2 uv. NOTE: two copies of all vertices are stored in sequential manner, with uv v-coordinate 0 and 1 to use for drawing as triangle strips (two strip vertices for each line vertex). u-coordinate is same for both and is interpolated along the length of the whole line, v-coordinate is set to 0 for vertex on "right" side of the strip and to 1 for vertex on "left" side. direction to next vertex: take average of direction to current and direction to next for smoother directions.

◆ generateTestData

void MainWindow::generateTestData ( int  numVertices,
glm::vec3  boundingBoxMin,
glm::vec3  boundingBoxMax 
)
protectedslot

generate vertices along smooth lines within given bounding box

Parameters
numVerticesthis is only half the number of vertices generated: two copies of each vertex are stored in sequential manner to be able to render triangle strips later
boundingBoxMinposition defining start of axis aligned bounding box
boundingBoxMaxposition defining end of axis aligned bounding box

each vertex consists of 8 floats: 3 position, 3 direction to next vertex, 2 uv NOTE: two copies of all vertices are stored in sequential manner, with uv v-coordinate 0 and 1 to use for drawing as triangle strips (two strip vertices for each line vertex)

◆ loadTRKData

bool MainWindow::loadTRKData ( QString &  filename)
protectedslot

Load TrackVis Tractography Track Line Data.

Parameters
filenamepath to file
Returns
true if file was successfully loaded, else false

This uses libtrkfileio by lheric from https://github.com/lheric/libtrkfileio.

◆ randomPosInBoundingBox

glm::vec3 MainWindow::randomPosInBoundingBox ( glm::vec3  boundingBoxMin,
glm::vec3  boundingBoxMax 
)
protectedslot

generate a random position within an axis-aligned bounding box

Parameters
boundingBoxMinposition defining start of axis aligned bounding box
boundingBoxMaxposition defining end of axis aligned bounding box

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