Base class for visualization canvas classes. More...
#include <OpenMS/VISUAL/SpectrumCanvas.h>
Public Types | |
Type definitions | |
| enum | ActionModes { AM_TRANSLATE, AM_ZOOM, AM_MEASURE } |
Mouse action modes. More... | |
| enum | IntensityModes { IM_NONE, IM_PERCENTAGE, IM_SNAP, IM_LOG } |
Display modes of intensity. More... | |
| typedef LayerData::ExperimentType | ExperimentType |
| Main data type (experiment). | |
| typedef LayerData::ExperimentSharedPtrType | ExperimentSharedPtrType |
| Main managed data type (experiment). | |
| typedef LayerData::FeatureMapType | FeatureMapType |
| Main data type (features). | |
| typedef LayerData::FeatureMapSharedPtrType | FeatureMapSharedPtrType |
| Main managed data type (features). | |
| typedef LayerData::ConsensusMapType | ConsensusMapType |
| Main data type (consensus features). | |
| typedef LayerData::ConsensusMapSharedPtrType | ConsensusMapSharedPtrType |
| Main managed data type (consensus features). | |
| typedef ExperimentType::SpectrumType | SpectrumType |
| Spectrum type. | |
| typedef SpectrumType::ConstIterator | SpectrumConstIteratorType |
| Spectrum iterator type (iterates over peaks). | |
| typedef SpectrumType::PeakType | PeakType |
| Peak type. | |
| typedef FeatureMapType::FeatureType | FeatureType |
| Feature type. | |
| typedef DPosition< 2 > | PointType |
| Type of the Points. | |
| typedef DRange< 2 > | AreaType |
| Types of Ranges/Areas. | |
Public Slots | |
| void | changeVisibility (Size i, bool b) |
| change the visibility of a layer | |
| void | changeLayerFilterState (Size i, bool b) |
| change if the defined data filters are used | |
| void | showGridLines (bool show) |
| Whether or not to show grid lines. | |
| void | resetZoom (bool repaint=true) |
| Zooms fully out and resets the zoom stack. | |
| void | setVisibleArea (AreaType area) |
| Sets the visible area. | |
| 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 | setAdditionalContextMenu (QMenu *menu) |
| Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas. | |
| void | getVisiblePeakData (ExperimentType &map) const |
Fills the handed over map with the visible peaks of the current layer. | |
| void | getVisibleFeatureData (FeatureMapType &map) const |
Fills the handed over map with the visible features of the current layer. | |
| void | getVisibleConsensusData (ConsensusMapType &map) const |
Fills the handed over map with the visible consensus features of the current layer. | |
| void | getVisibleIdentifications (std::vector< PeptideIdentification > &peptides) const |
Fills the handed over peptides with the visible peptide identifications of the current layer. | |
| virtual void | updateLayer (Size i)=0 |
Updates layer i when the data in the corresponding file changes. | |
Signals | |
| void | layerModficationChange (Size layer, bool modified) |
| Signal emitted whenever the modification status of a layer changes (editing and storing). | |
| void | layerActivated (QWidget *w) |
| Signal emitted whenever a new layer is activated within the current window. | |
| void | layerZoomChanged (QWidget *w) |
| Signal emitted whenever the zoom changed. | |
| void | visibleAreaChanged (DRange< 2 > area) |
| Change of the visible area. | |
| void | sendCursorStatus (double mz=-1.0, double rt=-1.0) |
| Emitted when the cursor position changes (for displaying e.g. in status bar). | |
| void | sendStatusMessage (std::string message, OpenMS::UInt time) |
Emits a status message that should be displayed for time ms. If time is 0 the message should be displayed until the next message is emitted. | |
| void | recalculateAxes () |
| Forces recalculation of axis ticks in the connected widget. | |
| void | updateVScrollbar (float, float, float, float) |
| Triggers the update of the vertical scrollbar. | |
| void | updateHScrollbar (float, float, float, float) |
| Triggers the update of the horizontal scrollbar. | |
| void | changeLegendVisibility () |
| Toggle axis legend visibility change. | |
| void | actionModeChange () |
| Emitted when the action mode changes. | |
| void | preferencesChange () |
| Emitted when the layer preferences have changed. | |
Public Member Functions | |
| SpectrumCanvas (const Param &preferences, QWidget *parent=0) | |
| Default constructor. | |
| virtual | ~SpectrumCanvas () |
| Destructor. | |
| void | setSpectrumWidget (SpectrumWidget *widget) |
| Sets the spectrum widget. | |
| SpectrumWidget * | getSpectrumWidget () const |
| Returns the spectrum widget. | |
| Int | getActionMode () const |
| Returns the action mode. | |
| Int | getIntensityMode () const |
| Returns the intensity mode. | |
| void | setIntensityMode (IntensityModes mod) |
| Sets the intensity mode. | |
| bool | gridLinesShown () const |
| Returns if the grid is currently shown. | |
| const LayerData & | getLayer (Size index) const |
returns the layer data with index index | |
| const LayerData & | getCurrentLayer () const |
| returns the layer data of the active layer | |
| LayerData & | getCurrentLayer () |
| returns the layer data of the active layer | |
| bool | getLayerFlag (LayerData::Flags f) const |
| returns a layer flag of the current layer | |
| void | setLayerFlag (LayerData::Flags f, bool value) |
| sets a layer flag of the current layer | |
| bool | getLayerFlag (Size layer, LayerData::Flags f) const |
returns a layer flag of the layer layer | |
| void | setLayerFlag (Size layer, LayerData::Flags f, bool value) |
sets a layer flag of the layer layer | |
| void | setLabel (LayerData::LabelType label) |
| const AreaType & | getVisibleArea () const |
| Returns the currently visible area. | |
| virtual void | setFilters (const DataFilters &filters) |
| Sets the filters applied to the data before drawing (for the current layer). | |
| bool | isMzToXAxis () |
| Returns the mapping of m/z to axes. | |
| void | mzToXAxis (bool mz_to_x_axis) |
| Sets the mapping of m/z to axes. | |
| bool | addLayer (std::vector< PeptideIdentification > &peptides, const String &filename="") |
| Add an identification data layer. | |
| Real | getCurrentMinIntensity () const |
| Returns the minimum intensity of the active layer. | |
| Real | getCurrentMaxIntensity () const |
| Returns the maximum intensity of the active layer. | |
| Real | getMinIntensity (Size index) const |
Returns the minimum intensity of the layer with index index. | |
| Real | getMaxIntensity (Size index) const |
Returns the maximum intensity of the layer with index index. | |
| void | setLayerName (Size i, const String &name) |
Sets the name of layer i. | |
| String | getLayerName (Size i) |
Gets the name of layer i. | |
| void | setCurrentLayerParameters (const Param ¶m) |
| Sets the parameters of the current layer. | |
| const DRange< 3 > & | getDataRange () |
| Returns the area which encloses all data points. | |
| DoubleReal | getSnapFactor () |
| Returns the first intensity scaling factor for 'snap to maximum intensity mode'. | |
| DoubleReal | getPercentageFactor () |
| Returns the percentage factor. | |
| virtual void | showCurrentLayerPreferences ()=0 |
| Shows the preferences dialog of the active layer. | |
| virtual void | showMetaData (bool modifiable=false, Int index=-1) |
| Shows a dialog with the meta data. | |
| virtual void | saveCurrentLayer (bool visible)=0 |
| Saves the current layer data. | |
Dataset handling methods | |
| |
| Size | getLayerCount () const |
| Returns the number of layers. | |
| Size | activeLayerIndex () const |
| Returns the index of the active layer. | |
| virtual void | activateLayer (Size layer_index)=0 |
| change the active layer (the one that is used for selecting and so on) | |
| virtual void | removeLayer (Size layer_index)=0 |
removes the layer with index layer_index | |
| bool | addLayer (ExperimentSharedPtrType map, const String &filename="") |
| Add a peak data layer. | |
| bool | addLayer (FeatureMapSharedPtrType map, const String &filename="") |
| Add a feature data layer. | |
| bool | addLayer (ConsensusMapSharedPtrType map, const String &filename="") |
| Add a consensus feature data layer. | |
Protected Slots | |
| void | updateCursor_ () |
| Updates the cursor accoring to the current action mode. | |
Protected Member Functions | |
| void | drawText_ (QPainter &painter, QStringList text) |
| Draws several lines of text to the upper right corner of the widget. | |
| DoubleReal | getIdentificationMZ_ (const Size layer_index, const PeptideIdentification &peptide) const |
| Returns the m/z value of an identification depending on the m/z source of the layer (precursor mass/theoretical peptide mass). | |
| virtual bool | finishAdding_ ()=0 |
| Method that is called when a new layer has been added. | |
| LayerData & | getLayer_ (Size index) |
Returns the layer with index index. | |
| LayerData & | getCurrentLayer_ () |
| Returns the currently active layer. | |
| ExperimentSharedPtrType | currentPeakData_ () |
| Returns the currently active layer (mutable). | |
| virtual void | intensityModeChange_ () |
| This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes. | |
| virtual void | changeVisibleArea_ (const AreaType &new_area, bool repaint=true, bool add_to_stack=false) |
| Sets the visible area. | |
| virtual void | recalculateSnapFactor_ () |
| REcalculates the intensity scaling factor for 'snap to maximum intensity mode'. | |
| virtual void | updateScrollbars_ () |
| Updates the scroll bars. | |
| PointType | widgetToData_ (DoubleReal x, DoubleReal y) |
| Convert widget to chart coordinates. | |
| PointType | widgetToData_ (const QPoint &pos) |
Calls widgetToData_ with x and y position of pos. | |
| void | dataToWidget_ (DoubleReal x, DoubleReal y, QPoint &point) |
| Convert chart to widget coordinates. | |
| virtual void | paintGridLines_ (QPainter &painter) |
| Helper function to paint grid lines. | |
| void | recalculateRanges_ (UInt mz_dim, UInt rt_dim, UInt it_dim) |
| Recalculates the overall_data_range_. | |
| virtual void | update_ (const char *caller_name) |
| Updates the diplayed data. | |
| void | modificationStatus_ (Size layer_index, bool modified) |
| Takes all actions necessary when the modification status of a layer changes (signals etc.). | |
| void | adjustBuffer_ () |
| Changes the size of the paint buffer to the currently required size. | |
| template<typename PeakType > | |
| void | addDataProcessing_ (MSExperiment< PeakType > &map, DataProcessing::ProcessingAction action) const |
| Data processing setter for peak maps. | |
reimplemented QT events | |
| void | resizeEvent (QResizeEvent *e) |
| void | wheelEvent (QWheelEvent *e) |
| void | keyPressEvent (QKeyEvent *e) |
| void | keyReleaseEvent (QKeyEvent *e) |
| void | focusOutEvent (QFocusEvent *e) |
| void | leaveEvent (QEvent *e) |
| void | enterEvent (QEvent *e) |
Zoom stack methods | |
| void | zoom (int x, int y, bool zoom_in) |
| Zooms such that screen point x, y would still point to the same data point. | |
| void | zoomBack_ () |
| Go backward in zoom history. | |
| virtual void | zoomForward_ () |
| Go forward in zoom history. | |
| void | zoomAdd_ (const AreaType &area) |
| Add a visible area to the zoom stack. | |
| void | zoomClear_ () |
| Clears the zoom stack and invalidates the current zoom position. After calling this, a valid zoom position has to be added immediately. | |
Translation methods, which are called when cursor buttons are pressed | |
| virtual void | translateLeft_ () |
| Translation bound to the 'Left' key. | |
| virtual void | translateRight_ () |
| Translation bound to the 'Rightt' key. | |
| virtual void | translateForward_ () |
| Translation bound to the 'Up' key. | |
| virtual void | translateBackward_ () |
| Translation bound to the 'Down' key. | |
Protected Attributes | |
| QImage | buffer_ |
| Buffer that stores the actual peak information. | |
| ActionModes | action_mode_ |
| Stores the current action mode (Pick, Zoom, Translate). | |
| IntensityModes | intensity_mode_ |
| Stores the used intensity mode function. | |
| std::vector< LayerData > | layers_ |
| Layer data. | |
| bool | mz_to_x_axis_ |
| Stores the mapping of m/z. | |
| AreaType | visible_area_ |
| Stores the currently visible area. | |
| DRange< 3 > | overall_data_range_ |
| Stores the data range (m/z, RT and intensity) of all layers. | |
| bool | show_grid_ |
| Stores whether or not to show a grid. | |
| std::vector< AreaType > | zoom_stack_ |
| The zoom stack. | |
| std::vector< AreaType >::iterator | zoom_pos_ |
| The current position in the zoom stack. | |
| bool | update_buffer_ |
| Whether to recalculate the data in the buffer when repainting. | |
| Size | current_layer_ |
| Stores the index of the currently active layer. | |
| SpectrumWidget * | spectrum_widget_ |
| Back-pointer to the enclosing spectrum widget. | |
| QPoint | last_mouse_pos_ |
| start position of mouse actions | |
| double | percentage_factor_ |
| Intensity scaling factor for relative scale with multiple layers. | |
| std::vector< DoubleReal > | snap_factors_ |
| Intensity scaling factor for 'snap to maximum intensity mode'. | |
| QRubberBand | rubber_band_ |
| Rubber band for selected area. | |
| QMenu * | context_add_ |
| External context menu extension. | |
| bool | show_timing_ |
| Flag that determines if timimg data is printed to the command line. | |
| PeakIndex | selected_peak_ |
| selected peak | |
| PeakIndex | measurement_start_ |
| start peak of measuring mode | |
Base class for visualization canvas classes.
This class is the base class for the spectrum data views.
It also provides commonly used constants such as ActionModes or IntensityModes.
To provide additional spectrum views, you can derive from this class. You should also create a subclass from SpectrumWidget which encloses your class derived from SpectrumCanvas. To integrate your class into TOPPView, you also need to derive a class from SpectrumWidget.
All derived classes should follow these interface conventions:
Measure mode
Main managed data type (consensus features).
Main data type (consensus features).
Main managed data type (experiment).
Main data type (experiment).
Main managed data type (features).
Main data type (features).
Feature type.
| typedef SpectrumType::PeakType PeakType |
Peak type.
Spectrum iterator type (iterates over peaks).
Spectrum type.
| enum ActionModes |
| enum IntensityModes |
| SpectrumCanvas | ( | const Param & | preferences, | |
| QWidget * | parent = 0 | |||
| ) |
Default constructor.
| virtual ~SpectrumCanvas | ( | ) | [virtual] |
Destructor.
| void actionModeChange | ( | ) | [signal] |
Emitted when the action mode changes.
| virtual void activateLayer | ( | Size | layer_index | ) | [pure virtual] |
change the active layer (the one that is used for selecting and so on)
Implemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
Referenced by TOPPViewBase::layerSelectionChange().
| Size activeLayerIndex | ( | ) | const |
Returns the index of the active layer.
Referenced by TOPPViewBase::addData(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), and TOPPViewBase::updateLayerBar().
| void addDataProcessing_ | ( | MSExperiment< PeakType > & | map, | |
| DataProcessing::ProcessingAction | action | |||
| ) | const [inline, protected] |
Data processing setter for peak maps.
References DataProcessing::getSoftware(), VersionInfo::getVersion(), DateTime::now(), DataProcessing::setCompletionTime(), Software::setName(), DataProcessing::setProcessingActions(), and Software::setVersion().
| bool addLayer | ( | ExperimentSharedPtrType | map, | |
| const String & | filename = "" | |||
| ) |
Add a peak data layer.
If chromatograms are present, a chromatogram layer is shown. Otherwise a peak layer is shown. Make sure to remove chromatograms from peak data and vice versa.
| map | Shared Pointer to input map. It can be performed in constant time and does not double the required memory. | |
| filename | This absolute filename is used to monitor changes in the file and reload the data |
Referenced by TOPPViewBase::addData(), IDEvaluationBase::addSearchFile(), TOPPViewBase::showCurrentPeaksAs2D(), and TOPPViewBase::showCurrentPeaksAs3D().
| bool addLayer | ( | ConsensusMapSharedPtrType | map, | |
| const String & | filename = "" | |||
| ) |
Add a consensus feature data layer.
| map | Shared Pointer to input map. It can be performed in constant time and does not double the required memory. | |
| filename | This absolute filename is used to monitor changes in the file and reload the data |
| bool addLayer | ( | std::vector< PeptideIdentification > & | peptides, | |
| const String & | filename = "" | |||
| ) |
Add an identification data layer.
| peptides | Input list of peptides, which has to be mutable and will be empty after adding. Swapping is used to insert the data. It can be performed in constant time and does not double the required memory. | |
| filename | This absolute filename is used to monitor changes in the file and reload the data |
| bool addLayer | ( | FeatureMapSharedPtrType | map, | |
| const String & | filename = "" | |||
| ) |
Add a feature data layer.
| map | Shared Pointer to input map. It can be performed in constant time and does not double the required memory. | |
| filename | This absolute filename is used to monitor changes in the file and reload the data |
| void adjustBuffer_ | ( | ) | [protected] |
Changes the size of the paint buffer to the currently required size.
| void changeLayerFilterState | ( | Size | i, | |
| bool | b | |||
| ) | [slot] |
change if the defined data filters are used
| i | the index of the layer | |
| b | true if layer is supposed to be visible |
Referenced by TOPPViewBase::layerFilterVisibilityChange().
| void changeLegendVisibility | ( | ) | [signal] |
Toggle axis legend visibility change.
| void changeVisibility | ( | Size | i, | |
| bool | b | |||
| ) | [slot] |
change the visibility of a layer
| i | the index of the layer | |
| b | true if layer is supposed to be visible |
Referenced by TOPPViewBase::layerVisibilityChange().
| virtual void changeVisibleArea_ | ( | const AreaType & | new_area, | |
| bool | repaint = true, |
|||
| bool | add_to_stack = false | |||
| ) | [protected, virtual] |
Sets the visible area.
Changes the visible area, adjustes the zoom stack and notifies interested clients about the change. If parts of the area are outside of the data area, the new area will be adjusted.
| new_area | The new visible area. | |
| repaint | If true, a complete repaint is forced. | |
| add_to_stack | If true the new area is to add to the zoom_stack_. |
Reimplemented in Spectrum1DCanvas.
| ExperimentSharedPtrType currentPeakData_ | ( | ) | [inline, protected] |
Returns the currently active layer (mutable).
| void dataToWidget_ | ( | DoubleReal | x, | |
| DoubleReal | y, | |||
| QPoint & | point | |||
| ) | [inline, protected] |
Convert chart to widget coordinates.
Translates chart coordinates to widget coordinates.
| x | the chart coordinate x | |
| y | the chart coordinate y | |
| point | returned widget coordinates |
Reimplemented in Spectrum2DCanvas.
References SpectrumCanvas::IM_LOG.
| void drawText_ | ( | QPainter & | painter, | |
| QStringList | text | |||
| ) | [protected] |
Draws several lines of text to the upper right corner of the widget.
| void enterEvent | ( | QEvent * | e | ) | [protected] |
| virtual bool finishAdding_ | ( | ) | [protected, pure virtual] |
Method that is called when a new layer has been added.
Implemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
| void focusOutEvent | ( | QFocusEvent * | e | ) | [protected] |
| Int getActionMode | ( | ) | const [inline] |
Returns the action mode.
Returns the current action mode of type ActionModes
| LayerData& getCurrentLayer | ( | ) | [inline] |
returns the layer data of the active layer
References OPENMS_PRECONDITION.
| const LayerData& getCurrentLayer | ( | ) | const [inline] |
returns the layer data of the active layer
References OPENMS_PRECONDITION.
Referenced by TOPPViewBase::addData(), TOPPViewBase::annotateWithID(), TOPPViewBase::copyLayer(), TOPPViewBase::editMetadata(), TOPPViewBase::enhancedWorkspaceWindowChanged(), TOPPViewBase::filterContextMenu(), TOPPViewBase::filterEdit(), TOPPViewBase::getCurrentLayer(), TOPPViewBase::layerZoomChanged(), TOPPViewBase::loadFiles(), TOPPViewBase::rerunTOPPTool(), TOPPViewBase::runTOPPTool_(), TOPPViewBase::setIntensityMode(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showTOPPDialog_(), TOPPViewBase::updateFilterBar(), TOPPViewBase::updateToolBar(), and TOPPViewBase::updateViewBar().
| LayerData& getCurrentLayer_ | ( | ) | [inline, protected] |
Returns the currently active layer.
| Real getCurrentMaxIntensity | ( | ) | const [inline] |
Returns the maximum intensity of the active layer.
References LayerData::DT_CHROMATOGRAM, LayerData::DT_FEATURE, and LayerData::DT_PEAK.
| Real getCurrentMinIntensity | ( | ) | const [inline] |
Returns the minimum intensity of the active layer.
References LayerData::DT_CHROMATOGRAM, LayerData::DT_FEATURE, and LayerData::DT_PEAK.
| const DRange<3>& getDataRange | ( | ) |
Returns the area which encloses all data points.
| DoubleReal getIdentificationMZ_ | ( | const Size | layer_index, | |
| const PeptideIdentification & | peptide | |||
| ) | const [protected] |
Returns the m/z value of an identification depending on the m/z source of the layer (precursor mass/theoretical peptide mass).
| Int getIntensityMode | ( | ) | const [inline] |
Returns the intensity mode.
Returns the current intensity mode of type IntensityModes
Referenced by TOPPViewBase::setIntensityMode(), and TOPPViewBase::updateToolBar().
returns the layer data with index index
References OPENMS_PRECONDITION.
Referenced by TOPPViewBase::addData(), TOPPViewBase::fileChanged_(), TOPPViewBase::getFilenamesOfOpenFiles_(), TOPPViewBase::layerContextMenu(), TOPPViewBase::layerVisibilityChange(), and TOPPViewBase::updateLayerBar().
Returns the layer with index index.
References OPENMS_PRECONDITION.
| Size getLayerCount | ( | ) | const [inline] |
Returns the number of layers.
Referenced by TOPPViewBase::addData(), IDEvaluationBase::addSearchFile(), TOPPViewBase::enhancedWorkspaceWindowChanged(), TOPPViewBase::fileChanged_(), TOPPViewBase::getFilenamesOfOpenFiles_(), TOPPViewBase::updateFilterBar(), TOPPViewBase::updateLayerBar(), and TOPPViewBase::updateToolBar().
| bool getLayerFlag | ( | LayerData::Flags | f | ) | const [inline] |
returns a layer flag of the current layer
Referenced by TOPPViewBase::changeUnassigned(), and TOPPViewBase::updateToolBar().
| bool getLayerFlag | ( | Size | layer, | |
| LayerData::Flags | f | |||
| ) | const [inline] |
returns a layer flag of the layer layer
References OPENMS_PRECONDITION.
Returns the maximum intensity of the layer with index index.
References LayerData::DT_CHROMATOGRAM, LayerData::DT_FEATURE, and LayerData::DT_PEAK.
Returns the minimum intensity of the layer with index index.
References LayerData::DT_CHROMATOGRAM, LayerData::DT_FEATURE, and LayerData::DT_PEAK.
| DoubleReal getPercentageFactor | ( | ) |
Returns the percentage factor.
| DoubleReal getSnapFactor | ( | ) |
Returns the first intensity scaling factor for 'snap to maximum intensity mode'.
| SpectrumWidget* getSpectrumWidget | ( | ) | const [inline] |
Returns the spectrum widget.
Returns the enclosing spectrum widget
| const AreaType& getVisibleArea | ( | ) | const [inline] |
Returns the currently visible area.
Referenced by TOPPViewBase::layerZoomChanged().
| void getVisibleConsensusData | ( | ConsensusMapType & | map | ) | const [slot] |
Fills the handed over map with the visible consensus features of the current layer.
Takes zoom area and data filters into account.
If the current layer is not a consensus feature layer, map is cleared only.
Referenced by TOPPViewBase::runTOPPTool_().
| void getVisibleFeatureData | ( | FeatureMapType & | map | ) | const [slot] |
Fills the handed over map with the visible features of the current layer.
Takes zoom area and data filters into account.
If the current layer is not a feature layer, map is cleared only.
Referenced by TOPPViewBase::runTOPPTool_().
| void getVisibleIdentifications | ( | std::vector< PeptideIdentification > & | peptides | ) | const [slot] |
Fills the handed over peptides with the visible peptide identifications of the current layer.
Takes zoom area into account.
If the current layer is not an identification data layer, peptides is cleared only.
| void getVisiblePeakData | ( | ExperimentType & | map | ) | const [slot] |
Fills the handed over map with the visible peaks of the current layer.
Takes zoom area and data filters into account.
If the current layer is not a peak layer, map is cleared only.
Referenced by TOPPViewBase::runTOPPTool_().
| bool gridLinesShown | ( | ) | const [inline] |
Returns if the grid is currently shown.
true if the grid is visible, false otherwise | 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 in Spectrum1DCanvas, and Spectrum2DCanvas.
| virtual void intensityModeChange_ | ( | ) | [protected, virtual] |
This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes.
Reimplemented in Spectrum1DCanvas, and Spectrum2DCanvas.
| bool isMzToXAxis | ( | ) | [inline] |
Returns the mapping of m/z to axes.
| void keyPressEvent | ( | QKeyEvent * | e | ) | [protected] |
Reimplemented in Spectrum1DCanvas, and Spectrum2DCanvas.
| void keyReleaseEvent | ( | QKeyEvent * | e | ) | [protected] |
Reimplemented in Spectrum2DCanvas.
| void layerActivated | ( | QWidget * | w | ) | [signal] |
Signal emitted whenever a new layer is activated within the current window.
| void layerModficationChange | ( | Size | layer, | |
| bool | modified | |||
| ) | [signal] |
Signal emitted whenever the modification status of a layer changes (editing and storing).
| void layerZoomChanged | ( | QWidget * | w | ) | [signal] |
Signal emitted whenever the zoom changed.
| void leaveEvent | ( | QEvent * | e | ) | [protected] |
| void modificationStatus_ | ( | Size | layer_index, | |
| bool | modified | |||
| ) | [protected] |
Takes all actions necessary when the modification status of a layer changes (signals etc.).
| void mzToXAxis | ( | bool | mz_to_x_axis | ) |
Sets the mapping of m/z to axes.
| virtual void paintGridLines_ | ( | QPainter & | painter | ) | [protected, virtual] |
Helper function to paint grid lines.
Reimplemented in Spectrum1DCanvas.
| void preferencesChange | ( | ) | [signal] |
Emitted when the layer preferences have changed.
| void recalculateAxes | ( | ) | [signal] |
Forces recalculation of axis ticks in the connected widget.
Recalculates the overall_data_range_.
A small margin is added to each side of the range in order to display all data.
| mz_dim | Int of m/z in overall_data_range_ | |
| rt_dim | Int of RT in overall_data_range_ | |
| it_dim | Int of intensity in overall_data_range_ |
| virtual void recalculateSnapFactor_ | ( | ) | [protected, virtual] |
REcalculates the intensity scaling factor for 'snap to maximum intensity mode'.
Reimplemented in Spectrum1DCanvas, and Spectrum2DCanvas.
| virtual void removeLayer | ( | Size | layer_index | ) | [pure virtual] |
removes the layer with index layer_index
Implemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
Referenced by TOPPViewBase::layerContextMenu().
| void resetZoom | ( | bool | repaint = true |
) | [slot] |
Zooms fully out and resets the zoom stack.
Sets the visible area to the initial value, such that all data is shown.
| repaint | If true a repaint is forced. Otherwise only the new area is set. |
Referenced by TOPPViewBase::resetZoom(), and IDEvaluationBase::resetZoom().
| void resizeEvent | ( | QResizeEvent * | e | ) | [protected] |
Reimplemented in Spectrum3DCanvas.
| virtual void saveCurrentLayer | ( | bool | visible | ) | [pure virtual] |
Saves the current layer data.
| visible | If true, only the visible data is stored. Otherwise the whole data is stored. |
Implemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
Referenced by TOPPViewBase::saveLayerAll(), and TOPPViewBase::saveLayerVisible().
Emitted when the cursor position changes (for displaying e.g. in status bar).
| void sendStatusMessage | ( | std::string | message, | |
| OpenMS::UInt | time | |||
| ) | [signal] |
Emits a status message that should be displayed for time ms. If time is 0 the message should be displayed until the next message is emitted.
| void setAdditionalContextMenu | ( | QMenu * | menu | ) | [slot] |
Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas.
| void setCurrentLayerParameters | ( | const Param & | param | ) | [inline] |
Sets the parameters of the current layer.
Referenced by TOPPViewBase::loadFiles().
| virtual void setFilters | ( | const DataFilters & | filters | ) | [virtual] |
Sets the filters applied to the data before drawing (for the current layer).
Referenced by TOPPViewBase::addData(), TOPPViewBase::filterContextMenu(), and TOPPViewBase::filterEdit().
| void setIntensityMode | ( | IntensityModes | mod | ) | [inline] |
Sets the intensity mode.
Sets the intensity mode
| mod | the new intensity mode |
| void setLabel | ( | LayerData::LabelType | label | ) | [inline] |
References OPENMS_PRECONDITION.
Referenced by TOPPViewBase::changeLabel().
| void setLayerFlag | ( | LayerData::Flags | f, | |
| bool | value | |||
| ) | [inline] |
sets a layer flag of the current layer
Referenced by TOPPViewBase::changeUnassigned().
| void setLayerFlag | ( | Size | layer, | |
| LayerData::Flags | f, | |||
| bool | value | |||
| ) | [inline] |
sets a layer flag of the layer layer
References OPENMS_PRECONDITION.
Sets the name of layer i.
Referenced by TOPPViewBase::addData(), IDEvaluationBase::addSearchFile(), TOPPViewBase::layerContextMenu(), TOPPViewBase::showCurrentPeaksAs2D(), and TOPPViewBase::showCurrentPeaksAs3D().
| void setSpectrumWidget | ( | SpectrumWidget * | widget | ) | [inline] |
Sets the spectrum widget.
Sets the enclosing spectrum widget. Call this from your SpectrumWidget derived class.
| widget | the spectrum widget |
| void setVisibleArea | ( | AreaType | area | ) | [slot] |
Sets the visible area.
Sets the visible area to a new value. Note that it does not emit visibleAreaChanged()
| area | the new visible area |
Reimplemented in Spectrum1DCanvas.
Referenced by TOPPViewBase::layerZoomChanged(), and TOPPViewBase::showCurrentPeaksAs3D().
| virtual void showCurrentLayerPreferences | ( | ) | [pure virtual] |
Shows the preferences dialog of the active layer.
Implemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
Referenced by TOPPViewBase::layerContextMenu(), TOPPViewBase::layerEdit(), and TOPPViewBase::showPreferences().
| void showGridLines | ( | bool | show | ) | [slot] |
Whether or not to show grid lines.
Sets whether grid lines are shown or not.
| show | Boolean variable deciding whether or not to show the grid lines. |
Referenced by TOPPViewBase::toggleGridLines().
| virtual void showMetaData | ( | bool | modifiable = false, |
|
| Int | index = -1 | |||
| ) | [virtual] |
Shows a dialog with the meta data.
| modifiable | indicates if the data can be modified. | |
| index | If given, the meta data of the corresponding element (spectrum, feature, consensus feature) is shown instead of the layer meta data. |
Referenced by TOPPViewBase::editMetadata(), and TOPPViewBase::showSpectrumMetaData().
| virtual void translateBackward_ | ( | ) | [protected, virtual] |
Translation bound to the 'Down' key.
Reimplemented in Spectrum2DCanvas, and Spectrum3DCanvas.
| virtual void translateForward_ | ( | ) | [protected, virtual] |
Translation bound to the 'Up' key.
Reimplemented in Spectrum2DCanvas, and Spectrum3DCanvas.
| virtual void translateLeft_ | ( | ) | [protected, virtual] |
Translation bound to the 'Left' key.
Reimplemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
| virtual void translateRight_ | ( | ) | [protected, virtual] |
Translation bound to the 'Rightt' key.
Reimplemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
| virtual void update_ | ( | const char * | caller_name | ) | [protected, virtual] |
Updates the diplayed data.
The default implementation calls QWidget::update().
This method is reimplemented in the 3D view to update the OpenGL widget.
| caller_name | Name of the calling function (use __PRETTY_FUNCTION__). |
Reimplemented in Spectrum3DCanvas.
| void updateCursor_ | ( | ) | [protected, slot] |
Updates the cursor accoring to the current action mode.
| void updateHScrollbar | ( | float | , | |
| float | , | |||
| float | , | |||
| float | ||||
| ) | [signal] |
Triggers the update of the horizontal scrollbar.
| virtual void updateLayer | ( | Size | i | ) | [pure virtual, slot] |
Updates layer i when the data in the corresponding file changes.
Implemented in Spectrum1DCanvas, Spectrum2DCanvas, and Spectrum3DCanvas.
Referenced by TOPPViewBase::fileChanged_().
| virtual void updateScrollbars_ | ( | ) | [protected, virtual] |
Updates the scroll bars.
Updates the scrollbars after a change of the visible area.
Reimplemented in Spectrum1DCanvas, and Spectrum2DCanvas.
| void updateVScrollbar | ( | float | , | |
| float | , | |||
| float | , | |||
| float | ||||
| ) | [signal] |
Triggers the update of the vertical scrollbar.
| 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 in Spectrum2DCanvas.
| void visibleAreaChanged | ( | DRange< 2 > | area | ) | [signal] |
Change of the visible area.
Signal emitted whenever the visible area changes.
| area | The new visible area. |
| void wheelEvent | ( | QWheelEvent * | e | ) | [protected] |
| PointType widgetToData_ | ( | const QPoint & | pos | ) | [inline, protected] |
Calls widgetToData_ with x and y position of pos.
| PointType widgetToData_ | ( | DoubleReal | x, | |
| DoubleReal | y | |||
| ) | [inline, protected] |
Convert widget to chart coordinates.
Translates widget coordinates to chart coordinates.
| x | the widget coordinate x | |
| y | the widget coordinate y |
| void zoom | ( | int | x, | |
| int | y, | |||
| bool | zoom_in | |||
| ) | [protected] |
Zooms such that screen point x, y would still point to the same data point.
| void zoomAdd_ | ( | const AreaType & | area | ) | [protected] |
Add a visible area to the zoom stack.
| void zoomBack_ | ( | ) | [protected] |
Go backward in zoom history.
| void zoomClear_ | ( | ) | [protected] |
Clears the zoom stack and invalidates the current zoom position. After calling this, a valid zoom position has to be added immediately.
| virtual void zoomForward_ | ( | ) | [protected, virtual] |
Go forward in zoom history.
Reimplemented in Spectrum1DCanvas.
ActionModes action_mode_ [protected] |
Stores the current action mode (Pick, Zoom, Translate).
QImage buffer_ [protected] |
Buffer that stores the actual peak information.
QMenu* context_add_ [protected] |
External context menu extension.
Size current_layer_ [protected] |
Stores the index of the currently active layer.
IntensityModes intensity_mode_ [protected] |
Stores the used intensity mode function.
QPoint last_mouse_pos_ [protected] |
start position of mouse actions
PeakIndex measurement_start_ [protected] |
start peak of measuring mode
Reimplemented in Spectrum2DCanvas.
bool mz_to_x_axis_ [protected] |
Stores the mapping of m/z.
DRange<3> overall_data_range_ [protected] |
Stores the data range (m/z, RT and intensity) of all layers.
Dimension 0 is the m/z dimension.
Dimension 1 is the RT dimension (2D and 3D view) or the intensity dimension (1D view).
Dimension 2 is the intensity dimension (2D and 3D view) or the RT dimension (1D view).
double percentage_factor_ [protected] |
Intensity scaling factor for relative scale with multiple layers.
In this mode all layers are scaled to the same maximum.
QRubberBand rubber_band_ [protected] |
Rubber band for selected area.
PeakIndex selected_peak_ [protected] |
selected peak
Reimplemented in Spectrum2DCanvas.
bool show_grid_ [protected] |
Stores whether or not to show a grid.
bool show_timing_ [protected] |
Flag that determines if timimg data is printed to the command line.
std::vector<DoubleReal> snap_factors_ [protected] |
Intensity scaling factor for 'snap to maximum intensity mode'.
In this mode the highest currently visible intensisty is treated like the maximum overall intensity.
SpectrumWidget* spectrum_widget_ [protected] |
Back-pointer to the enclosing spectrum widget.
bool update_buffer_ [protected] |
Whether to recalculate the data in the buffer when repainting.
AreaType visible_area_ [protected] |
Stores the currently visible area.
Dimension 0 is the m/z dimension.
Dimension 1 is the RT dimension (2D and 3D view) or the intensity dimension (1D view).
std::vector<AreaType> zoom_stack_ [protected] |
The zoom stack.
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:58 using doxygen 1.7.1 |