38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
45 #include <QTextDocument>
86 constexpr
static double TOP_MARGIN{1.09};
109 const bool multiple_select);
147 void dataToWidget(
double x,
double y, QPoint& point,
bool flipped =
false,
bool percentage =
false);
189 void paint(QPainter* paint_device, QPaintEvent* e);
342 void zoom_(
int x,
int y,
bool zoom_in)
override;
An abstract class acting as an interface for the different 1D annotation items.
Definition: Annotation1DItem.h:60
Painter1D for spectra.
Definition: Painter1DBase.h:71
Management and storage of parameters / INI files.
Definition: Param.h:70
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
Canvas for visualization of one or several spectra.
Definition: Plot1DCanvas.h:72
void setSwappedAxis(bool swapped)
is the widget shown vertically? (for projections)
double alignment_score_
Stores the score of the last alignment.
Definition: Plot1DCanvas.h:306
~Plot1DCanvas() override
Destructor.
std::vector< std::pair< Size, Size > > getAlignedPeaksIndices()
Returns aligned_peaks_indices_.
void drawCoordinates_(QPainter &painter, const PeakIndex &peak)
Draws the coordinates (or coordinate deltas) to the widget's upper left corner.
std::vector< std::pair< double, double > > aligned_peaks_mz_delta_
Stores the alignment as MZ values of pairs of aligned peaks in both spectra.
Definition: Plot1DCanvas.h:302
void addUserPeakAnnotation_(PeakIndex near_peak)
Shows dialog and calls addPeakAnnotation_.
bool show_alignment_
Indicates whether an alignment is currently visualized.
Definition: Plot1DCanvas.h:296
void zoomForward_() override
Go forward in zoom history.
bool finishAdding_() override
Method that is called when a new layer has been added.
QPoint measurement_start_point_
start point of "ruler" for measure mode
Definition: Plot1DCanvas.h:288
Plot1DCanvas(const Param &preferences, QWidget *parent=nullptr)
Default constructor.
void removeLayer(Size layer_index) override
void mousePressEvent(QMouseEvent *e) override
void setDrawInterestingMZs(bool enable)
interesting (e.g., high-intensity) get live annotated with m/s's
DrawModes getDrawMode() const
Returns the draw mode of the current layer.
LabelMode
Label modes (percentage or absolute) of x axis and y axis.
Definition: Plot1DCanvas.h:78
@ LM_XPERCENT_YABSOLUTE
Definition: Plot1DCanvas.h:80
@ LM_XABSOLUTE_YPERCENT
Definition: Plot1DCanvas.h:81
@ LM_XABSOLUTE_YABSOLUTE
Definition: Plot1DCanvas.h:79
void horizontalScrollBarChange(int value) override
void setCurrentLayerPeakPenStyle(Qt::PenStyle ps)
Set's the Qt PenStyle of the active layer.
void mouseMoveEvent(QMouseEvent *e) override
std::vector< DrawModes > draw_modes_
Draw modes (for each layer)
Definition: Plot1DCanvas.h:283
void setMirrorModeActive(bool b)
Sets whether this widget is currently in mirror mode.
void mouseReleaseEvent(QMouseEvent *e) override
void showCurrentPeaksAsIonMobility()
Requests to display all spectra in ion mobility plot.
void currentLayerParamtersChanged_()
Reacts on changed layer parameters.
bool isIonLadderVisible() const
PeakIndex findPeakAtPosition_(QPoint)
Find peak next to the given position.
bool ion_ladder_visible_
whether the ion ladder is displayed on the top right corner in ID view
Definition: Plot1DCanvas.h:310
void keyPressEvent(QKeyEvent *e) override
void activateSpectrum(Size index, bool repaint=true)
Sets current spectrum index of current layer to index.
void showCurrentPeaksAs2D()
Requests to display all spectra in 2D plot.
void updateScrollbars_() override
Updates the scroll bars.
void recalculateSnapFactor_() override
Recalculates the intensity scaling factor for 'snap to maximum intensity mode'.
DrawModes
Enumerate all available paint styles.
Definition: Plot1DCanvas.h:114
@ DM_PEAKS
draw data as peak
Definition: Plot1DCanvas.h:115
void showCurrentPeaksAsDIA()
Requests to display all spectra as DIA.
void showCurrentLayerPreferences() override
Shows the preferences dialog of the active layer.
void translateLeft_(Qt::KeyboardModifiers m) override
Translation bound to the 'Left' key.
bool mirrorModeActive() const
Returns whether this widget is currently in mirror mode.
void setIonLadderVisible(bool show)
void drawHighlightedPeak_(Size layer_index, const PeakIndex &peak, QPainter &painter, bool draw_elongation=false)
Draws a highlighted peak; if draw_elongation is true, the elongation line is drawn (for measuring)
void setTextBox(const QString &html)
Display a static text box on the top right.
void drawDeltas_(QPainter &painter, const PeakIndex &start, const PeakIndex &end)
Draws the coordinates (or coordinate deltas) to the widget's upper left corner.
bool draw_interesting_MZs_
annotate interesting peaks with m/z's
Definition: Plot1DCanvas.h:312
void flipLayer(Size index)
Flips the layer with index up/downwards.
void performAlignment(Size layer_index_1, Size layer_index_2, const Param ¶m)
bool isDrawInterestingMZs() const
Return true if interesting m/s are annotated.
std::vector< std::pair< Size, Size > > aligned_peaks_indices_
Stores the peak indices of pairs of aligned peaks in both spectra.
Definition: Plot1DCanvas.h:304
std::vector< Qt::PenStyle > peak_penstyle_
Draw style (for each layer)
Definition: Plot1DCanvas.h:285
void addLabelAnnotation_(const QPoint &screen_position, const QString &label_text)
Adds an annotation item at the given screen position.
void paint(QPainter *paint_device, QPaintEvent *e)
Actual painting takes place here.
void intensityModeChange_() override
This method is called whenever the intensity mode changes. Reimplement if you need to react on such c...
void updatePercentageFactor_(Size layer_index)
Recalculates the current scale factor based on the specified layer (= 1.0 if intensity mode !...
void changeVisibleArea_(double lo, double hi, bool repaint=true, bool add_to_stack=false)
Changes visible area interval.
double getAlignmentScore() const
Returns the score of the alignment.
void activateLayer(Size layer_index) override
void translateRight_(Qt::KeyboardModifiers m) override
Translation bound to the 'Right' key.
void updateLayer(Size i) override
void contextMenuEvent(QContextMenuEvent *e) override
PointType widgetToData(double x, double y, bool percentage=false)
Calls PlotCanvas::widgetToData_(), takes mirror mode into account.
void addUserLabelAnnotation_(const QPoint &screen_position)
Shows dialog and calls addLabelAnnotation_.
void setDrawMode(DrawModes mode)
Sets draw mode of the current layer.
QTextDocument text_box_content_
Definition: Plot1DCanvas.h:327
void showCurrentPeaksAs3D()
Requests to display all spectra in 3D plot.
bool moving_annotations_
Indicates whether annotation items are just being moved on the canvas.
Definition: Plot1DCanvas.h:293
void drawAlignment_(QPainter &painter)
Draws the alignment on painter.
bool addChromLayer(ExperimentSharedPtrType chrom_exp_sptr, ODExperimentSharedPtrType ondisc_sptr, OSWDataSharedPtrType chrom_annotation, const int index, const String &filename, const String &caption, const bool multiple_select)
void zoom_(int x, int y, bool zoom_in) override
docu in base class
void paintGridLines_(QPainter &painter) override
Helper function to paint grid lines.
void ensureAnnotationsWithinDataRange_()
Ensure that all annotations are within data range.
PointType widgetToData(const QPoint &pos, bool percentage=false)
For convenience - calls widgetToData.
Annotation1DItem * addPeakAnnotation(const PeakIndex &peak_index, const QString &text, const QColor &color)
—– Annotations
void dataToWidget(const PeakType &peak, QPoint &point, bool flipped=false, bool percentage=true)
For convenience - calls dataToWidget.
Size alignment_layer_1_
Layer index of the first alignment layer.
Definition: Plot1DCanvas.h:298
bool is_swapped_
is this widget showing data with swapped m/z and RT axis? (for drawCoordinates_ only)
Definition: Plot1DCanvas.h:308
bool mirror_mode_
Indicates whether this widget is currently in mirror mode.
Definition: Plot1DCanvas.h:290
Size getAlignmentSize()
Returns the number of aligned pairs of peaks.
Size alignment_layer_2_
Layer index of the second alignment layer.
Definition: Plot1DCanvas.h:300
void dataToWidget(double x, double y, QPoint &point, bool flipped=false, bool percentage=false)
Calls PlotCanvas::dataToWidget_(), takes mirror mode into account.
void saveCurrentLayer(bool visible) override
Saves the current layer data.
void paintEvent(QPaintEvent *e) override
bool flippedLayersExist()
Returns whether flipped layers exist or not.
void changeVisibleArea_(const AreaType &new_area, bool repaint=true, bool add_to_stack=false) override
Sets the visible area.
void resetAlignment()
Resets alignment_.
void setVisibleArea(DRange< 2 > range)
Sets the visible area.
Base class for visualization canvas classes.
Definition: PlotCanvas.h:138
LayerDataBase::OSWDataSharedPtrType OSWDataSharedPtrType
Definition: PlotCanvas.h:151
LayerDataBase::ExperimentSharedPtrType ExperimentSharedPtrType
Main managed data type (experiment)
Definition: PlotCanvas.h:148
LayerDataBase::ODExperimentSharedPtrType ODExperimentSharedPtrType
Definition: PlotCanvas.h:150
A more convenient string class.
Definition: String.h:60
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
Index of a peak or feature.
Definition: PeakIndex.h:51