Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Spectrum3DOpenGLCanvas.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2013.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Cornelia Friedle $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_VISUAL_SPECTRUM3DOPENGLCANVAS_H
36 #define OPENMS_VISUAL_SPECTRUM3DOPENGLCANVAS_H
37 
38 #include <QtOpenGL/QGLWidget>
39 
40 // OpenMS
42 
43 namespace OpenMS
44 {
45  class Spectrum3DCanvas;
46 
55  class OPENMS_GUI_DLLAPI Spectrum3DOpenGLCanvas :
56  public QGLWidget
57  {
58  Q_OBJECT
59 
60  friend class Spectrum3DCanvas;
61 
62 public:
63 
65  typedef std::vector<std::vector<double> > AxisTickVector;
66 
73  Spectrum3DOpenGLCanvas(QWidget * parent, Spectrum3DCanvas & canvas_3d);
79  virtual ~Spectrum3DOpenGLCanvas();
81  void initializeGL();
83  void resizeGL(int w, int h);
85  void paintGL();
87  GLuint makeDataAsStick();
89  GLuint makeAxes();
91  GLuint makeAxesTicks();
93  GLuint makeDataAsTopView();
95  GLuint makeGround();
97  GLuint makeGridLines();
99  void drawAxesLegend();
100 
103  void mouseMoveEvent(QMouseEvent * e);
104  void mouseReleaseEvent(QMouseEvent * e);
105  void mousePressEvent(QMouseEvent * e);
106  void focusOutEvent(QFocusEvent * e);
108 
110  void computeSelection();
111 
113  void updateIntensityScale();
114 
116  void dataToZoomArray(double x_1, double y_1, double x_2, double y_2);
117 
119  double scaledRT(double rt);
121  double scaledInversRT(double mz);
123  double scaledMZ(double mz);
125  double scaledInversMZ(double mz);
127  double scaledIntensity(Real intensity, Size layer_index);
128 
130  void recalculateDotGradient_(Size layer);
132  void calculateGridLines_();
133 
135  float width() const { return width_; }
136  float height() const { return heigth_; }
137 
139  int xRotation() const { return xrot_; }
141  int yRotation() const { return yrot_; }
143  int zRotation() const { return zrot_; }
145  void normalizeAngle(int * angle);
146  //document me
147  void setAngels(int xrot, int yrot, int zrot);
148  //document me
149  void resetTranslation();
150  //document me
151  void timeMessure();
152 
154  void storeRotationAndZoom();
156  void restoreRotationAndZoom();
157 
160  GLuint stickdata_;
161  GLuint axes_;
162  GLuint axes_ticks_;
163  GLuint gridlines_;
164  GLuint ground_;
166 
169 
171  int xrot_;
173  int yrot_;
175  int zrot_;
176 
183 
184 
185 
187  QPoint mouse_move_end_, mouse_move_begin_;
188 
190  double corner_;
192  double zoom_;
194  double zoom_tmp_;
195 
197  double near_;
199  double far_;
201  float width_;
203  float heigth_;
215  double x_1_;
217  double x_2_;
219  double y_1_;
221  double y_2_;
223  double trans_x_;
225  double trans_y_;
226 
227 protected slots:
229  void actionModeChange();
230  };
231 }
232 #endif
OpenGL Canvas for 3D-visualization of map data.
Definition: Spectrum3DOpenGLCanvas.h:55
double near_
member variable for the z- axis of the BB
Definition: Spectrum3DOpenGLCanvas.h:197
float Real
Real type.
Definition: Types.h:109
double x_1_
x1 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:215
float width() const
return width
Definition: Spectrum3DOpenGLCanvas.h:135
std::vector< std::vector< double > > AxisTickVector
Container for axis ticks.
Definition: Spectrum3DOpenGLCanvas.h:65
float width_
the width of the viewport
Definition: Spectrum3DOpenGLCanvas.h:201
double x_2_
x2 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:217
DRange< 1 > int_scale_
object wich contains the values of the current min and max intensity
Definition: Spectrum3DOpenGLCanvas.h:207
double trans_y_
y_translation
Definition: Spectrum3DOpenGLCanvas.h:225
int yrot_
member y-variables for the rotation
Definition: Spectrum3DOpenGLCanvas.h:173
double far_
member variable for the z- axis of the BB
Definition: Spectrum3DOpenGLCanvas.h:199
double y_1_
y1 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:219
AxisTickVector grid_rt_
member gridvectors which contains the data for the rt-axis-ticks
Definition: Spectrum3DOpenGLCanvas.h:211
double zoom_tmp_
member variable that stores original zoom factor during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:194
GLuint axes_
Definition: Spectrum3DOpenGLCanvas.h:161
double zoom_
member variable for the zoom mode
Definition: Spectrum3DOpenGLCanvas.h:192
AxisTickVector grid_mz_
member gridvectors which contains the data for the mz-axis-ticks
Definition: Spectrum3DOpenGLCanvas.h:209
int xRotation() const
return xRot_
Definition: Spectrum3DOpenGLCanvas.h:139
GLuint axes_ticks_
Definition: Spectrum3DOpenGLCanvas.h:162
int zRotation() const
return zRot_
Definition: Spectrum3DOpenGLCanvas.h:143
double corner_
member variable for the x and y axis of the BB
Definition: Spectrum3DOpenGLCanvas.h:190
AxisTickVector grid_intensity_
member gridvectors which contains the data for the intensity-axis-ticks
Definition: Spectrum3DOpenGLCanvas.h:213
int zrot_tmp_
member z-variable that stores the original angle during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:182
const double h
double y_2_
y2 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:221
int yrot_tmp_
member y-variable that stores the original angle during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:180
int xrot_
member x-variables for the rotation
Definition: Spectrum3DOpenGLCanvas.h:171
float height() const
Definition: Spectrum3DOpenGLCanvas.h:136
float heigth_
the height of the viewport
Definition: Spectrum3DOpenGLCanvas.h:203
DRange< 3 > overall_values_
object which contains the min and max values of mz, rt and intensity
Definition: Spectrum3DOpenGLCanvas.h:205
GLuint stickdata_
Definition: Spectrum3DOpenGLCanvas.h:160
QPoint mouse_move_end_
member variables fot the zoom-modus
Definition: Spectrum3DOpenGLCanvas.h:187
Canvas for 3D-visualization of peak map data.
Definition: Spectrum3DCanvas.h:62
GLuint ground_
Definition: Spectrum3DOpenGLCanvas.h:164
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
Spectrum3DCanvas & canvas_3d_
reference to Spectrum3DCanvas
Definition: Spectrum3DOpenGLCanvas.h:168
double trans_x_
x- translation
Definition: Spectrum3DOpenGLCanvas.h:223
GLuint gridlines_
Definition: Spectrum3DOpenGLCanvas.h:163
int yRotation() const
return yRot_
Definition: Spectrum3DOpenGLCanvas.h:141
int xrot_tmp_
member x-variable that stores the original angle during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:178
int zrot_
member z-variables for the rotation
Definition: Spectrum3DOpenGLCanvas.h:175

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:21 using doxygen 1.8.5