OpenMS
Plot3DOpenGLCanvas Class Reference

OpenGL Canvas for 3D-visualization of map data. More...

#include <OpenMS/VISUAL/Plot3DOpenGLCanvas.h>

Inheritance diagram for Plot3DOpenGLCanvas:
[legend]
Collaboration diagram for Plot3DOpenGLCanvas:
[legend]

Public Types

typedef std::vector< std::vector< double > > AxisTickVector
 Container for axis ticks. More...
 

Public Member Functions

 Plot3DOpenGLCanvas (QWidget *parent, Plot3DCanvas &canvas_3d)
 Constructor. More...
 
 ~Plot3DOpenGLCanvas () override
 Destructor. More...
 
void initializeGL () override
 virtual function provided from QGLWidget More...
 
void resizeGL (int w, int h) override
 virtual function provided from QGLWidget More...
 
void paintGL () override
 virtual function provided from QGLWidget More...
 

Friends

class Plot3DCanvas
 

Different OpenGL display lists

GLuint stickdata_
 
GLuint axes_
 
GLuint axes_ticks_
 
GLuint gridlines_
 
GLuint ground_
 
Plot3DCanvascanvas_3d_
 reference to Plot3DCanvas More...
 
int xrot_
 member x-variables for the rotation More...
 
int yrot_
 member y-variables for the rotation More...
 
int zrot_
 member z-variables for the rotation More...
 
int xrot_tmp_
 member x-variable that stores the original angle during zoom mode More...
 
int yrot_tmp_
 member y-variable that stores the original angle during zoom mode More...
 
int zrot_tmp_
 member z-variable that stores the original angle during zoom mode More...
 
QPainter * painter_ = nullptr
 
QPoint mouse_move_end_
 member variables for the zoom-mode More...
 
QPoint mouse_move_begin_
 
double corner_
 member variable for the x and y axis of the BB More...
 
double zoom_
 member variable for the zoom mode More...
 
double zoom_tmp_
 member variable that stores original zoom factor during zoom mode More...
 
double near_
 member variable for the z- axis of the BB More...
 
double far_
 member variable for the z- axis of the BB More...
 
float width_
 the width of the viewport More...
 
float height_
 the height of the viewport More...
 
DRange< 3 > overall_values_
 object which contains the min and max values of mz, rt and intensity More...
 
DRange< 1 > int_scale_
 object which contains the values of the current min and max intensity More...
 
AxisTickVector grid_mz_
 member gridvectors which contains the data for the mz-axis-ticks More...
 
AxisTickVector grid_rt_
 member gridvectors which contains the data for the rt-axis-ticks More...
 
AxisTickVector grid_intensity_
 member gridvectors which contains the data for the intensity-axis-ticks More...
 
double x_1_
 x1 coordinate of the zoomselection More...
 
double x_2_
 x2 coordinate of the zoomselection More...
 
double y_1_
 y1 coordinate of the zoomselection More...
 
double y_2_
 y2 coordinate of the zoomselection More...
 
double trans_x_
 x- translation More...
 
double trans_y_
 y_translation More...
 
QString x_label_
 
QString y_label_
 
QString z_label_
 
void actionModeChange ()
 Slot that reacts on action mode changes. More...
 

Reimplemented QT events

void mouseMoveEvent (QMouseEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void focusOutEvent (QFocusEvent *e) override
 
void setXLabel (const QString &l)
 
void setYLabel (const QString &l)
 
void setZLabel (const QString &l)
 
void updateIntensityScale ()
 updates the min and max values of the intensity More...
 
GLint project_ (GLdouble objx, GLdouble objy, GLdouble objz, GLdouble *winx, GLdouble *winy)
 helper function to project point to device space More...
 
void transformPoint_ (GLdouble out[4], const GLdouble m[16], const GLdouble in[4])
 helper function to transform point using matrix m (homogeneous coordinates) More...
 
void renderText_ (double x, double y, double z, const QString &text)
 helper function to replicate old behaviour of QGLWidget More...
 
void qglColor_ (const QColor &color)
 helper function to replicate old behaviour of QGLWidget More...
 
void qglClearColor_ (const QColor &clearColor)
 helper function to replicate old behaviour of QGLWidget More...
 
GLuint makeDataAsStick_ ()
 Builds up a display list for the 3D view. More...
 
GLuint makeAxes_ ()
 Builds up a display list for the axes. More...
 
GLuint makeAxesTicks_ ()
 Builds up a display list for axis ticks. More...
 
GLuint makeDataAsTopView_ ()
 Builds up a display list for the birds-eye view. More...
 
GLuint makeGround_ ()
 Builds up a display list for the background. More...
 
GLuint makeGridLines_ ()
 Builds up a display list for grid lines. More...
 
void drawAxesLegend_ ()
 Draws the axis texts. More...
 
void computeSelection_ ()
 computes the dataset supposed to be drawn when a section has been selected in zoom mode More...
 
void dataToZoomArray_ (double x_1, double y_1, double x_2, double y_2)
 calculates the zoom area , which is shown More...
 
double scaledRT_ (double rt)
 returns the BB-rt-coordinate : value –> BB-coordinates More...
 
double scaledInversRT_ (double mz)
 returns the rt-value : BB-coordinates –> value More...
 
double scaledMZ_ (double mz)
 returns the BB-mz-coordinate : values –> BB-coordinates More...
 
double scaledInversMZ_ (double mz)
 returns the mz-value : BB-coordinates –> value More...
 
double scaledIntensity_ (float intensity, Size layer_index)
 returns the BB-intensity -coordinate : values –> BB-coordinates More...
 
void recalculateDotGradient_ (LayerDataBase &layer)
 recalculates the dot gradient interpolation values. More...
 
void calculateGridLines_ ()
 calculate the ticks for the gridlines More...
 
void normalizeAngle (int *angle)
 normalize the angle by "angle % 360*16" More...
 
void resetTranslation ()
 
void storeRotationAndZoom ()
 stores the original rotation and zoom factor (e.g. before changing into zoom mode) More...
 
void restoreRotationAndZoom ()
 restores the original rotation and zoom factor (e.g. before changing into zoom mode) More...
 

Detailed Description

OpenGL Canvas for 3D-visualization of map data.

Note
Do not use this class directly. Use Plot3DCanvas instead!

Member Typedef Documentation

◆ AxisTickVector

typedef std::vector<std::vector<double> > AxisTickVector

Container for axis ticks.

Constructor & Destructor Documentation

◆ Plot3DOpenGLCanvas()

Plot3DOpenGLCanvas ( QWidget parent,
Plot3DCanvas canvas_3d 
)

Constructor.

Parameters
parentThe parent widget
canvas_3dThe main 3d canvas

◆ ~Plot3DOpenGLCanvas()

~Plot3DOpenGLCanvas ( )
override

Destructor.

Destroys the OpenGLWidget and all associated data.

Member Function Documentation

◆ actionModeChange

void actionModeChange ( )
protectedslot

Slot that reacts on action mode changes.

◆ calculateGridLines_()

void calculateGridLines_ ( )
protected

calculate the ticks for the gridlines

◆ computeSelection_()

void computeSelection_ ( )
protected

computes the dataset supposed to be drawn when a section has been selected in zoom mode

◆ dataToZoomArray_()

void dataToZoomArray_ ( double  x_1,
double  y_1,
double  x_2,
double  y_2 
)
protected

calculates the zoom area , which is shown

◆ drawAxesLegend_()

void drawAxesLegend_ ( )
protected

Draws the axis texts.

◆ focusOutEvent()

void focusOutEvent ( QFocusEvent *  e)
override

◆ initializeGL()

void initializeGL ( )
override

virtual function provided from QGLWidget

◆ makeAxes_()

GLuint makeAxes_ ( )
protected

Builds up a display list for the axes.

◆ makeAxesTicks_()

GLuint makeAxesTicks_ ( )
protected

Builds up a display list for axis ticks.

◆ makeDataAsStick_()

GLuint makeDataAsStick_ ( )
protected

Builds up a display list for the 3D view.

◆ makeDataAsTopView_()

GLuint makeDataAsTopView_ ( )
protected

Builds up a display list for the birds-eye view.

◆ makeGridLines_()

GLuint makeGridLines_ ( )
protected

Builds up a display list for grid lines.

◆ makeGround_()

GLuint makeGround_ ( )
protected

Builds up a display list for the background.

◆ mouseMoveEvent()

void mouseMoveEvent ( QMouseEvent *  e)
override

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent *  e)
override

◆ mouseReleaseEvent()

void mouseReleaseEvent ( QMouseEvent *  e)
override

◆ normalizeAngle()

void normalizeAngle ( int *  angle)
protected

normalize the angle by "angle % 360*16"

◆ paintGL()

void paintGL ( )
override

virtual function provided from QGLWidget

◆ project_()

GLint project_ ( GLdouble  objx,
GLdouble  objy,
GLdouble  objz,
GLdouble *  winx,
GLdouble *  winy 
)
protected

helper function to project point to device space

◆ qglClearColor_()

void qglClearColor_ ( const QColor &  clearColor)
protected

helper function to replicate old behaviour of QGLWidget

◆ qglColor_()

void qglColor_ ( const QColor &  color)
protected

helper function to replicate old behaviour of QGLWidget

◆ recalculateDotGradient_()

void recalculateDotGradient_ ( LayerDataBase layer)
protected

recalculates the dot gradient interpolation values.

◆ renderText_()

void renderText_ ( double  x,
double  y,
double  z,
const QString &  text 
)
protected

helper function to replicate old behaviour of QGLWidget

◆ resetTranslation()

void resetTranslation ( )
protected

◆ resizeGL()

void resizeGL ( int  w,
int  h 
)
override

virtual function provided from QGLWidget

◆ restoreRotationAndZoom()

void restoreRotationAndZoom ( )
protected

restores the original rotation and zoom factor (e.g. before changing into zoom mode)

◆ scaledIntensity_()

double scaledIntensity_ ( float  intensity,
Size  layer_index 
)
protected

returns the BB-intensity -coordinate : values –> BB-coordinates

◆ scaledInversMZ_()

double scaledInversMZ_ ( double  mz)
protected

returns the mz-value : BB-coordinates –> value

◆ scaledInversRT_()

double scaledInversRT_ ( double  mz)
protected

returns the rt-value : BB-coordinates –> value

◆ scaledMZ_()

double scaledMZ_ ( double  mz)
protected

returns the BB-mz-coordinate : values –> BB-coordinates

◆ scaledRT_()

double scaledRT_ ( double  rt)
protected

returns the BB-rt-coordinate : value –> BB-coordinates

◆ setXLabel()

void setXLabel ( const QString &  l)
inline

◆ setYLabel()

void setYLabel ( const QString &  l)
inline

◆ setZLabel()

void setZLabel ( const QString &  l)
inline

◆ storeRotationAndZoom()

void storeRotationAndZoom ( )
protected

stores the original rotation and zoom factor (e.g. before changing into zoom mode)

◆ transformPoint_()

void transformPoint_ ( GLdouble  out[4],
const GLdouble  m[16],
const GLdouble  in[4] 
)
protected

helper function to transform point using matrix m (homogeneous coordinates)

◆ updateIntensityScale()

void updateIntensityScale ( )

updates the min and max values of the intensity

Friends And Related Function Documentation

◆ Plot3DCanvas

friend class Plot3DCanvas
friend

Member Data Documentation

◆ axes_

GLuint axes_
protected

◆ axes_ticks_

GLuint axes_ticks_
protected

◆ canvas_3d_

Plot3DCanvas& canvas_3d_
protected

reference to Plot3DCanvas

◆ corner_

double corner_
protected

member variable for the x and y axis of the BB

◆ far_

double far_
protected

member variable for the z- axis of the BB

◆ grid_intensity_

AxisTickVector grid_intensity_
protected

member gridvectors which contains the data for the intensity-axis-ticks

◆ grid_mz_

AxisTickVector grid_mz_
protected

member gridvectors which contains the data for the mz-axis-ticks

◆ grid_rt_

AxisTickVector grid_rt_
protected

member gridvectors which contains the data for the rt-axis-ticks

◆ gridlines_

GLuint gridlines_
protected

◆ ground_

GLuint ground_
protected

◆ height_

float height_
protected

the height of the viewport

◆ int_scale_

DRange<1> int_scale_
protected

object which contains the values of the current min and max intensity

◆ mouse_move_begin_

QPoint mouse_move_begin_
protected

◆ mouse_move_end_

QPoint mouse_move_end_
protected

member variables for the zoom-mode

◆ near_

double near_
protected

member variable for the z- axis of the BB

◆ overall_values_

DRange<3> overall_values_
protected

object which contains the min and max values of mz, rt and intensity

◆ painter_

QPainter* painter_ = nullptr
protected

◆ stickdata_

GLuint stickdata_
protected

◆ trans_x_

double trans_x_
protected

x- translation

◆ trans_y_

double trans_y_
protected

y_translation

◆ width_

float width_
protected

the width of the viewport

◆ x_1_

double x_1_
protected

x1 coordinate of the zoomselection

◆ x_2_

double x_2_
protected

x2 coordinate of the zoomselection

◆ x_label_

QString x_label_
protected

◆ xrot_

int xrot_
protected

member x-variables for the rotation

◆ xrot_tmp_

int xrot_tmp_
protected

member x-variable that stores the original angle during zoom mode

◆ y_1_

double y_1_
protected

y1 coordinate of the zoomselection

◆ y_2_

double y_2_
protected

y2 coordinate of the zoomselection

◆ y_label_

QString y_label_
protected

◆ yrot_

int yrot_
protected

member y-variables for the rotation

◆ yrot_tmp_

int yrot_tmp_
protected

member y-variable that stores the original angle during zoom mode

◆ z_label_

QString z_label_
protected

◆ zoom_

double zoom_
protected

member variable for the zoom mode

◆ zoom_tmp_

double zoom_tmp_
protected

member variable that stores original zoom factor during zoom mode

◆ zrot_

int zrot_
protected

member z-variables for the rotation

◆ zrot_tmp_

int zrot_tmp_
protected

member z-variable that stores the original angle during zoom mode