Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_VISUAL_SPECTRUM3DOPENGLCANVAS_H
00036 #define OPENMS_VISUAL_SPECTRUM3DOPENGLCANVAS_H
00037
00038 #include <QtOpenGL/QGLWidget>
00039
00040
00041 #include <OpenMS/DATASTRUCTURES/DRange.h>
00042
00043 namespace OpenMS
00044 {
00045 class Spectrum3DCanvas;
00046
00055 class OPENMS_GUI_DLLAPI Spectrum3DOpenGLCanvas :
00056 public QGLWidget
00057 {
00058 Q_OBJECT
00059
00060 friend class Spectrum3DCanvas;
00061
00062 public:
00063
00065 typedef std::vector<std::vector<double> > AxisTickVector;
00066
00073 Spectrum3DOpenGLCanvas(QWidget * parent, Spectrum3DCanvas & canvas_3d);
00079 virtual ~Spectrum3DOpenGLCanvas();
00081 void initializeGL();
00083 void resizeGL(int w, int h);
00085 void paintGL();
00087 GLuint makeDataAsStick();
00089 GLuint makeAxes();
00091 GLuint makeAxesTicks();
00093 GLuint makeDataAsTopView();
00095 GLuint makeGround();
00097 GLuint makeGridLines();
00099 void drawAxesLegend();
00100
00103 void mouseMoveEvent(QMouseEvent * e);
00104 void mouseReleaseEvent(QMouseEvent * e);
00105 void mousePressEvent(QMouseEvent * e);
00106 void focusOutEvent(QFocusEvent * e);
00108
00110 void computeSelection();
00111
00113 void updateIntensityScale();
00114
00116 void dataToZoomArray(double x_1, double y_1, double x_2, double y_2);
00117
00119 double scaledRT(double rt);
00121 double scaledInversRT(double mz);
00123 double scaledMZ(double mz);
00125 double scaledInversMZ(double mz);
00127 double scaledIntensity(Real intensity, Size layer_index);
00128
00130 void recalculateDotGradient_(Size layer);
00132 void calculateGridLines_();
00133
00135 float width() const { return width_; }
00136 float height() const { return heigth_; }
00137
00139 int xRotation() const { return xrot_; }
00141 int yRotation() const { return yrot_; }
00143 int zRotation() const { return zrot_; }
00145 void normalizeAngle(int * angle);
00146
00147 void setAngels(int xrot, int yrot, int zrot);
00148
00149 void resetTranslation();
00150
00151 void timeMessure();
00152
00154 void storeRotationAndZoom();
00156 void restoreRotationAndZoom();
00157
00160 GLuint stickdata_;
00161 GLuint axes_;
00162 GLuint axes_ticks_;
00163 GLuint gridlines_;
00164 GLuint ground_;
00166
00168 Spectrum3DCanvas & canvas_3d_;
00169
00171 int xrot_;
00173 int yrot_;
00175 int zrot_;
00176
00178 int xrot_tmp_;
00180 int yrot_tmp_;
00182 int zrot_tmp_;
00183
00184
00185
00187 QPoint mouse_move_end_, mouse_move_begin_;
00188
00190 double corner_;
00192 double zoom_;
00194 double zoom_tmp_;
00195
00197 double near_;
00199 double far_;
00201 float width_;
00203 float heigth_;
00205 DRange<3> overall_values_;
00207 DRange<1> int_scale_;
00209 AxisTickVector grid_mz_;
00211 AxisTickVector grid_rt_;
00213 AxisTickVector grid_intensity_;
00215 double x_1_;
00217 double x_2_;
00219 double y_1_;
00221 double y_2_;
00223 double trans_x_;
00225 double trans_y_;
00226
00227 protected slots:
00229 void actionModeChange();
00230 };
00231 }
00232 #endif