35 #ifndef OPENMS_VISUAL_SPECTRUM1DCANVAS_H 36 #define OPENMS_VISUAL_SPECTRUM1DCANVAS_H 39 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> 44 #include <QTextDocument> 102 virtual void showCurrentLayerPreferences();
105 virtual void saveCurrentLayer(
bool visible);
108 bool flippedLayersExist();
111 void flipLayer(
Size index);
114 bool mirrorModeActive();
117 void setMirrorModeActive(
bool b);
120 void dataToWidget(
const PeakType & peak, QPoint & point,
bool flipped =
false,
bool percentage =
true);
123 void dataToWidget(
double x,
double y, QPoint & point,
bool flipped =
false,
bool percentage =
false);
126 PointType widgetToData(
const QPoint & pos,
bool percentage =
false);
129 PointType widgetToData(
double x,
double y,
bool percentage =
false);
132 void setTextBox(
const QString& html);
140 void drawAnnotations(
Size layer_index, QPainter & painter);
145 void performAlignment(
Size layer_index_1,
Size layer_index_2,
const Param & param);
148 void resetAlignment();
151 void drawAlignment(QPainter & painter);
154 Size getAlignmentSize();
157 double getAlignmentScore();
160 std::vector<std::pair<Size, Size> > getAlignedPeaksIndices();
163 void activateSpectrum(
Size index,
bool repaint =
true);
166 void setSwappedAxis(
bool swapped);
169 void setCurrentLayerPeakPenStyle(Qt::PenStyle ps);
172 void paint(QPainter * paint_device, QPaintEvent * e);
175 void showCurrentPeaksAs2D();
177 void showCurrentPeaksAs3D();
181 void activateLayer(
Size layer_index);
183 void removeLayer(
Size layer_index);
185 virtual void updateLayer(
Size i);
195 virtual void horizontalScrollBarChange(
int value);
200 void currentLayerParamtersChanged_();
204 bool finishAdding_();
207 void drawCoordinates_(QPainter & painter,
const PeakIndex & peak);
216 void changeVisibleArea_(
double lo,
double hi,
bool repaint =
true,
bool add_to_stack =
false);
219 void drawHighlightedPeak_(
Size layer_index,
const PeakIndex & peak, QPainter & painter,
bool draw_elongation =
false);
222 void drawDashedLine_(
const QPoint & from,
const QPoint & to, QPainter & painter);
225 void updatePercentageFactor_(
Size layer_index);
237 virtual void changeVisibleArea_(
const AreaType & new_area,
bool repaint =
true,
bool add_to_stack =
false);
239 virtual void recalculateSnapFactor_();
241 virtual void updateScrollbars_();
243 virtual void intensityModeChange_();
278 void addUserLabelAnnotation_(
const QPoint & screen_position);
280 void addLabelAnnotation_(
const QPoint & screen_position, QString label_text);
282 void addUserPeakAnnotation_(
PeakIndex near_peak);
285 void ensureAnnotationsWithinDataRange_();
291 void paintEvent(QPaintEvent * e);
292 void mousePressEvent(QMouseEvent * e);
293 void mouseReleaseEvent(QMouseEvent * e);
294 void mouseMoveEvent(QMouseEvent * e);
295 void keyPressEvent(QKeyEvent * e);
296 void contextMenuEvent(QContextMenuEvent * e);
300 virtual void zoomForward_();
302 virtual void zoom_(
int x,
int y,
bool zoom_in);
304 virtual void translateLeft_(Qt::KeyboardModifiers m);
306 virtual void translateRight_(Qt::KeyboardModifiers m);
308 virtual void paintGridLines_(QPainter & painter);
An abstract class acting as an interface for the different 1D annotation items.
Definition: Annotation1DItem.h:60
bool moving_annotations_
Indicates whether annotation items are just being moved on the canvas.
Definition: Spectrum1DCanvas.h:256
QTextDocument text_box_content_
Definition: Spectrum1DCanvas.h:287
std::vector< DrawModes > draw_modes_
Draw modes (for each spectrum)
Definition: Spectrum1DCanvas.h:246
Size alignment_layer_2_
Layer index of the second alignment layer.
Definition: Spectrum1DCanvas.h:263
LabelMode
Label modes (percentage or absolute) of x axis and y axis.
Definition: Spectrum1DCanvas.h:75
DrawModes
Enumerate all available paint styles.
Definition: Spectrum1DCanvas.h:89
Definition: Spectrum1DCanvas.h:91
Definition: Spectrum1DCanvas.h:77
Base class for visualization canvas classes.
Definition: SpectrumCanvas.h:96
std::vector< Qt::PenStyle > peak_penstyle_
Draw style.
Definition: Spectrum1DCanvas.h:248
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
bool is_swapped_
is this widget showing data with swapped m/z and RT axis? (for drawCoordinates_ only) ...
Definition: Spectrum1DCanvas.h:272
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
bool show_alignment_
Indicates whether an alignment is currently visualized.
Definition: Spectrum1DCanvas.h:259
Size alignment_layer_1_
Layer index of the first alignment layer.
Definition: Spectrum1DCanvas.h:261
bool mirror_mode_
Indicates whether this widget is currently in mirror mode.
Definition: Spectrum1DCanvas.h:253
Canvas for visualization of one or several spectra.
Definition: Spectrum1DCanvas.h:68
Management and storage of parameters / INI files.
Definition: Param.h:75
double alignment_score_
Stores the score of the last alignment.
Definition: Spectrum1DCanvas.h:270
Definition: Spectrum1DCanvas.h:79
QPoint measurement_start_point_
start point of "ruler" for measure mode
Definition: Spectrum1DCanvas.h:251
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
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: Spectrum1DCanvas.h:265
std::vector< std::pair< Size, Size > > aligned_peaks_indices_
Stores the peak indices of pairs of aligned peaks in both spectra.
Definition: Spectrum1DCanvas.h:267
Definition: Spectrum1DCanvas.h:78
Index of a peak or feature.
Definition: PeakIndex.h:51