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-2017.
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 // OpenMS_GUI config
39 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
40 
41 #include <QtOpenGL/QGLWidget>
42 
43 // OpenMS
45 
46 namespace OpenMS
47 {
48  class Spectrum3DCanvas;
49 
58  class OPENMS_GUI_DLLAPI Spectrum3DOpenGLCanvas :
59  public QGLWidget
60  {
61  Q_OBJECT
62 
63  friend class Spectrum3DCanvas;
64 
65 public:
66 
68  typedef std::vector<std::vector<double> > AxisTickVector;
69 
76  Spectrum3DOpenGLCanvas(QWidget * parent, Spectrum3DCanvas & canvas_3d);
82  virtual ~Spectrum3DOpenGLCanvas();
84  void initializeGL();
86  void resizeGL(int w, int h);
88  void paintGL();
90  GLuint makeDataAsStick();
92  GLuint makeAxes();
94  GLuint makeAxesTicks();
96  GLuint makeDataAsTopView();
98  GLuint makeGround();
100  GLuint makeGridLines();
102  void drawAxesLegend();
103 
106  void mouseMoveEvent(QMouseEvent * e);
107  void mouseReleaseEvent(QMouseEvent * e);
108  void mousePressEvent(QMouseEvent * e);
109  void focusOutEvent(QFocusEvent * e);
111 
113  void computeSelection();
114 
116  void updateIntensityScale();
117 
119  void dataToZoomArray(double x_1, double y_1, double x_2, double y_2);
120 
122  double scaledRT(double rt);
124  double scaledInversRT(double mz);
126  double scaledMZ(double mz);
128  double scaledInversMZ(double mz);
130  double scaledIntensity(float intensity, Size layer_index);
131 
133  void recalculateDotGradient_(Size layer);
135  void calculateGridLines_();
136 
138  float width() const { return width_; }
139  float height() const { return height_; }
140 
142  int xRotation() const { return xrot_; }
144  int yRotation() const { return yrot_; }
146  int zRotation() const { return zrot_; }
148  void normalizeAngle(int * angle);
149  //document me
150  void setAngels(int xrot, int yrot, int zrot);
151  //document me
152  void resetTranslation();
153  //document me
154  void timeMessure();
155 
157  void storeRotationAndZoom();
159  void restoreRotationAndZoom();
160 
163  GLuint stickdata_;
164  GLuint axes_;
165  GLuint axes_ticks_;
166  GLuint gridlines_;
167  GLuint ground_;
169 
172 
174  int xrot_;
176  int yrot_;
178  int zrot_;
179 
186 
187 
188 
190  QPoint mouse_move_end_, mouse_move_begin_;
191 
193  double corner_;
195  double zoom_;
197  double zoom_tmp_;
198 
200  double near_;
202  double far_;
204  float width_;
206  float height_;
212  AxisTickVector grid_mz_;
214  AxisTickVector grid_rt_;
216  AxisTickVector grid_intensity_;
218  double x_1_;
220  double x_2_;
222  double y_1_;
224  double y_2_;
226  double trans_x_;
228  double trans_y_;
229 
230 protected slots:
232  void actionModeChange();
233  };
234 }
235 #endif
OpenGL Canvas for 3D-visualization of map data.
Definition: Spectrum3DOpenGLCanvas.h:58
double near_
member variable for the z- axis of the BB
Definition: Spectrum3DOpenGLCanvas.h:200
double x_1_
x1 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:218
int zRotation() const
return zRot_
Definition: Spectrum3DOpenGLCanvas.h:146
int yRotation() const
return yRot_
Definition: Spectrum3DOpenGLCanvas.h:144
std::vector< std::vector< double > > AxisTickVector
Container for axis ticks.
Definition: Spectrum3DOpenGLCanvas.h:68
float width_
the width of the viewport
Definition: Spectrum3DOpenGLCanvas.h:204
double x_2_
x2 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:220
DRange< 1 > int_scale_
object which contains the values of the current min and max intensity
Definition: Spectrum3DOpenGLCanvas.h:210
double trans_y_
y_translation
Definition: Spectrum3DOpenGLCanvas.h:228
int yrot_
member y-variables for the rotation
Definition: Spectrum3DOpenGLCanvas.h:176
double far_
member variable for the z- axis of the BB
Definition: Spectrum3DOpenGLCanvas.h:202
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
double y_1_
y1 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:222
AxisTickVector grid_rt_
member gridvectors which contains the data for the rt-axis-ticks
Definition: Spectrum3DOpenGLCanvas.h:214
double zoom_tmp_
member variable that stores original zoom factor during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:197
GLuint axes_
Definition: Spectrum3DOpenGLCanvas.h:164
double zoom_
member variable for the zoom mode
Definition: Spectrum3DOpenGLCanvas.h:195
AxisTickVector grid_mz_
member gridvectors which contains the data for the mz-axis-ticks
Definition: Spectrum3DOpenGLCanvas.h:212
GLuint axes_ticks_
Definition: Spectrum3DOpenGLCanvas.h:165
double corner_
member variable for the x and y axis of the BB
Definition: Spectrum3DOpenGLCanvas.h:193
AxisTickVector grid_intensity_
member gridvectors which contains the data for the intensity-axis-ticks
Definition: Spectrum3DOpenGLCanvas.h:216
float width() const
return width
Definition: Spectrum3DOpenGLCanvas.h:138
int zrot_tmp_
member z-variable that stores the original angle during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:185
const double h
double y_2_
y2 coordinate of the zoomselection
Definition: Spectrum3DOpenGLCanvas.h:224
float height_
the height of the viewport
Definition: Spectrum3DOpenGLCanvas.h:206
int yrot_tmp_
member y-variable that stores the original angle during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:183
int xrot_
member x-variables for the rotation
Definition: Spectrum3DOpenGLCanvas.h:174
DRange< 3 > overall_values_
object which contains the min and max values of mz, rt and intensity
Definition: Spectrum3DOpenGLCanvas.h:208
GLuint stickdata_
Definition: Spectrum3DOpenGLCanvas.h:163
QPoint mouse_move_end_
member variables for the zoom-mode
Definition: Spectrum3DOpenGLCanvas.h:190
Canvas for 3D-visualization of peak map data.
Definition: Spectrum3DCanvas.h:67
GLuint ground_
Definition: Spectrum3DOpenGLCanvas.h:167
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
int xRotation() const
return xRot_
Definition: Spectrum3DOpenGLCanvas.h:142
Spectrum3DCanvas & canvas_3d_
reference to Spectrum3DCanvas
Definition: Spectrum3DOpenGLCanvas.h:171
float height() const
Definition: Spectrum3DOpenGLCanvas.h:139
double trans_x_
x- translation
Definition: Spectrum3DOpenGLCanvas.h:226
GLuint gridlines_
Definition: Spectrum3DOpenGLCanvas.h:166
int xrot_tmp_
member x-variable that stores the original angle during zoom mode
Definition: Spectrum3DOpenGLCanvas.h:181
int zrot_
member z-variables for the rotation
Definition: Spectrum3DOpenGLCanvas.h:178

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:04 using doxygen 1.8.13