38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> 
   49 #include <QRubberBand> 
  208       spectrum_widget_ = widget;
 
  219       return spectrum_widget_;
 
  242       return intensity_mode_;
 
  256       intensity_mode_ = mod;
 
  257       intensityModeChange_();
 
  273       return layers_.getLayer(index);
 
  278       return layers_.getLayer(index);
 
  284       return layers_.getCurrentLayer();
 
  289       return layers_.getCurrentLayer();
 
  295       return layers_.getCurrentLayerIndex();
 
  301       return getLayerFlag(layers_.getCurrentLayerIndex(), f);
 
  307       setLayerFlag(layers_.getCurrentLayerIndex(), f, value);
 
  313       return layers_.getLayer(layer).flags.test(f);
 
  320       if (layers_.empty()) 
return;
 
  322       layers_.getLayer(layer).flags.set(f, value);
 
  323       update_buffer_ = 
true;
 
  330       if (layers_.empty()) 
return;
 
  331       layers_.getCurrentLayer().label = label;
 
  332       update_buffer_ = 
true;
 
  343       return visible_area_;
 
  354       return mz_to_x_axis_;
 
  369       return layers_.getLayerCount();
 
  380       for (
Size i = getLayerCount(); i > 0; --i)
 
  430     bool addLayer(std::vector<PeptideIdentification> & peptides,
 
  431                   const String & filename = 
"");
 
  436       return layers_.getCurrentLayer().getMinIntensity();
 
  442       return layers_.getCurrentLayer().getMaxIntensity();
 
  448       return getLayer(index).getMinIntensity();
 
  454       return getLayer(index).getMaxIntensity();
 
  466       getCurrentLayer().param = param;
 
  467       emit preferencesChange();
 
  611       dataToWidget_(x, y, point);
 
  614       dataToWidget_(0, 0, zero);
 
  729     virtual void zoom_(
int x, 
int y, 
bool zoom_in);
 
  743     virtual void translateLeft_(Qt::KeyboardModifiers m);
 
  774                  visible_area_.minX() + (height() - y) / height()  * visible_area_.width(),
 
  775                  visible_area_.minY() + x  / width() * visible_area_.height()
 
  781                  visible_area_.minX() + x / width() * visible_area_.width(),
 
  782                  visible_area_.minY() + (height() - y) / height() * visible_area_.height()
 
  790       return widgetToData_(pos.x(), pos.y());
 
  809           point.setX(
int((y - visible_area_.minY()) / visible_area_.height() * width()));
 
  814                        std::log10((y - visible_area_.minY()) + 1) / std::log10(visible_area_.height() + 1) * width())
 
  818         point.setY(height() - 
int((x - visible_area_.minX()) / visible_area_.width() * height()));
 
  822         point.setX(
int((x - visible_area_.minX()) / visible_area_.width() * width()));
 
  826           point.setY(height() - 
int((y - visible_area_.minY()) / visible_area_.height() * height()));
 
  830           point.setY(height() - 
int(
 
  831                        std::log10((y - visible_area_.minY()) + 1) / std::log10(visible_area_.height() + 1) * height()
 
  900     virtual void update_(
const char * caller_name);
 
  947       std::set<DataProcessing::ProcessingAction> actions;
 
  948       actions.insert(action);
 
  952       p->setProcessingActions(actions);
 
  954       p->getSoftware().setName(
"PlotCanvas");
 
  960       for (
Size i = 0; i < map.
size(); ++i)
 
  962         map[i].getDataProcessing().push_back(p);
 
A container for consensus elements.
Definition: ConsensusMap.h:88
 
DataFilter array providing some convenience functions.
Definition: DataFilters.h:51
 
Description of the applied preprocessing steps.
Definition: DataProcessing.h:53
 
ProcessingAction
Definition: DataProcessing.h:59
 
static DateTime now()
Returns the current date and time.
 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
 
A container for features.
Definition: FeatureMap.h:105
 
An LC-MS feature.
Definition: Feature.h:72
 
Class that stores the data for one layer.
Definition: LayerData.h:96
 
boost::shared_ptr< ExperimentType > ExperimentSharedPtrType
SharedPtr on MSExperiment.
Definition: LayerData.h:159
 
boost::shared_ptr< OnDiscMSExperiment > ODExperimentSharedPtrType
SharedPtr on On-Disc MSExperiment.
Definition: LayerData.h:164
 
LabelType
Label used in visualization.
Definition: LayerData.h:131
 
boost::shared_ptr< const ExperimentType > ConstExperimentSharedPtrType
Definition: LayerData.h:161
 
boost::shared_ptr< ConsensusMap > ConsensusMapSharedPtrType
SharedPtr on consensus features.
Definition: LayerData.h:153
 
Flags
Flags that determine which information is shown.
Definition: LayerData.h:114
 
boost::shared_ptr< OSWData > OSWDataSharedPtrType
SharedPtr on OSWData.
Definition: LayerData.h:167
 
boost::shared_ptr< FeatureMap > FeatureMapSharedPtrType
SharedPtr on feature map.
Definition: LayerData.h:147
 
Definition: PlotCanvas.h:72
 
void addLayer(LayerData &&new_layer)
adds a new layer and makes it the current layer
 
LayerData & getLayer(const Size index)
 
std::vector< LayerData > layers_
Definition: PlotCanvas.h:99
 
Size getLayerCount() const
 
Size getCurrentLayerIndex() const
 
LayerData & getCurrentLayer()
 
Size current_layer_
Definition: PlotCanvas.h:101
 
const LayerData & getCurrentLayer() const
 
void removeLayer(Size layer_index)
 
void setCurrentLayer(Size index)
throws Exception::IndexOverflow unless index is smaller than getLayerCount()
 
void removeCurrentLayer()
 
const LayerData & getLayer(const Size index) const
 
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:80
 
Size size() const
Definition: MSExperiment.h:127
 
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
 
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:128
 
Management and storage of parameters / INI files.
Definition: Param.h:70
 
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
 
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:65
 
Base class for visualization canvas classes.
Definition: PlotCanvas.h:136
 
bool mz_to_x_axis_
Stores the mapping of m/z.
Definition: PlotCanvas.h:853
 
virtual void translateBackward_()
Translation bound to the 'Down' key.
 
float getMaxIntensity(Size index) const
Returns the maximum intensity of the layer with index index.
Definition: PlotCanvas.h:452
 
AreaType visible_area_
Stores the currently visible area.
Definition: PlotCanvas.h:861
 
float getMinIntensity(Size index) const
Returns the minimum intensity of the layer with index index.
Definition: PlotCanvas.h:446
 
float getCurrentMinIntensity() const
Returns the minimum intensity of the active layer.
Definition: PlotCanvas.h:434
 
void addDataProcessing_(PeakMap &map, DataProcessing::ProcessingAction action) const
Data processing setter for peak maps.
Definition: PlotCanvas.h:945
 
void layerActivated(QWidget *w)
Signal emitted whenever a new layer is activated within the current window.
 
LayerData::ExperimentType ExperimentType
Main data type (experiment)
Definition: PlotCanvas.h:144
 
void setLayerName(Size i, const String &name)
Sets the name of layer i.
 
~PlotCanvas() override
Destructor.
 
void setVisibleArea(AreaType area)
Sets the visible area.
 
DRange< 2 > AreaType
Types of Ranges/Areas.
Definition: PlotCanvas.h:171
 
LayerStack layers_
Layer data.
Definition: PlotCanvas.h:850
 
std::vector< double > snap_factors_
Intensity scaling factor for 'snap to maximum intensity mode'.
Definition: PlotCanvas.h:928
 
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/t...
 
bool addLayer(std::vector< PeptideIdentification > &peptides, const String &filename="")
Add an identification data layer.
 
PlotCanvas(const Param &preferences, QWidget *parent=nullptr)
Default constructor.
 
String getLayerName(Size i)
Gets the name of layer i.
 
LayerData::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: PlotCanvas.h:146
 
virtual void horizontalScrollBarChange(int value)
Notifies the canvas that the horizontal scrollbar has been moved.
 
SpectrumType::PeakType PeakType
Peak type.
Definition: PlotCanvas.h:164
 
QImage buffer_
Buffer that stores the actual peak information.
Definition: PlotCanvas.h:841
 
PeakIndex selected_peak_
selected peak
Definition: PlotCanvas.h:940
 
void zoomAdd_(const AreaType &area)
Add a visible area to the zoom stack.
 
void setIntensityMode(IntensityModes mod)
Sets the intensity mode.
Definition: PlotCanvas.h:254
 
void recalculateAxes()
Forces recalculation of axis ticks in the connected widget.
 
Size getLayerCount() const
Returns the number of layers.
Definition: PlotCanvas.h:367
 
virtual void updateLayer(Size i)=0
Updates layer i when the data in the corresponding file changes.
 
bool addLayer(ExperimentSharedPtrType map, ODExperimentSharedPtrType od_map, const String &filename="")
Add a peak data layer.
 
PointType widgetToDataDistance(double x, double y)
compute distance in widget coordinates (unit axis as shown) when moving x/y px in chart coordinates
Definition: PlotCanvas.h:621
 
bool gridLinesShown() const
Returns if the grid is currently shown.
Definition: PlotCanvas.h:265
 
SpectrumType::ConstIterator SpectrumConstIteratorType
Spectrum iterator type (iterates over peaks)
Definition: PlotCanvas.h:162
 
void enterEvent(QEvent *e) override
 
virtual void updateScrollbars_()
Updates the scroll bars.
 
void getVisibleConsensusData(ConsensusMapType &map) const
Fills the handed over map with the visible consensus features of the current layer.
 
Size getCurrentLayerIndex() const
returns the index of the active layer
Definition: PlotCanvas.h:293
 
bool addLayer(FeatureMapSharedPtrType map, const String &filename="")
Add a feature data layer.
 
Int getActionMode() const
Returns the action mode.
Definition: PlotCanvas.h:228
 
void mzToXAxis(bool mz_to_x_axis)
Sets the mapping of m/z to axes.
 
bool getLayerFlag(LayerData::Flags f) const
returns a layer flag of the current layer
Definition: PlotCanvas.h:299
 
virtual void activateLayer(Size layer_index)=0
change the active layer (the one that is used for selecting and so on)
 
LayerData & getCurrentLayer()
returns the layer data of the active layer
Definition: PlotCanvas.h:287
 
void updateCursor_()
Updates the cursor according to the current action mode.
 
void drawText_(QPainter &painter, QStringList text)
Draws several lines of text to the upper right corner of the widget.
 
PointType widgetToData_(const QPoint &pos)
Calls widgetToData_ with x and y position of pos.
Definition: PlotCanvas.h:788
 
virtual void removeLayer(Size layer_index)=0
removes the layer with index layer_index
 
LayerData::ConstExperimentSharedPtrType ConstExperimentSharedPtrType
Definition: PlotCanvas.h:147
 
virtual void verticalScrollBarChange(int value)
Notifies the canvas that the vertical scrollbar has been moved.
 
void actionModeChange()
Emitted when the action mode changes.
 
const AreaType & getVisibleArea() const
Returns the currently visible area.
Definition: PlotCanvas.h:341
 
void sendCursorStatus(double mz=-1.0, double rt=-1.0)
Emitted when the cursor position changes (for displaying e.g. in status bar)
 
void leaveEvent(QEvent *e) override
 
void zoomClear_()
Clears the zoom stack and invalidates the current zoom position. After calling this,...
 
void keyReleaseEvent(QKeyEvent *e) override
 
void getVisibleFeatureData(FeatureMapType &map) const
Fills the handed over map with the visible features of the current layer.
 
void recalculateRanges_(UInt mz_dim, UInt rt_dim, UInt it_dim)
Recalculates the overall_data_range_.
 
void visibleAreaChanged(DRange< 2 > area)
Change of the visible area.
 
LayerData::ConsensusMapSharedPtrType ConsensusMapSharedPtrType
Main managed data type (consensus features)
Definition: PlotCanvas.h:157
 
void getVisibleIdentifications(std::vector< PeptideIdentification > &peptides) const
Fills the handed over peptides with the visible peptide identifications of the current layer.
 
ExperimentType::SpectrumType SpectrumType
Spectrum type.
Definition: PlotCanvas.h:160
 
IntensityModes intensity_mode_
Stores the used intensity mode function.
Definition: PlotCanvas.h:847
 
virtual void showMetaData(bool modifiable=false, Int index=-1)
Shows a dialog with the meta data.
 
void resetZoom(bool repaint=true)
Zooms fully out and resets the zoom stack.
 
virtual void paintGridLines_(QPainter &painter)
Helper function to paint grid lines.
 
LayerData::FeatureMapSharedPtrType FeatureMapSharedPtrType
Main managed data type (features)
Definition: PlotCanvas.h:153
 
virtual void saveCurrentLayer(bool visible)=0
Saves the current layer data.
 
void keyPressEvent(QKeyEvent *e) override
 
std::vector< AreaType >::iterator zoom_pos_
The current position in the zoom stack.
Definition: PlotCanvas.h:889
 
const LayerData & getCurrentLayer() const
returns the layer data of the active layer
Definition: PlotCanvas.h:282
 
virtual void zoomForward_()
Go forward in zoom history.
 
void setAdditionalContextMenu(QMenu *menu)
Sets the additional context menu. If not 0, this menu is added to the context menu of the canvas.
 
void dataToWidgetDistance(double x, double y, QPoint &point)
converts a distance in axis values to pixel values
Definition: PlotCanvas.h:609
 
void changeVisibility(Size i, bool b)
change the visibility of a layer
 
double getPercentageFactor()
Returns the percentage factor.
 
LayerData::ConsensusMapType ConsensusMapType
Main data type (consensus features)
Definition: PlotCanvas.h:155
 
void updateVScrollbar(float, float, float, float)
Triggers the update of the vertical scrollbar.
 
void wheelEvent(QWheelEvent *e) override
 
void focusOutEvent(QFocusEvent *e) override
 
virtual void changeVisibleArea_(const AreaType &new_area, bool repaint=true, bool add_to_stack=false)
Sets the visible area.
 
void modificationStatus_(Size layer_index, bool modified)
Takes all actions necessary when the modification status of a layer changes (signals etc....
 
void setLayerFlag(Size layer, LayerData::Flags f, bool value)
sets a layer flag of the layer layer
Definition: PlotCanvas.h:317
 
virtual void translateForward_()
Translation bound to the 'Up' key.
 
DPosition< 2 > PointType
Type of the Points.
Definition: PlotCanvas.h:169
 
void setLayerFlag(LayerData::Flags f, bool value)
sets a layer flag of the current layer
Definition: PlotCanvas.h:305
 
bool update_buffer_
Whether to recalculate the data in the buffer when repainting.
Definition: PlotCanvas.h:906
 
void zoomBack_()
Go backward in zoom history.
 
IntensityModes
Display modes of intensity.
Definition: PlotCanvas.h:184
 
@ IM_NONE
Normal mode: f(x)=x.
Definition: PlotCanvas.h:185
 
@ IM_SNAP
Shows the maximum displayed intensity as if it was the overall maximum intensity.
Definition: PlotCanvas.h:187
 
@ IM_PERCENTAGE
Shows intensities normalized by layer maximum: f(x)=x/max(x)*100.
Definition: PlotCanvas.h:186
 
@ IM_LOG
Logarithmic mode.
Definition: PlotCanvas.h:188
 
float getCurrentMaxIntensity() const
Returns the maximum intensity of the active layer.
Definition: PlotCanvas.h:440
 
virtual void setFilters(const DataFilters &filters)
Sets the filters applied to the data before drawing (for the current layer)
 
void changeLayerFilterState(Size i, bool b)
change if the defined data filters are used
 
LayerData::OSWDataSharedPtrType OSWDataSharedPtrType
Definition: PlotCanvas.h:149
 
void layerModficationChange(Size layer, bool modified)
Signal emitted whenever the modification status of a layer changes (editing and storing)
 
virtual void translateRight_(Qt::KeyboardModifiers m)
Translation bound to the 'Right' key.
 
bool addLayer(ConsensusMapSharedPtrType map, const String &filename="")
Add a consensus feature data layer.
 
void setCurrentLayerParameters(const Param ¶m)
Sets the parameters of the current layer.
Definition: PlotCanvas.h:464
 
void updateHScrollbar(float, float, float, float)
Triggers the update of the horizontal scrollbar.
 
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 displ...
 
std::vector< AreaType > zoom_stack_
The zoom stack.
Definition: PlotCanvas.h:887
 
LayerData::FeatureMapType FeatureMapType
Main data type (features)
Definition: PlotCanvas.h:151
 
bool show_timing_
Flag that determines if timing data is printed to the command line.
Definition: PlotCanvas.h:937
 
void setLabel(LayerData::LabelType label)
Definition: PlotCanvas.h:327
 
QPoint last_mouse_pos_
start position of mouse actions
Definition: PlotCanvas.h:912
 
bool show_grid_
Stores whether or not to show a grid.
Definition: PlotCanvas.h:884
 
QMenu * context_add_
External context menu extension.
Definition: PlotCanvas.h:934
 
PointType widgetToData_(double x, double y)
Convert widget to chart coordinates.
Definition: PlotCanvas.h:769
 
FeatureMapType::FeatureType FeatureType
Feature type.
Definition: PlotCanvas.h:166
 
double getSnapFactor()
Returns the first intensity scaling factor for 'snap to maximum intensity mode'.
 
virtual bool finishAdding_()=0
Method that is called when a new layer has been added.
 
ActionModes
Mouse action modes.
Definition: PlotCanvas.h:176
 
@ AM_ZOOM
zoom
Definition: PlotCanvas.h:178
 
@ AM_TRANSLATE
translate
Definition: PlotCanvas.h:177
 
virtual void intensityModeChange_()
This method is called whenever the intensity mode changes. Reimplement if you need to react on such c...
 
bool isMzToXAxis()
Returns the mapping of m/z to axes.
Definition: PlotCanvas.h:352
 
void popIncompleteLayer_(const QString &error_message="")
 
bool getLayerFlag(Size layer, LayerData::Flags f) const
returns a layer flag of the layer layer
Definition: PlotCanvas.h:311
 
void preferencesChange()
Emitted when the layer preferences have changed.
 
PeakIndex measurement_start_
start peak of measuring mode
Definition: PlotCanvas.h:942
 
IntensityModes getIntensityMode() const
Returns the intensity mode.
Definition: PlotCanvas.h:240
 
void dataToWidget_(double x, double y, QPoint &point)
Convert chart to widget coordinates.
Definition: PlotCanvas.h:801
 
PlotWidget * spectrum_widget_
Back-pointer to the enclosing spectrum widget.
Definition: PlotCanvas.h:909
 
virtual void showCurrentLayerPreferences()=0
Shows the preferences dialog of the active layer.
 
ActionModes action_mode_
Stores the current action mode (Pick, Zoom, Translate)
Definition: PlotCanvas.h:844
 
void resizeEvent(QResizeEvent *e) override
 
const DRange< 3 > & getDataRange()
Returns the area which encloses all data points.
 
LayerData::ODExperimentSharedPtrType ODExperimentSharedPtrType
Definition: PlotCanvas.h:148
 
QRubberBand rubber_band_
Rubber band for selected area.
Definition: PlotCanvas.h:931
 
void getVisiblePeakData(ExperimentType &map) const
Fills the handed over map with the visible peaks of the current layer.
 
void changeLegendVisibility()
Toggle axis legend visibility change.
 
LayerData & getLayer(Size index)
returns the layer data with index index
Definition: PlotCanvas.h:276
 
void showGridLines(bool show)
Whether or not to show grid lines.
 
void layerZoomChanged(QWidget *w)
Signal emitted whenever the zoom changed.
 
const LayerData & getLayer(Size index) const
returns the layer data with index index
Definition: PlotCanvas.h:271
 
DRange< 3 > overall_data_range_
Stores the data range (m/z, RT and intensity) of all layers.
Definition: PlotCanvas.h:881
 
virtual void recalculateSnapFactor_()
Recalculates the intensity scaling factor for 'snap to maximum intensity mode'.
 
void removeLayers()
removes all layers by calling removeLayer() for all layer indices (from highest to lowest)
Definition: PlotCanvas.h:378
 
PlotWidget * getPlotWidget() const
Returns the spectrum widget.
Definition: PlotCanvas.h:217
 
double percentage_factor_
Intensity scaling factor for relative scale with multiple layers.
Definition: PlotCanvas.h:919
 
virtual void update_(const char *caller_name)
Updates the displayed data.
 
void setPlotWidget(PlotWidget *widget)
Sets the spectrum widget.
Definition: PlotCanvas.h:206
 
A more convenient string class.
Definition: String.h:61
 
static String getVersion()
Return the version number of OpenMS.
 
int Int
Signed integer type.
Definition: Types.h:102
 
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
 
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
 
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
 
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: DataProcessing.h:135
 
Index of a peak or feature.
Definition: PeakIndex.h:51