OpenMS
|
Base class for visualization canvas classes. More...
#include <OpenMS/VISUAL/PlotCanvas.h>
Protected Member Functions | |
reimplemented QT events | |
void | resizeEvent (QResizeEvent *e) override |
void | wheelEvent (QWheelEvent *e) override |
void | keyPressEvent (QKeyEvent *e) override |
void | keyReleaseEvent (QKeyEvent *e) override |
void | focusOutEvent (QFocusEvent *e) override |
void | leaveEvent (QEvent *e) override |
void | enterEvent (QEvent *e) override |
virtual void | intensityModeChange_ () |
This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes. More... | |
void | dimensionsChanged_ () |
Call this whenever the DimMapper receives new dimensions; will update the axes and scrollbars. More... | |
virtual void | changeVisibleArea_ (VisibleArea new_area, bool repaint=true, bool add_to_stack=false) |
Sets the visible area. More... | |
virtual void | recalculateSnapFactor_ () |
Recalculates the intensity scaling factor for 'snap to maximum intensity mode'. More... | |
Zoom stack methods | |
virtual void | zoom_ (int x, int y, bool zoom_in) |
Zooms such that screen point x, y would still point to the same data point. More... | |
void | zoomBack_ () |
Go backward in zoom history. More... | |
virtual void | zoomForward_ () |
Go forward in zoom history. More... | |
void | zoomAdd_ (const VisibleArea &area) |
Add a visible area to the zoom stack. More... | |
void | zoomClear_ () |
Clears the zoom stack and invalidates the current zoom position. After calling this, a valid zoom position has to be added immediately. More... | |
Protected Member Functions inherited from DefaultParamHandler | |
virtual void | updateMembers_ () |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
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 LayerDataBase::ExperimentType | ExperimentType |
Main data type (experiment) More... | |
typedef LayerDataBase::ExperimentSharedPtrType | ExperimentSharedPtrType |
Main managed data type (experiment) More... | |
typedef LayerDataBase::ConstExperimentSharedPtrType | ConstExperimentSharedPtrType |
typedef LayerDataBase::ODExperimentSharedPtrType | ODExperimentSharedPtrType |
typedef LayerDataBase::FeatureMapType | FeatureMapType |
Main data type (features) More... | |
typedef LayerDataBase::FeatureMapSharedPtrType | FeatureMapSharedPtrType |
Main managed data type (features) More... | |
typedef LayerDataBase::ConsensusMapType | ConsensusMapType |
Main data type (consensus features) More... | |
typedef LayerDataBase::ConsensusMapSharedPtrType | ConsensusMapSharedPtrType |
Main managed data type (consensus features) More... | |
typedef ExperimentType::SpectrumType | SpectrumType |
Spectrum type. More... | |
typedef SpectrumType::ConstIterator | SpectrumConstIteratorType |
Spectrum iterator type (iterates over peaks) More... | |
typedef SpectrumType::PeakType | PeakType |
Peak type. More... | |
using | RangeType = RangeAllType |
a generic range for the most common units More... | |
using | AreaXYType = Area< 2 >::AreaXYType |
The range of data shown on the X and Y axis (unit depends on runtime config) More... | |
using | VisibleArea = Area< 2 > |
The visible range of data on X and Y axis as shown on plot axis (not necessarily the range of actual data, e.g. no data to show). More... | |
using | GenericArea = Area< 2 > |
A generic range of data on X and Y axis as shown on plot axis. More... | |
using | PixelArea = Area< 2 > |
using | UnitRange = RangeAllType |
using | PointOnAxis = DimMapper< 2 >::Point |
PlotCanvas (const Param &preferences, QWidget *parent=nullptr) | |
Default constructor. More... | |
~PlotCanvas () override | |
Destructor. More... | |
void | setPlotWidget (PlotWidget *widget) |
Sets the spectrum widget. More... | |
PlotWidget * | getPlotWidget () const |
Returns the spectrum widget. More... | |
Int | getActionMode () const |
Returns the action mode. More... | |
IntensityModes | getIntensityMode () const |
Returns the intensity mode. More... | |
void | setIntensityMode (IntensityModes mod) |
Sets the intensity mode. More... | |
bool | gridLinesShown () const |
Returns if the grid is currently shown. More... | |
const LayerDataBase & | getLayer (Size index) const |
returns the layer data with index index More... | |
LayerDataBase & | getLayer (Size index) |
returns the layer data with index index More... | |
const LayerDataBase & | getCurrentLayer () const |
returns the layer data of the active layer More... | |
LayerDataBase & | getCurrentLayer () |
returns the layer data of the active layer More... | |
Size | getCurrentLayerIndex () const |
returns the index of the active layer More... | |
bool | getLayerFlag (LayerDataBase::Flags f) const |
returns a layer flag of the current layer More... | |
void | setLayerFlag (LayerDataBase::Flags f, bool value) |
sets a layer flag of the current layer More... | |
bool | getLayerFlag (Size layer, LayerDataBase::Flags f) const |
returns a layer flag of the layer layer More... | |
void | setLayerFlag (Size layer, LayerDataBase::Flags f, bool value) |
sets a layer flag of the layer layer More... | |
void | setLabel (LayerDataBase::LabelType label) |
const VisibleArea & | getVisibleArea () const |
Returns the currently visible area. This is the authority which determines the X and Y axis' scale. More... | |
bool | isVisible (const PointOnAxis &p) const |
PixelArea | getPixelRange () const |
virtual void | setFilters (const DataFilters &filters) |
Sets the filters applied to the data before drawing (for the current layer) More... | |
Translation methods, which are called when cursor buttons are pressed | |
QImage | buffer_ |
Buffer that stores the actual peak information. More... | |
DimMapper< 2 > | unit_mapper_ |
Mapper for X and Y axis. More... | |
ActionModes | action_mode_ = AM_TRANSLATE |
Stores the current action mode (Pick, Zoom, Translate) More... | |
IntensityModes | intensity_mode_ = IM_NONE |
Stores the used intensity mode function. More... | |
LayerStack | layers_ |
Layer data. More... | |
VisibleArea | visible_area_ |
Stores the currently visible area in data units (e.g. seconds, m/z, intensity etc) and axis (X,Y) area. More... | |
RangeType | overall_data_range_ |
Stores the data range (m/z, RT and intensity) of all layers. More... | |
bool | show_grid_ = true |
Stores whether or not to show a grid. More... | |
std::vector< VisibleArea > | zoom_stack_ |
The zoom stack. More... | |
std::vector< VisibleArea >::iterator | zoom_pos_ = zoom_stack_.end() |
The current position in the zoom stack. More... | |
bool | update_buffer_ = false |
Whether to recalculate the data in the buffer when repainting. More... | |
PlotWidget * | spectrum_widget_ = nullptr |
Back-pointer to the enclosing spectrum widget. More... | |
QPoint | last_mouse_pos_ |
start position of mouse actions More... | |
double | percentage_factor_ = 1.0 |
Intensity scaling factor for relative scale with multiple layers. More... | |
std::vector< double > | snap_factors_ |
Intensity scaling factor for 'snap to maximum intensity mode'. More... | |
QRubberBand | rubber_band_ |
Rubber band for selected area. More... | |
QMenu * | context_add_ = nullptr |
External context menu extension. More... | |
bool | show_timing_ = false |
Flag that determines if timing data is printed to the command line. More... | |
PeakIndex | selected_peak_ |
selected peak More... | |
PeakIndex | measurement_start_ |
start peak of measuring mode More... | |
virtual void | translateLeft_ (Qt::KeyboardModifiers m) |
Translation bound to the 'Left' key. More... | |
virtual void | translateRight_ (Qt::KeyboardModifiers m) |
Translation bound to the 'Right' key. More... | |
virtual void | translateForward_ () |
Translation bound to the 'Up' key. More... | |
virtual void | translateBackward_ () |
Translation bound to the 'Down' key. More... | |
virtual void | updateScrollbars_ () |
Updates the scroll bars. More... | |
PointXYType | widgetToData_ (double x, double y) |
Convert widget (pixel) to chart (unit) coordinates. More... | |
PointXYType | widgetToData_ (const QPoint &pos) |
Calls widgetToData_ with x and y position of pos . More... | |
virtual void | paintGridLines_ (QPainter &painter) |
Helper function to paint grid lines. More... | |
virtual void | recalculateRanges_ () |
Recalculates the overall_data_range_. More... | |
virtual void | update_ (const char *caller_name) |
Updates the displayed data. More... | |
void | modificationStatus_ (Size layer_index, bool modified) |
Takes all actions necessary when the modification status of a layer changes (signals etc.) More... | |
void | addDataProcessing_ (PeakMap &map, DataProcessing::ProcessingAction action) const |
Data processing setter for peak maps. More... | |
Dataset handling methods | |
| |
Size | getLayerCount () const |
Returns the number of layers. More... | |
virtual void | activateLayer (Size layer_index)=0 |
change the active layer (the one that is used for selecting and so on) More... | |
virtual void | removeLayer (Size layer_index)=0 |
removes the layer with index layer_index More... | |
void | removeLayers () |
removes all layers by calling removeLayer() for all layer indices (from highest to lowest) More... | |
bool | addLayer (std::unique_ptr< LayerData1DBase > layer) |
Add an already constructed layer (e.g. for projections) More... | |
bool | addPeakLayer (const ExperimentSharedPtrType &map, ODExperimentSharedPtrType od_map, const String &filename="", const String &caption="", const bool use_noise_cutoff=false) |
Add a peak data layer. More... | |
bool | addChromLayer (const ExperimentSharedPtrType &map, ODExperimentSharedPtrType od_map, const String &filename="", const String &caption="") |
Add a chrom data layer. More... | |
bool | addLayer (FeatureMapSharedPtrType map, const String &filename="", const String &caption="") |
Add a feature data layer. More... | |
bool | addLayer (ConsensusMapSharedPtrType map, const String &filename="", const String &caption="") |
Add a consensus feature data layer. More... | |
bool | addLayer (std::vector< PeptideIdentification > &peptides, const String &filename="", const String &caption="") |
Add an identification data layer. More... | |
float | getCurrentMinIntensity () const |
Returns the minimum intensity of the active layer. More... | |
float | getCurrentMaxIntensity () const |
Returns the maximum intensity of the active layer. More... | |
float | getMinIntensity (Size index) const |
Returns the minimum intensity of the layer with index index . More... | |
float | getMaxIntensity (Size index) const |
Returns the maximum intensity of the layer with index index . More... | |
void | setLayerName (Size i, const String &name) |
Sets the name of layer i . More... | |
String | getLayerName (Size i) |
Gets the name of layer i . More... | |
void | setCurrentLayerParameters (const Param ¶m) |
Sets the parameters of the current layer. More... | |
virtual const RangeType & | getDataRange () const |
Returns the area which encloses all data points of all layers. More... | |
double | getSnapFactor () |
Returns the first intensity scaling factor for 'snap to maximum intensity mode' (for the currently visible data range). More... | |
double | getPercentageFactor () const |
Returns the percentage factor. More... | |
virtual void | showCurrentLayerPreferences ()=0 |
Shows the preferences dialog of the active layer. More... | |
virtual void | showMetaData (bool modifiable=false, Int index=-1) |
Shows a dialog with the meta data. More... | |
void | changeVisibility (Size i, bool b) |
change the visibility of a layer More... | |
void | changeLayerFilterState (Size i, bool b) |
change if the defined data filters are used More... | |
void | showGridLines (bool show) |
Whether or not to show grid lines. More... | |
virtual void | resetZoom (bool repaint=true) |
Zooms fully out and resets the zoom stack. More... | |
void | setVisibleArea (const VisibleArea &area) |
Sets the visible area. More... | |
void | setVisibleArea (const RangeAllType &area) |
Sets the visible area. More... | |
void | setVisibleArea (const AreaXYType &area) |
Sets the visible area. More... | |
void | setVisibleAreaX (double min, double max) |
Set only the visible area for the x axis; other axes are untouched. More... | |
void | setVisibleAreaY (double min, double max) |
Set only the visible area for the y axis; other axes are untouched. More... | |
void | saveCurrentLayer (bool visible) |
Saves the current layer data. More... | |
virtual void | horizontalScrollBarChange (int value) |
Notifies the canvas that the horizontal scrollbar has been moved. More... | |
virtual void | verticalScrollBarChange (int value) |
Notifies the canvas that the vertical scrollbar has been moved. More... | |
void | setAdditionalContextMenu (QMenu *menu) |
Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas. More... | |
virtual void | updateLayer (Size i)=0 |
Updates layer i when the data in the corresponding file changes. More... | |
AreaXYType | canvasPixelArea () const |
Get the Area in pixel coordinates of the current canvas for X and Y axis. More... | |
const DimMapper< 2 > & | getMapper () const |
Get Mapper to translate between values for axis (X/Y) and units (m/z, RT, intensity, ...) More... | |
void | setMapper (const DimMapper< 2 > &mapper) |
Set a new mapper for the canvas. More... | |
void | layerModficationChange (Size layer, bool modified) |
Signal emitted whenever the modification status of a layer changes (editing and storing) More... | |
void | layerActivated (QWidget *w) |
Signal emitted whenever a new layer is activated within the current window. More... | |
void | layerZoomChanged (QWidget *w) |
Signal emitted whenever the zoom changed. More... | |
void | visibleAreaChanged (const VisibleArea &area) |
Change of the visible area. More... | |
void | sendCursorStatus (const String &x_value, const String &y_value) |
Emitted when the cursor position changes (for displaying e.g. in status bar) More... | |
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. More... | |
void | recalculateAxes () |
Forces recalculation of axis ticks in the connected widget. More... | |
void | updateVScrollbar (float f_min, float disp_min, float disp_max, float f_max) |
Triggers the update of the vertical scrollbar. More... | |
void | updateHScrollbar (float f_min, float disp_min, float disp_max, float f_max) |
Triggers the update of the horizontal scrollbar. More... | |
void | changeLegendVisibility () |
Toggle axis legend visibility change. More... | |
void | actionModeChange () |
Emitted when the action mode changes. More... | |
void | preferencesChange () |
Emitted when the layer preferences have changed. More... | |
void | updateCursor_ () |
Updates the cursor according to the current action mode. More... | |
void | drawText_ (QPainter &painter, const QStringList &text) |
Draws several lines of text to the upper right corner of the widget. More... | |
double | 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) More... | |
virtual bool | finishAdding_ ()=0 |
Method that is called when a new layer has been added. More... | |
void | popIncompleteLayer_ (const QString &error_message="") |
Additional Inherited Members | |
Public Member Functions inherited from DefaultParamHandler | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
Static Public Member Functions inherited from DefaultParamHandler | |
static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="") |
Writes all parameters to meta values. More... | |
Protected Attributes inherited from DefaultParamHandler | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
Base class for visualization canvas classes.
This class is the base class for the spectrum data views which are used for 1D, 2D and 3D visualization of data. In TOPPView, each PlotCanvas is paired with an enclosing PlotWidget (see also the getPlotWidget() function that provides a back-reference). To provide additional spectrum views, you can derive from this class and you should also create a subclass from PlotWidget which encloses your class derived from PlotCanvas. A spectrum canvas can display multiple data layers at the same time (see layers_ member variable).
The actual data to be displayed is stored as a vector of LayerDataBase objects which hold the actual data. It also stores information about the commonly used constants such as ActionModes or IntensityModes.
All derived classes should follow these interface conventions:
using AreaXYType = Area<2>::AreaXYType |
The range of data shown on the X and Y axis (unit depends on runtime config)
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)
using GenericArea = Area<2> |
A generic range of data on X and Y axis as shown on plot axis.
typedef SpectrumType::PeakType PeakType |
Peak type.
The number of pixels on the axis. The lower point of the area will be zero. The maxima will reflect the number of pixels in either dimension. Note that the unit of the Axis etc is in PIXELS (-> not in seconds, m/z or whatever)
using PointOnAxis = DimMapper<2>::Point |
using RangeType = RangeAllType |
a generic range for the most common units
Spectrum iterator type (iterates over peaks)
Spectrum type.
using UnitRange = RangeAllType |
using VisibleArea = Area<2> |
The visible range of data on X and Y axis as shown on plot axis (not necessarily the range of actual data, e.g. no data to show).
enum ActionModes |
enum IntensityModes |
Display modes of intensity.
PlotCanvas | ( | const Param & | preferences, |
QWidget * | parent = nullptr |
||
) |
Default constructor.
|
override |
Destructor.
|
signal |
Emitted when the action mode changes.
|
pure virtual |
change the active layer (the one that is used for selecting and so on)
bool addChromLayer | ( | const ExperimentSharedPtrType & | map, |
ODExperimentSharedPtrType | od_map, | ||
const String & | filename = "" , |
||
const String & | caption = "" |
||
) |
Add a chrom data layer.
map | Shared pointer to input map. It can be performed in constant time and does not double the required memory. |
od_map | Shared pointer to on disk data which potentially caches some data to save memory (the map can be empty, but do not pass nullptr). |
filename | This absolute filename is used to monitor changes in the file and reload the data |
caption | The caption of the layer (shown in the layer window) |
Referenced by TOPPViewBase::addData().
|
inlineprotected |
Data processing setter for peak maps.
References VersionInfo::getVersion(), DateTime::now(), and MSExperiment::size().
bool addLayer | ( | ConsensusMapSharedPtrType | map, |
const String & | filename = "" , |
||
const String & | caption = "" |
||
) |
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 |
caption | The caption of the layer (shown in the layer window) |
bool addLayer | ( | FeatureMapSharedPtrType | map, |
const String & | filename = "" , |
||
const String & | caption = "" |
||
) |
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 |
caption | The caption of the layer (shown in the layer window) |
bool addLayer | ( | std::unique_ptr< LayerData1DBase > | layer | ) |
Add an already constructed layer (e.g. for projections)
Referenced by TOPPViewBase::addData().
bool addLayer | ( | std::vector< PeptideIdentification > & | peptides, |
const String & | filename = "" , |
||
const String & | caption = "" |
||
) |
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 |
caption | The caption of the layer (shown in the layer window) |
bool addPeakLayer | ( | const ExperimentSharedPtrType & | map, |
ODExperimentSharedPtrType | od_map, | ||
const String & | filename = "" , |
||
const String & | caption = "" , |
||
const bool | use_noise_cutoff = false |
||
) |
Add a peak data layer.
map | Shared pointer to input map. It can be performed in constant time and does not double the required memory. |
od_map | Shared pointer to on disk data which potentially caches some data to save memory (the map can be empty, but do not pass nullptr). |
filename | This absolute filename is used to monitor changes in the file and reload the data |
caption | The caption of the layer (shown in the layer window) |
use_noise_cutoff | Add a noise filter which removes low-intensity peaks |
Referenced by TOPPViewBase::addData(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), and TOPPViewBase::showCurrentPeaksAsIonMobility().
|
inlineslot |
Get the Area in pixel coordinates of the current canvas for X and Y axis.
|
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().
|
signal |
Toggle axis legend visibility change.
|
slot |
change the visibility of a layer
i | the index of the layer |
b | true if layer is supposed to be visible |
|
protectedvirtual |
Sets the visible area.
Changes the visible area, adjusts the zoom stack and notifies interested clients about the change. If the area is outside the overall data range, the new area is pushed back into the overall range.
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 Plot1DCanvas.
Referenced by Plot1DCanvas::resetZoom().
|
protected |
Call this whenever the DimMapper receives new dimensions; will update the axes and scrollbars.
|
protected |
Draws several lines of text to the upper right corner of the widget.
|
overrideprotected |
|
protectedpure virtual |
Method that is called when a new layer has been added.
Implemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.
|
overrideprotected |
|
inline |
Returns the action mode.
Returns the current action mode of type ActionModes
|
inline |
returns the layer data of the active layer
|
inline |
returns the layer data of the active layer
Referenced by TOPPViewBase::annotateWithAMS(), TOPPViewBase::annotateWithID(), TOPPViewBase::annotateWithOSW(), TOPPViewBase::copyLayer(), TOPPViewBase::editMetadata(), TOPPViewBase::getCurrentLayer(), TOPPViewBase::loadFiles(), TOPPViewBase::rerunTOPPTool(), TOPPViewBase::runTOPPTool_(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAsDIA(), TOPPViewBase::showCurrentPeaksAsIonMobility(), TOPPViewBase::showPlotWidgetInWindow(), TOPPViewBase::showTOPPDialog_(), TOPPViewBase::updateToolBar(), and TOPPViewBase::zoomOtherWindows().
|
inline |
returns the index of the active layer
Referenced by TOPPViewBase::showCurrentPeaksAs3D(), and TOPPViewBase::showCurrentPeaksAsDIA().
|
inline |
Returns the maximum intensity of the active layer.
|
inline |
Returns the minimum intensity of the active layer.
|
virtual |
Returns the area which encloses all data points of all layers.
Reimplemented in Plot1DCanvas.
|
protected |
Returns the m/z value of an identification depending on the m/z source of the layer (precursor mass/theoretical peptide mass)
|
inline |
Returns the intensity mode.
Returns the current intensity mode of type IntensityModes
Referenced by TOPPViewBase::updateToolBar().
|
inline |
returns the layer data with index index
|
inline |
returns the layer data with index index
Referenced by TOPPViewBase::addData(), TOPPViewBase::fileChanged_(), and TOPPViewBase::showCurrentPeaksAs3D().
|
inline |
Returns the number of layers.
Referenced by TOPPViewBase::addData(), TOPPViewBase::fileChanged_(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::updateFilterBar(), and TOPPViewBase::updateToolBar().
|
inline |
returns a layer flag of the current layer
Referenced by TOPPViewBase::changeUnassigned(), and TOPPViewBase::updateToolBar().
|
inline |
returns a layer flag of the layer layer
Gets the name of layer i
.
Referenced by TOPPViewBase::addData().
|
slot |
Get Mapper to translate between values for axis (X/Y) and units (m/z, RT, intensity, ...)
Referenced by Annotation1DCaret< DataPoint >::draw(), and Annotation1DPeakItem< DataPoint >::draw().
|
inline |
Returns the maximum intensity of the layer with index index
.
|
inline |
Returns the minimum intensity of the layer with index index
.
double getPercentageFactor | ( | ) | const |
Returns the percentage factor.
|
inline |
Get the number of pixels of the current canvas (this is independent of the current visible area and zoom level). It's just the size of the canvas.
References Area< N_DIM >::setArea().
|
inline |
Returns the spectrum widget.
Returns the enclosing spectrum widget
double getSnapFactor | ( | ) |
Returns the first intensity scaling factor for 'snap to maximum intensity mode' (for the currently visible data range).
|
inline |
Returns the currently visible area. This is the authority which determines the X and Y axis' scale.
Referenced by TOPPViewBase::zoomOtherWindows().
|
inline |
Returns if the grid is currently shown.
true
if the grid is visible, false
otherwise
|
virtualslot |
Notifies the canvas that the horizontal scrollbar has been moved.
Reimplement this slot to react on scrollbar events.
|
protectedvirtual |
This method is called whenever the intensity mode changes. Reimplement if you need to react on such changes.
Reimplemented in Plot2DCanvas, and Plot1DCanvas.
|
inline |
Given a 2D axis coordinate, is it in the currently visible area? (useful to avoid plotting stuff outside the visible area) Note: The input p
must have unit coordinates (i.e. the result of widgetToData_), not pixel coordinates.
|
overrideprotected |
|
overrideprotected |
|
signal |
Signal emitted whenever a new layer is activated within the current window.
Referenced by TOPPViewBase::showPlotWidgetInWindow().
|
signal |
Signal emitted whenever the modification status of a layer changes (editing and storing)
Referenced by TOPPViewBase::showPlotWidgetInWindow().
|
signal |
Signal emitted whenever the zoom changed.
Referenced by TOPPViewBase::showPlotWidgetInWindow().
|
overrideprotected |
|
protected |
Takes all actions necessary when the modification status of a layer changes (signals etc.)
|
protectedvirtual |
Helper function to paint grid lines.
Reimplemented in Plot1DCanvas.
|
protected |
remove already added layer which did not pass final checks in finishAdding_()
error_message | Optional error message to show as messagebox |
|
signal |
Emitted when the layer preferences have changed.
Referenced by TOPPViewBase::showPlotWidgetInWindow().
|
signal |
Forces recalculation of axis ticks in the connected widget.
|
protectedvirtual |
Recalculates the overall_data_range_.
A small margin is added to each side of the range in order to display all data.
Reimplemented in Plot1DCanvas.
Referenced by Plot1DCanvas::recalculateRanges_().
|
protectedvirtual |
Recalculates the intensity scaling factor for 'snap to maximum intensity mode'.
Reimplemented in Plot2DCanvas.
|
pure virtual |
removes the layer with index layer_index
|
inline |
removes all layers by calling removeLayer() for all layer indices (from highest to lowest)
|
virtualslot |
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. |
Reimplemented in Plot1DCanvas.
Referenced by TOPPViewBase::resetZoom().
|
overrideprotected |
|
slot |
Saves the current layer data.
visible | If true, only the visible data is stored. Otherwise the whole data is stored. |
Referenced by TOPPViewBase::saveLayerAll(), and TOPPViewBase::saveLayerVisible().
Emitted when the cursor position changes (for displaying e.g. in status bar)
|
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.
|
slot |
Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas.
|
inline |
Sets the parameters of the current layer.
Referenced by TOPPViewBase::loadFiles().
|
virtual |
Sets the filters applied to the data before drawing (for the current layer)
Referenced by TOPPViewBase::TOPPViewBase().
|
inline |
Sets the intensity mode.
Sets the intensity mode and calls intensityModeChange_()
mod | the new intensity mode |
|
inline |
Referenced by TOPPViewBase::changeLabel().
|
inline |
sets a layer flag of the current layer
Referenced by TOPPViewBase::changeUnassigned().
|
inline |
sets a layer flag of the layer layer
Sets the name
of layer i
.
Referenced by TOPPViewBase::addData(), and TOPPViewBase::showCurrentPeaksAsDIA().
|
slot |
Set a new mapper for the canvas.
mapper | The new mapper for translating between units and axis |
|
inline |
Sets the spectrum widget.
Sets the enclosing spectrum widget. Call this from your PlotWidget derived class.
widget | the spectrum widget |
|
slot |
Sets the visible area.
Sets the visible area to a new value and emits visibleAreaChanged() if the area is different from the old one.
area | the new visible area |
|
slot |
Sets the visible area.
Sets the visible area to a new value and emits visibleAreaChanged() if the area is different from the old one.
area | the new visible area |
|
slot |
Sets the visible area.
Sets the visible area to a new value and emits visibleAreaChanged() if the area is different from the old one.
area | the new visible area |
Referenced by TOPPViewBase::showCurrentPeaksAs3D(), and TOPPViewBase::zoomOtherWindows().
|
slot |
Set only the visible area for the x axis; other axes are untouched.
min | |
max |
|
slot |
Set only the visible area for the y axis; other axes are untouched.
min | |
max |
|
pure virtual |
Shows the preferences dialog of the active layer.
Implemented in Plot3DCanvas, Plot2DCanvas, and Plot1DCanvas.
Referenced by TOPPViewBase::showPreferences().
|
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 |
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().
|
protectedvirtual |
Translation bound to the 'Down' key.
Reimplemented in Plot2DCanvas, and Plot1DCanvas.
|
protectedvirtual |
Translation bound to the 'Up' key.
Reimplemented in Plot2DCanvas, and Plot1DCanvas.
|
protectedvirtual |
Translation bound to the 'Left' key.
Reimplemented in Plot2DCanvas, and Plot1DCanvas.
|
protectedvirtual |
Translation bound to the 'Right' key.
Reimplemented in Plot2DCanvas, and Plot1DCanvas.
|
protectedvirtual |
Updates the displayed 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 OPENMS_PRETTY_FUNCTION). |
Reimplemented in Plot3DCanvas.
|
protectedslot |
Updates the cursor according to the current action mode.
|
signal |
Triggers the update of the horizontal scrollbar.
|
pure virtualslot |
Updates layer i
when the data in the corresponding file changes.
Referenced by TOPPViewBase::fileChanged_().
|
protectedvirtual |
Updates the scroll bars.
Updates the scrollbars after a change of the visible area.
Reimplemented in Plot2DCanvas, and Plot1DCanvas.
|
signal |
Triggers the update of the vertical scrollbar.
|
virtualslot |
Notifies the canvas that the vertical scrollbar has been moved.
Reimplement this slot to react on scrollbar events.
|
signal |
Change of the visible area.
Signal emitted whenever the visible area changes.
area | The new visible area. |
|
overrideprotected |
|
inlineprotected |
Calls widgetToData_ with x and y position of pos
.
|
inlineprotected |
Convert widget (pixel) to chart (unit) coordinates.
Translates widget coordinates to chart coordinates.
x | the widget coordinate x |
y | the widget coordinate y |
|
protectedvirtual |
Zooms such that screen point x, y would still point to the same data point.
Reimplemented in Plot1DCanvas.
|
protected |
Add a visible area to the zoom stack.
|
protected |
Go backward in zoom history.
|
protected |
Clears the zoom stack and invalidates the current zoom position. After calling this, a valid zoom position has to be added immediately.
|
protectedvirtual |
Go forward in zoom history.
Reimplemented in Plot1DCanvas.
|
protected |
Stores the current action mode (Pick, Zoom, Translate)
|
protected |
Buffer that stores the actual peak information.
|
protected |
External context menu extension.
|
protected |
Stores the used intensity mode function.
|
protected |
start position of mouse actions
|
protected |
Layer data.
|
protected |
start peak of measuring mode
|
protected |
Stores the data range (m/z, RT and intensity) of all layers.
|
protected |
Intensity scaling factor for relative scale with multiple layers.
In this mode all layers are scaled to the same maximum. FIXME: this factor changes, depending on the layer which is currently plotted! Ouch!
|
protected |
Rubber band for selected area.
|
protected |
selected peak
|
protected |
Stores whether or not to show a grid.
|
protected |
Flag that determines if timing data is printed to the command line.
|
protected |
Intensity scaling factor for 'snap to maximum intensity mode'.
In this mode the highest currently visible intensity is treated like the maximum overall intensity.
Only used in 2D mode.
|
protected |
Back-pointer to the enclosing spectrum widget.
|
protected |
Mapper for X and Y axis.
|
protected |
Whether to recalculate the data in the buffer when repainting.
|
protected |
Stores the currently visible area in data units (e.g. seconds, m/z, intensity etc) and axis (X,Y) area.
This is always (and only) the data shown in the widget. In 1D, the gravity axis may get some headroom on the y-axis, see Plot1DCanvas::correctGravityAxisOfVisibleArea_()
|
protected |
The current position in the zoom stack.
|
protected |
The zoom stack.