#include <OpenMS/VISUAL/Spectrum2DCanvas.h>
This widget displays a 2D representation of a set of peaks or features.
The example image shows Spectrum2DCanvas displaying a peak layer and a feature layer.
Spectrum2DCanvas Parameters are explained on a separate page.
Public Slots | |
void | activateLayer (int layer_index) |
change the active layer (the one that is used for selecting and so on) | |
void | removeLayer (int layer_index) |
removes the layer with index layer_index | |
Int | finishAdding () |
Finish adding data after call to addEmptyPeakLayer(). | |
virtual void | horizontalScrollBarChange (int value) |
Notifies the canvas that the horizontal scollbar has been moved. | |
virtual void | verticalScrollBarChange (int value) |
Notifies the canvas that the vertical scollbar has been moved. | |
void | showProjections () |
Updates the projection data and emits some related signals. | |
Signals | |
void | showProjectionHorizontal (const MSExperiment<> &, Spectrum1DCanvas::DrawModes) |
Sets the data for the horizontal projection. | |
void | showProjectionVertical (const MSExperiment<> &, Spectrum1DCanvas::DrawModes) |
Sets the data for the vertical projection. | |
void | showProjectionInfo (int, double, double) |
Shows the number of peaks and the intensity sum of the projection. | |
void | showCurrentPeaksAs3D () |
Requests to display the current peak data in 3D. | |
void | showSpectrumAs1D (int index) |
Requests to display the spectrum with index index in 1D. | |
Public Member Functions | |
Spectrum2DCanvas (const Param &preferences, QWidget *parent=0) | |
Default constructor. | |
~Spectrum2DCanvas () | |
Destructor. | |
virtual void | showCurrentLayerPreferences () |
Shows the preferences dialog of the active layer. | |
virtual void | saveCurrentLayer (bool visible) |
Saves the current layer data. | |
Protected Member Functions | |
virtual void | updateScrollbars_ () |
Updates the scroll bars. | |
void | paintDots_ (UInt layer_index, QPainter &p) |
Paints individual peaks. | |
void | paintTraceConvexHulls_ (UInt layer_index, QPainter &p) |
Paints convex hulls (one for each mass trace) for a features of a layer. | |
void | paintFeatureConvexHulls_ (UInt layer_index, QPainter &p) |
Paints the convex hulls (one for each feature) for a features of a layer. | |
void | paintConvexHulls_ (const std::vector< ConvexHull2D > &hulls, QPainter &p) |
Paints convex hulls (one for each mass trace) for a single feature. | |
void | paintFeaturePairConnections_ (UInt layer_index, QPainter &p) |
Paints feature pair connections. | |
virtual void | intensityModeChange_ () |
This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes. | |
virtual void | recalculateSnapFactor_ () |
REcalculates the intensity scaling factor for 'snap to maximum intensity mode'. | |
virtual void | currentLayerParamtersChanged_ () |
Change of layer parameters. | |
void | recalculateDotGradient_ (UInt layer) |
recalculates the dot gradient of a layer | |
float | betweenFactor_ (float v1, float v2, float val) |
interpolation helper function | |
const QColor & | heightColor_ (float val, const MultiGradient &gradient) |
Returns the color associated with val for the gradient gradient . | |
void | highlightPeak_ (QPainter &p, const Feature *peak) |
Highlights a single peak. | |
const Feature * | findNearestPeak_ (const QPoint &pos) |
Returns the nearest peak to position pos . | |
Reimplemented QT events | |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *e) |
void | mouseMoveEvent (QMouseEvent *e) |
void | wheelEvent (QWheelEvent *e) |
void | mouseDoubleClickEvent (QMouseEvent *e) |
void | paintEvent (QPaintEvent *e) |
void | contextMenuEvent (QContextMenuEvent *e) |
Protected Attributes | |
MSExperiment | projection_mz_ |
m/z projection data | |
MSExperiment | projection_rt_ |
RT projection data. | |
const Feature * | selected_peak_ |
the nearest peak/feature to the mouse cursor (DFeature to be able to store the convex hull too) | |
const Feature * | measurement_start_ |
start peak/feature of measuring mode | |
const Feature * | measurement_stop_ |
end peak/feature of measuring mode | |
Feature | tmp_peak_ |
temporary peak/feature for findNearestPeak_ |
Spectrum2DCanvas | ( | const Param & | preferences, | |
QWidget * | parent = 0 | |||
) |
Default constructor.
~Spectrum2DCanvas | ( | ) |
Destructor.
virtual void showCurrentLayerPreferences | ( | ) | [virtual] |
virtual void saveCurrentLayer | ( | bool | visible | ) | [virtual] |
Saves the current layer data.
visible | If true, only the visible data is stored. Otherwise the whole data is stored. |
Implements SpectrumCanvas.
void showProjectionHorizontal | ( | const MSExperiment<> & | , | |
Spectrum1DCanvas::DrawModes | ||||
) | [signal] |
Sets the data for the horizontal projection.
void showProjectionVertical | ( | const MSExperiment<> & | , | |
Spectrum1DCanvas::DrawModes | ||||
) | [signal] |
Sets the data for the vertical projection.
void showProjectionInfo | ( | int | , | |
double | , | |||
double | ||||
) | [signal] |
Shows the number of peaks and the intensity sum of the projection.
void showCurrentPeaksAs3D | ( | ) | [signal] |
Requests to display the current peak data in 3D.
void showSpectrumAs1D | ( | int | index | ) | [signal] |
Requests to display the spectrum with index index
in 1D.
void activateLayer | ( | int | layer_index | ) | [virtual, slot] |
void removeLayer | ( | int | layer_index | ) | [virtual, slot] |
Int finishAdding | ( | ) | [virtual, slot] |
Finish adding data after call to addEmptyPeakLayer().
You can use this method instead of addLayer (add by copy). First call addEmptyPeakLayer(),then fill returned reference and finally call finishAdding(float).
Implements SpectrumCanvas.
virtual void horizontalScrollBarChange | ( | int | value | ) | [virtual, slot] |
Notifies the canvas that the horizontal scollbar has been moved.
Reimplement this slot to react on scrollbar events.
Reimplemented from SpectrumCanvas.
virtual void verticalScrollBarChange | ( | int | value | ) | [virtual, slot] |
Notifies the canvas that the vertical scollbar has been moved.
Reimplement this slot to react on scrollbar events.
Reimplemented from SpectrumCanvas.
void showProjections | ( | ) | [slot] |
Updates the projection data and emits some related signals.
Emitted signals are showProjectionHorizontal(const MSExperiment<>&, Spectrum1DCanvas::DrawModes) and showProjectionVertical(const MSExperiment<>&, Spectrum1DCanvas::DrawModes).
void mousePressEvent | ( | QMouseEvent * | e | ) | [protected] |
void mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected] |
void mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected] |
void wheelEvent | ( | QWheelEvent * | e | ) | [protected] |
void mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected] |
void paintEvent | ( | QPaintEvent * | e | ) | [protected] |
void contextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected] |
virtual void updateScrollbars_ | ( | ) | [protected, virtual] |
Updates the scroll bars.
Updates the scrollbars after a change of the visible area.
Reimplemented from SpectrumCanvas.
void paintDots_ | ( | UInt | layer_index, | |
QPainter & | p | |||
) | [protected] |
Paints individual peaks.
Paints the peaks as small ellipses. The peaks are colored according to the selected dot gradient.
layer_index | The index of the layer. | |
p | The QPainter to paint on. |
void paintTraceConvexHulls_ | ( | UInt | layer_index, | |
QPainter & | p | |||
) | [protected] |
Paints convex hulls (one for each mass trace) for a features of a layer.
layer_index | Int of the layer. | |
p | The QPainter to paint on. |
void paintFeatureConvexHulls_ | ( | UInt | layer_index, | |
QPainter & | p | |||
) | [protected] |
Paints the convex hulls (one for each feature) for a features of a layer.
layer_index | Int of the layer. | |
p | The QPainter to paint on. |
void paintConvexHulls_ | ( | const std::vector< ConvexHull2D > & | hulls, | |
QPainter & | p | |||
) | [protected] |
Paints convex hulls (one for each mass trace) for a single feature.
hulls | Reference to convex hull vector. | |
p | The QPainter to paint on. |
void paintFeaturePairConnections_ | ( | UInt | layer_index, | |
QPainter & | p | |||
) | [protected] |
Paints feature pair connections.
layer_index | Int of the layer. | |
p | The QPainter to paint on. |
virtual void intensityModeChange_ | ( | ) | [protected, virtual] |
This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes.
Reimplemented from SpectrumCanvas.
virtual void recalculateSnapFactor_ | ( | ) | [protected, virtual] |
REcalculates the intensity scaling factor for 'snap to maximum intensity mode'.
Reimplemented from SpectrumCanvas.
virtual void currentLayerParamtersChanged_ | ( | ) | [protected, virtual] |
Change of layer parameters.
This method is called whenever the paramters of the current layer change. Reimplement if you need to react on such changes.
Reimplemented from SpectrumCanvas.
void recalculateDotGradient_ | ( | UInt | layer | ) | [protected] |
recalculates the dot gradient of a layer
float betweenFactor_ | ( | float | v1, | |
float | v2, | |||
float | val | |||
) | [protected] |
interpolation helper function
const QColor& heightColor_ | ( | float | val, | |
const MultiGradient & | gradient | |||
) | [inline, protected] |
Returns the color associated with val
for the gradient gradient
.
Takes intensity modes into account.
void highlightPeak_ | ( | QPainter & | p, | |
const Feature * | peak | |||
) | [protected] |
Highlights a single peak.
const Feature* findNearestPeak_ | ( | const QPoint & | pos | ) | [protected] |
Returns the nearest peak to position pos
.
MSExperiment projection_mz_ [protected] |
m/z projection data
MSExperiment projection_rt_ [protected] |
RT projection data.
const Feature* selected_peak_ [protected] |
the nearest peak/feature to the mouse cursor (DFeature to be able to store the convex hull too)
const Feature* measurement_start_ [protected] |
start peak/feature of measuring mode
const Feature* measurement_stop_ [protected] |
end peak/feature of measuring mode
Generated Tue Apr 1 15:36:48 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |