keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/FilterList.h
.h
1,838
69
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/PROCESSING/MISC/DataFilters.h> #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QWidget> namespace Ui { class FilterList; } class QListWidgetItem; namespace OpenMS { namespace Internal { /** @brief A widget which shows a list of DataFilter items. Filters can be added, edited and removed. A checkbox allows to switch them all on/off. */ class FilterList : public QWidget { Q_OBJECT public: /// C'tor explicit FilterList(QWidget* parent); ~FilterList() override; public slots: /// provide new filters to the widget /// does invoke the 'filterChanged' signal void set(const DataFilters& filters); signals: /// emitted when the user has edited/added/removed a filter void filterChanged(const DataFilters& filters); private slots: /// the user wants to edit a filter (by double-clicking it) /// emits 'filterChanged' signal if filter was modified void filterEdit_(QListWidgetItem* item); /// right-clicking on the QListWidget 'filter' will call this slot void customContextMenuRequested_(const QPoint &pos); private: Ui::FilterList *ui_; DataFilters filters_; ///< internal representation of filters }; } // ns Internal } // ns OpenMS // this is required to allow parent widgets (auto UIC'd from .ui) to have a FilterList member using FilterList = OpenMS::Internal::FilterList;
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TVToolDiscovery.h
.h
4,485
128
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: David Voigt $ // $Authors: David Voigt $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <future> #include <map> #include <OpenMS/DATASTRUCTURES/Param.h> #include <OpenMS/DATASTRUCTURES/ListUtils.h> namespace OpenMS { /** @brief Scans for tools and generates a param for each asynchronously. @details All tools listed in the ToolHandler class are considered. @code TVToolDiscovery scanner; scanner.loadToolParams(); // Do something else before explicitly waiting for the threads to finish ... // Wait when convenient. Keeps the GUI responsive while waiting scanner.waitForToolParams(); // Access the params. If no special timing for waiting or loading is needed this function can be safely called directly. scanner.getToolParams(); @endcode */ class OPENMS_GUI_DLLAPI TVToolDiscovery { public: TVToolDiscovery() : plugin_path_() {}; TVToolDiscovery(const TVToolDiscovery&) = delete; TVToolDiscovery& operator=(const TVToolDiscovery&) = delete; ~TVToolDiscovery() = default; /// Start creating params for each tool/util asynchronously void loadToolParams(); /** @brief Wait for all future params to finish evaluating. @details While waiting the GUI remains responsive. After waiting it is safe to access the params without further waiting. */ void waitForToolParams(); void waitForPluginParams(); /** @brief Returns a Param object containing the params for each tool/util. @details Note that it is possible that not all param futures have been finished (or loaded) yet if this function is called. In that case, the function starts param parsing (loadParam()) and waits for completion (waitForToolParams()) before returning the result. */ const Param& getToolParams(); /** @brief Returns a param containing the params for each plugin. @details This function will ALWAYS trigger a reload of the plugins. */ const Param& getPluginParams(); /// Returns the list of read plugin names as saved in the ini. const std::vector<std::string>& getPlugins(); /** * @brief Sets the path that will be searched for Plugins * @param[in] path The new path to set * @param[in] create Attempt to create the directory if it does not already exist * @returns False if setting/creating the path fails. True otherwise. */ [[maybe_unused]] bool setPluginPath(const String& path, bool create=false); /// set the verbosity level of the tool discovery for debug purposes void setVerbose(int verbosity_level); /// Returns the current set path to search plugins in const std::string getPluginPath(); /// Returns the path to the plugin executable or an empty string if the plugin name is unknown std::string findPluginExecutable(const std::string& name); private: /** Returns param for a given tool/util. This function is thread-safe. Additionally inserts names of tools into plugin list */ static Param getParamFromIni_(const String& tool_path, bool plugins=false); /** Start creating params for each plugin in the set plugin path asynchronously * This should only be called from waitForPluginParams() or the names in the plugins vector are not correct */ void loadPluginParams(); /// Returns a list of executables that are found at the plugin path const StringList getPlugins_(); /// The filepath to search pugins in std::string plugin_path_; /// The futures for asyncronous loading of the tools and plugins std::vector<std::future<Param>> tool_param_futures_; std::vector<std::future<Param>> plugin_param_futures_; /// Contains all the params of the tools/utils Param tool_params_; /// Contains all the params of the plugins Param plugin_params_; /// The names of all loaded plugins, this is used to add the plugins to the list in the ToolsDialog std::vector<std::string> plugins_; /// Set to value > 0 to output tool discovery debug information int verbosity_level_ = 0; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASOutputFolderVertex.h
.h
1,162
41
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASOutputVertex.h> namespace OpenMS { /** @brief A vertex representing an output folder @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASOutputFolderVertex : public TOPPASOutputVertex { Q_OBJECT public: virtual std::unique_ptr<TOPPASVertex> clone() const override; /// returns "OutputFolderVertex" String getName() const override; // documented in base class void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) override; // documented in base class QRectF boundingRect() const override; /// Called when the parent node has finished execution void run() override; }; } //namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TVDIATreeTabController.h
.h
1,263
46
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/METADATA/SpectrumSettings.h> #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/TVControllerBase.h> #include <vector> namespace OpenMS { class TOPPViewBase; class Plot1DWidget; struct MiniLayer; struct OSWIndexTrace; /** @brief Behavior of TOPPView in spectra view mode. */ class TVDIATreeTabController : public TVControllerBase { Q_OBJECT public: /// Construct the behaviour with its parent TVDIATreeTabController(TOPPViewBase* parent); public slots: /// shows all transitions from the given subtree virtual void showChromatograms(const OSWIndexTrace& trace); /// shows all transitions from the given subtree in a new 1D canvas virtual void showChromatogramsAsNew1D(const OSWIndexTrace& trace); private: bool showChromatogramsInCanvas_(const OSWIndexTrace& trace, MiniLayer& ml, Plot1DWidget* w); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/Plot3DOpenGLCanvas.h
.h
7,083
217
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Cornelia Friedle $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QOpenGLWidget> #include <QOpenGLFunctions_2_0> // OpenMS #include <OpenMS/DATASTRUCTURES/DRange.h> namespace OpenMS { class Plot3DCanvas; class LayerDataBase; /** @brief OpenGL Canvas for 3D-visualization of map data @note Do not use this class directly. Use Plot3DCanvas instead! @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI Plot3DOpenGLCanvas : public QOpenGLWidget, protected QOpenGLFunctions_2_0 { Q_OBJECT friend class Plot3DCanvas; public: /// Container for axis ticks typedef std::vector<std::vector<double> > AxisTickVector; /** @brief Constructor @param[in] parent The parent widget @param[in] canvas_3d The main 3d canvas */ Plot3DOpenGLCanvas(QWidget * parent, Plot3DCanvas & canvas_3d); /** @brief Destructor Destroys the OpenGLWidget and all associated data. */ ~Plot3DOpenGLCanvas() override; ///virtual function provided from QGLWidget void initializeGL() override; /// virtual function provided from QGLWidget void resizeGL(int w, int h) override; /// virtual function provided from QGLWidget void paintGL() override; /** @name Reimplemented QT events */ //@{ void mouseMoveEvent(QMouseEvent * e) override; void mouseReleaseEvent(QMouseEvent * e) override; void mousePressEvent(QMouseEvent * e) override; void focusOutEvent(QFocusEvent * e) override; //@} void setXLabel(const QString& l) { x_label_ = l; } void setYLabel(const QString& l) { y_label_ = l; } void setZLabel(const QString& l) { z_label_ = l; } /// updates the min and max values of the intensity void updateIntensityScale(); protected: /// helper function to project point to device space GLint project_(GLdouble objx, GLdouble objy, GLdouble objz, GLdouble * winx, GLdouble * winy); /// helper function to transform point using matrix m (homogeneous coordinates) void transformPoint_(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]); ///helper function to replicate old behaviour of QGLWidget void renderText_(double x, double y, double z, const QString & text); ///helper function to replicate old behaviour of QGLWidget void qglColor_(const QColor& color); ///helper function to replicate old behaviour of QGLWidget void qglClearColor_(const QColor& clearColor); /// Builds up a display list for the 3D view GLuint makeDataAsStick_(); /// Builds up a display list for the axes GLuint makeAxes_(); /// Builds up a display list for axis ticks GLuint makeAxesTicks_(); /// Builds up a display list for the birds-eye view GLuint makeDataAsTopView_(); /// Builds up a display list for the background GLuint makeGround_(); /// Builds up a display list for grid lines GLuint makeGridLines_(); /// Draws the axis texts void drawAxesLegend_(); /// computes the dataset supposed to be drawn when a section has been selected in zoom mode void computeSelection_(); /// calculates the zoom area , which is shown void dataToZoomArray_(double x_1, double y_1, double x_2, double y_2); /// returns the BB-rt-coordinate : value --> BB-coordinates double scaledRT_(double rt); /// returns the rt-value : BB-coordinates --> value double scaledInversRT_(double mz); /// returns the BB-mz-coordinate : values --> BB-coordinates double scaledMZ_(double mz); /// returns the mz-value : BB-coordinates --> value double scaledInversMZ_(double mz); /// returns the BB-intensity -coordinate : values --> BB-coordinates double scaledIntensity_(float intensity, Size layer_index); /// recalculates the dot gradient interpolation values. void recalculateDotGradient_(LayerDataBase& layer); ///calculate the ticks for the gridlines void calculateGridLines_(); /// normalize the angle by "angle % 360*16" void normalizeAngle(int* angle); // set translation vector to 0 void resetTranslation(); /// stores the original rotation and zoom factor (e.g. before changing into zoom mode) void storeRotationAndZoom(); /// restores the original rotation and zoom factor (e.g. before changing into zoom mode) void restoreRotationAndZoom(); /** @name Different OpenGL display lists */ //@{ GLuint stickdata_; GLuint axes_; GLuint axes_ticks_; GLuint gridlines_; GLuint ground_; //@} /// reference to Plot3DCanvas Plot3DCanvas & canvas_3d_; /// member x-variables for the rotation int xrot_; /// member y-variables for the rotation int yrot_; /// member z-variables for the rotation int zrot_; /// member x-variable that stores the original angle during zoom mode int xrot_tmp_; /// member y-variable that stores the original angle during zoom mode int yrot_tmp_; /// member z-variable that stores the original angle during zoom mode int zrot_tmp_; QPainter* painter_ = nullptr; /// member variables for the zoom-mode QPoint mouse_move_end_, mouse_move_begin_; ///member variable for the x and y axis of the BB double corner_; /// member variable for the zoom mode double zoom_; /// member variable that stores original zoom factor during zoom mode double zoom_tmp_; /// member variable for the z- axis of the BB double near_; /// member variable for the z- axis of the BB double far_; /// the width of the viewport float width_; /// the height of the viewport float height_; /// object which contains the min and max values of mz, rt and intensity DRange<3> overall_values_; ///object which contains the values of the current min and max intensity DRange<1> int_scale_; ///member gridvectors which contains the data for the mz-axis-ticks AxisTickVector grid_mz_; ///member gridvectors which contains the data for the rt-axis-ticks AxisTickVector grid_rt_; ///member gridvectors which contains the data for the intensity-axis-ticks AxisTickVector grid_intensity_; /// x1 coordinate of the zoomselection double x_1_; /// x2 coordinate of the zoomselection double x_2_; /// y1 coordinate of the zoomselection double y_1_; /// y2 coordinate of the zoomselection double y_2_; /// x- translation double trans_x_; /// y_translation double trans_y_; QString x_label_; QString y_label_; QString z_label_; protected slots: /// Slot that reacts on action mode changes void actionModeChange(); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/EnhancedTabBar.h
.h
2,755
89
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //QT #include <QTabBar> class QMouseEvent; class QMimeData; namespace OpenMS { class String; /** @brief Convenience tab bar implementation This tab bar differs in several ways form the QTabBar: - you can close a tab by double-clicking it or through its context menu. - it works based on tab identifiers (a fixed id stored in tab data) rather than on tab indices, which might change when inserting or removing a tab. - it accepts all drag-and-drop actions and emits signals to handle them. @ingroup Visual */ class OPENMS_GUI_DLLAPI EnhancedTabBar : public QTabBar { Q_OBJECT public: /// Constructor EnhancedTabBar(QWidget * parent = nullptr); /// Destructor ~EnhancedTabBar() override; /// sets the text of the current tab void setTabText(const QString& text); /// Adds a new tab with the name @p text and the identifier @p id int addTab(const String & text, int id); /// Selects the tab with identifier @p id void show(int id); public slots: /// Remove the tab with identifier @p id void removeId(int id); signals: /// Signal that indicates that the current tab changed, giving the @p id of the Tab void currentIdChanged(int id); /// Signal that indicates that the tab with identifier @p id is requested to be removed (double click or context menu) void closeRequested(int id); /// Signal that is emitted, when a drag-and-drop action ends on a tab void dropOnTab(const QMimeData * data, QWidget * source, int id); /// Signal that is emitted, when a drag-and-drop action ends on the unused space on the right side of the tabs. void dropOnWidget(const QMimeData * data, QWidget * source); protected: ///@name Reimplemented Qt events //@{ void mouseDoubleClickEvent(QMouseEvent * e) override; void contextMenuEvent(QContextMenuEvent * e) override; void dragEnterEvent(QDragEnterEvent * e) override; void dropEvent(QDropEvent * e) override; //@} /// Returns the QTabBar index of the tab at position @p pos. If there is no tab at that position -1 is returned. int tabAt_(const QPoint & pos); protected slots: /// Slot that translates the currentChanged(int) signal to currentIdChanged(int) void currentChanged_(int id); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerListView.h
.h
1,480
58
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/KERNEL/StandardTypes.h> #include <QtWidgets/QListWidget> namespace OpenMS { class PlotWidget; /** @brief Pimped QListView for Layers of a Canvas */ class OPENMS_GUI_DLLAPI LayerListView : public QListWidget { Q_OBJECT public: /// Default constructor LayerListView(QWidget* parent); /// rebuild list of layers and remember current widget (for context menu etc) void update(PlotWidget* active_widget); signals: /// emitted whenever a change to a layer happened, e.g. its name was changed, it was removed, or a new layer was selected void layerDataChanged(); private: /// active row was changed by user to new row @p i void currentRowChangedAction_(int i); void itemChangedAction_(QListWidgetItem* item); void contextMenuEvent(QContextMenuEvent* event) override; /// show preferences dialog void itemDoubleClickedAction_(QListWidgetItem*); PlotWidget* spectrum_widget_ = nullptr; ///< holds the actual data. Might be nullptr. }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASMergerVertex.h
.h
2,588
76
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASVertex.h> namespace OpenMS { /** @brief A special vertex that allows to merge several inputs. A special vertex that allows to merge several inputs. Mergers have two modes: The normal, round-based merging mode and a "wait & merge all" mode. In round-based mode, a merger first takes the first files of each incoming file list and merges them into a list (which has as many elements as the merger has incoming edges). In "wait & merge all" mode, the merger first waits for all upstream mergers to finish all their merging rounds and then merges all collected files from all merging rounds for all incoming edges into one single list and calls the next tool with this list of files as input. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASMergerVertex : public TOPPASVertex { Q_OBJECT public: /// Default constructor TOPPASMergerVertex() = default; /// Constructor TOPPASMergerVertex(bool round_based); /// Copy constructor TOPPASMergerVertex(const TOPPASMergerVertex& rhs) = default; /// Destructor ~TOPPASMergerVertex() override = default; /// Assignment operator TOPPASMergerVertex& operator=(const TOPPASMergerVertex& rhs) = default; virtual std::unique_ptr<TOPPASVertex> clone() const override; /// returns "MergerVertex" String getName() const override; /// check if upstream nodes are finished and call downstream nodes void run() override; /// Determines whether this merger is merging round based or merging all inputs into one list bool roundBasedMode() const; // documented in base class void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; // documented in base class QRectF boundingRect() const override; // documented in base class void markUnreachable() override; public slots: signals: /// Emitted when merging upstream data failed void mergeFailed(const QString message); protected: /// Stores whether this merger is merging round based or merging all inputs into one list bool round_based_mode_{true}; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerDataIonMobility.h
.h
3,037
91
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/LayerData1DBase.h> #include <OpenMS/KERNEL/Mobilogram.h> namespace OpenMS { /** @brief Class that stores the data for one layer of type IonMobility FIXME: currently we only store a single mobilogram, since this is what is required to show a projection in 2D View. If there is another application, feel free to implement a surrounding container (don't use vector<Mobilogram>, do it properly! :)). @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI LayerDataIonMobility : public virtual LayerDataBase { public: using PeakType = Mobilogram::PeakType; /// Default constructor LayerDataIonMobility(); /// Copy-ctor LayerDataIonMobility(const LayerDataIonMobility& ld); /// no assignment operator (should not be needed) LayerDataIonMobility& operator=(const LayerDataIonMobility& ld) = delete; std::unique_ptr<Painter2DBase> getPainter2D() const override; std::unique_ptr<LayerData1DBase> to1DLayer() const override; std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; ProjectionData getProjection(const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType& area) const override; PeakIndex findHighestDataPoint(const RangeAllType& /*area*/) const override { // todo: not implemented return PeakIndex(); } void updateRanges() override { single_mobilogram_.updateRanges(); // on_disc_peaks->updateRanges(); // note: this is not going to work since its on disk! We currently don't have a good way to access these ranges } RangeAllType getRange() const override { RangeAllType r; r.assign(single_mobilogram_); return r; } // for now, only a single Mobilogram. See class description. void setMobilityData(const Mobilogram& mobilogram) { single_mobilogram_ = mobilogram; } const Mobilogram& getMobilogram(Size index) const { if (index != 0) throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Only one mobilogram possible atm.", String(index)); return single_mobilogram_; } PointXYType peakIndexToXY(const PeakIndex& peak, const DimMapper<2>& mapper) const override; String getDataArrayDescription(const PeakIndex& peak_index) override; std::unique_ptr<LayerStatistics> getStats() const override; protected: Mobilogram single_mobilogram_; ///< a single mobilogram (for now) -- see class description }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/OutputDirectory.h
.h
1,605
66
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QWidget> namespace Ui { class OutputDirectoryTemplate; } namespace OpenMS { /** @brief A simple widget with a line-edit and a browse button to choose filenames @ingroup TOPPAS_elements @ingroup Dialogs */ class OPENMS_GUI_DLLAPI OutputDirectory : public QWidget { Q_OBJECT public: /// Constructor OutputDirectory(QWidget* parent); /// Destructor ~OutputDirectory(); /// Sets the text in the line-edit void setDirectory(const QString& dir); /// return the directory currently set (does not need to be valid) QString getDirectory() const; /// check if the current directory exists and is writeable bool dirNameValid() const; signals: /// emitted whenever the outputdirectory is changed (also when setDirectory() is used) void directoryChanged(const QString& dir); public slots: /// Lets the user select the file via a file dialog void showFileDialog(); private slots: /// forward internal textEdit::textChanged to directoryChanged signal void textEditChanged_(const QString& new_text); private: Ui::OutputDirectoryTemplate* ui_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASToolVertex.h
.h
9,048
260
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASVertex.h> #include <OpenMS/DATASTRUCTURES/Param.h> #include <OpenMS/DATASTRUCTURES/ListUtils.h> #include <QtCore/QVector> namespace OpenMS { class TOPPASScene; /** @brief A vertex representing a TOPP tool Besides TOPPASScene, this class contains most of the remaining functionality of TOPPAS regarding the execution of pipelines. Once a pipeline run is started from TOPPASScene, the execution is propagated from tool to tool and the TOPP tools are actually called from here. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASToolVertex : public TOPPASVertex { Q_OBJECT public: /// current status of the vertex enum TOOLSTATUS {TOOL_READY, TOOL_SCHEDULED, TOOL_RUNNING, TOOL_SUCCESS, TOOL_CRASH, TOOLSTATUS_SIZE}; /// Stores the information for input/output files/lists struct IOInfo { /// Standard constructor IOInfo() : type(IOT_FILE), param_name(), valid_types() { } /// Copy constructor IOInfo(const IOInfo& rhs) : type(rhs.type), param_name(rhs.param_name), valid_types(rhs.valid_types) { } /// The type enum IOType { IOT_FILE, IOT_LIST, IOT_DIR ///< output directory }; /// Comparison operator bool operator<(const IOInfo& rhs) const { if (type != rhs.type) { return type == IOT_FILE; } else { return param_name.compare(rhs.param_name) < 0; } } /// Comparison operator bool operator==(const IOInfo& rhs) const { return type == rhs.type && param_name == rhs.param_name; } /// Assignment operator IOInfo& operator=(const IOInfo& rhs) { type = rhs.type; param_name = rhs.param_name; valid_types = rhs.valid_types; return *this; } /// Is any of the input/output parameters a list? static bool isAnyList(const QVector<IOInfo>& params) { for (const auto& p : params) { if (p.type == IOT_LIST) return true; } return false; } ///The type of the parameter IOType type; ///The name of the parameter String param_name; ///The valid file types for this parameter StringList valid_types; }; /// Default constructor TOPPASToolVertex(); /// Constructor TOPPASToolVertex(const String& name, const String& type = ""); /// Copy constructor TOPPASToolVertex(const TOPPASToolVertex& rhs); /// Destructor ~TOPPASToolVertex() override = default; /// Assignment operator TOPPASToolVertex& operator=(const TOPPASToolVertex& rhs); virtual std::unique_ptr<TOPPASVertex> clone() const override; /// returns the name of the TOPP tool String getName() const override; /// Returns the type of the tool const String& getType() const; /// Returns input file/list parameters together with their valid types. QVector<IOInfo> getInputParameters() const; /// Returns output file/list/dir parameters together with their valid types. QVector<IOInfo> getOutputParameters() const; // documented in base class void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; // documented in base class QRectF boundingRect() const override; // documented in base class void setTopoNr(UInt nr) override; // documented in base class void reset(bool reset_all_files = false) override; /// Sets the Param object of this tool void setParam(const Param& param); /// Returns the Param object of this tool const Param& getParam(); /// Checks if all parent nodes have finished the tool execution and, if so, runs the tool void run() override; /// Updates the vector containing the lists of current output files for all output parameters /// using the input files as guidance /// Returns true on success, on failure the error_message is filled bool updateCurrentOutputFileNames(const RoundPackages& pkg, String& error_message); /// return if tool failed or is ready etc. TOOLSTATUS getStatus() const; /// Lets the user edit the parameters of the tool void editParam(); /// Returns the number of iterations this tool has to perform int numIterations(); /// Returns the full directory (including preceding tmp path) String getFullOutputDirectory() const; /// Returns the directory where this tool stores its output files String getOutputDir() const; /// Creates all necessary directories void createDirs(); /// Opens the folder where the file is contained void openContainingFolder() const; /// Opens the files in TOPPView void openInTOPPView(); /// Refreshes the parameters of this tool, returns if their has been a change bool refreshParameters(); /// underlying TOPP tool found and parameters fetched?! (done in C'Tor) bool isToolReady() const; /// Toggle breakpoint void toggleBreakpoint(); /// Called when the QProcess in the queue is called: emits 'toolStarted()' virtual void emitToolStarted(); /// invert status of recycling (overriding base class) bool invertRecylingMode() override; public slots: /// Called when the execution of this tool has finished void executionFinished(int ec, QProcess::ExitStatus es); /// Called when the running TOPP tool produces output void forwardTOPPOutput(); /// Called when the tool is started void toolStartedSlot(); /// Called when the tool has finished void toolFinishedSlot(); /// Called when the tool has crashed void toolCrashedSlot(); /// Called when the tool has failed void toolFailedSlot(); /// Called when the tool was scheduled for running virtual void toolScheduledSlot(); /// Called by an incoming edge when it has changed void inEdgeHasChanged() override; /// Called by an outgoing edge when it has changed void outEdgeHasChanged() override; signals: /// Emitted when the tool is started void toolStarted(); /// Emitted when the tool is finished void toolFinished(); /// Emitted when the tool crashes void toolCrashed(); /// Emitted when the tool execution fails void toolFailed(int return_code = -1, const QString& message = ""); /// Emitted from forwardTOPPOutput() to forward the signal outside void toppOutputReady(const QString& out); protected: ///@name reimplemented Qt events //@{ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e) override; //@} /// get parent Scene TOPPASScene* getScene_() const; /// determines if according to current status_, a parameter change would invalidate the pipeline status (e.g., because this node was already processed) bool doesParamChangeInvalidate_(); /// renames SUFFICES of the output files created by the TOPP tool by inspecting file content bool renameOutput_(); /// Initializes the parameters with standard values (from -write_ini), uses the parameters from the old_ini_file if given, returns if parameters have changed (if old_ini_file was given) bool initParam_(const QString& old_ini_file = ""); /// returns input/output file/list parameters. If @p input_params is true, input params are returned, otherwise output params. QVector<IOInfo> getParameters_(bool input_params) const; /// Writes @p param to the @p ini_file void writeParam_(const Param& param, const QString& ini_file); /// Helper method for finding good boundaries for wrapping the tool name. Returns a string with whitespaces at the preferred boundaries. QString toolnameWithWhitespacesForFancyWordWrapping_(QPainter* painter, const QString& str); /// smart naming of round-based filenames /// when basename is not unique we take the preceding directory name void smartFileNames_(std::vector<QStringList>& filenames); /// The name of the tool String name_; /// The type of the tool, or "" if it does not have a type String type_; /// The temporary path String tmp_path_; /// The parameters of the tool Param param_; /// current status of the tool TOOLSTATUS status_{TOOL_READY}; /// tool initialization status: if C'tor was successful in finding the TOPP tool, this is set to 'true' bool tool_ready_{true}; /// Breakpoint set? bool breakpoint_set_{false}; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TableView.h
.h
5,852
130
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <QTableWidget> #include <OpenMS/VISUAL/MISC/CommonDefs.h> namespace OpenMS { /** @brief A better QTable for TOPPView, which supports exporting to TSV and conveniently adding data to cells and headers. */ class TableView : public QTableWidget { Q_OBJECT public: /// Constructor TableView(QWidget* parent = nullptr); /// Destructor ~TableView() override = default; /** @brief Export table entries as currently shown in the table in TSV format (only for visible data) A filename will be queried using a dialog, before exporting. Headers will be exported using their export name (if available, see @p setHeaderExportName()). All cells will be queried for their Qt::UserRole, then for Qt::DisplayRole and last for Qt::CheckStateRole. The first item to return data will be used! Thus, to export data which differs from the visible (==DisplayRole), use QTableWidgetItem::setData(Qt::UserRole, ...). Note: to force export of hidden columns use @p setMandatoryExportColumns() */ virtual void exportEntries(); /// adds a new row to the bottom void appendRow(); QTableWidgetItem* setAtBottomRow(const QString& text, size_t column_index, const QColor& background, const QColor& foreground = QColor("SomeInvalidColor")); QTableWidgetItem* setAtBottomRow(const char* text, size_t column_index, const QColor& background, const QColor& foreground = QColor("SomeInvalidColor")); QTableWidgetItem* setAtBottomRow(const int i, size_t column_index, const QColor& background, const QColor& foreground = QColor("SomeInvalidColor")); QTableWidgetItem* setAtBottomRow(const double d, size_t column_index, const QColor& background, const QColor& foreground = QColor("SomeInvalidColor")); /// create a checkbox item (with no text) QTableWidgetItem* setAtBottomRow(const bool selected, size_t column_index, const QColor& background, const QColor& foreground = QColor("SomeInvalidColor")); /// create a custom item (if above methods are not sufficient) QTableWidgetItem* setAtBottomRow(QTableWidgetItem* item, size_t column_index, const QColor& background, const QColor& foreground); /// if the item is purely a checkbox (e.g. added with setAtBottomRow(const bool selected, ...)), /// we set its DisplayRole to either '' or ' ', depending on checked state, to allow for row sorting /// This function should be called whenever the check-state of the item changes static void updateCheckBoxItem(QTableWidgetItem* item); /// sets the visible headers (and the number of columns) void setHeaders(const QStringList& headers); /// hides columns with the given names /// @throws Exception::InvalidParameter if a name is not matching the current column names void hideColumns(const QStringList& header_names); /** @brief Obtain header names, either from all, or only the visible columns Headers can be obtained as shown (@p use_export_name = false) or for exporting to CSV where the alternative export name is preferred (if exists). See setHeaderExportName(). @param[in] which With or without invisible columns? @param[in] use_export_name If column has a hidden export name, use that instead of the displayed name @return List of header names */ QStringList getHeaderNames(const WidgetHeader which, bool use_export_name = false); /** @brief Set the export-name of a column, which will be returned in getHeaderNames() when @p use_export_name it true Export names are useful when exporting the table to CSV (see @p exportEntries()), and the column header should be a bit more verbose. Internally, this uses the Qt::UserRole's data to store the value. @param[in] header_column Index of column @param[in] export_name New export name to set @throws Exception::ElementNotFound if header at index @p header_column is not valid */ void setHeaderExportName(const int header_column, const QString& export_name); /** @brief Gets the export-name of a column. Export names are useful when exporting the table to CSV (see @p exportEntries()), and the column header should be a bit more verbose. Internally, this queries the Qt::UserRole's data to get the value. If the export name was not set (using @p setHeaderExportName()), it returns the display name. @param[in] header_column Index of column @throws Exception::ElementNotFound if header at index @p header_column is not valid */ QString getHeaderExportName(const int header_column); /// get the displayed name of the header in column with index @p header_column /// @throws Exception::ElementNotFound if header at index @p header_column is not valid QString getHeaderName(const int header_column); /// Set the mandatory export columns @p cols which get exported even if the user decided to hide them. void setMandatoryExportColumns(QStringList& cols); signals: /// emitted when the widget is resized void resized(); protected: /// emits the resized signal void resizeEvent(QResizeEvent* event) override; /// columns that are exported to tsv files even if they are hidden in the GUI QStringList mandatory_export_columns_; protected slots: /// Display header context menu; allows to show/hide columns void headerContextMenu_(const QPoint&); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/AxisWidget.h
.h
3,962
146
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> // QT #include <QtWidgets> class QPaintEvent; // OpenMS #include <OpenMS/CONCEPT/Types.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <OpenMS/MATH/MathFunctions.h> #include <OpenMS/VISUAL/AxisPainter.h> namespace OpenMS { /** @brief Widget that represents an axis of a graph. Additional to ticks and tick values a label e.g. the unit can be displayed. It supports both linear and logarithmic scale. @image html AxisWidget.png The above image shows a horizontal example axis. @ingroup Visual */ class OPENMS_GUI_DLLAPI AxisWidget : public QWidget { Q_OBJECT public: ///Type definitions //@{ ///Vector of vector of doubles that defines the grid typedef std::vector<std::vector<double> > GridVector; /// constructor AxisWidget(const AxisPainter::Alignment alignment, const char * legend = "", QWidget * parent = nullptr); /// destructor ~AxisWidget() override; /// sets the margin on the top/right side (default is 0) void setMargin(UInt size); /// returns the margin UInt margin() const; /// enable the display of the legend (default true) void showLegend(bool show_legend); /// returns true if legend is shown bool isLegendShown() const; /// sets the legend text void setLegend(const String & legend); /// returns the actual legend text const String & getLegend() const; /// returns the currently used grid lines const GridVector & gridLines() const; /// sets the axis to logarithmic scale void setLogScale(bool is_log); /// returns true if the axis has logarithmic scale bool isLogScale() const; /// set true to display the axis label in inverse order (left to right or bottom to top) void setInverseOrientation(bool inverse_orientation); /// returns if the axis label is displayed in inverse order bool hasInverseOrientation() const; /// set true to allow for shortened numbers (with k/M/G units) on the axis label void setAllowShortNumbers(bool short_nums); /// returns the minimum value displayed on the axis double getAxisMinimum() const; /// returns the maximum value displayed on the axis double getAxisMaximum() const; /// Actual painting takes place here void paint(QPainter * painter, QPaintEvent * e); public slots: ///sets min/max of the axis void setAxisBounds(double min, double max); /// set maximum number of tick levels ('1' or '2', default: '2') void setTickLevel(UInt level); protected: /// Vector that defines the position of the ticks/gridlines and the shown values on axis GridVector grid_line_; /// format of axis scale (linear or logarithmic) bool is_log_; /// display of legend enabled or not bool show_legend_; /// Position of the axis (right, left, top, down as defined in ALIGNMENT_ENUM) AxisPainter::Alignment alignment_; /// true if axis label are displayed in inverse order (left to right or bottom to top) bool is_inverse_orientation_; /// margin of axis UInt margin_; /// minimum value on the axis double min_; /// maximum value on the axis double max_; /// text/unit on axis String legend_; /// maximum number of tick levels (default=2) UInt tick_level_; /// true if k/M/G units can be used bool allow_short_numbers_; /// Reimplemented Qt event (calls paint with "this") void paintEvent(QPaintEvent *) override; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/Plot3DWidget.h
.h
1,678
70
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Cornelia Friedle $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/PlotWidget.h> #include <OpenMS/VISUAL/Plot3DCanvas.h> namespace OpenMS { class Plot3DCanvas; /** @brief Widget for 3D-visualization of map data @image html Plot3DWidget.png @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI Plot3DWidget : public PlotWidget { Q_OBJECT public: /// Constructor Plot3DWidget(const Param & preferences, QWidget * parent = nullptr); /// Destructor ~Plot3DWidget() override; // docu in base class Plot3DCanvas* canvas() const override { return static_cast<Plot3DCanvas*>(canvas_); } // Docu in base class void setMapper(const DimMapper<2>& /*mapper*/) override { // 3D widget currently only handles MSExperiment. That's it. throw Exception::NotImplemented(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); } // Docu in base class void recalculateAxes_() override; //docu in base class bool isLegendShown() const override; //docu in base class void showLegend(bool show) override; signals: /// Requests to display all spectra in 2D plot void showCurrentPeaksAs2D(); public slots: // Docu in base class void showGoToDialog() override; }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/PlotWidget.h
.h
7,439
215
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/CONCEPT/Types.h> #include <OpenMS/MATH/STATISTICS/Histogram.h> #include <OpenMS/VISUAL/EnhancedTabBarWidgetInterface.h> #include <OpenMS/VISUAL/PlotCanvas.h> class QCloseEvent; class QGridLayout; class QMimeData; class QScrollBar; namespace OpenMS { class AxisWidget; /** @brief Base class for spectrum widgets This class is the base class for the different MDI window types in the TOPPView application. For each type of spectrum view (such as 1D view, 2D view, 3D view etc.), there must exist a corresponding class derived from this class. In TOPPView, each PlotWidget holds an enclosed PlotCanvas with which it is paired (e.g. a Plot1DWidget holds a Plot1DCanvas) which can retrieved with the canvas() function. While the PlotCanvas does the actual drawing, the PlotWidget holds information about the axes (axis widgets), scrolling (scrollbars) etc. The PlotWidget uses a grid layout (QGridLayout) with a default 3x3 grid where the upper right corner of the grid is the canvas and the spaces left and below the canvas are for the axes widget and scrollbars. To integrate a new spectrum view (i.e. classes derived from PlotWidget and PlotCanvas) into the TOPPView application, a class must be derived from this class which holds an instance of the PlotCanvas class as a child widget. @todo Add support to store the displayed data as SVG image (HiWi) */ class OPENMS_GUI_DLLAPI PlotWidget : public QWidget, public EnhancedTabBarWidgetInterface { Q_OBJECT public: static const char RT_AXIS_TITLE[]; static const char MZ_AXIS_TITLE[]; static const char INTENSITY_AXIS_TITLE[]; static const char IM_MS_AXIS_TITLE[]; static const char IM_ONEKZERO_AXIS_TITLE[]; /** @name Type definitions */ //@{ /// Main data type (experiment) typedef LayerDataBase::ExperimentType ExperimentType; /// Main data type (features) typedef LayerDataBase::FeatureMapType FeatureMapType; /// Spectrum type typedef ExperimentType::SpectrumType SpectrumType; //@} /// Default constructor PlotWidget(const Param & preferences, QWidget * parent = nullptr); /// Destructor ~PlotWidget() override; /** @brief Returns a pointer to canvas object This method is overwritten for 1D, 2D, 3D to make the class specific members accessible. The canvas object is set with the setCanvas_() method. This is usually done in the constructor. */ virtual PlotCanvas* canvas() const = 0; /// Returns a pointer to the x-axis axis widget. virtual inline AxisWidget * xAxis() { return x_axis_; } /// Returns a pointer to the y-axis axis widget. virtual inline AxisWidget * yAxis() { return y_axis_; } /// Get the mouse action mode Int getActionMode() const; /// Returns if the axis labels are shown virtual bool isLegendShown() const; /// Shows/hides axis labels virtual void showLegend(bool show); /// Sets the intensity mode of the PlotCanvas void setIntensityMode(PlotCanvas::IntensityModes mode); /// Hides x-axis and y-axis virtual void hideAxes(); /// Saves the widget's content as image file virtual void saveAsImage(); signals: /// Emits a status message that should be displayed for @p time ms. If @p time is 0 the message should be displayed until the next message is emitted. void sendStatusMessage(std::string, OpenMS::UInt); /// Emitted when the cursor position changes (for displaying e.g. in status bar) void sendCursorStatus(const String& x_value, const String& y_value); /// Message about the destruction of this widget void aboutToBeDestroyed(int window_id); /// Shows the main preferences dialog void openPreferences(); /// Signal that is emitted, when a drag-and-drop action ends on this widget void dropReceived(const QMimeData* data, QWidget* source, int id); public slots: /// Shows statistics about the data (count, min, max, avg of intensity, charge, quality and meta data) void showStatistics(); /// Shows the intensity distribution of the current layer void showIntensityDistribution(const Math::Histogram<>& dist); /// Shows the meta data distribution of value @p name of the current layer void showMetaDistribution(const String& name, const Math::Histogram<>& dist); /// Updates the axes by setting the right labels and calling recalculateAxes_(); void updateAxes(); /** @brief Updates the horizontal scrollbar @param[in] min The overall minimum of the range @param[in] disp_min The displayed minimum @param[in] disp_max The displayed maximum @param[in] max The overall maximum of the range */ void updateHScrollbar(float min, float disp_min, float disp_max, float max); /** @brief Updates the vertical scrollbar @param[in] min The overall minimum of the range @param[in] disp_min The displayed minimum @param[in] disp_max The displayed maximum @param[in] max The overall maximum of the range */ void updateVScrollbar(float min, float disp_min, float disp_max, float max); /// Shows a goto dialog virtual void showGoToDialog() = 0; /// Toggles the axis legend visibility void changeLegendVisibility(); /** * \brief Set a new mapper for the canvas and axis. Internally, all dependent components are updated (e.g. projections in 2D View) * \param mapper The new mapper for translating between units and axis */ virtual void setMapper(const DimMapper<2>& mapper) = 0; protected: /// @name Reimplemented Qt events //@{ void closeEvent(QCloseEvent * e) override; //@} /** @brief Adds the canvas, axes and scrollbars to the layout @p row and @p col define the position of the canvas. Axes and scrollbars are added to the left and bottom of the canvas. */ void setCanvas_(PlotCanvas * canvas, UInt row = 0, UInt col = 2); /// Switch between different intensity modes virtual void intensityModeChange_(); /// recalculates the Axis ticks virtual void recalculateAxes_() = 0; ///@name reimplemented Qt events //@{ void dragEnterEvent(QDragEnterEvent * event) override; void dragMoveEvent(QDragMoveEvent * event) override; void dropEvent(QDropEvent * event) override; /// make our subclassed QWidget listen to things like stylesheet changes void paintEvent(QPaintEvent * /*event*/) override; //@} /// Pointer to the canvas widget PlotCanvas* canvas_; /// Main layout QGridLayout* grid_; /// Vertical axis AxisWidget* y_axis_; /// Horizontal axis AxisWidget* x_axis_; /// Horizontal scrollbar QScrollBar* x_scrollbar_; /// Vertical scrollbar QScrollBar* y_scrollbar_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerDataChrom.h
.h
3,634
127
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerDataBase.h> namespace OpenMS { /// SharedPtr on OSWData typedef std::shared_ptr<OSWData> OSWDataSharedPtrType; /** @brief Class that stores the data for one layer of type Chromatogram @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI LayerDataChrom : public virtual LayerDataBase { public: /// Default constructor LayerDataChrom(); /// Copy-ctor LayerDataChrom(const LayerDataChrom& ld) = default; /// no assignment operator (should not be needed) LayerDataChrom& operator=(const LayerDataChrom& ld) = delete; std::unique_ptr<Painter2DBase> getPainter2D() const override; std::unique_ptr<LayerData1DBase> to1DLayer() const override; std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; ProjectionData getProjection(const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType& area) const override; PeakIndex findHighestDataPoint(const RangeAllType& area) const override; void updateRanges() override { chromatogram_map_->getMSExperiment().updateRanges(); } RangeAllType getRange() const override { RangeAllType r; r.assign(chromatogram_map_->getMSExperiment().chromatogramRanges()); return r; } std::unique_ptr<LayerStatistics> getStats() const override; PointXYType peakIndexToXY(const PeakIndex& peak, const DimMapper<2>& mapper) const override; String getDataArrayDescription(const PeakIndex& peak_index) override; const ExperimentType::ChromatogramType& getChromatogram(Size idx) const { return chromatogram_map_->getMSExperiment().getChromatogram(idx); } /** @brief Set the current in-memory chrom data */ void setChromData(ExperimentSharedPtrType p) { chromatogram_map_ = p; } /// Returns a mutable reference to the current chromatogram data const ExperimentSharedPtrType& getChromatogramData() const { return chromatogram_map_; } /// Returns a mutable reference to the current chromatogram data ExperimentSharedPtrType& getChromatogramData() { return chromatogram_map_; } /// Set the current on-disc data void setOnDiscPeakData(ODExperimentSharedPtrType p) { on_disc_peaks_ = p; } /// Returns a mutable reference to the on-disc data const ODExperimentSharedPtrType& getOnDiscPeakData() const { return on_disc_peaks_; } OSWDataSharedPtrType& getChromatogramAnnotation() { return chrom_annotation_; } const OSWDataSharedPtrType& getChromatogramAnnotation() const { return chrom_annotation_; } /// add annotation from an OSW sqlite file. void setChromatogramAnnotation(OSWData&& data); protected: /// chromatogram data ExperimentSharedPtrType chromatogram_map_ = ExperimentSharedPtrType(new ExperimentType()); /// on disc chrom data ODExperimentSharedPtrType on_disc_peaks_ = ODExperimentSharedPtrType(new OnDiscMSExperiment()); /// Chromatogram annotation data OSWDataSharedPtrType chrom_annotation_; }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASWidget.h
.h
2,642
85
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/CONCEPT/Types.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <OpenMS/VISUAL/EnhancedTabBarWidgetInterface.h> #include <QtWidgets/QGraphicsView> namespace OpenMS { class TOPPASScene; class Param; /** @brief Widget visualizing and allowing to edit TOPP pipelines. This class is a subclass of QGraphicsView and visualizes a TOPPASScene. Several TOPPASWidgets can be opened in TOPPAS at the same time, managed by a QWorkspace. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASWidget : public QGraphicsView, public EnhancedTabBarWidgetInterface { Q_OBJECT public: /// Default constructor TOPPASWidget(const Param & preferences, QWidget * parent = nullptr, const String & tmp_path = ""); /// Destructor ~TOPPASWidget() override; /// Returns the scene TOPPASScene * getScene(); /// Zooms in or out, depending on @p zoom_in void zoom(bool zoom_in); signals: /// Emits a status message that should be displayed for @p time ms. If @p time is 0 the message should be displayed until the next message is emitted. void sendStatusMessage(std::string message, OpenMS::UInt time); /// Emitted when the cursor position changes (for displaying e.g. in status bar) void sendCursorStatus(double x = 0.0, double y = 0.0); /// Emitted when a drop event occurs void toolDroppedOnWidget(double x = 0.0, double y = 0.0); /// Emitted when a drop event occurs void pipelineDroppedOnWidget(const String & filename, bool new_window); protected: /// The scene visualized by this widget TOPPASScene * scene_; ///@name reimplemented QT events //@{ void wheelEvent(QWheelEvent * event) override; void keyPressEvent(QKeyEvent * e) override; void keyReleaseEvent(QKeyEvent * e) override; void leaveEvent(QEvent * e) override; void enterEvent(QEnterEvent * e) override; void dragEnterEvent(QDragEnterEvent * event) override; void dragMoveEvent(QDragMoveEvent * event) override; void dropEvent(QDropEvent * event) override; void resizeEvent(QResizeEvent * event) override; void closeEvent(QCloseEvent * e) override; //@} }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/InputFileList.h
.h
3,137
92
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/DATASTRUCTURES/ListUtils.h> #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QWidget> namespace Ui { class InputFileList; } namespace OpenMS { namespace Internal { /** @brief A widget shows a list of input files (i.e. existing files on a mounted drive), which allows adding/removing files and supports drag'n'drop from the window manager. */ class InputFileList : public QWidget { Q_OBJECT public: /// C'tor explicit InputFileList(QWidget* parent = nullptr); ~InputFileList(); /// support drag'n'drop of files from OS window manager void dragEnterEvent(QDragEnterEvent* e) override; /// support drag'n'drop of files from OS window manager void dropEvent(QDropEvent* e) override; void dragMoveEvent(QDragMoveEvent* pEvent) override; /// Stores the list of all filenames in the list widget in @p files void getFilenames(QStringList& files) const; /// Stores the list of all filenames in the list widget in @p files StringList getFilenames() const; /// Set the list of all filenames in the list widget void setFilenames(const QStringList& files); /// get the CWD (according to most recently added file) const QString& getCWD() const; /// set the current working directory (for opening files), but only if the current input list is not already populated. Use @p force to set the CWD in any case. void setCWD(const QString& cwd, bool force = false); /// support Ctrl+C to copy currently selected items to clipboard void keyPressEvent(QKeyEvent* e) override; public slots: /// Lets the user select files via a file dialog void showFileDialog(); /// Removes all currently selected files from the list void removeSelected(); /// Removes all files from the list void removeAll(); /// Shows a TOPPASInputFileDialog which edits the current item void editCurrentItem(); signals: /// emitted when a new file is added (by drag'n'drop or 'Add..' button) void updatedCWD(QString new_cwd); protected: /// add files to the list, and update 'cwd_' by using the path of the last filename void addFiles_(const QStringList& files); /// updates the CWD, based on the last file in the current list void updateCWD_(); QString cwd_; ///< current working dir, i.e. the last position a file was added from private: Ui::InputFileList *ui_; }; } // ns Internal } // ns OpenMS // this is required to allow parent widgets (auto UIC'd from .ui) to have a InputFileList member using InputFileList = OpenMS::Internal::InputFileList;
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerDataFeature.h
.h
3,182
107
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/INTERFACES/IPeptideIds.h> namespace OpenMS { /** @brief Class that stores the data for one layer of type FeatureMap @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI LayerDataFeature : public virtual LayerDataBase, public IPeptideIds { public: /// Default constructor LayerDataFeature(); /// no Copy-ctor (should not be needed) LayerDataFeature(const LayerDataFeature& ld) = delete; /// no assignment operator (should not be needed) LayerDataFeature& operator=(const LayerDataFeature& ld) = delete; std::unique_ptr<Painter2DBase> getPainter2D() const override; std::unique_ptr<LayerData1DBase> to1DLayer() const override { throw Exception::NotImplemented(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); } std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; ProjectionData getProjection(const DIM_UNIT /*unit_x*/, const DIM_UNIT /*unit_y*/, const RangeAllType& /*area*/) const override { // currently only a stub ProjectionData proj; return proj; } PeakIndex findHighestDataPoint(const RangeAllType& area) const override; PointXYType peakIndexToXY(const PeakIndex& peak, const DimMapper<2>& mapper) const override; void updateRanges() override { features_->updateRanges(); } RangeAllType getRange() const override { RangeAllType r; r.assign(*getFeatureMap()); return r; } std::unique_ptr<LayerStatistics> getStats() const override; bool annotate(const PeptideIdentificationList& identifications, const std::vector<ProteinIdentification>& protein_identifications) override; const PepIds& getPeptideIds() const override { return getFeatureMap()->getUnassignedPeptideIdentifications(); } PepIds& getPeptideIds() override { return getFeatureMap()->getUnassignedPeptideIdentifications(); } void setPeptideIds(const PepIds& ids) override { getFeatureMap()->getUnassignedPeptideIdentifications() = ids; } void setPeptideIds(PepIds&& ids) override { getFeatureMap()->getUnassignedPeptideIdentifications() = std::move(ids); } /// Returns a const reference to the current feature data const FeatureMapSharedPtrType& getFeatureMap() const { return features_; } /// Returns a const reference to the current feature data FeatureMapSharedPtrType& getFeatureMap() { return features_; } protected: /// feature data FeatureMapSharedPtrType features_ = FeatureMapSharedPtrType(new FeatureMapType()); }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TVControllerBase.h
.h
1,898
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/METADATA/SpectrumSettings.h> #include <OpenMS/VISUAL/LayerDataBase.h> namespace OpenMS { class TOPPViewBase; /** @brief Base behavior for different visualizaton modules in TOPPView. */ class TVControllerBase : public QObject { Q_OBJECT public: ///@name Type definitions //@{ /// Feature map type typedef LayerDataBase::FeatureMapType FeatureMapType; /// Feature map managed type typedef LayerDataBase::FeatureMapSharedPtrType FeatureMapSharedPtrType; /// Consensus feature map type typedef LayerDataBase::ConsensusMapType ConsensusMapType; /// Consensus map managed type typedef LayerDataBase::ConsensusMapSharedPtrType ConsensusMapSharedPtrType; /// Peak map type typedef LayerDataBase::ExperimentType ExperimentType; /// Main managed data type (experiment) typedef LayerDataBase::ExperimentSharedPtrType ExperimentSharedPtrType; /// Peak spectrum type typedef ExperimentType::SpectrumType SpectrumType; //@} TVControllerBase() = delete; ~TVControllerBase() override = default; public slots: /// Slot for behavior activation. The default behaviour does nothing. Override in child class if desired. virtual void activateBehavior(); /// Slot for behavior deactivation. The default behaviour does nothing. Override in child class if desired. virtual void deactivateBehavior(); protected: /// Construct the behaviour TVControllerBase(TOPPViewBase* parent); TOPPViewBase* tv_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/SpectraIDViewTab.h
.h
4,337
113
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/DataSelectionTabs.h> #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/TableView.h> #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h> #include <QtWidgets> #include <QCheckBox> #include <unordered_map> #include <vector> namespace OpenMS { /** @brief Tabular visualization / selection of identified spectra. @htmlinclude OpenMS_SpectraIDViewTab.parameters */ class OPENMS_GUI_DLLAPI SpectraIDViewTab : public QWidget, public DefaultParamHandler, public DataTabBase { Q_OBJECT public: /// Constructor SpectraIDViewTab(const Param& preferences, QWidget* parent = nullptr); /// Destructor ~SpectraIDViewTab() override = default; // docu in base class bool hasData(const LayerDataBase* layer) override; /// set layer data and create table anew; if given a nullptr or the layer is not LayerDataPeak, behaves as clear() void updateEntries(LayerDataBase* model) override; /// get layer data LayerDataBase* getLayer(); /// clears all visible data from table widget and voids the layer void clear() override; /// Helper member to block outgoing signals bool ignore_update = false; protected slots: /// Rebuild table entries void updateEntries_(); /// Rebuild protein table entries void updateProteinEntries_(int spec_cell_row_idx); /// Switch horizontal or vertical layout of the PSM and Proteintable void switchOrientation_(); signals: /// request to show a specific spectrum, and (if available) a specific pepId + pepHit in there (otherwise -1, -1) void spectrumSelected(int spectrum_index, int pep_id_index, int pep_hit_index); /// request to unshow a spectrum void spectrumDeselected(int spectrum_index); /// request to zoom into a 1D spec void requestVisibleArea1D(double lower_mz, double upper_mz); private: /// partially fill the bottom-most row void fillRow_(const MSSpectrum& spectrum, const int spec_index, const QColor& background_color); /// extract the required part of the accession static QString extractNumFromAccession_(const QString& listItem); /// open browser to navigate to uniport site with accession void openUniProtSiteWithAccession_(const QString& accession); class SelfResizingTableView_ : TableView { void resizeEvent(QResizeEvent * event) override; }; LayerDataPeak* layer_ = nullptr; QCheckBox* hide_no_identification_ = nullptr; QCheckBox* create_rows_for_commmon_metavalue_ = nullptr; TableView* table_widget_ = nullptr; TableView* protein_table_widget_ = nullptr; QTableWidget* fragment_window_ = nullptr; QSplitter* tables_splitter_ = nullptr; bool is_first_time_loading_ = true; std::unordered_map<String, std::vector<const PeptideIdentification*>> protein_to_peptide_id_map; private slots: /// Saves the (potentially filtered) IDs as an idXML or mzIdentML file void saveIDs_(); /// update PeptideIdentification / PeptideHits, when data in the table changes (status of checkboxes) void updatedSingleCell_(QTableWidgetItem* item); /// Cell clicked in table_widget; emits which spectrum (row) was clicked, and may show additional data void currentCellChanged_(int row, int column, int old_row, int old_column); /// Create 'protein accession to peptide identification' map using C++ STL unordered_map void createProteinToPeptideIDMap_(); /// Cell selected or deselected: this is only used to check for deselection, rest happens in currentCellChanged_ void currentSpectraSelectionChanged_(); /// update ProteinHits, when data in the table changes (status of checkboxes) void updatedSingleProteinCell_(QTableWidgetItem* /*item*/); /// Protein Cell clicked in protein_table_widget; emits which protein (row) was clicked, and may show additional data void proteinCellClicked_(int row, int column); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/DataSelectionTabs.h
.h
3,510
112
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/KERNEL/StandardTypes.h> #include <QTabWidget> namespace OpenMS { class DIATreeTab; class LayerDataBase; class SpectraTreeTab; class SpectraIDViewTab; class TVDIATreeTabController; class TVIdentificationViewController; class TVSpectraViewController; class TOPPViewBase; /// all tabs need to implement this interface class OPENMS_GUI_DLLAPI DataTabBase { public: /// given a layer, determine if the tab could use it to show data (useful to decide if the tab should be enabled/disabled) /// If a nullptr is given, it HAS to return false! virtual bool hasData(const LayerDataBase* layer) = 0; /// populate the tab using date from @p layer /// Should handle nullptr well (by calling clear()) virtual void updateEntries(LayerDataBase* layer) = 0; /// explicitly show no data at all virtual void clear() = 0; }; /** @brief A tabbed view, to browse lists of spectra or identifications */ class OPENMS_GUI_DLLAPI DataSelectionTabs : public QTabWidget { Q_OBJECT public: enum TAB_INDEX { SPECTRA_IDX = 0, ///< first tab IDENT_IDX = 1, ///< second tab DIAOSW_IDX = 2, ///< third tab SIZE_OF_TAB_INDEX }; /// Default constructor DataSelectionTabs(QWidget* parent, TOPPViewBase* tv); /// Destructor ~DataSelectionTabs(); /// Update items in the tabs according to the currently selected layer. /// Tabs which have data to show are automatically enabled. Others are disabled. /// If the currently visible tab would have to data to show, we pick the highest (rightmost) tab /// which has data and show that instead void callUpdateEntries(); /// invoked when user changes the active tab to @p tab_index void currentTabChanged(int tab_index); /// forwards to the TOPPView*Behaviour classes, to show a certain spectrum in 1D void showSpectrumAsNew1D(int index); /// forwards to the TOPPView*Behaviour classes, to show a certain set of chromatograms in 1D void showChromatogramsAsNew1D(const std::vector<int>& indices); /// double-click on disabled identification view /// --> enables it and creates an empty identification structure void tabBarDoubleClicked(int tab_index); SpectraIDViewTab* getSpectraIDViewTab(); signals: private: ///@name Spectrum selection widgets //@{ SpectraTreeTab* spectra_view_widget_; SpectraIDViewTab* id_view_widget_; DIATreeTab* dia_widget_; //@} std::vector< DataTabBase* > tab_ptrs_; ///< holds pointers to all of the above tabs, for iteration purposes /// TOPPView behavior for the spectra view TVSpectraViewController* spectraview_controller_; /// TOPPView behavior for the identification view TVIdentificationViewController* idview_controller_; /// TOPPView behavior for the DIA view TVDIATreeTabController* diatab_controller_; /// pointer to base class to access some members (going signal/slot would be cleaner) TOPPViewBase* tv_; }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LogWindow.h
.h
1,742
72
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/KERNEL/StandardTypes.h> #include <QTextEdit> namespace OpenMS { class String; /** @brief A log window (QTextEdit) with convenience functions */ class LogWindow : public QTextEdit { Q_OBJECT Q_PROPERTY(int max_length READ maxLength WRITE setMaxLength) public: ///Log message states enum LogState { NOTICE, ///< Notice WARNING, ///< Warning CRITICAL ///< Fatal error }; /// Default constructor LogWindow(QWidget* parent); /// appends text without adding line breaks and shows the log-window void appendText(const QString& text); /// appends a new block with @p heading and a @p body void appendNewHeader(const LogState state, const String& heading, const String& body); /// appends a line break (same as append("")) void addNewline(); /// read max_length int maxLength() const; /// set max_length void setMaxLength(int max_length); signals: protected slots: /// if text length reached max_length_, then delete prefix until length of text is 1/2 of max_length_ void trimText_(); private: void contextMenuEvent(QContextMenuEvent* event) override; int max_length_ { -1 }; ///< -1 by default, which means there is no maximum length }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/RecentFilesMenu.h
.h
2,815
95
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/KERNEL/StandardTypes.h> #include <QMenu> #include <QStringList> #include <vector> class QAction; namespace OpenMS { class Param; class String; /** @brief Manages recent files opened by the user and provides a QMenu to go with it */ class RecentFilesMenu : public QObject { Q_OBJECT signals: /// when a recent file action item from the getMenu() was clicked void recentFileClicked(const String& filename); public: /// C'tor RecentFilesMenu(int max_entries = 15); /// sets a list of recent files (up to max_entries many -- see C'tor) void set(const QStringList& initial); /** @brief Extracts all values from all elements in the param object and tries to interpret them as filenames If they exist, they will be used in the list of recent files. The name of the param items is ignored. @param[in] filenames A Param object of which all values will be tested for being a filename @return The number of items which were successfully interpreted as filenames */ unsigned setFromParam(const Param& filenames); /** @brief Convert current file list to Param. Their names are just numbers, starting at "0". The values are the filenames. @return Param object with name:value pairs */ Param getAsParam() const; /// get a menu-pointer to an internal member which always contains the up-to-date recent items QMenu* getMenu(); /// current list of recent files (most recent first) const QStringList& get() const; public slots: /// put a new recent file at the top (removing any duplicates in other positions); will update the QMenu void add(const String& filename); private slots: /// invoked by the QAction when it was clicked; emits recentFileClicked(String filename) void itemClicked_(); private: /// updates the menu by synching text and and visibility of actions using the current list of recent files void sync_(); /// holds the menu and the filenames (as QActions) QMenu recent_menu_; /// maximum of entries; adding more will delete the oldest one int max_entries_; /// list of the recently opened files actions (menu entries) QStringList recent_files_; /// .. and the actions to go with it std::vector<QAction*> recent_actions_; }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TVSpectraViewController.h
.h
1,338
49
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/METADATA/SpectrumSettings.h> #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/TVControllerBase.h> #include <vector> namespace OpenMS { class TOPPViewBase; /** @brief Behavior of TOPPView in spectra view mode. */ class TVSpectraViewController : public TVControllerBase { Q_OBJECT public: /// Construct the behaviour with its parent TVSpectraViewController(TOPPViewBase* parent); public slots: /// Behavior for showSpectrumAsNew1D virtual void showSpectrumAsNew1D(int index); /// Behavior for showChromatogramsAsNew1D virtual void showChromatogramsAsNew1D(const std::vector<int>& indices); /// Behavior for activate1DSpectrum virtual void activate1DSpectrum(int index); /// Behavior for activate1DSpectrum virtual void activate1DSpectrum(const std::vector<int>& indices); /// Behavior for deactivate1DSpectrum virtual void deactivate1DSpectrum(int index); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASScene.h
.h
14,567
363
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASEdge.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <OpenMS/VISUAL/TOPPASOutputVertex.h> #include <OpenMS/VISUAL/TOPPASToolVertex.h> #include <QtWidgets/QGraphicsScene> #include <QtCore/QProcess> namespace OpenMS { class TOPPASVertex; class TOPPASToolVertex; class TOPPASMergerVertex; class TOPPASOutputFileListVertex; class TOPPASEdge; class TOPPASResources; /** @brief A FakeProcess class. */ class FakeProcess : public QProcess { Q_OBJECT public: virtual void start(const QString & program, const QStringList & arguments, OpenMode mode = ReadWrite); }; /** @brief A container for all visual items of a TOPPAS workflow TOPPASScene is a subclass of QGraphicsScene and acts as a container for all visual items (i.e. all vertices and edges). It is visualized by a TOPPASWidget (a subclass of QGraphicsView). This class also provides large parts of the functionality of TOPPAS, e.g., the methods for loading, saving, running, and aborting pipelines are located here. TOPPASScene can also be used without a visualizing TOPPASWidget (i.e., without a gui) which can be indicated via the constructor. In this case, the signals for log message output are connected to standard out. This is utilized for the ExecutePipeline tool. Temporary files of the pipeline are stored in the member tmp_path_. Update it when loading a pipeline which has tmp data from an old run. TOPPASToolVertex will ask its parent scene() whenever it wants to know the tmp directory. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASScene : public QGraphicsScene { Q_OBJECT public: /// Stores the information for a TOPP process struct TOPPProcess { /// Constructor TOPPProcess(QProcess * p, const QString & cmd, const QStringList & arg, TOPPASToolVertex * const tool) : proc(p), command(cmd), args(arg), tv(tool) { } /// The process QProcess * proc; /// The command QString command; /// The arguments QStringList args; /// The tool which is started (used to call its slots) TOPPASToolVertex * tv; }; /// The current action mode (creation of a new edge, or panning of the widget) enum ActionMode { AM_NEW_EDGE, AM_MOVE }; /// Pipeline status after refreshParameters() was called enum RefreshStatus { ST_REFRESH_NOCHANGE, ///< no updates required ST_REFRESH_CHANGED, ///< some parameters were updated, but pipeline is ok ST_REFRESH_CHANGEINVALID, ///< updating made pipeline invalid ST_REFRESH_REMAINSINVALID ///< pipeline was not valid before and is invalid afterwards }; /// The container for edges typedef QList<TOPPASEdge *> EdgeContainer; /// A mutable iterator for edges typedef EdgeContainer::iterator EdgeIterator; /// A const iterator for edges typedef EdgeContainer::const_iterator ConstEdgeIterator; /// The container for vertices typedef QList<TOPPASVertex *> VertexContainer; /// A mutable iterator for vertices typedef VertexContainer::iterator VertexIterator; /// A const iterator for vertices typedef VertexContainer::const_iterator ConstVertexIterator; /// Constructor TOPPASScene(QObject * parent, const QString & tmp_path, bool gui = true); /// Destructor ~TOPPASScene() override; /// Adds a vertex void addVertex(TOPPASVertex * tv); /// Adds an edge void addEdge(TOPPASEdge * te); /// Sets the action mode void setActionMode(ActionMode mode); /// Returns the action mode ActionMode getActionMode(); /// Returns begin() iterator of all vertices VertexIterator verticesBegin(); /// Returns end() iterator of all vertices VertexIterator verticesEnd(); /// Returns begin() iterator of all edges EdgeIterator edgesBegin(); /// Returns end() iterator of all edges EdgeIterator edgesEnd(); /// Copies all currently selected edges and vertices void copySelected(); /// Pastes the copied items void paste(QPointF pos = QPointF()); /// Removes all currently selected edges and vertices void removeSelected(); /// Unselects all items void unselectAll(); /// Updates all edge colors (color of green and yellow edges can change when edges are added/removed) void updateEdgeColors(); /// Called when user fires "Resume" action, to clear downstream nodes from previous results void resetDownstream(TOPPASVertex * vertex); /// Runs the pipeline void runPipeline(); /// Stores the pipeline to @p file, returns true on success bool store(const String & file); /// Loads the pipeline from @p file void load(const String & file); /// Includes the pipeline @p scene void include(TOPPASScene * new_scene, QPointF pos = QPointF()); /// Returns the file name const String & getSaveFileName(); /// Sets the file name void setSaveFileName(const String & name); /// Performs a topological sort of all vertices void topoSort(bool resort_all = true); /// Returns the name of the directory for output files const QString & getOutDir() const; /// Returns the name of the directory for temporary files const QString & getTempDir() const; /// Sets the name of the directory for output files void setOutDir(const QString & dir); /// Saves the pipeline if it has been changed since the last save. bool saveIfChanged(); /// Sets the changed flag void setChanged(bool b); /// Returns if a pipeline is currently running bool isPipelineRunning() const; /// Shows a dialog that allows to specify the output directory. If @p always_ask == false, the dialog won't be shown if a directory has been set, already. bool askForOutputDir(bool always_ask = true); /// Enqueues the process, it will be run when the currently pending processes have finished void enqueueProcess(const TOPPProcess & process); /// Runs the next process in the queue, if any void runNextProcess(); /// Resets the processes queue void resetProcessesQueue(); /// Sets the clipboard content void setClipboard(TOPPASScene * clipboard); ///Connects the signals to slots void connectVertexSignals(TOPPASVertex * tv); ///Connects the signals to slots void connectToolVertexSignals(TOPPASToolVertex * ttv); ///Connects the signals to slots void connectOutputVertexSignals(TOPPASOutputVertex * oflv); ///Connects the signals to slots void connectMergerVertexSignals(TOPPASMergerVertex * tmv); ///Connects the signals to slots void connectEdgeSignals(TOPPASEdge * e); ///Loads the @p resources into the input nodes of this workflow void loadResources(const TOPPASResources & resources); ///Create @p resources from the current workflow void createResources(TOPPASResources & resources); ///Returns whether the workflow has been changed since the latest "save" bool wasChanged() const; /// Refreshes the parameters of the TOPP tools in this workflow RefreshStatus refreshParameters(); /// is TOPPASScene run in GUI or non-GUI (ExecutePipeline) mode, i.e. are MessageBoxes allowed? bool isGUIMode() const; /// determine dry run status (are tools actually called?) bool isDryRun() const; /// workflow description (to be displayed in TOPPAS window) QString getDescription() const; /// when description is updated by user, use this to update the description for later storage in file void setDescription(const QString & desc); /// sets the maximum number of jobs void setAllowedThreads(int num_threads); /// returns the hovering edge TOPPASEdge* getHoveringEdge(); /// Checks whether all output vertices are finished, and if yes, emits entirePipelineFinished() (called by finished output vertices) void checkIfWeAreDone(); public slots: /// Terminates the currently running pipeline void abortPipeline(); /// Called when an item is clicked void itemClicked(); /// Called when an item is released void itemReleased(); /// Called when the position of the hovering edge changes void updateHoveringEdgePos(const QPointF & new_pos); /// Called when a new out edge is supposed to be created void addHoveringEdge(const QPointF & pos); /// Called when the new edge is being "released" void finishHoveringEdge(); /// Called by vertices at which an error occurred during pipeline execution void pipelineErrorSlot(int return_code = -1, const QString& msg = ""); /// Moves all selected items by dx, dy void moveSelectedItems(qreal dx, qreal dy); /// Makes all vertices snap to the grid void snapToGrid(); /// Sets if the running_ flag to true, or false /// If set to false, the application emits an 'alert' sign, demanding user attention (to let him know it finished) void setPipelineRunning(bool b = true); /// Invoked by TTV or other vertices if a parameter was edited void changedParameter(const bool invalidates_running_pipeline); /// Invoked by OutfilelistVertex of user changed the folder name void changedOutputFolder(); /// Called by a finished QProcess to indicate that we are free to start a new one void processFinished(); /// dirty solution: when using ExecutePipeline this slot is called when the pipeline crashes. This will quit the app void quitWithError(int exit_code); ///@name Slots for printing log/error output when no GUI is available //@{ /// Writes the TOPP tool output to the logfile (and to stdout if no gui available) void logTOPPOutput(const QString & out); /// Writes the "tool started" message to the logfile (and to stdout if no gui available) void logToolStarted(); /// Writes the "tool finished" message to the logfile (and to stdout if no gui available) void logToolFinished(); /// Writes the "tool failed" message to the logfile (and to stdout if no gui available) void logToolFailed(); /// Writes the "tool crashed" message to the logfile (and to stdout if no gui available) void logToolCrashed(); /// Writes the "output file written" message to the logfile (and to stdout if no gui available) void logOutputFileWritten(const String & file); //@} signals: /// Emitted when the entire pipeline execution is finished void entirePipelineFinished(); /// Emitted when the pipeline execution has failed void pipelineExecutionFailed(int return_code = -1); /// Emitted when the pipeline should be saved (showing a save as file dialog and so on) void saveMe(); /// Kills all connected TOPP processes void terminateCurrentPipeline(); /// Emitted when a selection is copied to the clipboard void selectionCopied(TOPPASScene * ts); /// Requests the clipboard content from TOPPASBase, will be stored in clipboard_ void requestClipboardContent(); /// Emitted when the main window needs to be updated void mainWindowNeedsUpdate(); /// Emitted when files are triggered for opening in TOPPView void openInTOPPView(QStringList all_files); /// Emitted when in dry run mode and asked to run a TOPP tool (to fake success) void dryRunFinished(int, QProcess::ExitStatus); /// Emitted when there is an important message that needs to be printed in TOPPAS void messageReady(const QString & msg); protected: /// The current action mode ActionMode action_mode_; /// The list of all vertices VertexContainer vertices_; /// The list of all edges EdgeContainer edges_; /// The hovering edge which is currently being created TOPPASEdge * hover_edge_; /// The current potential target vertex of the hovering edge TOPPASVertex * potential_target_; /// The file name of this pipeline String file_name_; /// The path for temporary files QString tmp_path_; /// Are we in a GUI or is the scene used by ExecutePipeline (at the command line)? bool gui_; /// The directory where the output files will be written QString out_dir_; /// Flag that indicates if the pipeline has been changed since the last save bool changed_; /// Indicates if a pipeline is currently running bool running_; /// true if an error occurred during pipeline execution bool error_occured_; /// Indicates if the output directory has been specified by the user already bool user_specified_out_dir_; /// The queue of pending TOPP processes QList<TOPPProcess> topp_processes_queue_; /// Stores the clipboard content when requested from TOPPASBase TOPPASScene * clipboard_; /// dry run mode (no tools are actually called) bool dry_run_; /// currently running processes... int threads_active_; /// description text QString description_text_; /// maximum number of allowed threads int allowed_threads_; /// last node where 'resume' was started TOPPASToolVertex* resume_source_; /// Returns the vertex in the foreground at position @p pos , if existent, otherwise 0. TOPPASVertex * getVertexAt_(const QPointF & pos); /// Returns whether an edge between node u and v would be allowed bool isEdgeAllowed_(TOPPASVertex * u, TOPPASVertex * v); /// DFS helper method. Returns true, if a back edge has been discovered bool dfsVisit_(TOPPASVertex * vertex); /// Performs a sanity check of the pipeline and notifies user when it finds something strange. Returns if pipeline OK. /// if 'allowUserOverride' is true, some dialogs are shown which allow the user to ignore some warnings (e.g. disconnected nodes) bool sanityCheck_(bool allowUserOverride); ///@name reimplemented Qt events //@{ void contextMenuEvent(QGraphicsSceneContextMenuEvent * event) override; //@} ///Writes the @p text to the logfile void writeToLogFile_(const QString & text); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASEdge.h
.h
4,932
156
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QtWidgets/QGraphicsItem> namespace OpenMS { class TOPPASVertex; class TOPPASToolVertex; class TOPPASInputFileListVertex; class String; /** @brief An edge representing a data flow in TOPPAS Like all TOPPASVertex classes, TOPPASEdge is a subclass of QGraphicsItem and thus implements methods to draw itself and to react on incoming events such as mouse clicks. It holds the data needed to represent an edge between two vertices of a TOPPAS workflow. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASEdge : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: /// The status of this edge enum EdgeStatus { ES_VALID, ES_NO_TARGET_PARAM, ES_NO_SOURCE_PARAM, ES_FILE_EXT_MISMATCH, ES_MERGER_EXT_MISMATCH, ES_MERGER_WITHOUT_TOOL, ES_NOT_READY_YET, // no input files given. We cannot know if the types will match. ES_TOOL_API_CHANGED, ES_UNKNOWN }; /// Standard constructor TOPPASEdge(); /// Constructor TOPPASEdge(TOPPASVertex * from, const QPointF & hover_pos); /// Copy constructor TOPPASEdge(const TOPPASEdge & rhs); /// Destructor ~TOPPASEdge() override; /// Assignment operator TOPPASEdge & operator=(const TOPPASEdge & rhs); /// for debug output String toString(); /// Returns the bounding rectangle of this item QRectF boundingRect() const override; /// Returns a more precise shape QPainterPath shape() const override; /// Paints the item void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) override; /// Returns the start position of this edge QPointF startPos() const; /// Returns the end position of this edge QPointF endPos() const; /// Sets the position of the hovering end while edge is being created void setHoverPos(const QPointF & pos); /// Sets the source vertex of this edge void setSourceVertex(TOPPASVertex * tv); /// Sets the target vertex of this edge void setTargetVertex(TOPPASVertex * tv); /// Returns the source vertex TOPPASVertex * getSourceVertex(); /// Returns the target vertex TOPPASVertex * getTargetVertex(); /// Call this before changing the item geometry void prepareResize(); /// Sets the color void setColor(const QColor & color); /// Returns the status of this edge EdgeStatus getEdgeStatus(); /// Sets the source output parameter index void setSourceOutParam(int out); /// Returns the source output parameter index int getSourceOutParam() const; /// Returns the source output parameter name QString getSourceOutParamName(); /// Sets the target input parameter index void setTargetInParam(int in); /// Returns the target input parameter index int getTargetInParam() const; /// Returns the target input parameter index QString getTargetInParamName(); /// Updates the edge color void updateColor(); /// Emits the somethingHasChanged() signal void emitChanged(); /// Shows the I/O mapping dialog void showIOMappingDialog(); public slots: /// Called by the source vertex when it has changed void sourceHasChanged(); signals: /// Emitted when something has changed void somethingHasChanged(); protected: ///@name reimplemented Qt events //@{ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * e) override; void contextMenuEvent(QGraphicsSceneContextMenuEvent * event) override; //@} ///@name helper methods of getEdgeStatus() //@{ EdgeStatus getToolToolStatus_(TOPPASToolVertex * source, int source_param_index, TOPPASToolVertex * target, int target_param_index); EdgeStatus getListToolStatus_(TOPPASInputFileListVertex * source, TOPPASToolVertex * target, int target_param_index); //@} /// point where the current edge touches the source or target (default) vertex QPointF borderPoint_(bool atTargetVertex = true) const; /// Pointer to the source of this edge TOPPASVertex * from_; /// Pointer to the target of this edge TOPPASVertex * to_; /// Position of hovering end while edge is being created QPointF hover_pos_; /// The color QColor color_; /// The source output parameter index int source_out_param_; /// The target input parameter index int target_in_param_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerDataIdent.h
.h
2,659
96
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/INTERFACES/IPeptideIds.h> namespace OpenMS { /** @brief Class that stores the data for one layer of type PeptideIdentifications @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI LayerDataIdent : public LayerDataBase, public IPeptideIds { public: /// Default constructor LayerDataIdent() : LayerDataBase(LayerDataBase::DT_IDENT){}; /// no Copy-ctor (should not be needed) LayerDataIdent(const LayerDataIdent& ld) = delete; /// no assignment operator (should not be needed) LayerDataIdent& operator=(const LayerDataIdent& ld) = delete; std::unique_ptr<Painter2DBase> getPainter2D() const override; std::unique_ptr<LayerData1DBase> to1DLayer() const override { throw Exception::NotImplemented(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION); } std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; ProjectionData getProjection(const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType& area) const override; PeakIndex findHighestDataPoint(const RangeAllType& /*area*/) const override { // todo: not implemented return PeakIndex(); } PointXYType peakIndexToXY(const PeakIndex& peak, const DimMapper<2>& mapper) const override; void updateRanges() override { // nothing to do... } RangeAllType getRange() const override { RangeAllType r; for (const PeptideIdentification& pep : peptides_) { r.extendRT(pep.getRT()); r.extendMZ(pep.getMZ()); } return r; } std::unique_ptr<LayerStatistics> getStats() const override; virtual const PepIds& getPeptideIds() const override { return peptides_; } virtual PepIds& getPeptideIds() override { return peptides_; } virtual void setPeptideIds(const PepIds& ids) override { peptides_ = ids; } virtual void setPeptideIds(PepIds&& ids) override { peptides_ = std::move(ids); } private: /// peptide identifications PeptideIdentificationList peptides_; }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASResource.h
.h
1,754
66
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QtCore/QString> #include <QtCore/QStringList> #include <QtCore/QUrl> #include <QtCore/QObject> namespace OpenMS { /** @brief Represents a data resource for TOPPAS workflows. Currently, the only supported type of resource is local files. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASResource : QObject { Q_OBJECT public: /// Constructor TOPPASResource(const QString & file); /// Constructor from URL TOPPASResource(const QUrl & url); /// Copy constructor TOPPASResource(const TOPPASResource & rhs); /// Destructor ~TOPPASResource() override; /// Assignment operator TOPPASResource & operator=(const TOPPASResource & rhs); /// Writes this resource to the local file @p file void writeToFile(const QString & file_name); /// Returns the file name of the local file, or "" if it has not been written yet const QString & getLocalFile() const; /// Returns the URL of this resource const QUrl & getURL() const; /// Sets the URL of this resource from @p file void fromLocalFile(const QString & file); /// Supported schemes static QStringList supported_schemes; protected: /// The URL of this resource QUrl url_; /// The name of the local file QString file_name_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/Plot3DCanvas.h
.h
2,831
115
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Cornelia Friedle $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> // OpenMS #include <OpenMS/VISUAL/PlotCanvas.h> #include <OpenMS/VISUAL/MultiGradient.h> class QPainter; class QOpenGLWidget; class QResizeEvent; namespace OpenMS { class Plot3DOpenGLCanvas; /** @brief Canvas for 3D-visualization of peak map data The Plot3DCanvas uses the helper class Plot3DOpenGLCanvas for the actual 3D rendering. Deriving Plot3DCanvas directly from QGLWidget is not possible due to the "Deadly Diamond" shape of inheritance. @image html Plot3DWidget.png @htmlinclude OpenMS_Plot3DCanvas.parameters @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI Plot3DCanvas : public PlotCanvas { Q_OBJECT friend class Plot3DOpenGLCanvas; public: /// Constructor Plot3DCanvas(const Param & preferences, QWidget * parent = nullptr); /// Destructor ~Plot3DCanvas() override; ///Different shade modes enum ShadeModes { SHADE_FLAT = 0, SHADE_SMOOTH = 1 }; ///returns the Plot3DOpenGLcanvas Plot3DOpenGLCanvas * openglwidget() const; ///@name Reimplemented Qt events //@{ void resizeEvent(QResizeEvent * e) override; void contextMenuEvent(QContextMenuEvent * e) override; //@} /// Returns if the legend is shown bool isLegendShown() const; ///Shows/hides the legend void showLegend(bool); ///pointer to the SpectrumOpenGLCanvas implementation Plot3DOpenGLCanvas * openglcanvas_; // docu in base class void showCurrentLayerPreferences() override; signals: /// Requests to display all spectra in 2D plot void showCurrentPeaksAs2D(); public slots: // Docu in base class void activateLayer(Size layer_index) override; // Docu in base class void removeLayer(Size layer_index) override; // Docu in base class void updateLayer(Size i) override; // Docu in base class void intensityModeChange_() override; protected slots: /// Reacts on changed layer parameters void currentLayerParamtersChanged_(); protected: // Docu in base class bool finishAdding_() override; // Reimplementation in order to update the OpenGL widget void update_(const char * caller_name = nullptr) override; ///whether the legend is shown or not bool legend_shown_; ///stores the linear color gradient for non-log modes MultiGradient linear_gradient_; }; } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/FileWatcher.h
.h
2,292
91
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/CONCEPT/Types.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <map> //Qt #include <QtCore/QFileSystemWatcher> //STL #include <map> namespace OpenMS { class String; /** @brief Watcher that monitors file changes. This class can be used similar to QFileSystemWatcher. Additionally it offers a delayed fileChanged signal. This behaviour is required for the following reason: Normally QFileSystemWatcher emits a signal every time a file is changed. This causes several signals for large files (one for each flush of the buffer). */ class OPENMS_GUI_DLLAPI FileWatcher : public QFileSystemWatcher //find out why ICC requires public instead of protected { Q_OBJECT public: /// Constructor FileWatcher(QObject * parent = nullptr); /// Destructor ~FileWatcher() override; ///Sets the delay in seconds (default: 1s) inline void setDelayInSeconds(double delay) { delay_in_seconds_ = delay; } ///Adds a file to the watcher inline void addFile(const String & path) { QFileSystemWatcher::addPath(path.toQString()); } ///removes a file from the watcher inline void removeFile(const String & path) { QFileSystemWatcher::removePath(path.toQString()); } signals: ///Delayed file change signal void fileChanged(const String &); protected slots: /// Slot that is connected to the fileChanged signal in order to track the changes void monitorFileChanged_(const QString & name); /// Slot that is called when the delay is over void timerTriggered_(); protected: /// A map that links timer name and file std::map<QString, QString> timers_; /// Delay (seconds) double delay_in_seconds_; }; // OPENMS_DLLAPI extern FileWatcher myFileWatcher_instance; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/GUIProgressLoggerImpl.h
.h
1,646
60
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Stephan Aiche, Marc Sturm $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/CONCEPT/ProgressLogger.h> class QProgressDialog; namespace OpenMS { /** @brief Implements a GUI version of the ProgressLoggerImpl. */ class OPENMS_GUI_DLLAPI GUIProgressLoggerImpl : public ProgressLogger::ProgressLoggerImpl { public: /// default c'tor. GUIProgressLoggerImpl(); /** @brief Implement ProgressLoggerImpl::startProgress(). */ void startProgress(const SignedSize begin, const SignedSize end, const String& label, const int /* current_recursion_depth */) const override; /** @brief Implement ProgressLoggerImpl::setProgress(). */ void setProgress(const SignedSize value, const int /* current_recursion_depth */) const override; /** @brief Implement ProgressLoggerImpl::nextProgress(). */ SignedSize nextProgress() const override; /** @brief Implement ProgressLoggerImpl::endProgress(). */ void endProgress(const int current_recursion_depth, UInt64 bytes_processed = 0) const override; /// d'tor ~GUIProgressLoggerImpl() override; private: mutable QProgressDialog* dlg_; mutable SignedSize begin_; mutable SignedSize end_; mutable SignedSize current_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerDataPeak.h
.h
6,501
207
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/LayerData1DBase.h> #include <OpenMS/METADATA/PeptideIdentification.h> #include <OpenMS/METADATA/ProteinIdentification.h> #include <vector> namespace OpenMS { class Annotation1DItem; /** @brief Class that stores the data for one layer of type PeakMap @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI LayerDataPeak : public virtual LayerDataBase { public: using SpectrumType = ExperimentType::SpectrumType; using PeakType = SpectrumType::PeakType; /// Default constructor LayerDataPeak(); /// Copy-ctor LayerDataPeak(const LayerDataPeak& ld) = default; /// no assignment operator (should not be needed) LayerDataPeak& operator=(const LayerDataPeak& ld) = delete; std::unique_ptr<Painter2DBase> getPainter2D() const override; std::unique_ptr<LayerData1DBase> to1DLayer() const override; std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; ProjectionData getProjection(const DIM_UNIT unit_x, const DIM_UNIT unit_y, const RangeAllType& area) const override; PeakIndex findHighestDataPoint(const RangeAllType& area) const override; void updateRanges() override { peak_map_->getMSExperiment().updateRanges(); // on_disc_peaks_->updateRanges(); // note: this is not going to work since its on disk! We currently don't have a good way to access these ranges } RangeAllType getRange() const override { RangeAllType r; r.assign(peak_map_->getMSExperiment().spectrumRanges()); return r; } PointXYType peakIndexToXY(const PeakIndex& peak, const DimMapper<2>& mapper) const override; String getDataArrayDescription(const PeakIndex& peak_index) override; std::unique_ptr<LayerStatistics> getStats() const override; bool annotate(const PeptideIdentificationList& identifications, const std::vector<ProteinIdentification>& protein_identifications) override; const ExperimentType::SpectrumType& getSpectrum(Size spectrum_idx) const { if (peak_map_->getMSExperiment()[spectrum_idx].size() > 0) { return peak_map_->getMSExperiment()[spectrum_idx]; } if (!on_disc_peaks_->empty()) { static MSSpectrum local_spec; local_spec = on_disc_peaks_->getSpectrum(spectrum_idx); return local_spec; } return peak_map_->getMSExperiment()[spectrum_idx]; } /** @brief Returns a const reference to the current in-memory peak data @note Depending on the caching strategy (on-disk or in-memory), all or some spectra may have zero size and contain only meta data since peak data is cached on disk. @note Do *not* use this function to access the current spectrum for the 1D view, use getCurrentSpectrum() instead. */ const ConstExperimentSharedPtrType getPeakData() const; /** @brief Returns a mutable reference to the current in-memory peak data @note Depending on the caching strategy (on-disk or in-memory), all or some spectra may have zero size and contain only meta data since peak data is cached on disk. @note Do *not* use this function to access the current spectrum for the 1D view, use getCurrentSpectrum() instead. */ const ExperimentSharedPtrType& getPeakDataMuteable() { return peak_map_; } /** @brief Set the current in-memory peak data */ void setPeakData(ExperimentSharedPtrType p) { peak_map_ = p; } /// Set the current on-disc data void setOnDiscPeakData(ODExperimentSharedPtrType p) { on_disc_peaks_ = p; } /// Returns a mutable reference to the on-disc data const ODExperimentSharedPtrType& getOnDiscPeakData() const { return on_disc_peaks_; } /// Check whether the current layer should be represented as ion mobility bool isIonMobilityData() const { const MSExperiment& exp = this->getPeakData()->getMSExperiment(); return exp.size() > 0 && exp.metaValueExists("is_ion_mobility") && exp.getMetaValue("is_ion_mobility").toBool(); } void labelAsIonMobilityData() const { peak_map_->getMSExperiment().setMetaValue("is_ion_mobility", "true"); } /// Check whether the current layer contains DIA (SWATH-MS) data bool isDIAData() const { const MSExperiment& exp = this->getPeakData()->getMSExperiment(); return exp.size() > 0 && exp.metaValueExists("is_dia_data") && exp.getMetaValue("is_dia_data").toBool(); } /// Label the current layer as DIA (SWATH-MS) data void labelAsDIAData() { peak_map_->getMSExperiment().setMetaValue("is_dia_data", "true"); } /** @brief Check whether the current layer is a chromatogram This is needed because type will *not* distinguish properly between chromatogram and spectra data. This is due to the fact that we store chromatograms for display in 1D in a data layer using MSSpectrum and so the layer looks like PEAK data to tools. */ bool chromatogram_flag_set() const { const MSExperiment& exp = this->getPeakData()->getMSExperiment(); return exp.size() > 0 && exp.metaValueExists("is_chromatogram") && exp.getMetaValue("is_chromatogram").toBool(); } /// set the chromatogram flag void set_chromatogram_flag() { peak_map_->getMSExperiment().setMetaValue("is_chromatogram", "true"); } /// remove the chromatogram flag void remove_chromatogram_flag() { if (this->chromatogram_flag_set()) { peak_map_->getMSExperiment().removeMetaValue("is_chromatogram"); } } protected: /// peak data ExperimentSharedPtrType peak_map_ = ExperimentSharedPtrType(new ExperimentType()); /// on disc peak data ODExperimentSharedPtrType on_disc_peaks_ = ODExperimentSharedPtrType(new OnDiscMSExperiment()); }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerData1DPeak.h
.h
2,851
87
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerData1DBase.h> #include <OpenMS/VISUAL/LayerDataPeak.h> namespace OpenMS { class OPENMS_GUI_DLLAPI LayerData1DPeak : public LayerDataPeak, public LayerData1DBase { public: LayerData1DPeak() : LayerDataBase(DT_PEAK) { } LayerData1DPeak(const LayerDataPeak& base) : LayerDataBase(base), LayerDataPeak(base) { } std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; std::unique_ptr<Painter1DBase> getPainter1D() const override; bool hasIndex(Size index) const override { return index < peak_map_->getMSExperiment().size(); } RangeAllType getRangeForArea(const RangeAllType partial_range) const override { const auto& spec = getCurrentSpectrum(); auto spec_filtered = SpectrumType(); spec_filtered.insert(spec_filtered.begin(), spec.MZBegin(partial_range.getMinMZ()), spec.MZEnd(partial_range.getMaxMZ())); spec_filtered.updateRanges(); return RangeAllType().assign(spec_filtered.getRange()); } const ExperimentType::SpectrumType& getCurrentSpectrum() const { return LayerDataPeak::getSpectrum(current_idx_); } void updateRanges() override { LayerDataPeak::updateRanges(); } RangeAllType getRange1D() const override { return RangeAllType().assign(getCurrentSpectrum().getRange()); } // docu in base class QMenu* getContextMenuAnnotation(Annotation1DItem* annot_item, bool& need_repaint) override; PeakIndex findClosestDataPoint(const RangeAllType& area) const override; // docu in base class Annotation1DItem* addPeakAnnotation(const PeakIndex& peak_index, const QString& text, const QColor& color) override; /// updates the PeakAnnotations in the current PeptideHit with manually changed annotations /// if no PeptideIdentification or PeptideHit for the spectrum exist, it is generated void synchronizePeakAnnotations(); /// remove peak annotations in the given list from the currently active PeptideHit void removePeakAnnotationsFromPeptideHit(const std::vector<Annotation1DItem*>& selected_annotations); /// updates the PeakAnnotations in the current PeptideHit with manually changed annotations void updatePeptideHitAnnotations_(PeptideHit& hit); protected: }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerData1DChrom.h
.h
2,929
89
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerData1DBase.h> #include <OpenMS/VISUAL/LayerDataChrom.h> namespace OpenMS { class OPENMS_GUI_DLLAPI LayerData1DChrom : public LayerDataChrom, public LayerData1DBase { public: LayerData1DChrom() : LayerDataBase(DT_CHROMATOGRAM) { } LayerData1DChrom(const LayerDataChrom& base) : LayerDataBase(base), LayerDataChrom(base) { } std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; std::unique_ptr<Painter1DBase> getPainter1D() const override; bool hasIndex(Size index) const override { return index < chromatogram_map_->getMSExperiment().getNrChromatograms(); } RangeAllType getRangeForArea(const RangeAllType partial_range) const override { // update ranges based on given RT range if (partial_range.RangeRT::isEmpty()) { // .. unless RT is empty, then we use the whole RT range auto r = RangeAllType(partial_range); r.extend(getCurrentChrom().getRange()); return r; } const auto& chrom = getCurrentChrom(); auto chrom_filtered = MSExperiment::ChromatogramType(); chrom_filtered.insert(chrom_filtered.begin(), chrom.RTBegin(partial_range.getMinRT()), chrom.RTEnd(partial_range.getMaxRT())); chrom_filtered.updateRanges(); return RangeAllType().assign(chrom_filtered.getRange()); } RangeAllType getRange1D() const override { return RangeAllType().assign(getCurrentChrom().getRange()); } const ExperimentType::ChromatogramType& getCurrentChrom() const { return getChromatogram(current_idx_); } void updateRanges() override { LayerDataChrom::updateRanges(); } RangeAllType getRange() const override { // do NOT change the behaviour of getRange() for 1D, since we want the full RT range across all chroms // when scrolling in the list of chroms return LayerDataChrom::getRange(); } // docu in base class QMenu* getContextMenuAnnotation(Annotation1DItem* annot_item, bool& need_repaint) override; PeakIndex findClosestDataPoint(const RangeAllType& area) const override; // docu in base class Annotation1DItem* addPeakAnnotation(const PeakIndex& peak_index, const QString& text, const QColor& color) override; protected: /// Current cached spectrum //ExperimentType::SpectrumType cached_spectrum_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/InputFile.h
.h
2,307
82
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QWidget> namespace Ui { class InputFileTemplate; } namespace OpenMS { /** @brief A simple widget with a line-edit and a browse button to choose filenames @ingroup TOPPAS_elements @ingroup Dialogs */ class OPENMS_GUI_DLLAPI InputFile : public QWidget { Q_OBJECT public: /// Constructor InputFile(QWidget* parent); /// Destructor ~InputFile(); /// support drag'n'drop of files from OS window manager void dragEnterEvent(QDragEnterEvent* e) override; /// support drag'n'drop of files from OS window manager void dropEvent(QDropEvent* e) override; void dragMoveEvent(QDragMoveEvent* pEvent) override; /// Sets the text in the line-edit void setFilename(const QString& filename); /// Returns the filename currently set in the line-edit QString getFilename() const; /// Users can only choose certain filetypes, e.g. "Transition sqLite file (*.pqp)" void setFileFormatFilter(const QString& fff); /// get the CWD (according to most recently added file) const QString& getCWD() const; /// set the current working directory (for opening files). If the input is not empty, the cwd will not be altered, unless @p force is used void setCWD(const QString& cwd, bool force = false); signals: /// emitted when a new file is added (by drag'n'drop or 'Browse' button) void updatedCWD(QString new_cwd); /// emitted when a new file is added (by drag'n'drop or 'Browse' button) void updatedFile(QString new_path); public slots: /// Lets the user select the file via a file dialog void showFileDialog(); protected: /// optional filter during file browsing QString file_format_filter_; /// the current working directory according to the last file added QString cwd_; private: Ui::InputFileTemplate* ui_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerData1DIonMobility.h
.h
2,574
83
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerData1DBase.h> #include <OpenMS/VISUAL/LayerDataIonMobility.h> namespace OpenMS { class OPENMS_GUI_DLLAPI LayerData1DIonMobility : public LayerDataIonMobility, public LayerData1DBase { public: LayerData1DIonMobility() : LayerDataBase(DT_PEAK) { } LayerData1DIonMobility(const LayerDataIonMobility& base) : LayerDataBase(base), LayerDataIonMobility(base) { } std::unique_ptr<LayerStoreData> storeVisibleData(const RangeAllType& visible_range, const DataFilters& layer_filters) const override; std::unique_ptr<LayerStoreData> storeFullData() const override; std::unique_ptr<Painter1DBase> getPainter1D() const override; bool hasIndex(Size index) const override { return index == 0; } RangeAllType getRangeForArea(const RangeAllType partial_range) const override { const auto& spec = getCurrentMobilogram(); auto spec_filtered = Mobilogram(); spec_filtered.insert(spec_filtered.begin(), spec.MBBegin(partial_range.getMinMobility()), spec.MBEnd(partial_range.getMaxMobility())); spec_filtered.updateRanges(); return RangeAllType().assign(spec_filtered.getRange()); } RangeAllType getRange1D() const override { return RangeAllType().assign(getCurrentMobilogram().getRange()); } const Mobilogram& getCurrentMobilogram() const { return LayerDataIonMobility::getMobilogram(this->getCurrentIndex()); } void updateRanges() override { LayerDataIonMobility::updateRanges(); } RangeAllType getRange() const override { // do NOT change the behaviour of getRange() for 1D, since we want the full IM range across all mbs // when scrolling in the list of mbs return LayerDataIonMobility::getRange(); } // docu in base class QMenu* getContextMenuAnnotation(Annotation1DItem* annot_item, bool& need_repaint) override; PeakIndex findClosestDataPoint(const RangeAllType& area) const override; // docu in base class Annotation1DItem* addPeakAnnotation(const PeakIndex& peak_index, const QString& text, const QColor& color) override; protected: }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASOutputVertex.h
.h
2,808
76
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASVertex.h> namespace OpenMS { /** @brief A vertex representing an output, either folder or files(s) @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASOutputVertex : public TOPPASVertex { Q_OBJECT public: /// Default C'tor TOPPASOutputVertex() = default; /// Copy constructor TOPPASOutputVertex(const TOPPASOutputVertex& rhs); /// Assignment operator TOPPASOutputVertex& operator=(const TOPPASOutputVertex& rhs); // documented in base class void reset(bool reset_all_files = false) override; /// opens the folder containing the output data void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) override; /// Returns the full directory (including preceding output path as selected by user and a trailing '/') String getFullOutputDirectory() const; /// Returns the directory where the output files are stored (includes a trailing '/') String getOutputDir() const; /// Creates the output directory for this node (includes a trailing '/') String createOutputDir() const; /// Sets the topological sort number and removes invalidated tmp files void setTopoNr(UInt nr) override; /// Opens the folders of the output files void openContainingFolder() const; /// Sets a custom output folder name, which will be integrated into 'getOutputDir()' and 'getFullOutputDirectory()' calls. /// @note The string is not checked for validity (avoid characters which are not allowed in directories, e.g. '{') void setOutputFolderName(const QString& name); /// return the output folder where results are written const QString& getOutputFolderName() const; signals: /// Emitted when an output file was written void outputFileWritten(const String& file); /// Emitted when user has changed the output folder name (i.e. output dir needs to be newly created and packages updates) void outputFolderNameChanged(); public slots: // documented in base class void inEdgeHasChanged() override; protected: /// custom output folder name QString output_folder_name_; // convenience members, not required for operation, but for progress during copying int files_written_ = 0; ///< files that were already written int files_total_ = 0; ///< total number of files from upstream }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASResources.h
.h
1,824
65
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/DATASTRUCTURES/StringListUtils.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <OpenMS/VISUAL/TOPPASResource.h> #include <QtCore/QString> #include <QtCore/QObject> #include <map> namespace OpenMS { /** @brief A dictionary mapping string keys to lists of TOPPASResource objects @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASResources : QObject { Q_OBJECT public: /// Constructor TOPPASResources(); /// Copy constructor TOPPASResources(const TOPPASResources & rhs); /// Destructor ~TOPPASResources() override; /// Assignment operator TOPPASResources & operator=(const TOPPASResources & rhs); /// Adds the (key,resource_list) pair to the dictionary void add(const QString & key, const QList<TOPPASResource> & resource_list); /// Returns the resource list that @p key is mapped to, or an empty list if @p key does not exist const QList<TOPPASResource> & get(const QString & key) const; /// Loads the dictionary from file @p file_name void load(const QString & file_name); /// Writes the dictionary to file @p file_name void store(const QString & file_name); /// Clears the dictionary void clear(); protected: /// The dictionary std::map<QString, QList<TOPPASResource> > map_; /// The empty list QList<TOPPASResource> empty_list_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASSplitterVertex.h
.h
2,128
64
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Hendrik Weisser $ // $Authors: Johannes Junker, Chris Bielow, Hendrik Weisser $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASVertex.h> namespace OpenMS { /** @brief A special vertex that allows to split a list of inputs. Tools that produce lists of output files (several files in each processing round, e.g. map alignment tools) cannot directly provide input for tools that only take a single input file in TOPPAS. This "Splitter" node provides the necessary glue, by splitting a list of output files into several rounds of single input files. See the @ref OpenMS::TOPPASMergerVertex "Collector" node for the opposite operation. @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASSplitterVertex : public TOPPASVertex { Q_OBJECT public: /// Default constructor TOPPASSplitterVertex() = default; /// Copy constructor TOPPASSplitterVertex(const TOPPASSplitterVertex& rhs); /// Destructor ~TOPPASSplitterVertex() override = default; /// Assignment operator TOPPASSplitterVertex& operator=(const TOPPASSplitterVertex& rhs); virtual std::unique_ptr<TOPPASVertex> clone() const override; /// returns "SplitterVertex" String getName() const override; /// check if upstream nodes are finished and call downstream nodes void run() override; // documented in base class void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; // documented in base class QRectF boundingRect() const override; // documented in base class void markUnreachable() override; protected: ///@name reimplemented Qt events //@{ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e) override; //@} }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/SpectraTreeTab.h
.h
3,385
95
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once #include <QtWidgets> #include <OpenMS/VISUAL/DataSelectionTabs.h> #include <OpenMS/VISUAL/LayerDataBase.h> class QLineEdit; class QComboBox; class QTreeWidget; class QTreeWidgetItem; namespace OpenMS { class TreeView; /** @brief Hierarchical visualization and selection of spectra. @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI SpectraTreeTab : public QWidget, public DataTabBase { Q_OBJECT public: /// Constructor SpectraTreeTab(QWidget * parent = nullptr); /// Destructor ~SpectraTreeTab() override = default; /// docu in base class bool hasData(const LayerDataBase* layer) override; /// refresh the table using data from @p cl void updateEntries(LayerDataBase* cl) override; /// remove all visible data void clear() override; /// Return a copy of the currently selected spectrum/chrom (for drag'n'drop to new window) /// and store it either as Spectrum or Chromatogram in @p exp (all other data is cleared) /// If no spectrum/chrom is selected, false is returned and @p exp is empty /// /// @param[out] exp The currently active spec/chrom /// @param[in] current_type Either DT_PEAK or DT_CHROMATOGRAM, depending on what is currently shown /// @return true if a spec/chrom is currently active bool getSelectedScan(MSExperiment& exp, LayerDataBase::DataType& current_type) const; signals: void spectrumSelected(int); void chromsSelected(std::vector<int> indices); void spectrumDoubleClicked(int); void chromsDoubleClicked(std::vector<int> indices); void showSpectrumAsNew1D(int); void showChromatogramsAsNew1D(std::vector<int> indices); void showSpectrumMetaData(int); private: QLineEdit* spectra_search_box_ = nullptr; QComboBox* spectra_combo_box_ = nullptr; TreeView* spectra_treewidget_ = nullptr; LayerDataBase* layer_ = nullptr; /// cache to store mapping of chromatogram precursors to chromatogram indices std::map<size_t, std::map<Precursor, std::vector<Size>, Precursor::MZLess> > map_precursor_to_chrom_idx_cache_; /// remember the last PeakMap that we used to fill the spectra list (and avoid rebuilding it) const PeakMap* last_peakmap_ = nullptr; private slots: /// fill the search-combo-box with current column header names void populateSearchBox_(); /// searches for rows containing a search text (from spectra_search_box_); called when text search box is used void spectrumSearchText_(); /// emits spectrumSelected() for PEAK or chromsSelected() for CHROM data void itemSelectionChange_(QTreeWidgetItem *, QTreeWidgetItem *); /// searches using text box and plots the spectrum void searchAndShow_(); /// called upon double click on an item; emits spectrumDoubleClicked() or chromsDoubleClicked() after some checking void itemDoubleClicked_(QTreeWidgetItem *); /// Display context menu; allows to open metadata window void spectrumContextMenu_(const QPoint &); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/AxisTickCalculator.h
.h
1,468
57
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <vector> #include <OpenMS/CONCEPT/Types.h> namespace OpenMS { /** @brief Calculates ticks for a given value range. It has only static methods, that's why the constructor is private. @ingroup Visual */ class OPENMS_GUI_DLLAPI AxisTickCalculator { public: /// Typedef for the grid vector typedef std::vector<std::vector<double> > GridVector; /** @brief Returns a GridVector with ticks for linear scales. @param[in] x1 minimum value @param[in] x2 maximum value @param[out] grid the grid_vector to fill */ static void calcGridLines(double x1, double x2, GridVector & grid); /** @brief Returns a GridVector with ticks for logarithmic scales. @param[in] x1 minimum value @param[in] x2 maximum value @param[out] grid the grid_vector to fill */ static void calcLogGridLines(double x1, double x2, GridVector & grid); private: ///Constructor: only static methods AxisTickCalculator(); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/TOPPASOutputFileListVertex.h
.h
1,161
43
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TOPPASOutputVertex.h> namespace OpenMS { /** @brief A vertex representing an output file list @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASOutputFileListVertex : public TOPPASOutputVertex { Q_OBJECT public: virtual std::unique_ptr<TOPPASVertex> clone() const override; /// returns "OutputFileVertex" String getName() const override; // documented in base class void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) override; // documented in base class QRectF boundingRect() const override; /// Called when the parent node has finished execution void run() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/MetaDataBrowser.h
.h
8,199
247
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/KERNEL/StandardTypes.h> #include <OpenMS/KERNEL/FeatureMap.h> #include <OpenMS/KERNEL/ConsensusMap.h> //QT #include <QtWidgets/QDialog> #include <QtWidgets/QTreeWidget> class QTreeWidgetItem; class QPushButton; class QStackedWidget; class QHBoxLayout; class QVBoxLayout; class QGridLayout; namespace OpenMS { class BaseVisualizerGUI; class Acquisition; class AcquisitionInfo; class ContactPerson; class ExperimentalSettings; class Gradient; class HPLC; class PeptideIdentification; class Instrument; class IonDetector; class IonSource; class MassAnalyzer; class MetaInfo; class MetaInfoDescription; class MetaInfoInterface; class MetaInfoRegistry; class PeptideHit; class Precursor; class DataProcessing; class ProteinHit; class ProteinIdentification; class Sample; class Software; class SourceFile; class SpectrumSettings; class DocumentIdentifier; class Product; /** @brief A meta data visualization widget @image html MetaDataBrowser.png It contains a tree view showing all objects of the meta data to be viewed in hierarchical order. The meta info data of the tree items are shown in the right part of the viewer, when they are selected in the tree. If the data has been modified exec() returns @em true . Otherwise @em false is returned. @improvement Add generic mechanism to add items to data vectors e.g. for Instrument - IonSource (Hiwi) @ingroup Visual */ class OPENMS_GUI_DLLAPI MetaDataBrowser : public QDialog { Q_OBJECT public: /// Constructor with flag for edit mode MetaDataBrowser(bool editable = false, QWidget * parent = nullptr, bool modal = false); /// Adds a peak map void add(PeakMap & exp) { add(static_cast<ExperimentalSettings &>(exp)); treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first()); } /// Adds a peak spectrum void add(MSSpectrum & spectrum) { //spectrum settings add(static_cast<SpectrumSettings &>(spectrum)); //MetaInfoDescriptions for (Size i = 0; i < spectrum.getFloatDataArrays().size(); ++i) { add(spectrum.getFloatDataArrays()[i]); } for (Size i = 0; i < spectrum.getIntegerDataArrays().size(); ++i) { add(spectrum.getIntegerDataArrays()[i]); } for (Size i = 0; i < spectrum.getStringDataArrays().size(); ++i) { add(spectrum.getStringDataArrays()[i]); } add(static_cast<MetaInfoInterface &>(spectrum)); treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first()); } /// Adds a feature map void add(FeatureMap& map) { //identifier add(static_cast<DocumentIdentifier &>(map)); //protein ids for (Size i = 0; i < map.getProteinIdentifications().size(); ++i) { add(map.getProteinIdentifications()[i]); } //unassigned peptide ids for (Size i = 0; i < map.getUnassignedPeptideIdentifications().size(); ++i) { add(map.getUnassignedPeptideIdentifications()[i]); } treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first()); } /// Adds a feature void add(Feature & feature); /// Adds a consensus feature void add(ConsensusFeature & feature); /// Adds a consensus map void add(ConsensusMap & map); /** @brief A generic function to add data. The meta data information of all classes that for which a visualize_ method exists can be visualized. */ template <class MetaDataType> void add(MetaDataType & meta_data_object) { visualize_(meta_data_object); treeview_->expandItem(treeview_->findItems(QString::number(0), Qt::MatchExactly, 1).first()); } /// Check if mode is editable or not bool isEditable() const; /// Defines friend classes that can use the functionality of the subclasses. friend class ProteinIdentificationVisualizer; friend class PeptideIdentificationVisualizer; public slots: /// Set a list of error strings due to invalid date format. void setStatus(const std::string& status); protected slots: /// Raises the corresponding viewer from the widget stack according to the item selected in the tree. void showDetails_(); /// Saves all changes and close explorer void saveAll_(); protected: ///@name Visualizer for the different classes //@{ void visualize_(ExperimentalSettings & meta, QTreeWidgetItem * parent = nullptr); void visualize_(SpectrumSettings & meta, QTreeWidgetItem * parent = nullptr); void visualize_(MetaInfoInterface & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Sample & meta, QTreeWidgetItem * parent = nullptr); void visualize_(HPLC & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Gradient & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Software & meta, QTreeWidgetItem * parent = nullptr); void visualize_(ScanWindow & meta, QTreeWidgetItem * parent = nullptr); void visualize_(SourceFile & meta, QTreeWidgetItem * parent = nullptr); void visualize_(ContactPerson & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Instrument & meta, QTreeWidgetItem * parent = nullptr); void visualize_(IonSource & meta, QTreeWidgetItem * parent = nullptr); void visualize_(IonDetector & meta, QTreeWidgetItem * parent = nullptr); void visualize_(MassAnalyzer & meta, QTreeWidgetItem * parent = nullptr); void visualize_(DataProcessingPtr & meta, QTreeWidgetItem * parent = nullptr); void visualize_(ProteinIdentification & meta, QTreeWidgetItem * parent = nullptr); void visualize_(ProteinHit & meta, QTreeWidgetItem * parent = nullptr); void visualize_(PeptideHit & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Acquisition & meta, QTreeWidgetItem * parent = nullptr); void visualize_(AcquisitionInfo & meta, QTreeWidgetItem * parent = nullptr); void visualize_(MetaInfoDescription & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Precursor & meta, QTreeWidgetItem * parent = nullptr); void visualize_(Product & meta, QTreeWidgetItem * parent = nullptr); void visualize_(InstrumentSettings & meta, QTreeWidgetItem * parent = nullptr); void visualize_(PeptideIdentification & meta, QTreeWidgetItem * parent = nullptr); void visualize_(DocumentIdentifier & meta, QTreeWidgetItem * parent = nullptr); //@} /// Visualizes all elements of a container template <typename ContainerType> void visualizeAll_(ContainerType & container, QTreeWidgetItem * parent) { for (typename ContainerType::iterator it = container.begin(); it != container.end(); ++it) { visualize_(*it, parent); } } /// Connects the Signals of all visualiser classes with Slot setStatus() void connectVisualizer_(BaseVisualizerGUI * ptr); /// Filters hits according to a score @a threshold. Takes the score orientation into account void filterHits_(double threshold, bool higher_better, int tree_item_id); /// Shows hits. void showAllHits_(int tree_item_id); /// A list of setting errors due to invalid formats. std::string status_list_; /// Indicates the mode bool editable_; /// A widgetstack that keeps track of all widgets. QStackedWidget * ws_; /// Save button QPushButton * saveallbutton_; /// Close Button QPushButton * closebutton_; /// Cancel Button QPushButton * cancelbutton_; /// Undo Button QPushButton * undobutton_; /// The tree. QTreeWidget * treeview_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/EnhancedWorkspace.h
.h
2,176
71
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QMdiArea> class QMimeData; class QDragEnterEvent; class QDragMoveEvent; class QDropEvent; namespace OpenMS { class EnhancedTabBarWidgetInterface; class OPENMS_GUI_DLLAPI EnhancedWorkspace : public QMdiArea { Q_OBJECT public: /// Constructor EnhancedWorkspace(QWidget * parent); /// Destructor ~EnhancedWorkspace() override; /// Adds a subwindow to the QMdiArea /// Qt will add a System menu (which shows when you right-click on the subwindows' local top bar). /// This menu will contain a shortcut for Ctrl-W, which makes our custom Ctrl-W in TOPPView's menu ambiguous. /// Upon pressing it, you will get a `QAction::event: Ambiguous shortcut overload: Ctrl+W` on the console and no triggered signal. /// To prevent this we simply set the SystemMenu to null (no menu will show when you right-click). /// If you do not want that, call Qt's overload of addSubWindow QMdiSubWindow* addSubWindow(QWidget* widget); /// arrange all windows horizontally void tileHorizontal(); /// arrange all windows vertically void tileVertical(); /// get the subwindow with the given id (for all subwindows which inherit from EnhancedTabBarWidgetInterface) /// Returns nullptr if window is not present EnhancedTabBarWidgetInterface* getWidget(int id) const; signals: /// Signal that is emitted, when a drag-and-drop action ends on this widget void dropReceived(const QMimeData * data, QWidget * source, int id); protected: ///@name Reimplemented Qt events //@{ void dragEnterEvent(QDragEnterEvent * event) override; void dragMoveEvent(QDragMoveEvent * event) override; void dropEvent(QDropEvent * event) override; //@} }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/LayerData1DBase.h
.h
4,888
123
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/LayerDataBase.h> #include <OpenMS/VISUAL/ANNOTATION/Annotations1DContainer.h> class QWidget; namespace OpenMS { class Annotation1DItem; /** * \brief Base class for all 1D layers, a special case of LayerData. * * 1D is a bit special because we need to remember which spectrum/chrom/IM is currently shown (there are usually many of them to choose from). * * */ class OPENMS_GUI_DLLAPI LayerData1DBase : public virtual LayerDataBase { public: // rule of 0 /** * \brief Obtain a painter which can draw the layer on a canvas * \return A painter */ virtual std::unique_ptr<Painter1DBase> getPainter1D() const = 0; /// Returns the data range in all known dimensions for the data of the currently active index (i.e. only a single spec/chrom/etc). /// If a layer does not support the dimension (or the layer is empty) the dimension will be empty /// If you need the data range for the whole layer (i.e. all specs/chroms/etc), call 'LayerDataBase::getRange()' virtual RangeAllType getRange1D() const = 0; /** * \brief Given a @p partial_range for the current 1D layer (e.g. an m/z range), fill in the other * dimensions (usually intensity) from all data points which are within the input range. * \param partial_range Range with at least one dimension populated (which is used to filter the current spectrum/chrom/...) * \return Range of the data points within the input range (e.g. for spectra: m/z and intensity; or chroms: RT and intensity, etc) */ virtual RangeAllType getRangeForArea(const RangeAllType partial_range) const = 0; /** * \brief Get a context menu (with lambda actions included) for this 1D layer, when a Annotation1DItem was right-clicked * \param annot_item The annotation item clicked on * \param need_repaint Reference of bool in calling function, which must know if the action requires repainting the canvas * \return A context menu to embed into the generic menu */ virtual QMenu* getContextMenuAnnotation(Annotation1DItem* annot_item, bool& need_repaint) = 0; /** * \brief Add a Annotation1DPeakItem to getCurrentAnnotations(). The specific type is determined by the derived class (e.g. Peak1D, ChromatogramPeak1D, etc) * \param peak_index Which peak should be annotated? * \param text Text to annotate with * \param color Color of the text * \return The item that was created */ virtual Annotation1DItem* addPeakAnnotation(const PeakIndex& peak_index, const QString& text, const QColor& color) = 0; /// get name augmented with attributes, e.g. '*' if modified String getDecoratedName() const override; /// Returns a const reference to the annotations of the current spectrum (1D view) const Annotations1DContainer& getCurrentAnnotations() const { return annotations_1d_[current_idx_]; } /// Returns a mutable reference to the annotations of the current spectrum (1D view) Annotations1DContainer& getCurrentAnnotations() { return annotations_1d_[current_idx_]; } /// Returns a const reference to the annotations of the @p spectrum_index's spectrum (1D view) const Annotations1DContainer& getAnnotations(Size spectrum_index) const { return annotations_1d_[spectrum_index]; } /// Returns a mutable reference to the annotations of the @p spectrum_index's spectrum (1D view) Annotations1DContainer& getAnnotations(Size spectrum_index) { return annotations_1d_[spectrum_index]; } /// Get the index of the current spectrum (1D view) Size getCurrentIndex() const { return current_idx_; } /// Set the index of the current spectrum (1D view) -- and prepares annotations void setCurrentIndex(Size index); /// Does the layer have at least @p index items (e.g. spectra, chroms, etc), so a call to setCurrentIndex() is valid? virtual bool hasIndex(Size index) const = 0; /// if this layer is flipped (1d mirror view) bool flipped = false; /// Peak colors of the currently shown spectrum std::vector<QColor> peak_colors_1d; protected: /// Index of the current spectrum/chromatogram etc (by default, show the first one) Size current_idx_ = 0; /// Annotations of all spectra of the experiment (1D view) std::vector<Annotations1DContainer> annotations_1d_ = std::vector<Annotations1DContainer>(1); }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/Plot1DWidget.h
.h
2,938
113
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> // STL #include <vector> // OpenMS #include <OpenMS/VISUAL/PlotWidget.h> #include <OpenMS/VISUAL/Plot1DCanvas.h> class QAction; class QSpacerItem; namespace OpenMS { class Plot1DCanvas; /** @brief Widget for visualization of several spectra The widget is composed of a scroll bar, an AxisWidget and a Plot1DCanvas as central widget. @image html Plot1DWidget.png The example image shows %Plot1DWidget displaying a raw data layer and a peak data layer. @ingroup PlotWidgets */ class OPENMS_GUI_DLLAPI Plot1DWidget : public PlotWidget { Q_OBJECT public: /// Default constructor Plot1DWidget(const Param& preferences, const DIM gravity_axis = DIM::Y, QWidget* parent = nullptr); /// Destructor ~Plot1DWidget() override; // docu in base class Plot1DCanvas* canvas() const override { return static_cast<Plot1DCanvas*>(canvas_); } // Docu in base class void setMapper(const DimMapper<2>& mapper) override { canvas_->setMapper(mapper); } // Docu in base class void hideAxes() override; // Docu in base class void showLegend(bool show) override; /// Switches to mirror view, displays another y-axis for the second spectrum void toggleMirrorView(bool mirror); /// Performs an alignment of the layers with @p layer_index_1 and @p layer_index_2 void performAlignment(Size layer_index_1, Size layer_index_2, const Param & param); /// Resets the alignment void resetAlignment(); // Docu in base class void saveAsImage() override; // Docu in base class virtual void renderForImage(QPainter& painter); signals: /// Requests to display the whole spectrum in 2D view void showCurrentPeaksAs2D(); /// Requests to display the whole spectrum in 3D view void showCurrentPeaksAs3D(); /// Requests to display the whole spectrum in ion mobility view void showCurrentPeaksAsIonMobility(const MSSpectrum& spec); /// Requests to display a full DIA window void showCurrentPeaksAsDIA(const Precursor& pc, const MSExperiment& exp); public slots: // Docu in base class void showGoToDialog() override; protected: // Docu in base class void recalculateAxes_() override; /// The second y-axis for the mirror view AxisWidget * flipped_y_axis_; /// Spacer between the two y-axes in mirror mode (needed when visualizing an alignment) QSpacerItem * spacer_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/MISC/FilterableList.h
.h
4,491
107
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QSet> #include <QWidget> namespace Ui { class FilterableList; } class QListWidgetItem; namespace OpenMS { namespace Internal { /** @brief A widget which shows a list of text items, which can be filtered. A text field serves as filter expression (unix wildcard regEx support - see https://doc.qt.io/archives/qt-5.10/qregexp.html#wildcard-matching), which hides any items in the list which do not match the currently typed text. You can also specify a blacklist of items which should never be shown, even though they are in the list. This is useful for only showing items which are not yet chosen elsewhere. Make sure all blacklist items are actually valid text items, which are contained in the list and can actually be blacklisted. Otherwise an exception is thrown. To query the currently selected items, use getSelectedItems() or connect to the 'itemDoubleClicked()' signal. */ class FilterableList : public QWidget { Q_OBJECT public: /// C'tor explicit FilterableList(QWidget* parent); ~FilterableList(); /// get the currently selected items of all visible items, i.e. must pass the filter and be selected QStringList getSelectedItems() const; /// get all items which are visible (i.e. excludes the ones which are hidden by the filter) QStringList getAllVisibleItems() const; public slots: /// Provide new items to the widget. /// Be careful if blacklisted items have already been set. If in doubt, clear blacklisted items first to avoid an exception. /// @throws Exception::InvalidValue if any of the internal @p blacklist_items_ is not contained in the given @p items void setItems(const QStringList& items); /// sets items of a blacklist, i.e. they are not shown, even if they are in the item list /// @throws Exception::InvalidValue if any of @p blacklist_items is not contained in current items void setBlacklistItems(const QStringList& blacklist_items); /// adds items to a blacklist, i.e. they are not shown, even if they are in the item list /// @throws Exception::InvalidValue if any of @p additional_blacklist_items is not contained in current items void addBlackListItems(const QStringList& additional_blacklist_items); /// removes items from blacklist, which should not be shown, even if they are in the item list /// @throws Exception::InvalidValue if any of @p outdated_blacklist_items is not contained in current blacklist void removeBlackListItems(const QStringList& outdated_blacklist_items); signals: /// emitted when the user has edited the filter void filterChanged(const QString& filter_text); /// emitted when this item was double clicked void itemDoubleClicked(QListWidgetItem* item); private slots: /// internally invoked when the filter was changed by the user /// emits 'filterChanged' signal and updates the current list of visible items void filterEdited_(const QString& filter_text); /// recompute @p items_wo_bl_, whenever items_ or blacklist_ changed. /// and call updateVisibleList_() void updateInternalList_(); /// update shown items, based on current @p items_wo_bl_ and current filter void updateVisibleList_(); private: Ui::FilterableList* ui_; QStringList items_; ///< full list of items to show; when filtered only a subset is shown // this needs to be a Set, otherwise items might be blacklisted twice, which will lead to an Exception (because it cannot find the item on the second round) QSet<QString> blacklist_; ///< blacklisted items, which are never shown, even if in @p items_; QStringList items_wo_bl_; ///< items from @p item_ with blacklisted items removed }; } // ns Internal } // ns OpenMS // this is required to allow parent widgets (auto UIC'd from .ui) to have a FilterableList member using FilterableList = OpenMS::Internal::FilterableList;
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/MISC/GUIHelpers.h
.h
8,061
206
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/DATASTRUCTURES/ListUtils.h> #include <OpenMS/FORMAT/FileHandler.h> // declare Qt classes OUTSIDE of namespace OpenMS! class QPainter; class QPoint; class QPointF; class QRectF; class QWidget; #include <QColor> #include <QFont> #include <QtCore/qcontainerfwd.h> // for QStringList #include <array> namespace OpenMS { class FileTypeList; /** Namespace which holds static GUI-related helper functions. */ namespace GUIHelpers { /// Open a folder in file explorer /// Will show a message box on failure OPENMS_GUI_DLLAPI void openFolder(const QString& folder); /// Open a dialog to select a filename to save data to. OPENMS_GUI_DLLAPI QString getSaveFilename(QWidget* parent, const QString& caption, const QString& dir, const FileTypeList& supported_file_types, bool add_all_filter, const FileTypes::Type fallback_extension); /// Open TOPPView (e.g. from within TOPPAS) as a detached process (i.e. will continue running when this process ends) /// @return true if process started successfully OPENMS_GUI_DLLAPI bool startTOPPView(QStringList args); /// Open a certain URL (in a browser) /// Will show a message box on failure OPENMS_GUI_DLLAPI void openURL(const QString& target); /** @brief draw a multi-line text at coordinates XY using a specific font and color Internally used getTextDimension() to figure out the size of the text-block/background which needs to be painted. @param[in] painter Where to draw @param[in] text Each item is a new line @param[in] where Coordinates where to start drawing (upper left corner of text) @param[in] col_fg Optional text color; if invalid (=default) will use the current painter's color @param[in] col_bg Optional background color of bounding rectangle; if invalid (=default) no background will be painted @param[in] font Font to use; will use Courier by default */ OPENMS_GUI_DLLAPI void drawText(QPainter& painter, const QStringList& text, const QPoint& where, const QColor& col_fg = QColor("invalid"), const QColor& col_bg = QColor("invalid"), const QFont& font = QFont("Courier")); /** @brief Obtains the bounding rectangle of a text (useful to determine overlaps etc) */ OPENMS_GUI_DLLAPI QRectF getTextDimension(const QStringList& text, const QFont& font, int& line_spacing); /// Returns the point in the @p list that is nearest to @p origin OPENMS_GUI_DLLAPI QPointF nearestPoint(const QPointF& origin, const QList<QPointF>& list); /** * \brief Find the point on a rectangle where a ray/line from a point @p p to its center would intersect at * \param rect Rectangle which intersects with the line from @p p to its center * \param p A point outside the rectangle * \return The intersection point or the center() of @p rect if @p p is inside the rectangle */ OPENMS_GUI_DLLAPI QPointF intersectionPoint(const QRectF& rect, const QPointF& p); /** @brief A heuristic: Given a set of levels (rows), try to add items at to topmost row which does not overlap an already placed item in this row (according to its x-coordinate) If a collision occurs, try the row below. If no row is collision-free, pick the one with the smallest overlap. Only positions beyond the largest x-coordinate observed so far are considered (i.e. gaps are not filled). X-coordinates should always be positive (a warning is issued otherwise). */ class OPENMS_GUI_DLLAPI OverlapDetector { public: /// C'tor: number of @p levels must be >=1 /// @throw Exception::InvalidSize if levels <= 0 explicit OverlapDetector(int levels); /// try to put an item which spans from @p x_start to @p x_end in the topmost row possible /// @return the smallest row index (starting at 0) which has none (or the least) overlap size_t placeItem(double x_start, double x_end); private: std::vector<double> rows_; ///< store the largest x_end for each row }; /** @brief RAII class to disable the GUI and set a busy cursor and go back to the original state when this class is destroyed */ class OPENMS_GUI_DLLAPI GUILock { public: /// C'tor receives the widget to lock /// @param[in] gui QWidget to lock(including all children); can be nullptr (nothing will be locked) GUILock(QWidget* gui); /// no copy/assignment allowed GUILock(const GUILock& rhs) = delete; GUILock(GUILock&& rhs) = delete; GUILock& operator=(const GUILock& rhs) = delete; /// D'tor: unlocks the GUI (does nothing if already unlocked) ~GUILock(); /// manually lock the GUI (does nothing if already locked) void lock(); /// manually unlock the GUI (does nothing if already unlocked) void unlock(); private: QWidget* locked_widget_{ nullptr }; bool currently_locked_{ false }; bool was_enabled_{ true }; }; /// color palette for certain purposes /// Currently, only a set of distinct colors is supported class ColorBrewer { public: struct Distinct { enum NAMES { Red, Blue, Green, Brown, Purple, LightGrey, LightGreen, LightBlue, Cyan, Orange, Yellow, Tan, Pink, DarkGrey, SIZE_OF_NAMES }; const std::array<QColor, NAMES::SIZE_OF_NAMES> values = { { Qt::red, Qt::blue, Qt::green, QColor(129, 74, 25) /*brown*/, QColor(129, 38, 192) /*purple*/, Qt::lightGray, QColor(129,197,122) /*lightGreen*/, QColor(157,175,255) /*lightBlue*/, Qt::cyan, QColor(255,146,51) /*orange*/, Qt::yellow, QColor(233,222,187) /*tan*/, QColor(255,205,243) /*pink*/, Qt::darkGray } }; }; /// get a certain color. If @p index is larger than the maximum color, modulo operator will applied (cycling through colors) template<class COLOR_CLASS> static QColor getColor(uint32_t index) { // cycle if necessary if (index >= COLOR_CLASS::NAMES::SIZE_OF_NAMES) index = index % COLOR_CLASS::NAMES::SIZE_OF_NAMES; return COLOR_CLASS().values[index]; } }; // ColorBrewer OPENMS_GUI_DLLAPI StringList convert(const QStringList& in); OPENMS_GUI_DLLAPI QStringList convert(const StringList& in); }; // GUIHelpers }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/MISC/CommonDefs.h
.h
1,237
35
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/DATASTRUCTURES/DPosition.h> namespace OpenMS { /// Macro for Qt's connect() overload resolution (in case signals/slots are overloaded and we need to tell connect what overload to pick /// without repeating ourselves. /// This can be solved in Qt 5.7 by using qOverload<> /// @note: provide the brackets for 'args' yourself, since there might be multiple arguments, separated by comma /// Example: QObject::connect(spinBox, CONNECTCAST(QSpinBox, valueChanged, (double)), slider, &QSlider::setValue); #define CONNECTCAST(class,func,args) static_cast<void(class::*)args>(&class::func) /// Enum to decide which headers(=column) names should be get/set in a table/tree widget enum class WidgetHeader { VISIBLE_ONLY, WITH_INVISIBLE, }; /// Type of the Points in a 'flat' canvas (1D and 2D) using PointXYType = DPosition<2U>; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/MISC/ExternalProcessMBox.h
.h
2,875
66
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/SYSTEM/ExternalProcess.h> namespace OpenMS { /** @brief A wrapper around ExternalProcess to conveniently show a MessageBox when an error occurs Use the custom Ctor to provide callback functions for stdout/stderr output or set them via setCallbacks(). Running an external program blocks the caller, so do not use this in a main GUI thread (unless you have some other means to tell the user that no interaction is possible at the moment). */ class OPENMS_GUI_DLLAPI ExternalProcessMBox { public: /// default Ctor; callbacks for stdout/stderr are empty ExternalProcessMBox(); /// set the callback functions to process stdout and stderr output when the external process generates it ExternalProcessMBox(std::function<void(const String&)> callbackStdOut, std::function<void(const String&)> callbackStdErr); /// D'tor ~ExternalProcessMBox(); /// re-wire the callbacks used using run() void setCallbacks(std::function<void(const String&)> callbackStdOut, std::function<void(const String&)> callbackStdErr); /** @brief Runs a program by calling ExternalProcess::run and shows any error reported in @p error_msg as a MessageBox before this function returns @param[in] parent Optional parent widget, used to position QMesssageBoxes above the parent @param[in] exe The program to call (can contain spaces in path, no problem) @param[in] args A list of extra arguments (can be empty) @param[in,out] working_dir Execute the external process in the given directory (relevant when relative input/output paths are given). Leave empty to use the current working directory. @param[in] verbose Report the call command and errors via the callbacks (default: false) @param[out] error_msg Message to display to the user or log somewhere if something went wrong (if return != SUCCESS) @return Did the external program succeed (SUCCESS) or did something go wrong? */ ExternalProcess::RETURNSTATE run(QWidget* parent, const QString& exe, const QStringList& args, const QString& working_dir, const bool verbose, String& error_msg); /** @brief Same as other overload, just without a returned error message */ ExternalProcess::RETURNSTATE run(QWidget* parent, const QString& exe, const QStringList& args, const QString& working_dir, const bool verbose); private: ExternalProcess ep_; }; } // ns OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/INTERFACES/IPeptideIds.h
.h
1,068
38
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/METADATA/PeptideIdentification.h> #include <OpenMS/METADATA/PeptideIdentificationList.h> #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <vector> namespace OpenMS { /** @brief Abstract base class which defines an interface for PeptideIdentifications */ class OPENMS_GUI_DLLAPI IPeptideIds { public: using PepIds = PeptideIdentificationList; /// get the peptide IDs for this layer virtual const PepIds& getPeptideIds() const = 0; virtual PepIds& getPeptideIds() = 0; /// overwrite the peptide IDs for this layer virtual void setPeptideIds(const PepIds& ids) = 0; virtual void setPeptideIds(PepIds&& ids) = 0; }; }// namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/SpectrumSettingsVisualizer.h
.h
1,501
61
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/SpectrumSettings.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> class QTextEdit; namespace OpenMS { /** @brief Class that displays all meta information for SpectrumSettings objects This class provides all functionality to view the meta information of an object of type SpectrumSettings. */ class OPENMS_GUI_DLLAPI SpectrumSettingsVisualizer : public BaseVisualizerGUI, public BaseVisualizer<SpectrumSettings> { Q_OBJECT public: ///Constructor SpectrumSettingsVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: /// The date of this experiment QLineEdit * native_id_; /// The type of this experiment QComboBox * type_; /// The date of this experiment QTextEdit * comment_; //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/AcquisitionVisualizer.h
.h
1,341
59
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/Acquisition.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for Acquisition objects This class provides all functionality to view the meta information of an object of type Acquisition. */ class OPENMS_GUI_DLLAPI AcquisitionVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Acquisition> { Q_OBJECT public: ///Constructor AcquisitionVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: /// Edit field for the number QLineEdit * acquisitionnumber_; //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/ProteinHitVisualizer.h
.h
1,465
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/ProteinHit.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for ProteinHit objects This class provides all functionality to view the meta information of an object of type ProteinHit. */ class OPENMS_GUI_DLLAPI ProteinHitVisualizer : public BaseVisualizerGUI, public BaseVisualizer<ProteinHit> { Q_OBJECT public: ///Constructor ProteinHitVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * proteinhit_score_; QLineEdit * proteinhit_rank_; QLineEdit * proteinhit_accession_; QTextEdit * proteinhit_sequence_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/ProductVisualizer.h
.h
1,400
59
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/Product.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for Product objects This class provides all functionality to view the meta information of an object of type Product. */ class OPENMS_GUI_DLLAPI ProductVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Product> { Q_OBJECT public: ///Constructor ProductVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * product_mz_; QLineEdit * product_window_up_; QLineEdit * product_window_low_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h
.h
1,381
60
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> namespace OpenMS { /** @brief A base class for all visualizer classes This class provides members and functions that depend on the visualizer type. The GUI components are provided by the BaseVisualizerGUI class. The two classes cannot be merged, as templates and the Qt meta object compiler cannot be combined. Visualizers are mainly used by the MetaDataBrowser. */ template <typename ObjectType> class OPENMS_GUI_DLLAPI BaseVisualizer { public: /// Loads the object that is to be edited. void load(ObjectType& o) { ptr_ = &o; temp_ = o; update_(); } virtual ~BaseVisualizer() {} protected: /// Pointer to the object that is currently edited ObjectType* ptr_; /// Copy of current object used to restore the original values ObjectType temp_; protected: ///Updates the GUI from the temp_ variable. virtual void update_() { } }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/MassAnalyzerVisualizer.h
.h
1,731
72
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/MassAnalyzer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for MassAnalyzer objects This class provides all functionality to view the meta information of an object of type MassAnalyzer. */ class OPENMS_GUI_DLLAPI MassAnalyzerVisualizer : public BaseVisualizerGUI, public BaseVisualizer<MassAnalyzer> { Q_OBJECT public: ///Constructor MassAnalyzerVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name edit fields to modify properties //@{ QLineEdit * order_; QLineEdit * res_; QLineEdit * acc_; QLineEdit * scan_rate_; QLineEdit * scan_time_; QLineEdit * TOF_; QLineEdit * iso_; QLineEdit * final_MS_; QLineEdit * magnetic_fs_; QComboBox * type_; QComboBox * res_method_; QComboBox * res_type_; QComboBox * scan_dir_; QComboBox * scan_law_; QComboBox * reflectron_state_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/PrecursorVisualizer.h
.h
1,510
63
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/Precursor.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for Precursor objects This class provides all functionality to view the meta information of an object of type Precursor. */ class OPENMS_GUI_DLLAPI PrecursorVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Precursor> { Q_OBJECT public: ///Constructor PrecursorVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * mz_; QLineEdit * int_; QLineEdit * charge_; QLineEdit * window_up_; QLineEdit * window_low_; QListWidget * activation_methods_; QLineEdit * activation_energy_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/ContactPersonVisualizer.h
.h
1,524
65
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/ContactPerson.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for ContactPerson objects This class provides all functionality to view the meta information of an object of type ContactPerson. */ class OPENMS_GUI_DLLAPI ContactPersonVisualizer : public BaseVisualizerGUI, public BaseVisualizer<ContactPerson> { Q_OBJECT public: ///Constructor ContactPersonVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * firstname_; QLineEdit * lastname_; QLineEdit * institution_; QLineEdit * email_; QLineEdit * contact_info_; QLineEdit * address_; QLineEdit * url_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/MetaInfoVisualizer.h
.h
2,582
100
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> #include <OpenMS/METADATA/MetaInfoInterface.h> //STL #include <vector> #include <utility> class QAbstractButton; class QButtonGroup; namespace OpenMS { /** @brief MetaInfoVisualizer is a visualizer class for all classes that use one MetaInfo object as member. Meta information is an array of Type-Name-Value tuples. Classes that have a MetaInfo objects as a member can use this class to edit the MetaInfo object. */ class OPENMS_GUI_DLLAPI MetaInfoVisualizer : public BaseVisualizerGUI, public BaseVisualizer<MetaInfoInterface> { Q_OBJECT public: ///Constructor MetaInfoVisualizer(bool editable = false, QWidget * parent = nullptr); //Docu in base class void load(MetaInfoInterface & m); public slots: //Docu in base class void store() override; protected slots: /// Adds a new Type-Value pair to the MetaInfo Object. void add_(); /// Clears out all fields. void clear_(); /// Removes a selected Type-Value pair from the MetaInfo Object. void remove_(int); ///Undo the changes made in the GUI. void undo_(); protected: /// Loads all Type-Value pairs one after another. void loadData_(UInt index); /** @name Edit fields for new Type-Value pair. */ //@{ QLineEdit * newkey_; QLineEdit * newvalue_; QLineEdit * newdescription_; //@} ///@name Arrays of pointers to objects for temporary metaInfo data //@{ std::vector<std::pair<UInt, QLineEdit *> > metainfoptr_; std::vector<std::pair<UInt, QLabel *> > metalabels_; std::vector<std::pair<UInt, QAbstractButton *> > metabuttons_; //@} ///@name Edit fields and buttons //@{ QPushButton * addbutton_; QPushButton * clearbutton_; QButtonGroup * buttongroup_; //@} /// Counter to keep track of the actual row in the layout. int nextrow_; /// The layout to display the Type-Value pairs. QGridLayout * viewlayout_; /// Container for metainfo data. std::vector<UInt> keys_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/AcquisitionInfoVisualizer.h
.h
1,374
59
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/AcquisitionInfo.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> //QT namespace OpenMS { /** @brief Class that displays all meta information for AcquisitionInfo objects This class provides all functionality to view the meta information of an object of type AcquisitionInfo. */ class OPENMS_GUI_DLLAPI AcquisitionInfoVisualizer : public BaseVisualizerGUI, public BaseVisualizer<AcquisitionInfo> { Q_OBJECT public: ///Constructor AcquisitionInfoVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: /// Edit field for the method QLineEdit * acquisitioninfo_method_; //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/InstrumentVisualizer.h
.h
1,449
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/Instrument.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for an MS instrument This class provides all functionality to view the meta information of an object of type Instrument. */ class OPENMS_GUI_DLLAPI InstrumentVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Instrument> { Q_OBJECT public: ///Constructor InstrumentVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * name_; QLineEdit * vendor_; QLineEdit * model_; QTextEdit * customizations_; QComboBox * ion_optics_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/PeptideIdentificationVisualizer.h
.h
2,305
78
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/PeptideIdentification.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { class MetaDataBrowser; /** @brief Class that displays all meta information for PeptideIdentification objects This class provides all functionality to view the meta information of an object of type PeptideIdentification. */ class OPENMS_GUI_DLLAPI PeptideIdentificationVisualizer : public BaseVisualizerGUI, public BaseVisualizer<PeptideIdentification> { Q_OBJECT public: ///Constructor PeptideIdentificationVisualizer(bool editable = false, QWidget * parent = nullptr, MetaDataBrowser * caller = nullptr); /// Loads the meta data from the object to the viewer. Gets the id of the item in the tree as parameter. void load(PeptideIdentification & s, int tree_item_id); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); /** @brief Updates the tree by calling MetaDataBrowser::updatePeptideHits(PeptideIdentification, int) Calls MetaDataBrowser::updatePeptideHits(PeptideIdentification, int).<br> Updates the tree depending of the protein significance threshold.<br> Only ProteinHits with a score superior or equal to the current threshold will be displayed. */ void updateTree_(); protected: /// Pointer to MetaDataBrowser MetaDataBrowser * pidv_caller_; /// The id of the item in the tree int tree_id_; ///@name Edit fields and buttons //@{ QLineEdit * identifier_; QLineEdit * score_type_; QComboBox * higher_better_; QLineEdit * identification_threshold_; //@} /// Threshold for filtering by score QLineEdit * filter_threshold_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/InstrumentSettingsVisualizer.h
.h
1,488
61
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/InstrumentSettings.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for InstrumentSettings objects This class provides all functionality to view the meta information of an object of type InstrumentSettings. */ class OPENMS_GUI_DLLAPI InstrumentSettingsVisualizer : public BaseVisualizerGUI, public BaseVisualizer<InstrumentSettings> { Q_OBJECT public: ///Constructor InstrumentSettingsVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QComboBox * instrumentsettings_scan_mode_; QComboBox * zoom_scan_; QComboBox * instrumentsettings_polarity_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/HPLCVisualizer.h
.h
1,467
65
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/HPLC.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for HPLC objects This class provides all functionality to view the meta information of an object of type HPLC. */ class OPENMS_GUI_DLLAPI HPLCVisualizer : public BaseVisualizerGUI, public BaseVisualizer<HPLC> { Q_OBJECT public: ///Constructor HPLCVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * hplcinstrument_; QLineEdit * hplccolumn_; QLineEdit * hplctemperature_; QLineEdit * hplcpressure_; QLineEdit * hplcflux_; QTextEdit * hplccomment_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/MetaInfoDescriptionVisualizer.h
.h
1,415
59
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/MetaInfoDescription.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for MetaInfoDescription objects This class provides all functionality to view the meta information of an object of type MetaInfoDescription. */ class OPENMS_GUI_DLLAPI MetaInfoDescriptionVisualizer : public BaseVisualizerGUI, public BaseVisualizer<MetaInfoDescription> { Q_OBJECT public: ///Constructor MetaInfoDescriptionVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * metainfodescription_name_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/IonSourceVisualizer.h
.h
1,426
61
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/IonSource.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for IonSource objects This class provides all functionality to view the meta information of an object of type IonSource */ class OPENMS_GUI_DLLAPI IonSourceVisualizer : public BaseVisualizerGUI, public BaseVisualizer<IonSource> { Q_OBJECT public: ///Constructor IonSourceVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * order_; QComboBox * inlet_type_; QComboBox * ionization_method_; QComboBox * polarity_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/DataProcessingVisualizer.h
.h
1,424
61
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/DataProcessing.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> class QListWidget; namespace OpenMS { /** @brief Class that displays all meta information for DataProcessing objects This class provides all functionality to view the meta information of an object of type DataProcessing. */ class OPENMS_GUI_DLLAPI DataProcessingVisualizer : public BaseVisualizerGUI, public BaseVisualizer<DataProcessing> { Q_OBJECT public: /// Constructor DataProcessingVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * completion_time_; QListWidget * actions_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/SourceFileVisualizer.h
.h
1,529
65
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/SourceFile.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for SourceFile objects This class provides all functionality to view the meta information of an object of type SourceFile. */ class OPENMS_GUI_DLLAPI SourceFileVisualizer : public BaseVisualizerGUI, public BaseVisualizer<SourceFile> { Q_OBJECT public: ///Constructor SourceFileVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * name_of_file_; QLineEdit * path_to_file_; QLineEdit * file_size_; QLineEdit * file_type_; QLineEdit * checksum_; QComboBox * checksum_type_; QLineEdit * native_id_type_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/SoftwareVisualizer.h
.h
1,400
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/Software.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { class MetaDataBrowser; /** @brief Class that displays all meta information for Software objects This class provides all functionality to view the meta information of an object of type Software. */ class OPENMS_GUI_DLLAPI SoftwareVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Software> { Q_OBJECT public: ///Constructor SoftwareVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * software_name_; QLineEdit * software_version_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/ExperimentalSettingsVisualizer.h
.h
1,542
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/ExperimentalSettings.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { class MetaDataBrowser; /** @brief Class that displays all meta information for ExperimentalSettings objects This class provides all functionality to view the meta information of an object of type ExperimentalSettings. */ class OPENMS_GUI_DLLAPI ExperimentalSettingsVisualizer : public BaseVisualizerGUI, public BaseVisualizer<ExperimentalSettings> { Q_OBJECT public: ///Constructor ExperimentalSettingsVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: /// The date of this experiment QLineEdit * datetime_; /// The comment to this experiment QTextEdit * comment_; /// Fraction identifier QLineEdit * fraction_identifier_; //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/GradientVisualizer.h
.h
2,863
114
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> #include <OpenMS/METADATA/Gradient.h> //STL #include <vector> class QIntValidator; namespace OpenMS { /** @brief GradientVisualizer is a visualizer class for objects of type gradient. Each HPLC objects contains a gradient object. A gradient objects contains a list of eluents, timepoints and percentage values. Values can be added to the list, or the whole list can be deleted. */ class OPENMS_GUI_DLLAPI GradientVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Gradient> { Q_OBJECT public: ///Constructor GradientVisualizer(bool editable = false, QWidget * parent = nullptr); //Docu in base class void load(Gradient & g); public slots: //Docu in base class void store() override; protected slots: /// Add new timepoint to the list void addTimepoint_(); /// Add new eluent to the list void addEluent_(); ///Delete all data from gradient void deleteData_(); ///Undo the changes made in the GUI. void undo_(); protected: /// Loads a list of eluent, timepoint and percentage triplets. void loadData_(); /// Remove all data from layout void removeData_(); /** @name Edit fields for new eluent-timepoint-percentage-triplets. */ //@{ QLineEdit * new_eluent_; QLineEdit * new_timepoint_; //@} /** @name Arrays of string values containing eluent, timepoint and percentage values. */ //@{ std::vector<String> eluents_; std::vector<Int> timepoints_; //@} /** @name Some buttons. */ //@{ QPushButton * add_eluent_button_; QPushButton * add_timepoint_button_; QPushButton * removebutton_; //@} /// Array of temporary pointers to gradient edit fields std::vector<QLineEdit *> gradientdata_; /// Array of temporary pointers to gradient labels std::vector<QLabel *> gradientlabel_; /// Pointer to fields with actual data QLineEdit * percentage_; /// A validator to check the input for the new timepoint. QIntValidator * timepoint_vali_; /// Counter to keep track of the actual row in the layout. int nextrow_; /// The layout to display the eluents, timepoints and percentages. QGridLayout * viewlayout_; //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/ScanWindowVisualizer.h
.h
1,391
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/ScanWindow.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { class MetaDataBrowser; /** @brief Class that displays all meta information for ScanWindow objects This class provides all functionality to view the meta information of an object of type ScanWindow. */ class OPENMS_GUI_DLLAPI ScanWindowVisualizer : public BaseVisualizerGUI, public BaseVisualizer<ScanWindow> { Q_OBJECT public: ///Constructor ScanWindowVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * begin_; QLineEdit * end_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/SampleVisualizer.h
.h
1,548
66
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/Sample.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information of sample objects. This class provides all functionality to view the meta information of an object of type Sample. */ class OPENMS_GUI_DLLAPI SampleVisualizer : public BaseVisualizerGUI, public BaseVisualizer<Sample> { Q_OBJECT public: ///Constructor SampleVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * samplename_; QLineEdit * samplenumber_; QLineEdit * sampleorganism_; QTextEdit * samplecomment_; QComboBox * samplestate_; QLineEdit * samplemass_; QLineEdit * samplevolume_; QLineEdit * sampleconcentration_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/DocumentIdentifierVisualizer.h
.h
1,456
61
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/DocumentIdentifier.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> //QT namespace OpenMS { /** @brief Class that displays all meta information for DocumentIdentifier objects This class provides all functionality to view the meta information of an object of type DocumentIdentifier. */ class OPENMS_GUI_DLLAPI DocumentIdentifierVisualizer : public BaseVisualizerGUI, public BaseVisualizer<DocumentIdentifier> { Q_OBJECT public: ///Constructor DocumentIdentifierVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * identifier_; QLineEdit * file_path_; QLineEdit * file_type_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/IonDetectorVisualizer.h
.h
1,450
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/IonDetector.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for IonDetector objects This class provides all functionality to view the meta information of an object of type IonDetector. */ class OPENMS_GUI_DLLAPI IonDetectorVisualizer : public BaseVisualizerGUI, public BaseVisualizer<IonDetector> { Q_OBJECT public: ///Constructor IonDetectorVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name edit fields to modify properties //@{ QLineEdit * order_; QLineEdit * res_; QLineEdit * freq_; QComboBox * type_; QComboBox * ac_mode_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/PeptideHitVisualizer.h
.h
1,462
63
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/PeptideHit.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { /** @brief Class that displays all meta information for PeptideHit objects This class provides all functionality to view the meta information of an object of type PeptideHit. */ class OPENMS_GUI_DLLAPI PeptideHitVisualizer : public BaseVisualizerGUI, public BaseVisualizer<PeptideHit> { Q_OBJECT public: ///Constructor PeptideHitVisualizer(bool editable = false, QWidget * parent = nullptr); public slots: //Docu in base class void store() override; protected slots: ///Undo the changes made in the GUI. void undo_(); protected: ///@name Edit fields and buttons //@{ QLineEdit * peptidehit_score_; QLineEdit * peptidehit_charge_; QLineEdit * peptidehit_rank_; QTextEdit * peptidehit_sequence_; //@} //Docu in base class void update_() override; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h
.h
3,617
108
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer:Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/CONCEPT/Types.h> #include <QtWidgets> class QPushButton; class QGridLayout; class QLineEdit; class QTextEdit; class QComboBox; class QListWidget; class QLabel; namespace OpenMS { /** @brief A base class for all visualizer classes This class provides the GUI for part for all visualizers. Several additional members are provided by the BaseVisualizer class. The two classes cannot be merged, as templates and the Qt meta object compiler cannot be combined. Visualizers are mainly used by the MetaDataBrowser. */ class OPENMS_GUI_DLLAPI BaseVisualizerGUI : public QWidget { Q_OBJECT public: ///Constructor BaseVisualizerGUI(bool editable = false, QWidget * parent = nullptr); /// Returns if the values are editable bool isEditable() const; signals: /// Sends a status message, if date is not in proper format. void sendStatus(std::string status); public slots: ///Saves the changes made in the GUI to the object. virtual void store() = 0; protected: /// Adds a label to the grid layout. void addLabel_(const QString& label); /// Adds a label to a certain row void addLabel_(const QString& label, UInt row); /// Adds a line edit field with label to the grid layout. void addLineEdit_(QLineEdit * & ptr, QString label); /// Adds a line edit field to the grid layout including a int validator void addIntLineEdit_(QLineEdit * & ptr, QString label); /// Adds a line edit field to the grid layout including a double validator void addDoubleLineEdit_(QLineEdit * & ptr, QString label); /// Adds a line edit field with label and button to the next free position in the grid. void addLineEditButton_(const QString& label, QLineEdit * & ptr1, QPushButton * & ptr2, const QString& buttonlabel); /// Adds a list edit field to the grid layout. void addListView_(QListWidget * & ptr, QString label); /// Adds a text edit field to the grid layout. void addTextEdit_(QTextEdit * & ptr, QString label); /// Adds a drop-down field to the grid layout. void addComboBox_(QComboBox * & ptr, QString label); /// Adds a boolean drop-down field to the grid layout ( 'true'=1, 'false'=0 ). void addBooleanComboBox_(QComboBox * & ptr, QString label); /// Fills a combo box with string @p items (the number of strings is determined by @p item_count). void fillComboBox_(QComboBox * & ptr, const std::string * items, int item_count); /// Adds vertical spacer. void addVSpacer_(); /// Adds a button to the next free position in the grid. void addButton_(QPushButton * & ptr, const QString& label); /// Adds two buttons in a row. void add2Buttons_(QPushButton * & ptr1, const QString& label1, QPushButton * & ptr2, const QString& label2); /// Adds a horizontal line as a separator. void addSeparator_(); /// Adds buttons common to all visualizers void finishAdding_(); ///Undo button QPushButton * undo_button_; /// The main layout. QGridLayout * mainlayout_; /// Counter for the current grid row. UInt row_; /// Edit flag bool editable_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISUALIZER/ProteinIdentificationVisualizer.h
.h
2,600
92
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/METADATA/ProteinIdentification.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h> #include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h> namespace OpenMS { class MetaDataBrowser; /** @brief Class that displays all meta information for ProteinIdentification objects This class provides all functionality to view the meta information of an object of type Identification. */ class OPENMS_GUI_DLLAPI ProteinIdentificationVisualizer : public BaseVisualizerGUI, public BaseVisualizer<ProteinIdentification> { Q_OBJECT public: ///Constructor ProteinIdentificationVisualizer(bool editable = false, QWidget * parent = 0, MetaDataBrowser * caller = nullptr); /// Loads the meta data from the object to the viewer. Gets the id of the item in the tree as parameter. void load(ProteinIdentification & s, int tree_item_id); public slots: //Docu in base class void store() override; protected slots: /** @brief Updates the tree by calling MetaDataBrowser::updateProteinHits() Calls MetaDataBrowser::updateProteinHits().<br> Updates the tree depending of the protein significance threshold.<br> Only ProteinHits with a score superior or equal to the current threshold will be displayed. */ void updateTree_(); ///Undo the changes made in the GUI. void undo_(); protected: /// Pointer to MetaDataBrowser MetaDataBrowser * pidv_caller_; /// The id of the item in the tree int tree_id_; ///@name Edit fields and buttons //@{ QLineEdit * engine_; QLineEdit * engine_version_; QLineEdit * identification_date_; QLineEdit * identification_threshold_; QLineEdit * identifier_; QLineEdit * score_type_; QComboBox * higher_better_; QLineEdit * db_; QLineEdit * db_version_; QLineEdit * taxonomy_; QLineEdit * charges_; QLineEdit * missed_cleavages_; QLineEdit * peak_tolerance_; QLineEdit * precursor_tolerance_; QComboBox * mass_type_; QLineEdit * enzyme_; //@} /// Threshold for filtering by score QLineEdit * filter_threshold_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISITORS/LayerStoreData.h
.h
8,686
239
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/PROCESSING/MISC/DataFilters.h> #include <OpenMS/KERNEL/ConsensusMap.h> #include <OpenMS/KERNEL/FeatureMap.h> #include <OpenMS/KERNEL/MSExperiment.h> #include <OpenMS/KERNEL/RangeManager.h> #include <OpenMS/CONCEPT/ProgressLogger.h> #include <OpenMS/VISUAL/INTERFACES/IPeptideIds.h> namespace OpenMS { /** @brief Base class to store either the currently visible or all data of a canvas */ class OPENMS_GUI_DLLAPI LayerStoreData { public: LayerStoreData(FileTypeList supported_storage_formats) : storage_formats_(supported_storage_formats) { } /// virtual D'tor for proper cleanup of derived classes' members virtual ~LayerStoreData() = default; /// Which formats are supported when writing the file? FileTypeList getSupportedFileFormats() const { return storage_formats_; } /// Save the internal data to a file. The @p filename's suffix determines the file format. It must be one of getSupportedFileFormats() or UNKNOWN. /// If the @p filename's suffix is unknown, the first item from getSupportedFileFormats() determines the storage format. /// @param[in] filename A relative or absolute path+filename. Its suffix determines the format. /// @param[in] lt Show a progress bar in the GUI? /// @throw Exception::UnableToCreateFile if the extension of @p filename is neither in getSupportedFileFormats() nor UNKNOWN. virtual void saveToFile(const String& filename, const ProgressLogger::LogType lt) const = 0; protected: /// extracts the supported extension (converting UNKNOWN to first item in storage_formats_) or throws an Exception::UnableToCreateFile FileTypes::Type getSupportedExtension_(const String& filename) const; FileTypeList storage_formats_; ///< file formats which can hold the data from the layer; The first item should be the preferred/default format }; /** @brief Visitor which can save a visible piece of data; subsequently the data can be stored to a file. */ class OPENMS_GUI_DLLAPI LayerStoreDataPeakMapVisible : public LayerStoreData { public: LayerStoreDataPeakMapVisible() : LayerStoreData(FileTypeList({FileTypes::MZML, FileTypes::MZDATA, FileTypes::MZXML})) {} // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; /** * \brief Stores data from a 1D canvas and remembers the data internally * \param spec The spectrum to store * \param visible_range Restricts m/z (and intensity) * \param layer_filters Remove all peaks not passing this filter */ void storeVisibleSpectrum(const MSSpectrum& spec, const RangeAllType& visible_range, const DataFilters& layer_filters); /** * \brief Stores data from a 1D canvas and remembers the data internally * \param chrom The chromatogram to store * \param visible_range Restricts RT (and intensity) * \param layer_filters Remove all peaks not passing this filter */ void storeVisibleChromatogram(const MSChromatogram& chrom, const RangeAllType& visible_range, const DataFilters& layer_filters); /// analog to storeVisibleSpectrum() void storeVisibleExperiment(const PeakMap& exp, const RangeAllType& visible_range, const DataFilters& layer_filters); private: PeakMap pm_; ///< the filtered data; used when saveToFile() is called }; /** @brief Visitor which can save a full experiment; subsequently the data can be stored to a file. Since only a pointer is stored internally, make sure the lifetime of the PeakMap exceeds this visitor. */ class OPENMS_GUI_DLLAPI LayerStoreDataPeakMapAll : public LayerStoreData { public: LayerStoreDataPeakMapAll() : LayerStoreData(FileTypeList({FileTypes::MZML, FileTypes::MZDATA, FileTypes::MZXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeFullExperiment(const PeakMap& exp); private: const PeakMap* full_exp_ = nullptr; ///< pointer to the full data, when storeFullExperiment() was called }; /** @brief Visitor which can save a visible piece of data; subsequently the data can be stored to a file. */ class OPENMS_GUI_DLLAPI LayerStoreDataFeatureMapVisible : public LayerStoreData { public: LayerStoreDataFeatureMapVisible() : LayerStoreData(FileTypeList({FileTypes::FEATUREXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeVisibleFM(const FeatureMap& fm, const RangeAllType& visible_range, const DataFilters& layer_filters); private: FeatureMap fm_; ///< the filtered data; used when saveToFile() is called }; /** @brief Visitor which can save a full FeatureMap; subsequently the data can be stored to a file. Since only a pointer is stored internally, make sure the lifetime of the FeatureMap exceeds this visitor. */ class OPENMS_GUI_DLLAPI LayerStoreDataFeatureMapAll : public LayerStoreData { public: LayerStoreDataFeatureMapAll() : LayerStoreData(FileTypeList({FileTypes::FEATUREXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeFullFM(const FeatureMap& fm); private: const FeatureMap* full_fm_ = nullptr; ///< pointer to the full data, when storeFullExperiment() was called }; /** @brief Visitor which can save a visible piece of data; subsequently the data can be stored to a file. */ class OPENMS_GUI_DLLAPI LayerStoreDataConsensusMapVisible : public LayerStoreData { public: LayerStoreDataConsensusMapVisible() : LayerStoreData(FileTypeList({FileTypes::CONSENSUSXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeVisibleCM(const ConsensusMap& cm, const RangeAllType& visible_range, const DataFilters& layer_filters); private: ConsensusMap cm_; ///< the filtered data; used when saveToFile() is called }; /** @brief Visitor which can save a full ConsensusMap; subsequently the data can be stored to a file. Since only a pointer is stored internally, make sure the lifetime of the ConsensusMap exceeds this visitor. */ class OPENMS_GUI_DLLAPI LayerStoreDataConsensusMapAll : public LayerStoreData { public: LayerStoreDataConsensusMapAll() : LayerStoreData(FileTypeList({FileTypes::CONSENSUSXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeFullCM(const ConsensusMap& cm); private: const ConsensusMap* full_cm_ = nullptr; ///< pointer to the full data, when storeFullExperiment() was called }; /** @brief Visitor which can save a visible piece of data; subsequently the data can be stored to a file. */ class OPENMS_GUI_DLLAPI LayerStoreDataIdentVisible : public LayerStoreData { public: LayerStoreDataIdentVisible() : LayerStoreData(FileTypeList({FileTypes::IDXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeVisibleIdent(const IPeptideIds::PepIds& ids, const RangeAllType& visible_range, const DataFilters& layer_filters); private: IPeptideIds::PepIds ids_; ///< the filtered data; used when saveToFile() is called }; /** @brief Visitor which can save a full set of Identifications; subsequently the data can be stored to a file. Since only a pointer is stored internally, make sure the lifetime of the Identifications exceeds this visitor. */ class OPENMS_GUI_DLLAPI LayerStoreDataIdentAll : public LayerStoreData { public: LayerStoreDataIdentAll() : LayerStoreData(FileTypeList({FileTypes::IDXML})) { } // docu in base class void saveToFile(const String& filename, const ProgressLogger::LogType lt) const override; void storeFullIdent(const IPeptideIds::PepIds& ids); private: const IPeptideIds::PepIds* full_ids_ = nullptr; ///< pointer to the full data, when storeFullExperiment() was called }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/VISITORS/LayerStatistics.h
.h
7,735
229
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/CONCEPT/Types.h> #include <OpenMS/KERNEL/StandardTypes.h> #include <OpenMS/MATH/STATISTICS/Histogram.h> #include <OpenMS/VISUAL/INTERFACES/IPeptideIds.h> #include <array> #include <map> #include <string> #include <variant> namespace OpenMS { class MetaInfoInterface; class ConsensusMap; class FeatureMap; /** @brief Struct representing the statistics about a set of values Min and max are only useful if count > 0 */ template <typename VALUE_TYPE> struct RangeStats { public: void addDataPoint(VALUE_TYPE v) { ++count_; sum_ += v; min_ = std::min(min_, v); max_ = std::max(max_, v); } VALUE_TYPE getMin() const { return min_; } VALUE_TYPE getMax() const { return max_; } size_t getCount() const { return count_; } /// get the average value from all calls to addDataPoint() double getAvg() const { return count_ == 0 ? 0 : double(sum_) / count_; } protected: size_t count_{0}; VALUE_TYPE min_{std::numeric_limits<VALUE_TYPE>::max()}; // init with very high value VALUE_TYPE max_{std::numeric_limits<VALUE_TYPE>::lowest()}; // init with lowest (=negative) value possible VALUE_TYPE sum_{0}; }; using RangeStatsInt = RangeStats<int>; using RangeStatsDouble = RangeStats<double>; using RangeStatsVariant = std::variant<RangeStatsInt, RangeStatsDouble>; /// a simple counting struct, for non-numerical occurrences of meta-values struct StatsCounter { size_t counter{0}; }; /// Where did a statistic come from? Useful for display to user, and for internal dispatch when user requests a more detailed value distribution enum class RangeStatsSource { CORE, ///< statistic was obtained from a core data structure of the container, e.g. intensity METAINFO, ///< statistic was obtained from MetaInfoInterface of container elements, e.g. "FWHM" for FeatureMaps ARRAYINFO, ///< statistic was obtained from Float/IntegerArrays of the container elements, e.g. "IonMobility" for PeakMap SIZE_OF_STATSSOURCE }; /// Names corresponding to elements of enum RangeStatsSource static const std::array<const char*, (size_t)RangeStatsSource::SIZE_OF_STATSSOURCE> StatsSourceNames = {"core statistics", "meta values", "data arrays"}; /// Origin and name of a statistic. struct RangeStatsType { RangeStatsSource src; std::string name; bool operator<(const RangeStatsType& rhs) const { return std::tie(src, name) < std::tie(rhs.src, rhs.name); } bool operator==(const RangeStatsType& rhs) const { return src == rhs.src && name == rhs.name; } }; /// collection of Min/Max/Avg statistics from different sources. Note: must be sorted, i.e. do not switch to unordered_map! using StatsMap = std::map<RangeStatsType, RangeStatsVariant>; /// collection of MetaValues which are not numeric (counts only the number of occurrences per metavalue) using StatsCounterMap = std::map<std::string, StatsCounter>; /** @brief Compute summary statistics (count/min/max/avg) about a container, e.g. intensity, charge, meta values, ... */ class OPENMS_GUI_DLLAPI LayerStatistics { public: /// Make D'tor virtual for correct destruction from pointers to base virtual ~LayerStatistics() = default; /// get all range statistics, any of which can then be plugged into getDistribution() const StatsMap& getRangeStatistics() const { return overview_range_data_; } /// obtain count statistics for all meta values which are not numerical const StatsCounterMap& getCountStatistics() const { return overview_count_data_; } /** @brief After computing the overview statistic, you can query a concrete distribution by giving the name of the statistic @param[in] which Distribution based on which data? @param[in] number_of_bins Number of histogram bins (equally spaced within [min,max] of the distribution) @return The distribution @throws Exception::InvalidValue if @p which is not a valid overview statistic for the underlying data */ virtual Math::Histogram<> getDistribution(const RangeStatsType& which, const UInt number_of_bins = 500) const = 0; protected: /// compute the range and count statistics. Call this method in the Ctor of derived classes. virtual void computeStatistics_() = 0; /// Brings the meta values of one @p meta_interface (a peak or feature) into the statistics void bringInMetaStats_(const MetaInfoInterface* meta_interface); StatsMap overview_range_data_; ///< data on numerical values computed during getOverviewStatistics StatsCounterMap overview_count_data_; ///< count data on non-numerical values computed during getOverviewStatistics }; /** @brief Computes statistics and distributions for a PeakMap */ class OPENMS_GUI_DLLAPI LayerStatisticsPeakMap : public LayerStatistics { public: LayerStatisticsPeakMap(const PeakMap& pm); Math::Histogram<> getDistribution(const RangeStatsType& which, const UInt number_of_bins) const override; private: void computeStatistics_() override; const PeakMap* pm_; ///< internal reference to a PeakMap -- make sure it does not go out of ///< scope while using this class }; /** @brief Computes statistics and distributions for a PeakMap */ class OPENMS_GUI_DLLAPI LayerStatisticsFeatureMap : public LayerStatistics { public: LayerStatisticsFeatureMap(const FeatureMap& fm); Math::Histogram<> getDistribution(const RangeStatsType& which, const UInt number_of_bins) const override; private: void computeStatistics_() override; const FeatureMap* fm_; ///< internal reference to a FeatureMap -- make sure it does not go out of ///< scope while using this class }; /** @brief Computes statistics and distributions for a PeakMap */ class OPENMS_GUI_DLLAPI LayerStatisticsConsensusMap : public LayerStatistics { public: LayerStatisticsConsensusMap(const ConsensusMap& cm); Math::Histogram<> getDistribution(const RangeStatsType& which, const UInt number_of_bins) const override; private: void computeStatistics_() override; const ConsensusMap* cm_; ///< internal reference to a PeakMap -- make sure it does not go out of ///< scope while using this class }; /** @brief Computes statistics and distributions for a vector<PeptideIdentifications> */ class OPENMS_GUI_DLLAPI LayerStatisticsIdent : public LayerStatistics { public: LayerStatisticsIdent(const IPeptideIds::PepIds& cm); Math::Histogram<> getDistribution(const RangeStatsType& which, const UInt number_of_bins) const override; private: void computeStatistics_() override; const IPeptideIds::PepIds* ids_; ///< internal reference to a PeptideIds -- make sure it does not ///< go out of scope while using this class }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DPeakItem.h
.h
10,495
307
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h> #include <OpenMS/METADATA/PeptideHit.h> #include <OpenMS/VISUAL/MISC/GUIHelpers.h> #include <OpenMS/VISUAL/Plot1DCanvas.h> #include <QtGui/QColor> #include <QtGui/QFontMetricsF> namespace OpenMS { /** @brief A peak annotation item @see Annotation1DItem */ template <class DataPoint> // e.g. Peak1D class Annotation1DPeakItem : public Annotation1DItem { public: /// Constructor Annotation1DPeakItem(const DataPoint& peak_position, const QString& text, const QColor& color) : Annotation1DItem(text), peak_position_(peak_position), position_(peak_position), color_(color) { } /// Copy constructor Annotation1DPeakItem(const Annotation1DPeakItem& rhs) = default; /// Destructor ~Annotation1DPeakItem() override = default; // Docu in base class void draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped = false) override { painter.save(); painter.setPen(color_); QPoint position_widget, peak_position_widget; // translate units to pixel coordinates canvas->dataToWidget(canvas->getMapper().map(position_), position_widget, flipped); canvas->dataToWidget(canvas->getMapper().map(peak_position_), peak_position_widget, flipped); // pre-compute bounding box of text_item const QFontMetricsF fm(QApplication::font()); const auto prebox = fm.boundingRect(QRectF(position_widget.x(), position_widget.y(), 0, 0), Qt::AlignCenter, getText()); // Shift position of the widget/text, so it sits 'on top' of the peak // We can only do that there, since we do not know the state of 'flipped' in general // Compute the delta in data-units, NOT pixels, since the shift (up/down, or even left/right) depends on state of 'flipped' and axis const auto deltaXY_in_units = canvas->widgetToDataDistance(prebox.width(), prebox.height()).abs(); // abs() to make sure y axis is not negative const auto delta_gravity_in_units = canvas->getGravitator().swap().gravitateZero(deltaXY_in_units); // only keep gravity dim // recompute 'position_widget', shifting the text up by 1/2 box canvas->dataToWidget(canvas->getMapper().map(position_) + delta_gravity_in_units / 2, position_widget, flipped); // re-compute bounding box of text_item on with new position! bounding_box_ = fm.boundingRect(QRectF(position_widget.x(), position_widget.y(), 0, 0), Qt::AlignCenter, getText()); // draw connection line between anchor point and current position if pixel coordinates differ significantly if ((position_widget - peak_position_widget).manhattanLength() > 2) { QPointF border_point = GUIHelpers::intersectionPoint(bounding_box_, peak_position_widget); if (bounding_box_.center() != border_point) { painter.save(); painter.setPen(Qt::DashLine); painter.drawLine(peak_position_widget, border_point); painter.restore(); } } // some pretty printing QString text = text_; if (!text.contains("<\\")) // don't process HTML strings again { // extract ion index { QRegularExpression reg_exp(R"(([abcdwxyz])(\d+))"); QRegularExpressionMatch match = reg_exp.match(text); if (text.indexOf(reg_exp) == 0) // only process if at the beginning of the string { text.replace(reg_exp, "\\1<sub>\\2</sub>"); } else // protein-protein XL specific ion names { // e.g. "[alpha|ci$y1]" QRegularExpression reg_exp_xlms(R"((ci|xi)[$][abcxyz](\d+))"); auto match_pos = text.indexOf(reg_exp_xlms); if ((match_pos == 6) || (match_pos == 7)) { // set the match_pos to the position of the ion index match_pos += 3; // skip "ci$" or "xi$" ++match_pos; // skip the ion type (=captured(1)) QString charge_str = match.captured(2); // put sub html tag around number text = text.left(match_pos) + QString("<sub>") + charge_str + QString("</sub>") + text.right(text.size() - match_pos - charge_str.size()); } } } // common losses text.replace("H2O1", "H<sub>2</sub>O"); // mind the order with H2O substitution text.replace("H2O", "H<sub>2</sub>O"); text.replace("NH3", "NH<sub>3</sub>"); text.replace("H3N1", "NH<sub>3</sub>"); text.replace("C1H4O1S1", "H<sub>4</sub>COS"); // methionine sulfoxide loss // nucleotide XL related losses text.replace("H3PO4", "H<sub>3</sub>PO<sub>4</sub>"); text.replace("HPO3", "HPO<sub>3</sub>"); text.replace("C3O", "C<sub>3</sub>O"); // charge format: +z QRegularExpression charge_rx(R"([\+|\-](\d+)$)"); int match_pos = text.indexOf(charge_rx); if (match_pos > 0) { text = text.left(match_pos) + QString("<sup>") + text[match_pos] // + or - + charge_rx.match(text).captured(1) + QString("</sup>"); // charge } // charge format: z+ charge_rx = QRegularExpression(R"((\d+)[\+|\-]$)"); match_pos = text.indexOf(charge_rx); if (match_pos > 0) { auto charge_match = charge_rx.match(text).captured(1); text = text.left(match_pos) + QString("<sup>") + charge_match // charge + text[match_pos + charge_match.size()] + QString("</sup>"); // + or - } text.replace(QRegularExpression(R"(\+\+$)"), "<sup>2+</sup>"); text.replace(QRegularExpression(R"(\+$)"), ""); text.replace(QRegularExpression(R"(\-\-$)"), "<sup>2-</sup>"); text.replace(QRegularExpression(R"(\-$)"), ""); } text = "<font color=\"" + color_.name() + "\">" + text + "</font>"; // draw html text { QTextDocument td; td.setHtml(text); painter.save(); double w = td.size().width(); double h = td.size().height(); painter.translate(position_widget.x() - w / 2, position_widget.y() - h / 2); td.drawContents(&painter); painter.restore(); } if (selected_) { drawBoundingBox_(painter); } painter.restore(); } // Docu in base class void move(const PointXYType delta, const Gravitator& /*gr*/, const DimMapper<2>& dim_mapper) override { auto pos_xy = dim_mapper.map(position_); pos_xy += delta; dim_mapper.fromXY(pos_xy, position_); } /// Sets the position of the label void setPosition(const DataPoint& position) { position_ = position; } /// Returns the position of the label (peak) const DataPoint& getPosition() const { return position_; } /// Returns the position of the annotated peak const DataPoint& getPeakPosition() const { return peak_position_; } // Docu in base class void ensureWithinDataRange(Plot1DCanvas* const canvas, const int layer_index) override { canvas->pushIntoDataRange(position_, layer_index); } /// Set the color of the label void setColor(const QColor& color) { color_ = color; } /// Returns the color of the label const QColor& getColor() const { return color_; } /// Convert the 'text()' to a Peptide::PeakAnnotation PeptideHit::PeakAnnotation toPeakAnnotation() const { // add new fragment annotation QString peak_anno = this->getText().trimmed(); // check for newlines in the label and only continue with the first line for charge determination peak_anno.remove('\r'); QStringList lines = peak_anno.split('\n', Qt::SkipEmptyParts); if (lines.size() > 1) { peak_anno = lines[0]; } // regular expression for a charge at the end of the annotation QRegularExpression reg_exp(R"(([\+|\-]\d+)$)"); // read charge and text from annotation item string // we support two notations for the charge suffix: '+2' or '++' // cut and convert the trailing + or - to a proper charge int match_pos = peak_anno.indexOf(reg_exp); int tmp_charge(0); if (match_pos >= 0) { tmp_charge = reg_exp.match(peak_anno).captured(1).toInt(); peak_anno = peak_anno.left(match_pos); } else { // count number of + and - in suffix (e.g., to support "++" as charge 2 annotation) int plus(0), minus(0); for (int p = (int)peak_anno.size() - 1; p >= 0; --p) { if (peak_anno[p] == '+') { ++plus; continue; } else if (peak_anno[p] == '-') { ++minus; continue; } else // not '+' or '-'? { if (plus > 0 && minus == 0) // found pluses? { tmp_charge = plus; peak_anno = peak_anno.left(peak_anno.size() - plus); break; } else if (minus > 0 && plus == 0) // found minuses? { tmp_charge = -minus; peak_anno = peak_anno.left(peak_anno.size() - minus); break; } break; } } } PeptideHit::PeakAnnotation fa; fa.charge = tmp_charge; fa.mz = this->getPeakPosition().getMZ(); fa.intensity = this->getPeakPosition().getIntensity(); if (lines.size() > 1) { peak_anno.append("\n").append(lines[1]); } fa.annotation = peak_anno; return fa; } // Docu in base class Annotation1DItem* clone() const override { return new Annotation1DPeakItem(*this); } protected: /// The position of the anchor (e.g. the Peak1D) DataPoint peak_position_; /// The position of the label (e.g. the Peak1D) DataPoint position_; /// The color of the label QColor color_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h
.h
3,063
92
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit, Chris Bielow $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/MISC/CommonDefs.h> // for PointXYType #include <QtCore/QRectF> #include <QtCore/QString> class QPainter; namespace OpenMS { template<int D> class DimMapper; class Gravitator; class Plot1DCanvas; /** @brief An abstract class acting as an interface for the different 1D annotation items. This is an abstract polymorphic class which acts as an interface between its subclasses and all containers and methods that contain or handle Annotation1DItem objects. If you want to add new kinds of annotation items, inherit this class, implement the pure virtual methods, and add everything else the item should have or be capable of. */ class Annotation1DItem { public: /// Destructor virtual ~Annotation1DItem(); /// Returns the current bounding box of this item on the canvas where it has last been drawn const QRectF& boundingBox() const; /// Returns true if this item is currently selected on the canvas, else false bool isSelected() const; /// Sets whether this item is currently selected on the canvas or not void setSelected(bool selected); /// Sets the text of the item void setText(const QString & text); /// Returns the text of the item const QString& getText() const; /// open a GUI input field and let the user edit the text /// If the text was changed, true is returned; otherwise false. bool editText(); /// Ensures that the item has coordinates within the visible area of the canvas virtual void ensureWithinDataRange(Plot1DCanvas* const canvas, const int layer_index) = 0; /// Draws the item on @p painter virtual void draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped = false) = 0; /// Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses virtual void move(const PointXYType delta, const Gravitator& gr, const DimMapper<2>& dim_mapper) = 0; /// Creates a copy of the item on the heap and returns a pointer virtual Annotation1DItem* clone() const = 0; protected: /// Constructor Annotation1DItem(const QString & text); /// Copy constructor Annotation1DItem(const Annotation1DItem & rhs); /// Draws the bounding_box_ void drawBoundingBox_(QPainter & painter); /// The current bounding box of this item on the canvas where it has last been drawn QRectF bounding_box_; /// Determines whether this item is currently selected on the canvas bool selected_; /// The displayed text QString text_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotations1DContainer.h
.h
2,687
107
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/DATASTRUCTURES/DPosition.h> #include <list> #include <QtGui/QPen> class QPoint; class QObject; class QRectF; class QPainter; namespace OpenMS { class Annotation1DItem; /// Container for annotations to content of Plot1DCanvas class Annotations1DContainer : public std::list<Annotation1DItem *> { public: /// Default constructor Annotations1DContainer(); /// Copy constructor Annotations1DContainer(const Annotations1DContainer & rhs); /// Assignment operator Annotations1DContainer & operator=(const Annotations1DContainer & rhs); /// Destructor virtual ~Annotations1DContainer(); using Base = std::list<Annotation1DItem *>; /// Iterator for the 1D annotations using Iterator = Base::iterator; /// Const iterator for the 1D annotations using ConstIterator = std::list<Annotation1DItem *>::const_iterator; /// Type of the Points using PointType = DPosition<2>; /// Coordinate type using CoordinateType = double; /** @brief Returns a pointer to the item at @p pos, or 0, if not existent If more than one item's bounding box encloses @p pos , the one in the foreground is returned. */ Annotation1DItem * getItemAt(const QPoint & pos) const; /// Selects the item at @p pos on the canvas, if it exists. void selectItemAt(const QPoint & pos) const; /// Deselects the item at @p pos on the canvas, if it exists. void deselectItemAt(const QPoint & pos) const; /// Selects all items void selectAll(); /// Deselects all items void deselectAll(); /// Removes the selected items void removeSelectedItems(); /// Returns the selected items std::vector<Annotation1DItem*> getSelectedItems(); /// Sets the pen_ void setPen(const QPen & pen); /// Returns the pen_ const QPen & getPen() const; /// Sets the selected_pen_ void setSelectedPen(const QPen & pen); /// Returns the selected_pen_ const QPen & getSelectedPen() const; protected: /// call delete on all pointers in the container, without modifying the container void deleteAllItems_() const; /// The pen used to draw items QPen pen_; /// The pen used to draw selected items QPen selected_pen_; }; } // namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DTextItem.h
.h
2,193
82
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Johannes Junker, Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h> #include <OpenMS/VISUAL/Plot1DCanvas.h> namespace OpenMS { /** @brief An annotation item which represents an arbitrary text on the canvas. @see Annotation1DItem */ class Annotation1DTextItem : public Annotation1DItem { public: /// Constructor Annotation1DTextItem(const PointXYType& position, const QString& text, const int flags = Qt::AlignCenter) : Annotation1DItem(text), position_(position), flags_(flags) { } /// Copy constructor Annotation1DTextItem(const Annotation1DTextItem & rhs) = default; /// Destructor ~Annotation1DTextItem() override = default; // Docu in base class void ensureWithinDataRange(Plot1DCanvas* const canvas, const int layer_index) override; // Docu in base class void draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped = false) override; // Docu in base class void move(const PointXYType delta, const Gravitator& gr, const DimMapper<2>& dim_mapper) override; /// Sets the position of the item (in X-Y coordinates) void setPosition(const PointXYType& position) { position_ = position; } /// Returns the position of the item (in X-Y coordinates) const PointXYType& getPosition() const { return position_; } /// Set Qt flags (default: Qt::AlignCenter) void setFlags(int flags) { flags_ = flags; } /// Get Qt flags int getFlags() const { return flags_; } // Docu in base class Annotation1DItem* clone() const override { return new Annotation1DTextItem(*this); } protected: /// The position of the item as a datatype, e.g. Peak1D PointXYType position_; int flags_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DCaret.h
.h
6,115
202
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h> #include <OpenMS/VISUAL/MISC/GUIHelpers.h> #include <OpenMS/VISUAL/Painter1DBase.h> #include <OpenMS/VISUAL/Plot1DCanvas.h> #include <QPainter> #include <QtGui/QColor> #include <QStaticText> #include <vector> namespace OpenMS { /** @brief An annotation item which paints a set of carets on the canvas. Most useful to visualize (theoretical) isotope distributions (one caret per isotope position). Additionally, a text annotation can be provided. @see Annotation1DItem */ template <class DataPoint> class Annotation1DCaret : public Annotation1DItem { public: typedef std::vector<DataPoint> PositionsType; using PointType = DataPoint; /// Constructor Annotation1DCaret(const PositionsType& caret_positions, const QString& text, const QColor& color, const QColor& connection_line_color) : Annotation1DItem(text), caret_positions_(caret_positions), position_(caret_positions[0]), color_(color), connection_line_color_(connection_line_color) { st_.setText(text); } /// Copy constructor Annotation1DCaret(const Annotation1DCaret& rhs) = default; /// Destructor ~Annotation1DCaret() override = default; // Docu in base class void ensureWithinDataRange(Plot1DCanvas* const canvas, const int layer_index) override { canvas->pushIntoDataRange(position_, layer_index); } // Docu in base class void draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped = false) override { painter.save(); painter.setPen(color_); // translate mz/intensity to pixel coordinates QPoint position_widget, caret_position_widget; auto xy_pos = canvas->getMapper().map(position_); auto xy_1stcaret = canvas->getMapper().map(position_); canvas->dataToWidget(xy_pos, position_widget, flipped); canvas->dataToWidget(xy_1stcaret, caret_position_widget, flipped); // draw carets '^' for (const auto& pos : caret_positions_) { auto xy_pos_caret = canvas->getMapper().map(pos); QPoint caret; canvas->dataToWidget(xy_pos_caret, caret, flipped); Painter1DBase::drawCaret(caret, &painter); } // compute bounding box of text_item on the specified painter bounding_box_ = QRectF(position_widget, st_.size()); // shift pos - annotation should be over peak or, if not possible, next to it double vertical_shift = bounding_box_.height() / 2 + 5; if (!flipped) { vertical_shift *= -1; } bounding_box_.translate(0.0, vertical_shift); if (flipped && bounding_box_.bottom() > canvas->height()) { bounding_box_.moveBottom(canvas->height()); bounding_box_.moveLeft(position_widget.x() + 5.0); } else if (!flipped && bounding_box_.top() < 0.0) { bounding_box_.moveTop(0.0); bounding_box_.moveLeft(position_widget.x() + 5.0); } // keep inside canvas if (bounding_box_.right() > canvas->width()) { bounding_box_.moveRight(canvas->width()); } // draw connection line between anchor point and current position if pixel coordinates differ significantly if ((position_widget - caret_position_widget).manhattanLength() > 2) { QPointF border_point = GUIHelpers::intersectionPoint(bounding_box_, caret_position_widget); if (bounding_box_.center() != border_point) { painter.save(); painter.setPen(Qt::DashLine); painter.drawLine(caret_position_widget, border_point); painter.restore(); } } painter.drawStaticText(bounding_box_.topLeft(), st_); if (selected_) { drawBoundingBox_(painter); } painter.restore(); } // Docu in base class void move(const PointXYType delta, const Gravitator& /*gr*/, const DimMapper<2>& dim_mapper) override { auto xy_before = dim_mapper.map(position_); xy_before += delta; dim_mapper.fromXY(xy_before, position_); } /// Returns the positions of the lines (in unit coordinates) const PositionsType& getCaretPositions() const { return caret_positions_; } /// Sets the position of the label (in unit coordinates) void setPosition(const DataPoint& position) { position_ = position; } /// Returns the position of the annotated peak (in unit coordinates) const DataPoint& getPosition() const { return position_; } /// Set the color of the carets (color of text must be set using html) void setColor(const QColor& color) { color_ = color; } /// Returns the color of the carets const QColor& getColor() const { return color_; } /// The text to display (optional). /// Rendered using QStaticText, so HTML formatting is allowed. void setRichText(const QString& text) { st_.setText(text); text_ = text; // this is just to keep the base class consistent.. we don't really use text_ } // Docu in base class Annotation1DItem* clone() const override { return new Annotation1DCaret(*this); } protected: /// The positions of points (in unit coordinates) /// Ensure positions are sorted by m/z axis (or equivalent) when assigning PositionsType caret_positions_; /// The position of the label (in unit coordinates) DataPoint position_; /// The color of the label QColor color_; /// The color of the (optional) dashed line connecting peak and label QColor connection_line_color_; /// Holds the (rich) text QStaticText st_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DDistanceItem.h
.h
2,992
87
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit, Chris Bielow $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h> #include <vector> namespace OpenMS { /** @brief An annotation item which represents a measured distance between two peaks. @see Annotation1DItem */ class Annotation1DDistanceItem : public Annotation1DItem { public: /** * \brief * \param text The text to display between the two points * \param start_point Start point in XY unit coordinates * \param end_point End point in XY unit coordinates * \param swap_ends_if_negative Make sure the distance is positive when creating the distance item? */ Annotation1DDistanceItem(const QString& text, const PointXYType& start_point, const PointXYType& end_point, const bool swap_ends_if_negative = true); /// Copy constructor Annotation1DDistanceItem(const Annotation1DDistanceItem & rhs) = default; /// Destructor ~Annotation1DDistanceItem() override = default; // Docu in base class void ensureWithinDataRange(Plot1DCanvas* const canvas, const int layer_index) override; // Docu in base class void draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped = false) override; // Docu in base class void move(const PointXYType delta, const Gravitator& gr, const DimMapper<2>& dim_mapper) override; /// Returns the start point const PointXYType& getStartPoint() const { return start_point_; } /// Returns the end point const PointXYType& getEndPoint() const { return end_point_; } /** * \brief Compute the (negative) euclidean distance between start and endpoint. * * If the startpoint is closer to (0,0) than the endpoint, the distance will be positive; otherwise negative. * * \return sign * sqrt(deltaX^2 + deltaY^2), where deltaX/Y is the difference between start and endpoint in dimension X/Y */ double getDistance() const; /// Set tick lines for the distance item in unit XY coordinates (the gravity dimension is ignored) void setTicks(const std::vector<PointXYType>& ticks); // Docu in base class Annotation1DItem* clone() const override { return new Annotation1DDistanceItem(*this); } protected: /// The start point of the measured distance line (in XY data coordinates) PointXYType start_point_; /// The end point of the measured distance line (in XY data coordinates) PointXYType end_point_; /// Additional tick lines for the distance item (the gravity dimension is ignored) std::vector<PointXYType> ticks_; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DVerticalLineItem.h
.h
4,155
92
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Jihyung Kim, Timo Sachsenberg $ // $Authors: Jihyung Kim, Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once #include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h> #include <QtGui/QColor> namespace OpenMS { /** @brief An annotation item which represents a vertical line (or more precisely a line along the gravity axis, i.e. it could also be horizontal) and text label on top. @see Annotation1DItem */ class Annotation1DVerticalLineItem : public Annotation1DItem { public: /** Constructor for a single vertical line of 1px width. @param[in] center_pos Center of the line in unit coordinates (only the non-gravity component will be used) @param[in] color Optional color. If invalid (=default), the current painter color will be used when this is painted @param[in] text Optional text displayed next to the line. Can contain '\n' which will force multiple lines. **/ Annotation1DVerticalLineItem(const PointXYType& center_pos, const QColor& color = QColor("as_before"), const QString& text = ""); /** Constructor for a single vertical line of 1px width or a broader line (band) with the given width @param[in] center_pos Center of the line in unit coordinates (only the non-gravity component will be used) @param[in] width Full width of the band in unit coordinates; use =0 to make a thin line and not a band; @param[in] alpha255 A transparency value from 0 (not visible), to 255 (fully opaque) @param[in] dashed_line Should the line/band be dashed @param[in] color Optional color. If invalid (=default), the current painter color will be used when this is painted @param[in] text Optional text displayed next to the line/band. Can contain '\n' which will force multiple lines. Text will be plotted at the very top (modify using setTextYOffset()) **/ Annotation1DVerticalLineItem(const PointXYType& center_pos, const float width, const int alpha255 = 128, const bool dashed_line = false, const QColor& color = QColor("as_before"), const QString& text = ""); /// Copy constructor Annotation1DVerticalLineItem(const Annotation1DVerticalLineItem& rhs) = default; /// Destructor ~Annotation1DVerticalLineItem() override = default; // Docu in base class void ensureWithinDataRange(Plot1DCanvas* const canvas, const int layer_index) override; // Docu in base class void draw(Plot1DCanvas* const canvas, QPainter& painter, bool flipped = false) override; // Docu in base class void move(const PointXYType delta, const Gravitator& gr, const DimMapper<2>& dim_mapper) override; /// Sets the center position of the line (the widths will extend from there) void setPosition(const PointXYType& pos); /// Returns the position on the non-gravity-axis const PointXYType& getPosition() const; /// size of the painted text (width and height of the rectangle) QRectF getTextRect() const; /// offset the text by this much downwards in y-direction (to avoid overlaps etc) void setTextOffset(int offset); // Docu in base class Annotation1DItem* clone() const override { return new Annotation1DVerticalLineItem(*this); } protected: /// The position of the line (gravity axis is ignored) PointXYType pos_; /// offset (in pixel coordinates of gravity axis) in for the text (to avoid overlaps) int text_offset_ {0}; /// width of the item in unit coordinates (allowing to show a 'band'; use =0 to make a thin line and not a band) float width_ = 0; /// transparency 0...255 of the band/line int alpha255_ = 128; /// is the band/line dashed? bool dashed_{false}; /// The color of the line; if invalid, the current painter color will be used QColor color_ = Qt::black; }; } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/APPLICATIONS/TOPPViewBase.h
.h
20,252
543
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm, Timo Sachsenberg $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/KERNEL/StandardTypes.h> #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h> #include <OpenMS/VISUAL/EnhancedTabBar.h> #include <OpenMS/VISUAL/EnhancedWorkspace.h> #include <OpenMS/VISUAL/FileWatcher.h> #include <OpenMS/VISUAL/FilterList.h> #include <OpenMS/VISUAL/RecentFilesMenu.h> #include <OpenMS/VISUAL/PlotCanvas.h> #include <OpenMS/VISUAL/PlotWidget.h> #include <OpenMS/VISUAL/TOPPViewMenu.h> #include <OpenMS/VISUAL/TVToolDiscovery.h> #include <OpenMS/VISUAL/DIALOGS/TheoreticalSpectrumGenerationDialog.h> //STL #include <map> //QT #include <QtWidgets/QMainWindow> #include <QtWidgets/QButtonGroup> #include <QActionGroup> #include <QtCore/QStringList> #include <QtCore/QProcess> #include <QElapsedTimer> class QAction; class QComboBox; class QLabel; class QLineEdit; class QListWidget; class QListWidgetItem; class QTreeWidget; class QTreeWidgetItem; class QDockWidget; class QToolButton; class QCloseEvent; class QCheckBox; class QSplashScreen; class QToolButton; namespace OpenMS { class DataSelectionTabs; class FileWatcher; class LogWindow; class LayerListView; class MultiGradientSelector; class Plot1DWidget; class Plot2DWidget; class Plot3DWidget; class ToolsDialog; /** @brief Main window of TOPPView tool Uses the default QMainWindow layout (see Qt documentation) with a central widget in the middle (consistent of a EnhancedTabBar and an EnhancedWorkspace) and multiple docked widgets around it (to the right and below) and multiple tool bars. On top and bottom are a menu bar and a status bar. The main layout is using - Central Widget: - EnhancedTabBar: tab_bar_ - EnhancedWorkspace: ws_ - Docked to the right: - layer_dock_widget_ - views_dockwidget_ - filter_dock_widget_ - Docked to the bottom: - log_bar (only connected through slots) The views_dockwidget_ internally holds a tab widget views_tabwidget_ which holds the two different views on the data (spectra and identification view) which are implemented using idview_behaviour_ and spectraview_behavior_. @improvement Use DataRepository singleton to share data between TOPPView and the canvas classes (Hiwi) @improvement For painting single mass traces with no width we currently paint each line twice (once going down, and then coming back up). This could be more efficient... @improvement Keep spectrum browser widgets of all layers in memory in order to avoid rebuilding the entire tree view every time the active layer changes (Hiwi, Johannes) @ingroup TOPPView_elements */ class OPENMS_GUI_DLLAPI TOPPViewBase : public QMainWindow, public DefaultParamHandler { Q_OBJECT friend class TestTOPPView; public: ///@name Type definitions //@{ //Feature map type typedef LayerDataBase::FeatureMapType FeatureMapType; //Feature map managed type typedef LayerDataBase::FeatureMapSharedPtrType FeatureMapSharedPtrType; //Consensus feature map type typedef LayerDataBase::ConsensusMapType ConsensusMapType; //Consensus map managed type typedef LayerDataBase::ConsensusMapSharedPtrType ConsensusMapSharedPtrType; //Peak map type typedef LayerDataBase::ExperimentType ExperimentType; //Main managed data type (experiment) typedef LayerDataBase::ExperimentSharedPtrType ExperimentSharedPtrType; //Main on-disc managed data type (experiment) typedef LayerDataBase::ODExperimentSharedPtrType ODExperimentSharedPtrType; ///Peak spectrum type typedef ExperimentType::SpectrumType SpectrumType; //@} /// Used for deciding whether new tool/util params should be generated or reused from TOPPView's ini file enum class TOOL_SCAN { /** TVToolDiscovery does not generate params for each tool/util unless they are absolutely needed and could not be extracted from TOPPView's ini file. This may be useful for testing. */ SKIP_SCAN, /// Only generate params for each tool/util if TOPPView's last ini file has an older version. (Default behaviour) SCAN_IF_NEWER_VERSION, /// Forces TVToolDiscovery to generate params and using them instead of the params in TOPPView's ini file FORCE_SCAN }; enum class VERBOSITY { DEFAULT, VERBOSE }; ///Constructor explicit TOPPViewBase(TOOL_SCAN scan_mode = TOOL_SCAN::SCAN_IF_NEWER_VERSION, VERBOSITY verbosity = VERBOSITY::DEFAULT, QWidget* parent = nullptr); ///Destructor ~TOPPViewBase() override; enum class LOAD_RESULT { OK, FILE_NOT_FOUND, ///< file did not exist FILETYPE_UNKNOWN, ///< file exists, but type could no be determined FILETYPE_UNSUPPORTED, ///< filetype is known, but the format not supported as layer data LOAD_ERROR ///< an error occurred while loading the file }; /** @brief Opens and displays data from a file Loads the data and adds it to the application by calling addData_() @param[in] filename The file to open @param[in] show_options If the options dialog should be shown (otherwise the defaults are used) @param[in] caption Sets the layer name and window caption of the data. If unset the file name is used. @param[in] add_to_recent If the file should be added to the recent files after opening @param[in] window_id in which window the file is opened if opened as a new layer (0 or default equals current window). @param[in] spectrum_id determines the spectrum to show in 1D view. */ LOAD_RESULT addDataFile(const String& filename, bool show_options, bool add_to_recent, String caption = "", UInt window_id = 0, Size spectrum_id = 0); /** @brief Adds a peak or feature map to the viewer @param[in] feature_map The feature data (empty if not feature data) @param[in] consensus_map The consensus feature data (empty if not consensus feature data) @param[in] peptides The peptide identifications (empty if not ID data) @param[in] peak_map The peak data (empty if not peak data) @param[in] on_disc_peak_map The peak data managed on disc (empty if not peak data) @param[in] data_type Type of the data @param[in] show_as_1d Force dataset to be opened in 1D mode (even if it contains several spectra) @param[in] show_options If the options dialog should be shown (otherwise the defaults are used) @param[in] as_new_window Open the layer in a new window within TOPPView (ignored if 'window_id' is set) @param[in] filename source file name (if the data came from a file) @param[in] caption Sets the layer name and window caption of the data. If unset the file name is used. If set, the file is not monitored for changes. @param[in] window_id in which window the file is opened if opened as a new layer (0 will open a new window). @param[in] spectrum_id determines the spectrum to show in 1D view. */ void addData(const FeatureMapSharedPtrType& feature_map, const ConsensusMapSharedPtrType& consensus_map, PeptideIdentificationList& peptides, const ExperimentSharedPtrType& peak_map, const ODExperimentSharedPtrType& on_disc_peak_map, LayerDataBase::DataType data_type, bool show_as_1d, bool show_options, bool as_new_window = true, const String& filename = "", const String& caption = "", UInt window_id = 0, Size spectrum_id = 0); /// Opens all the files in the string list void loadFiles(const StringList& list, QSplashScreen* splash_screen); /** @brief Loads the preferences from the filename given. If the filename is empty, the application name + ".ini" is used as filename */ void loadPreferences(String filename = ""); /// Stores the preferences (used when this window is closed) void savePreferences(); /// Returns the parameters for a PlotCanvas of dimension @p dim Param getCanvasParameters(UInt dim) const; /// Returns the active Layer data (0 if no layer is active) const LayerDataBase* getCurrentLayer() const; /// Returns the active Layer data (0 if no layer is active) LayerDataBase* getCurrentLayer(); //@name Accessors for the main gui components. //@brief The top level enhanced workspace and the EnhancedTabWidgets resing in the EnhancedTabBar. //@{ /// returns a pointer to the EnhancedWorkspace containing PlotWidgets EnhancedWorkspace* getWorkspace(); /// returns a pointer to the active PlotWidget (0 if none is active) PlotWidget* getActivePlotWidget() const; /// returns a pointer to the active Plot1DWidget (0 the active window is no Plot1DWidget or there is no active window) Plot1DWidget* getActive1DWidget() const; /// returns a pointer to the active Plot2DWidget (0 the active window is no Plot2DWidget or there is no active window) Plot2DWidget* getActive2DWidget() const; /// returns a pointer to the active Plot3DWidget (0 the active window is no Plot2DWidget or there is no active window) Plot3DWidget* getActive3DWidget() const; //@} /// returns a pointer to the active PlotCanvas (0 if none is active) PlotCanvas* getActiveCanvas() const; /// Opens the provided spectrum widget in a new window void showPlotWidgetInWindow(PlotWidget* sw); public slots: /// changes the current path according to the currently active window/layer void updateCurrentPath(); /// shows the file dialog for opening files (a starting directory, e.g. for the example files can be provided; otherwise, uses the current_path_) void openFilesByDialog(const String& initial_directory = ""); /// shows the DB dialog for opening files void showGoToDialog() const; /// shows the preferences dialog void preferencesDialog(); /// Shows statistics (count,min,max,avg) about Intensity, Quality, Charge and meta data void layerStatistics() const; /// lets the user edit the meta data of a layer void editMetadata(); /// gets called if a layer got activated void layerActivated(); /// gets called when a layer changes in zoom; will apply the same zoom to other windows (if linked) void zoomOtherWindows() const; /// link the zoom of individual windows void linkZoom(); /// gets called if a layer got deactivated void layerDeactivated(); /// closes the active window void closeTab(); /// returns the last invoked TOPP tool with the same parameters void rerunTOPPTool(); /// calls update*Bar and updateMenu_() to make sure the interface matches the current data void updateBarsAndMenus(); /// updates the toolbar void updateToolBar(); /// adapts the layer bar to the active window void updateLayerBar(); /// adapts view bar to the active window void updateViewBar(); /// activates/deactivates menu entries void updateMenu(); /// adapts the filter bar to the active window void updateFilterBar(); /** @brief Shows a status message in the status bar. If @p time is 0 the status message is displayed until showStatusMessage is called with an empty message or a new message. Otherwise the message is displayed for @p time ms. */ void showStatusMessage(const std::string& msg, OpenMS::UInt time); /// shows X/Y axis mouse values in the status bar void showCursorStatus(const String& x, const String& y); /// Apply TOPP tool void showTOPPDialog(); /// Annotates current layer with ID data from AccurateMassSearch void annotateWithAMS(); /// Annotates current layer with ID data void annotateWithID(); /// Annotates current chromatogram layer with ID data void annotateWithOSW(); /// Shows the theoretical spectrum generation dialog void showSpectrumGenerationDialog(); /// Shows the spectrum alignment dialog void showSpectrumAlignmentDialog(); /// Shows the current peak data of the active layer in 2D void showCurrentPeaksAs2D(); /// Shows the current peak data of the active layer in 3D void showCurrentPeaksAs3D(); /// Shows the current peak data of the active layer as ion mobility void showCurrentPeaksAsIonMobility(const MSSpectrum& spec); /// Shows the current peak data of the active layer as DIA data void showCurrentPeaksAsDIA(const Precursor& pc, const MSExperiment& exp); /// Saves the whole current layer data void saveLayerAll() const; /// Saves the visible layer data void saveLayerVisible() const; /// Toggles the grid lines void toggleGridLines() const; /// Toggles the axis legends void toggleAxisLegends() const; /// Toggles drawing of interesting MZs void toggleInterestingMZs() const; /// Shows current layer preferences void showPreferences() const; /// dialog for inspecting database meta data void metadataFileDialog(); /** @name Toolbar slots */ //@{ void setDrawMode1D(int) const; void setIntensityMode(int); void changeLayerFlag(bool); void changeLabel(QAction*); void changeUnassigned(QAction*); void resetZoom() const; void toggleProjections(); //@} /// list of the recently opened files /// called when RecentFileMenu items is clicked void openFile(const String& filename); /// Enables/disables the data filters for the current layer void layerFilterVisibilityChange(bool) const; /// shows a spectrum's metadata with index @p spectrum_index from the currently active canvas void showSpectrumMetaData(int spectrum_index) const; protected slots: /// slot for the finished signal of the TOPP tools execution void finishTOPPToolExecution(int exitCode, QProcess::ExitStatus exitStatus); /// aborts the execution of a TOPP tool void abortTOPPTool(); /// shows the spectrum browser and updates it void showSpectrumBrowser(); /** @name Tabbar slots */ //@{ /// Closes the window corresponding to the data of the tab with identifier @p id void closeByTab(int id); /// Raises the window corresponding to the data of the tab with identifier @p id void showWindow(int id); /// Slot for drag-and-drop of layer manager to tabbar void copyLayer(const QMimeData* data, QWidget* source, int id = -1); //@} /// Appends process output to log window void updateProcessLog(); /// Called if a data file has been externally changed void fileChanged_(const String&); protected: /// Initializes the default parameters on TOPPView construction. void initializeDefaultParameters_(); /** @brief Shows a dialog where the user can select files */ QStringList chooseFilesDialog_(const String& path_overwrite = ""); ///@name dock widgets //@{ QDockWidget* layer_dock_widget_; QDockWidget* views_dockwidget_; QDockWidget* filter_dock_widget_; //@} /// Layer management widget LayerListView* layers_view_; DataSelectionTabs* selection_view_; ///@name Filter widget //@{ FilterList* filter_list_; //@} /// Watcher that tracks file changes (in order to update the data in the different views) FileWatcher* watcher_ = nullptr; /// Holds the messageboxes for each layer that are currently popped up (to avoid popping them up again, if file changes again before the messagebox is closed) bool watcher_msgbox_ = false; /// Stores whether the individual windows should zoom together (be linked) or not bool zoom_together_ = false; /// Log output window LogWindow* log_; /// Determines TVToolDiscovery scans for tools and generates new params. TOOL_SCAN scan_mode_; /// Scans for tools and generates a param for each. TVToolDiscovery tool_scanner_; /// Verbosity of TV VERBOSITY verbosity_; /** @name Toolbar */ //@{ QToolBar* tool_bar_; // common intensity modes QButtonGroup* intensity_button_group_; // 1D specific stuff QToolBar* tool_bar_1d_; QButtonGroup* draw_group_1d_; // 2D specific stuff QToolBar* tool_bar_2d_peak_; QToolBar* tool_bar_2d_feat_; QToolBar* tool_bar_2d_cons_; QToolBar* tool_bar_2d_ident_; QAction* dm_precursors_2d_; QAction* dm_hull_2d_; QAction* dm_hulls_2d_; QToolButton* dm_label_2d_; QActionGroup* group_label_2d_; QToolButton* dm_unassigned_2d_; QActionGroup* group_unassigned_2d_; QAction* dm_elements_2d_; QAction* projections_2d_; QAction* dm_ident_2d_; //@} /// Main workspace EnhancedWorkspace ws_; // not a pointer, but an actual object, so it gets destroyed before the DefaultParamhandler (on which it depends) /// LAST active subwindow (~ corresponding to tab) in the MDI container. Since subwindows can lose focus, /// we want to make sure that things like the ID tables only update when a NEW window is activated. (Actually, /// we should check for the underlying data but this might be a @todo). QMdiSubWindow* lastActiveSubwindow_ = nullptr; // due to Qt bugs or confusing features we need to save the current Window id in the children of the workspace; /// Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() EnhancedTabBar tab_bar_; /// manages recent list of filenames and the menu that goes with it RecentFilesMenu recent_files_; // needs to be declared before 'menu_', because its needed there /// manages the menu items (active/inactive) and recent files etc TOPPViewMenu menu_; /** @name Status bar */ //@{ /// Label for messages in the status bar QLabel* message_label_; /// x-axis label for messages in the status bar QLabel* x_label_; /// y-axis label for messages in the status bar QLabel* y_label_; //@} /// @name Recent files //@{ /// adds a Filename to the recent files void addRecentFile_(const String& filename); //@} /// @name TOPP tool execution //@{ /// Runs the TOPP tool according to the information in topp_ void runTOPPTool_(); /// Information needed for execution of TOPP tools struct { Param param; String tool; String in; String out; String file_name; String file_name_in; String file_name_out; String layer_name; UInt window_id; Size spectrum_id; QProcess* process = nullptr; QElapsedTimer timer; bool visible_area_only; } topp_; //@} /// check if all available preferences get set by the .ini file. If there are some missing entries fill them with default values. void checkPreferences_(); ///@name reimplemented Qt events //@{ void closeEvent(QCloseEvent* event) override; //@} ///Additional context menu for 2D layers QMenu* add_2d_context_; /// Apply TOPP tool. If @p visible is true, only the visible data is used, otherwise the whole layer is used. void showTOPPDialog_(bool visible); /// The current path (used for loading and storing). /// Depending on the preferences this is static or changes with the current window/layer. String current_path_; private: /// Suffix appended to caption of tabs when layer is shown in 3D static const String CAPTION_3D_SUFFIX_; /// This dialog is a member so that its settings can be perserved upon closing. TheoreticalSpectrumGenerationDialog spec_gen_dialog_; }; //class } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/APPLICATIONS/FLASHDeconvWizardBase.h
.h
1,846
78
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Jihyung Kim $ // $Authors: Jihyung Kim $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> // OpenMS #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h> // QT #include <QtCore/QProcess> #include <QtNetwork/QNetworkReply> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMdiArea> #include <QtWidgets/QSplashScreen> class QToolBar; class QListWidget; class QTextEdit; class QMdiArea; class QLabel; class QWidget; class QTreeWidget; class QTreeWidgetItem; class QWebView; class QNetworkAccessManager; namespace Ui { class FLASHDeconvWizardBase; } namespace OpenMS { /** @brief Main window of the FLASHDeconvWizard tool */ class OPENMS_GUI_DLLAPI FLASHDeconvWizardBase : public QMainWindow, public DefaultParamHandler { Q_OBJECT public: /// Constructor FLASHDeconvWizardBase(QWidget* parent = nullptr); /// Destructor ~FLASHDeconvWizardBase() override; void showAboutDialog(); protected: /// The current path (used for loading and storing). /// Depending on the preferences this is static or changes with the current window/layer. String current_path_; /// The path for temporary files String tmp_path_; private slots: // names created by QtCreator. Do not change them. void on_actionExit_triggered(); void on_actionVisit_FLASHDeconv_homepage_triggered(); void on_actionReport_new_issue_triggered(); private: Ui::FLASHDeconvWizardBase* ui; }; // class } // namespace OpenMS
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/APPLICATIONS/SwathWizardBase.h
.h
1,884
87
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h> //QT #include <QtWidgets/QMainWindow> #include <QtWidgets/QMdiArea> #include <QtWidgets/QButtonGroup> #include <QtCore/QProcess> #include <QtWidgets/QSplashScreen> #include <QtNetwork/QNetworkReply> class QToolBar; class QListWidget; class QTextEdit; class QMdiArea; class QLabel; class QWidget; class QTreeWidget; class QTreeWidgetItem; class QWebView; class QNetworkAccessManager; namespace Ui { class SwathWizardBase; } namespace OpenMS { /** @brief Main window of the SwathWizard tool */ class OPENMS_GUI_DLLAPI SwathWizardBase : public QMainWindow, public DefaultParamHandler { Q_OBJECT public: /// Constructor SwathWizardBase(QWidget* parent = nullptr); /// Destructor ~SwathWizardBase() override; void showAboutDialog(); protected slots: protected: /// Log output window //TOPPASLogWindow* log_; /// The current path (used for loading and storing). /// Depending on the preferences this is static or changes with the current window/layer. String current_path_; /// The path for temporary files String tmp_path_; private slots: // names created by QtCreator. Do not change them. void on_actionExit_triggered(); void on_actionVisit_OpenSwath_homepage_triggered(); void on_actionReport_new_issue_triggered(); private: Ui::SwathWizardBase* ui; }; //class } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/APPLICATIONS/INIFileEditorWindow.h
.h
1,846
64
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg$ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/ParamEditor.h> #include <OpenMS/DATASTRUCTURES/Param.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <QtWidgets/QMdiArea> #include <QtWidgets/QMainWindow> class QToolBar; class QAction; class QString; class QFileDialog; namespace OpenMS { /** @brief shows the ParamEditor widget in a QMainWindow with a toolbar */ class OPENMS_GUI_DLLAPI INIFileEditorWindow : public QMainWindow { Q_OBJECT public: /// menu is created here INIFileEditorWindow(QWidget * parent = nullptr); /// when user closes window a message box asks the user if he wants to save void closeEvent(QCloseEvent * event) override; public slots: ///loads the xml-file into a Param object and loads Param into ParamEditor bool openFile(const String & filename = ""); /// saves the users changes in a xml-file if the Param object is valid bool saveFile(); /// like saveFile but with a file dialog to choose a filename bool saveFileAs(); /// if the user changes data in ParamEditor the title shows a '*' void updateWindowTitle(bool); private: /// ParamEditor object for visualization ParamEditor * editor_; /// Param object for storing data Param param_; /// filename of xml-file to store the Param object QString filename_; /// path used as next default location of the load/store dialogs String current_path_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/APPLICATIONS/TOPPASBase.h
.h
9,475
283
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker, Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //OpenMS #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h> #include <OpenMS/VISUAL/EnhancedWorkspace.h> #include <OpenMS/VISUAL/TOPPASTreeView.h> #include <OpenMS/VISUAL/RecentFilesMenu.h> //QT #include <QtWidgets/QButtonGroup> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMdiArea> #include <QtNetwork/QNetworkReply> #include <QtWidgets/QSplashScreen> class QToolBar; class QListWidget; class QTextEdit; class QMdiArea; class QLabel; class QPushButton; class QWidget; class QTreeWidget; class QTreeWidgetItem; class QWebView; class QNetworkAccessManager; namespace OpenMS { class EnhancedWorkSpace; class EnhancedTabBar; class TOPPASWidget; class TOPPASScene; class LogWindow; class TOPPASResources; /** @brief Main window of the TOPPAS tool @ingroup TOPPAS_elements */ class OPENMS_GUI_DLLAPI TOPPASBase : public QMainWindow, public DefaultParamHandler { Q_OBJECT public: ///Constructor TOPPASBase(QWidget* parent = nullptr); ///Destructor ~TOPPASBase() override; /** @brief Loads the preferences from the filename given. If the filename is empty, the application name + ".ini" is used as filename */ void loadPreferences(String filename = ""); /// stores the preferences (used when this window is closed) void savePreferences(); /// loads the files and updates the splash screen void loadFiles(const std::vector<String>& list, QSplashScreen* splash_screen); public slots: /// opens the file in a new window void addTOPPASFile(const String& file_name, bool in_new_window = true); /// shows the dialog for opening files void openFilesByDialog(); /// shows the dialog for opening example files void openExampleDialog(); /// creates a new tab void newPipeline(); /// shows the dialog for including another workflow in the currently opened one void includePipeline(); /// shows the dialog for saving the current file and updates the current tab caption void saveCurrentPipelineAs(); /// saves the pipeline (determined by Qt's sender mechanism) void savePipeline(); /// exports the current pipeline as image void exportAsImage(); /// shows a file dialog for selecting the resource file to load void loadPipelineResourceFile(); /// shows a file dialog for selecting the resource file to write to void savePipelineResourceFile(); /// opens the OpenMS Homepage to download example workflows void openOnlinePipelineRepository(); /// shows the preferences dialog void preferencesDialog(); /// changes the current path according to the currently active window/layer void updateCurrentPath(); /// brings the tab corresponding to the active window in front void updateTabBar(QMdiSubWindow* w); /// Shows the 'About' dialog void showAboutDialog(); /// shows the URL stored in the data of the sender QAction void showURL(); /** @brief Shows a status message in the status bar. If @p time is 0 the status message is displayed until showStatusMessage is called with an empty message or a new message. Otherwise the message is displayed for @p time ms. */ void showStatusMessage(const std::string& msg, OpenMS::UInt time); /// shows x,y coordinates in the status bar void showCursorStatus(double x, double y); /// closes the active window void closeFile(); /// updates the toolbar void updateToolBar(); /// Runs the pipeline of the current window void runPipeline(); /// Terminates the current pipeline void abortPipeline(); /// Called when a tool is started void toolStarted(); /// Called when a tool is finished void toolFinished(); /// Called when a tool crashes void toolCrashed(); /// Called when a tool execution fails void toolFailed(); /// Called when a file was successfully written to an output vertex void outputVertexFinished(const String& file); /// Called when a TOPP tool produces (error) output. void updateTOPPOutputLog(const QString& out); /// Called by the scene if the pipeline execution finishes successfully void showPipelineFinishedLogMessage(); /// Saves @p scene to the clipboard void saveToClipboard(TOPPASScene* scene); /// Sends the clipboard content to the sender of the connected signal void sendClipboardContent(); /// Refreshes the parameters of the TOPP tools of the current workflow and stores an updated workflow including the current parameters void refreshParameters(); /// Open files in a new TOPPView instance void openFilesInTOPPView(QStringList all_files); /// Opens a toppas file void openToppasFile(const QString& filename); protected slots: /** @name Tab bar slots */ //@{ /// Closes the window corresponding to the data of the tab with identifier @p id void closeByTab(int id); /// Raises the window corresponding to the data of the tab with identifier @p id void focusByTab(int id); //@} /// enable/disable menu entries depending on the current state void updateMenu(); /// Shows the widget as window in the workspace void showAsWindow_(TOPPASWidget* sw, const String& caption); /// Inserts a new TOPP tool in the current window at (x,y) void insertNewVertex_(double x, double y, QTreeWidgetItem* item = nullptr); /// Inserts the @p item in the middle of the current window void insertNewVertexInCenter_(QTreeWidgetItem* item); /// triggered when user clicks a link - if it ends in .TOPPAS we're done void downloadTOPPASfromHomepage_(const QUrl& url); /// triggered when download of .toppas file is finished, so we can store & open it void toppasFileDownloaded_(QNetworkReply* r); /// debug... void TOPPASreadyRead(); /// user edited the workflow description void descriptionUpdated_(); protected: /// Log output window LogWindow* log_; /// Workflow Description window QTextEdit* desc_; /** @name Toolbar */ //@{ QToolBar* tool_bar_; //@} /// manages recent list of filenames and the menu that goes with it RecentFilesMenu recent_files_menu_; // needs to be declared before 'menu_', because its needed there /// Main workspace EnhancedWorkspace* ws_; /// OpenMS homepage workflow browser QWebView* webview_; /// download .toppas files from homepage QNetworkAccessManager* network_manager_; /// the content of the network request QNetworkReply* network_reply_; ///Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() EnhancedTabBar* tab_bar_; /// Tree view of all available TOPP tools TOPPASTreeView* tools_tree_view_; /// Filter for the Tree view QLineEdit* tools_filter_; /// Expand button for the Tree view QPushButton* tools_expand_all_; /// Collapse button for the Tree view QPushButton* tools_collapse_all_; /// List of ready analysis pipelines QListWidget* blocks_list_; /** @name Status bar */ //@{ /// Label for messages in the status bar QLabel* message_label_; //@} ///returns the window with id @p id TOPPASWidget* window_(int id) const; void filterToolTree_(); /// The current path (used for loading and storing). /// Depending on the preferences this is static or changes with the current window/layer. String current_path_; /// The path for temporary files String tmp_path_; /// Offset counter for new inserted nodes (to avoid invisible stacking) static int node_offset_; /// z-value counter for new inserted nodes (new nodes should be on top) static qreal z_value_; ///returns a pointer to the active TOPPASWidget (0 if none is active) TOPPASWidget* activeSubWindow_() const; ///@name reimplemented Qt events //@{ void closeEvent(QCloseEvent* event) override; void keyPressEvent(QKeyEvent* e) override; //@} /// The clipboard TOPPASScene* clipboard_scene_; public: /// @name common functions used in TOPPAS and TOPPView //@{ /// Creates and fills a tree widget with all available tools static TOPPASTreeView* createTOPPToolsTreeWidget(QWidget* parent_widget = nullptr); /// Saves the workflow in the provided TOPPASWidget to a user defined location. /// Returns the full file name or "" if no valid one is selected. static QString savePipelineAs(TOPPASWidget* w, const QString& current_path); /// Loads and sets the resources of the TOPPASWidget. static QString loadPipelineResourceFile(TOPPASWidget* w, const QString& current_path); /// Saves the resources of the TOPPASWidget. static QString savePipelineResourceFile(TOPPASWidget* w, const QString& current_path); /// Refreshes the TOPP tools parameters of the pipeline static QString refreshPipelineParameters(TOPPASWidget* tw, QString current_path); //@} }; //class } //namespace
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/APPLICATIONS/MISC/QApplicationTOPP.h
.h
1,732
66
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Chris Bielow $ // $Authors: Chris Bielow $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> //Qt #include <QtWidgets/QApplication> namespace OpenMS { /** @brief Extension to the QApplication for running TOPPs GUI tools. Basically re-implements notify of QApplication to prevent ungraceful exit. */ class OPENMS_GUI_DLLAPI QApplicationTOPP : public QApplication { Q_OBJECT public: /// Constructor (no NOT remove the "&" from argc, since Qt will segfault on some platforms otherwise!) QApplicationTOPP(int& argc, char** argv); /// Destructor ~QApplicationTOPP() override; /** @brief: Catch exceptions in Qt GUI applications, preventing ungraceful exit Re-implementing QApplication::notify() to catch exception thrown in event handlers (which is most likely OpenMS code). */ bool notify(QObject* rec, QEvent* ev) override; /** Reimplemented from QApplication, to handle QEvent::FileOpen to enable handling of odoc event on MacOSX */ bool event(QEvent*) override; /** @brief Show the About-Dialog with License and Citation for all GUI tools @param[in] parent Parent widget (usually 'this') @param[in] toolname name of the tool (used as heading) */ static void showAboutDialog(QWidget* parent, const QString& toolname); signals: void fileOpen(QString file); }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/DIALOGS/TOPPASInputFileDialog.h
.h
1,381
60
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QtWidgets/QDialog> namespace Ui { class TOPPASInputFileDialogTemplate; } namespace OpenMS { class InputFile; /** @brief Dialog which allows to specify an input file @ingroup TOPPAS_elements @ingroup Dialogs */ class OPENMS_GUI_DLLAPI TOPPASInputFileDialog : public QDialog { Q_OBJECT public: /// Constructor TOPPASInputFileDialog(const QString& file_name); ~TOPPASInputFileDialog(); /// users can only choose certain filetypes void setFileFormatFilter(const QString& fff); /// Returns the filename QString getFilename() const; protected slots: /// Called when OK is pressed; checks if the selected file is valid void checkValidity_(); private: Ui::TOPPASInputFileDialogTemplate* ui_; }; } // ns OpenMS // this is required to allow Ui_TOPPASInputFileDialog (auto UIC'd from .ui) to have a InputFile member using InputFile = OpenMS::InputFile;
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/DIALOGS/FLASHDeconvTabWidget.h
.h
3,853
105
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Jihyung Kim $ // $Authors: Jihyung Kim $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/DATASTRUCTURES/ListUtils.h> #include <OpenMS/DATASTRUCTURES/Param.h> #include <OpenMS/DATASTRUCTURES/String.h> #include <OpenMS/VISUAL/MISC/ExternalProcessMBox.h> #include <OpenMS/VISUAL/MISC/GUIHelpers.h> #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/VISUAL/TableView.h> #include <QTabWidget> // our base class #include <utility> // for std::pair #include <vector> namespace Ui { class FLASHDeconvTabWidget; } namespace OpenMS { class InputFile; class OutputDirectory; class ParamEditor; namespace Internal { class FLASHDeconvTabWidget; /// A multi-tabbed widget for the FLASHDeconvWizard offering setting of parameters, input-file specification and running FLASHDeconv and more class OPENMS_GUI_DLLAPI FLASHDeconvTabWidget : public QTabWidget { Q_OBJECT public: template <typename> friend class WizardGUILock; /// constructor explicit FLASHDeconvTabWidget(QWidget* parent = nullptr); /// Destructor ~FLASHDeconvTabWidget(); /// get all the input mzML files as a string list StringList getMzMLInputFiles() const; private slots: void on_run_fd_clicked(); void on_edit_advanced_parameters_clicked(); void on_open_output_directory_clicked(); /// update the current working directory for all file input fields void broadcastNewCWD_(const QString& new_cwd); private: /// collect all parameters throughout the Wizard's controls and update 'flashdeconv_param_' void updateFLASHDeconvParamFromWidgets_(); /// collect output format parameters from the Wizard's control and update 'flashdeconv_output_tags_' void updateOutputParamFromWidgets_(); /// update 'flashdeconv_param_outputs' with given input file name void updateOutputParamFromPerInputFile(const QString& input_file_name); /// update Widgets given a param object void setWidgetsfromFDDefaultParam_(); /// where to write output QString getCurrentOutDir_() const; /// append text to the log tab /// @param[in] text The text to write /// @param[in] color Color for the text /// @param[in] new_section Start a new block with a date and time void writeLog_(const QString& text, const QColor& color = "#000000", bool new_section = false); /// @brief convenient overload for String void writeLog_(const String& text, const QColor& color = "#000000", bool new_section = false); /// Ensure all input widgets are filled with data by the user to run FLASHDeconv /// If anything is missing: show a Messagebox and return false. bool checkFDInputReady_(); Ui::FLASHDeconvTabWidget* ui; Param flashdeconv_param_; ///< the global FLASHDeconv parameters which will be passed to FLASHDeconv.exe, once updated with parameters the Wizard holds separately Param flashdeconv_param_outputs_; ///< Parameter set for different output formats StringList flashdeconv_output_tags_; ///< list of output parameter names checked by the user ExternalProcessMBox ep_; ///< to run external programs and pipe their output into our log }; } // namespace Internal } // namespace OpenMS // this is required to allow Ui_FLASHDeconvTabWidget (auto UIC'd from .ui) to have a InputFile member using InputFile = OpenMS::InputFile; using OutputDirectory = OpenMS::OutputDirectory; using ParamEditor = OpenMS::ParamEditor;
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/DIALOGS/TOPPASVertexNameDialog.h
.h
1,045
51
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Johannes Veit $ // $Authors: Johannes Junker $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <QtWidgets/QDialog> namespace Ui { class TOPPASVertexNameDialogTemplate; } namespace OpenMS { /** @brief Dialog which allows to change the name of an input/output vertex @ingroup TOPPAS_elements @ingroup Dialogs */ class OPENMS_GUI_DLLAPI TOPPASVertexNameDialog : public QDialog { Q_OBJECT public: /// Constructor TOPPASVertexNameDialog(const QString& name, const QString& input_regex = QString()); ~TOPPASVertexNameDialog() override; /// Returns the name QString getName(); private: Ui::TOPPASVertexNameDialogTemplate* ui_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/DIALOGS/Plot2DGoToDialog.h
.h
2,184
81
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/CONCEPT/Types.h> #include <OpenMS/VISUAL/PlotCanvas.h> // for AreaXYType #include <QtWidgets/QDialog> namespace Ui { class Plot2DGoToDialogTemplate; } namespace OpenMS { class String; /** @brief GoTo dialog used to zoom to a m/z and retention time range or to a feature. @ingroup Dialogs */ class OPENMS_GUI_DLLAPI Plot2DGoToDialog : public QDialog { Q_OBJECT public: using AreaXYType = PlotCanvas::AreaXYType; ///Constructor /// @param[in] parent Parent widget /// @param[in] x_name Name of the x_axis dimension /// @param[in] y_name Name of the y_axis dimension Plot2DGoToDialog(QWidget* parent, std::string_view x_name, std::string_view y_name); ///Destructor ~Plot2DGoToDialog() override; /// Returns if a feature UID was set an a feature should be displayed (false), otherwise, show a range (true) bool showRange() const; bool checked(); ///@name Methods for ranges //@{ ///Sets the data range to display initially void setRange(const AreaXYType& range); ///Sets the data range of the complete experiment for better navigation with the dialog void setMinMaxOfRange(const AreaXYType& max_range); /// Query the range set by the user. /// If any dimension is <1, it is extended to at least 1 to ensure proper displaying. AreaXYType getRange(); //@} ///@name Methods for feature numbers //@{ ///Returns the selected feature numbers. If a number is returned, the feature rather than the range should be displayed. String getFeatureNumber() const; ///Disables the feature number field void enableFeatureNumber(bool); //@} private: Ui::Plot2DGoToDialogTemplate* ui_; }; }
Unknown
3D
OpenMS/OpenMS
src/openms_gui/include/OpenMS/VISUAL/DIALOGS/FeatureEditDialog.h
.h
1,161
62
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin // SPDX-License-Identifier: BSD-3-Clause // // -------------------------------------------------------------------------- // $Maintainer: Timo Sachsenberg $ // $Authors: Marc Sturm $ // -------------------------------------------------------------------------- #pragma once // OpenMS_GUI config #include <OpenMS/VISUAL/OpenMS_GUIConfig.h> #include <OpenMS/KERNEL/Feature.h> #include <QDialog> namespace Ui { class FeatureEditDialogTemplate; } namespace OpenMS { /** @brief Dialog for editing a feature @ingroup Dialogs */ class OPENMS_GUI_DLLAPI FeatureEditDialog : public QDialog { Q_OBJECT public: /// Constructor FeatureEditDialog(QWidget * parent); /// Destructor ~FeatureEditDialog() override; /// Sets the feature void setFeature(const Feature & feature); /// Returns the feature const Feature & getFeature() const; protected: /// The feature to edit mutable Feature feature_; private: ///Not implemented FeatureEditDialog(); Ui::FeatureEditDialogTemplate* ui_; }; }
Unknown