OpenMS
Loading...
Searching...
No Matches
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.
 

Public Member Functions

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

Friends

class Plot3DCanvas
 

Different OpenGL display lists

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

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

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
[in]parentThe parent widget
[in]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 Symbol 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