OpenMS
TOPPViewBase Class Reference

Main window of TOPPView tool. More...

#include <OpenMS/VISUAL/APPLICATIONS/TOPPViewBase.h>

Inheritance diagram for TOPPViewBase:
[legend]
Collaboration diagram for TOPPViewBase:
[legend]

Protected Member Functions

Recent files
void addRecentFile_ (const String &filename)
 adds a Filename to the recent files More...
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

dock widgets
QDockWidget * layer_dock_widget_
 
QDockWidget * views_dockwidget_
 
QDockWidget * filter_dock_widget_
 
LayerListViewlayers_view_
 Layer management widget. More...
 
DataSelectionTabsselection_view_
 
Filter widget
FilterListfilter_list_
 
FileWatcherwatcher_ = nullptr
 Watcher that tracks file changes (in order to update the data in the different views) More...
 
bool watcher_msgbox_ = false
 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) More...
 
bool zoom_together_ = false
 Stores whether the individual windows should zoom together (be linked) or not. More...
 
LogWindowlog_
 Log output window. More...
 
TOOL_SCAN scan_mode_
 Determines TVToolDiscovery scans for tools and generates new params. More...
 
TVToolDiscovery tool_scanner_
 Scans for tools and generates a param for each. More...
 
VERBOSITY verbosity_
 Verbosity of TV. More...
 
Toolbar
QToolBar * tool_bar_
 
QButtonGroup * intensity_button_group_
 
QToolBar * tool_bar_1d_
 
QButtonGroup * draw_group_1d_
 
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_
 
EnhancedWorkspace ws_
 Main workspace. More...
 
QMdiSubWindow * lastActiveSubwindow_ = nullptr
 
EnhancedTabBar tab_bar_
 Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() More...
 
RecentFilesMenu recent_files_
 manages recent list of filenames and the menu that goes with it More...
 
TOPPViewMenu menu_
 manages the menu items (active/inactive) and recent files etc More...
 
Status bar
QLabel * message_label_
 Label for messages in the status bar. More...
 
QLabel * x_label_
 x-axis label for messages in the status bar More...
 
QLabel * y_label_
 y-axis label for messages in the status bar More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Friends

class TestTOPPView
 

Type definitions

enum class  TOOL_SCAN { SKIP_SCAN , SCAN_IF_NEWER_VERSION , FORCE_SCAN }
 Used for deciding whether new tool/util params should be generated or reused from TOPPView's ini file. More...
 
enum class  VERBOSITY { DEFAULT , VERBOSE }
 
enum class  LOAD_RESULT {
  OK , FILE_NOT_FOUND , FILETYPE_UNKNOWN , FILETYPE_UNSUPPORTED ,
  LOAD_ERROR
}
 
typedef LayerDataBase::FeatureMapType FeatureMapType
 
typedef LayerDataBase::FeatureMapSharedPtrType FeatureMapSharedPtrType
 
typedef LayerDataBase::ConsensusMapType ConsensusMapType
 
typedef LayerDataBase::ConsensusMapSharedPtrType ConsensusMapSharedPtrType
 
typedef LayerDataBase::ExperimentType ExperimentType
 
typedef LayerDataBase::ExperimentSharedPtrType ExperimentSharedPtrType
 
typedef LayerDataBase::ODExperimentSharedPtrType ODExperimentSharedPtrType
 
typedef ExperimentType::SpectrumType SpectrumType
 Peak spectrum type. More...
 
 TOPPViewBase (TOOL_SCAN scan_mode=TOOL_SCAN::SCAN_IF_NEWER_VERSION, VERBOSITY verbosity=VERBOSITY::DEFAULT, QWidget *parent=nullptr)
 Constructor. More...
 
 ~TOPPViewBase () override
 Destructor. More...
 
LOAD_RESULT addDataFile (const String &filename, bool show_options, bool add_to_recent, String caption="", UInt window_id=0, Size spectrum_id=0)
 Opens and displays data from a file. More...
 
void addData (const FeatureMapSharedPtrType &feature_map, const ConsensusMapSharedPtrType &consensus_map, std::vector< PeptideIdentification > &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)
 Adds a peak or feature map to the viewer. More...
 
void loadFiles (const StringList &list, QSplashScreen *splash_screen)
 Opens all the files in the string list. More...
 
void loadPreferences (String filename="")
 Loads the preferences from the filename given. More...
 
void savePreferences ()
 Stores the preferences (used when this window is closed) More...
 
Param getCanvasParameters (UInt dim) const
 Returns the parameters for a PlotCanvas of dimension dim. More...
 
const LayerDataBasegetCurrentLayer () const
 Returns the active Layer data (0 if no layer is active) More...
 
LayerDataBasegetCurrentLayer ()
 Returns the active Layer data (0 if no layer is active) More...
 
EnhancedWorkspacegetWorkspace ()
 returns a pointer to the EnhancedWorkspace containing PlotWidgets More...
 
PlotWidgetgetActivePlotWidget () const
 returns a pointer to the active PlotWidget (0 if none is active) More...
 
Plot1DWidgetgetActive1DWidget () const
 returns a pointer to the active Plot1DWidget (0 the active window is no Plot1DWidget or there is no active window) More...
 
Plot2DWidgetgetActive2DWidget () const
 returns a pointer to the active Plot2DWidget (0 the active window is no Plot2DWidget or there is no active window) More...
 
Plot3DWidgetgetActive3DWidget () const
 returns a pointer to the active Plot3DWidget (0 the active window is no Plot2DWidget or there is no active window) More...
 
PlotCanvasgetActiveCanvas () const
 returns a pointer to the active PlotCanvas (0 if none is active) More...
 
void showPlotWidgetInWindow (PlotWidget *sw)
 Opens the provided spectrum widget in a new window. More...
 
void updateCurrentPath ()
 changes the current path according to the currently active window/layer More...
 
void openFilesByDialog (const String &initial_directory="")
 shows the file dialog for opening files (a starting directory, e.g. for the example files can be provided; otherwise, uses the current_path_) More...
 
void showGoToDialog () const
 shows the DB dialog for opening files More...
 
void preferencesDialog ()
 shows the preferences dialog More...
 
void layerStatistics () const
 Shows statistics (count,min,max,avg) about Intensity, Quality, Charge and meta data. More...
 
void editMetadata ()
 lets the user edit the meta data of a layer More...
 
void layerActivated ()
 gets called if a layer got activated More...
 
void zoomOtherWindows () const
 gets called when a layer changes in zoom; will apply the same zoom to other windows (if linked) More...
 
void linkZoom ()
 link the zoom of individual windows More...
 
void layerDeactivated ()
 gets called if a layer got deactivated More...
 
void closeTab ()
 closes the active window More...
 
void rerunTOPPTool ()
 returns the last invoked TOPP tool with the same parameters More...
 
void updateBarsAndMenus ()
 calls update*Bar and updateMenu_() to make sure the interface matches the current data More...
 
void updateToolBar ()
 updates the toolbar More...
 
void updateLayerBar ()
 adapts the layer bar to the active window More...
 
void updateViewBar ()
 adapts view bar to the active window More...
 
void updateMenu ()
 activates/deactivates menu entries More...
 
void updateFilterBar ()
 adapts the filter bar to the active window More...
 
void showStatusMessage (const std::string &msg, OpenMS::UInt time)
 Shows a status message in the status bar. More...
 
void showCursorStatus (const String &x, const String &y)
 shows X/Y axis mouse values in the status bar More...
 
void showTOPPDialog ()
 Apply TOPP tool. More...
 
void annotateWithAMS ()
 Annotates current layer with ID data from AccurateMassSearch. More...
 
void annotateWithID ()
 Annotates current layer with ID data. More...
 
void annotateWithOSW ()
 Annotates current chromatogram layer with ID data. More...
 
void showSpectrumGenerationDialog ()
 Shows the theoretical spectrum generation dialog. More...
 
void showSpectrumAlignmentDialog ()
 Shows the spectrum alignment dialog. More...
 
void showCurrentPeaksAs2D ()
 Shows the current peak data of the active layer in 2D. More...
 
void showCurrentPeaksAs3D ()
 Shows the current peak data of the active layer in 3D. More...
 
void showCurrentPeaksAsIonMobility (const MSSpectrum &spec)
 Shows the current peak data of the active layer as ion mobility. More...
 
void showCurrentPeaksAsDIA (const Precursor &pc, const MSExperiment &exp)
 Shows the current peak data of the active layer as DIA data. More...
 
void saveLayerAll () const
 Saves the whole current layer data. More...
 
void saveLayerVisible () const
 Saves the visible layer data. More...
 
void toggleGridLines () const
 Toggles the grid lines. More...
 
void toggleAxisLegends () const
 Toggles the axis legends. More...
 
void toggleInterestingMZs () const
 Toggles drawing of interesting MZs. More...
 
void showPreferences () const
 Shows current layer preferences. More...
 
void metadataFileDialog ()
 dialog for inspecting database meta data More...
 

TOPP tool execution

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
 
QProcessprocess = nullptr
 
QElapsedTimer timer
 
bool visible_area_only
 
topp_
 Information needed for execution of TOPP tools. More...
 
void runTOPPTool_ ()
 Runs the TOPP tool according to the information in topp_. More...
 
void checkPreferences_ ()
 check if all available preferences get set by the .ini file. If there are some missing entries fill them with default values. More...
 

reimplemented Qt events

QMenu * add_2d_context_
 Additional context menu for 2D layers. More...
 
String current_path_
 
static const String CAPTION_3D_SUFFIX_
 Suffix appended to caption of tabs when layer is shown in 3D. More...
 
TheoreticalSpectrumGenerationDialog spec_gen_dialog_
 This dialog is a member so that its settings can be perserved upon closing. More...
 
void closeEvent (QCloseEvent *event) override
 
void showTOPPDialog_ (bool visible)
 Apply TOPP tool. If visible is true, only the visible data is used, otherwise the whole layer is used. More...
 

Toolbar slots

void setDrawMode1D (int) const
 
void setIntensityMode (int)
 
void changeLayerFlag (bool)
 
void changeLabel (QAction *)
 
void changeUnassigned (QAction *)
 
void resetZoom () const
 
void toggleProjections ()
 
void openFile (const String &filename)
 
void layerFilterVisibilityChange (bool) const
 Enables/disables the data filters for the current layer. More...
 
void showSpectrumMetaData (int spectrum_index) const
 shows a spectrum's metadata with index spectrum_index from the currently active canvas More...
 
void finishTOPPToolExecution (int exitCode, QProcess::ExitStatus exitStatus)
 slot for the finished signal of the TOPP tools execution More...
 
void abortTOPPTool ()
 aborts the execution of a TOPP tool More...
 
void showSpectrumBrowser ()
 shows the spectrum browser and updates it More...
 

Tabbar slots

void closeByTab (int id)
 Closes the window corresponding to the data of the tab with identifier id. More...
 
void showWindow (int id)
 Raises the window corresponding to the data of the tab with identifier id. More...
 
void copyLayer (const QMimeData *data, QWidget *source, int id=-1)
 Slot for drag-and-drop of layer manager to tabbar. More...
 
void updateProcessLog ()
 Appends process output to log window. More...
 
void fileChanged_ (const String &)
 Called if a data file has been externally changed. More...
 
void initializeDefaultParameters_ ()
 Initializes the default parameters on TOPPView construction. More...
 
QStringList chooseFilesDialog_ (const String &path_overwrite="")
 Shows a dialog where the user can select files. More...
 

Additional Inherited Members

- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 

Detailed Description

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:
  • 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)

Member Typedef Documentation

◆ ConsensusMapSharedPtrType

◆ ConsensusMapType

◆ ExperimentSharedPtrType

◆ ExperimentType

◆ FeatureMapSharedPtrType

◆ FeatureMapType

◆ ODExperimentSharedPtrType

◆ SpectrumType

Peak spectrum type.

Member Enumeration Documentation

◆ LOAD_RESULT

enum LOAD_RESULT
strong
Enumerator
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

◆ TOOL_SCAN

enum TOOL_SCAN
strong

Used for deciding whether new tool/util params should be generated or reused from TOPPView's ini file.

Enumerator
SKIP_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.

SCAN_IF_NEWER_VERSION 

Only generate params for each tool/util if TOPPView's last ini file has an older version. (Default behaviour)

FORCE_SCAN 

Forces TVToolDiscovery to generate params and using them instead of the params in TOPPView's ini file.

◆ VERBOSITY

enum VERBOSITY
strong
Enumerator
DEFAULT 
VERBOSE 

Constructor & Destructor Documentation

◆ TOPPViewBase()

TOPPViewBase ( TOOL_SCAN  scan_mode = TOOL_SCAN::SCAN_IF_NEWER_VERSION,
VERBOSITY  verbosity = VERBOSITY::DEFAULT,
QWidget parent = nullptr 
)
explicit

Constructor.

References EnhancedTabBar::addTab(), TOPPViewMenu::addWindowToggle(), TOPPViewBase::changeLabel(), TOPPViewBase::changeLayerFlag(), TOPPViewBase::changeUnassigned(), TOPPViewBase::closeByTab(), EnhancedTabBar::closeRequested(), CONNECTCAST, TOPPViewBase::copyLayer(), TOPPViewBase::current_path_, EnhancedTabBar::currentIdChanged(), DefaultParamHandler::defaultsToParam_(), Plot1DCanvas::DM_CONNECTEDLINES, TOPPViewBase::dm_elements_2d_, TOPPViewBase::dm_hull_2d_, TOPPViewBase::dm_hulls_2d_, TOPPViewBase::dm_ident_2d_, TOPPViewBase::dm_label_2d_, Plot1DCanvas::DM_PEAKS, TOPPViewBase::dm_precursors_2d_, TOPPViewBase::dm_unassigned_2d_, TOPPViewBase::draw_group_1d_, EnhancedTabBar::dropOnTab(), EnhancedTabBar::dropOnWidget(), EnhancedWorkspace::dropReceived(), FileWatcher::fileChanged(), TOPPViewBase::fileChanged_(), TOPPViewBase::filter_dock_widget_, TOPPViewBase::filter_list_, FilterList::filterChanged(), TOPPViewBase::getActiveCanvas(), Param::getValue(), TOPPViewBase::group_label_2d_, TOPPViewBase::group_unassigned_2d_, PlotCanvas::IM_LOG, PlotCanvas::IM_NONE, PlotCanvas::IM_PERCENTAGE, PlotCanvas::IM_SNAP, TOPPViewBase::initializeDefaultParameters_(), TOPPViewBase::intensity_button_group_, TOPPViewBase::lastActiveSubwindow_, TOPPViewBase::layer_dock_widget_, LayerListView::layerDataChanged(), TOPPViewBase::layers_view_, TOPPViewBase::loadPreferences(), TOPPViewBase::log_, TOPPViewBase::menu_, TOPPViewBase::message_label_, LayerDataDefs::NamesOfLabelType, TOPPViewBase::openFile(), DefaultParamHandler::param_, TOPPViewBase::projections_2d_, TOPPViewBase::recent_files_, RecentFilesMenu::recentFileClicked(), EnhancedTabBar::removeId(), TOPPViewBase::resetZoom(), TOPPViewBase::selection_view_, TOPPViewBase::setDrawMode1D(), PlotCanvas::setFilters(), TOPPViewBase::setIntensityMode(), TVToolDiscovery::setPluginPath(), TVToolDiscovery::setVerbose(), TOPPViewBase::showWindow(), LayerDataDefs::SIZE_OF_LABEL_TYPE, TOPPViewBase::tab_bar_, TOPPViewBase::toggleProjections(), TOPPViewBase::tool_bar_, TOPPViewBase::tool_bar_1d_, TOPPViewBase::tool_bar_2d_cons_, TOPPViewBase::tool_bar_2d_feat_, TOPPViewBase::tool_bar_2d_ident_, TOPPViewBase::tool_bar_2d_peak_, TOPPViewBase::tool_scanner_, ParamValue::toString(), TOPPViewBase::updateBarsAndMenus(), TOPPViewBase::updateMenu(), OpenMS::user_section, TOPPViewBase::VERBOSE, TOPPViewBase::verbosity_, TOPPViewBase::views_dockwidget_, TOPPViewBase::watcher_, TOPPViewBase::ws_, TOPPViewBase::x_label_, and TOPPViewBase::y_label_.

◆ ~TOPPViewBase()

Member Function Documentation

◆ abortTOPPTool

void abortTOPPTool ( )
protectedslot

◆ addData()

void addData ( const FeatureMapSharedPtrType feature_map,
const ConsensusMapSharedPtrType consensus_map,
std::vector< PeptideIdentification > &  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 
)

Adds a peak or feature map to the viewer.

Parameters
feature_mapThe feature data (empty if not feature data)
consensus_mapThe consensus feature data (empty if not consensus feature data)
peptidesThe peptide identifications (empty if not ID data)
peak_mapThe peak data (empty if not peak data)
on_disc_peak_mapThe peak data managed on disc (empty if not peak data)
data_typeType of the data
show_as_1dForce dataset to be opened in 1D mode (even if it contains several spectra)
show_optionsIf the options dialog should be shown (otherwise the defaults are used)
as_new_windowOpen the layer in a new window within TOPPView (ignored if 'window_id' is set)
filenamesource file name (if the data came from a file)
captionSets 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.
window_idin which window the file is opened if opened as a new layer (0 will open a new window).
spectrum_iddetermines the spectrum to show in 1D view.

References Plot1DCanvas::activateSpectrum(), PlotCanvas::addChromLayer(), PlotCanvas::addLayer(), PlotCanvas::addPeakLayer(), PlotWidget::canvas(), Plot1DWidget::canvas(), TOPPViewOpenDialog::disableCutoff(), TOPPViewOpenDialog::disableDimension(), TOPPViewOpenDialog::disableLocation(), LayerDataDefs::DT_CHROMATOGRAM, LayerDataDefs::DT_CONSENSUS, LayerDataDefs::DT_FEATURE, LayerDataDefs::DT_IDENT, LayerDataDefs::DT_PEAK, TOPPViewBase::getActivePlotWidget(), TOPPViewBase::getCanvasParameters(), PlotCanvas::getLayer(), PlotCanvas::getLayerCount(), PlotCanvas::getLayerName(), TOPPViewOpenDialog::getMergeLayer(), LayerDataBase::getName(), Param::getValue(), EnhancedWorkspace::getWidget(), TOPPViewOpenDialog::isCutoffEnabled(), TOPPViewOpenDialog::isDataDIA(), Plot2DCanvas::mergeIntoLayer(), TOPPViewOpenDialog::openAsNewWindow(), DefaultParamHandler::param_, PlotCanvas::setLayerName(), TOPPViewOpenDialog::setMergeLayers(), TOPPViewBase::showPlotWidgetInWindow(), LayerDataBase::type, OpenMS::user_section, TOPPViewOpenDialog::viewMapAs1D(), TOPPViewOpenDialog::viewMapAs2D(), TOPPViewBase::ws_, and OpenMS::Y.

Referenced by TOPPViewBase::addDataFile(), TOPPViewBase::copyLayer(), and TOPPViewBase::showSpectrumGenerationDialog().

◆ addDataFile()

TOPPViewBase::LOAD_RESULT addDataFile ( const String filename,
bool  show_options,
bool  add_to_recent,
String  caption = "",
UInt  window_id = 0,
Size  spectrum_id = 0 
)

Opens and displays data from a file.

Loads the data and adds it to the application by calling addData_()

Parameters
filenameThe file to open
show_optionsIf the options dialog should be shown (otherwise the defaults are used)
captionSets the layer name and window caption of the data. If unset the file name is used.
add_to_recentIf the file should be added to the recent files after opening
window_idin which window the file is opened if opened as a new layer (0 or default equals current window).
spectrum_iddetermines the spectrum to show in 1D view.

References File::absolutePath(), TOPPViewBase::addData(), FileWatcher::addFile(), TOPPViewBase::addRecentFile_(), LogWindow::appendNewHeader(), File::basename(), FileTypes::CONSENSUSXML, FileTypeList::contains(), LayerDataDefs::DT_CHROMATOGRAM, LayerDataDefs::DT_CONSENSUS, LayerDataDefs::DT_FEATURE, LayerDataDefs::DT_IDENT, LayerDataDefs::DT_PEAK, LayerDataDefs::DT_UNKNOWN, File::exists(), FileTypes::FEATUREXML, TOPPViewBase::FILE_NOT_FOUND, TOPPViewBase::FILETYPE_UNKNOWN, TOPPViewBase::FILETYPE_UNSUPPORTED, TOPPViewBase::getActivePlotWidget(), TOPPViewBase::getCurrentLayer(), IndexedMzMLHandler::getNrChromatograms(), IndexedMzMLHandler::getNrSpectra(), IndexedMzMLHandler::getParsingSuccess(), FileHandler::getType(), Param::getValue(), EnhancedTabBarWidgetInterface::getWindowId(), ProgressLogger::GUI, FileTypes::IDXML, OpenMS::Constants::k, TOPPViewBase::LOAD_ERROR, FileHandler::loadConsensusFeatures(), FileHandler::loadExperiment(), FileHandler::loadFeatures(), FileHandler::loadIdentifications(), TOPPViewBase::log_, FileTypes::MZIDENTML, FileTypes::MZML, TOPPViewBase::OK, IndexedMzMLHandler::openFile(), OPENMS_LOG_INFO, OPENMS_LOG_WARN, DefaultParamHandler::param_, FileHandler::stripExtension(), OpenMS::supported_types, FileHandler::swapExtension(), OpenMS::StringUtils::toQString(), FileTypes::typeToName(), FileTypes::UNKNOWN, GUILock::unlock(), OpenMS::user_section, and TOPPViewBase::watcher_.

Referenced by TOPPViewBase::copyLayer(), TOPPViewBase::finishTOPPToolExecution(), TOPPViewBase::loadFiles(), TOPPViewBase::openFile(), and TOPPViewBase::openFilesByDialog().

◆ addRecentFile_()

void addRecentFile_ ( const String filename)
protected

adds a Filename to the recent files

References RecentFilesMenu::add(), and TOPPViewBase::recent_files_.

Referenced by TOPPViewBase::addDataFile().

◆ annotateWithAMS

void annotateWithAMS ( )
slot

◆ annotateWithID

◆ annotateWithOSW

◆ changeLabel

◆ changeLayerFlag

◆ changeUnassigned

◆ checkPreferences_()

void checkPreferences_ ( )
protected

check if all available preferences get set by the .ini file. If there are some missing entries fill them with default values.

◆ chooseFilesDialog_()

QStringList chooseFilesDialog_ ( const String path_overwrite = "")
protected

◆ closeByTab

void closeByTab ( int  id)
protectedslot

Closes the window corresponding to the data of the tab with identifier id.

References EnhancedWorkspace::getWidget(), TOPPViewBase::updateBarsAndMenus(), and TOPPViewBase::ws_.

Referenced by TOPPViewBase::TOPPViewBase().

◆ closeEvent()

void closeEvent ( QCloseEvent *  event)
overrideprotected

References TOPPViewBase::ws_.

◆ closeTab

void closeTab ( )
slot

closes the active window

References TOPPViewBase::ws_.

◆ copyLayer

◆ editMetadata

◆ fileChanged_

◆ finishTOPPToolExecution

void finishTOPPToolExecution ( int  exitCode,
QProcess::ExitStatus  exitStatus 
)
protectedslot

◆ getActive1DWidget()

◆ getActive2DWidget()

◆ getActive3DWidget()

Plot3DWidget * getActive3DWidget ( ) const

returns a pointer to the active Plot3DWidget (0 the active window is no Plot2DWidget or there is no active window)

References TOPPViewBase::getActivePlotWidget().

Referenced by TOPPViewBase::loadFiles(), and TOPPViewBase::updateToolBar().

◆ getActiveCanvas()

◆ getActivePlotWidget()

◆ getCanvasParameters()

◆ getCurrentLayer() [1/2]

LayerDataBase * getCurrentLayer ( )

Returns the active Layer data (0 if no layer is active)

References TOPPViewBase::getActiveCanvas(), and PlotCanvas::getCurrentLayer().

◆ getCurrentLayer() [2/2]

◆ getWorkspace()

EnhancedWorkspace * getWorkspace ( )

returns a pointer to the EnhancedWorkspace containing PlotWidgets

References TOPPViewBase::ws_.

◆ initializeDefaultParameters_()

◆ layerActivated

◆ layerDeactivated

void layerDeactivated ( )
slot

gets called if a layer got deactivated

◆ layerFilterVisibilityChange

void layerFilterVisibilityChange ( bool  on) const
slot

Enables/disables the data filters for the current layer.

References PlotCanvas::changeLayerFilterState(), and TOPPViewBase::getActiveCanvas().

◆ layerStatistics

void layerStatistics ( ) const
slot

Shows statistics (count,min,max,avg) about Intensity, Quality, Charge and meta data.

References TOPPViewBase::getActivePlotWidget(), and PlotWidget::showStatistics().

◆ linkZoom

void linkZoom ( )
slot

link the zoom of individual windows

References TOPPViewBase::zoom_together_.

◆ loadFiles()

◆ loadPreferences()

◆ metadataFileDialog

void metadataFileDialog ( )
slot

◆ openFile

void openFile ( const String filename)
slot

list of the recently opened files called when RecentFileMenu items is clicked

References TOPPViewBase::addDataFile().

Referenced by main(), and TOPPViewBase::TOPPViewBase().

◆ openFilesByDialog

void openFilesByDialog ( const String initial_directory = "")
slot

shows the file dialog for opening files (a starting directory, e.g. for the example files can be provided; otherwise, uses the current_path_)

References TOPPViewBase::addDataFile(), and TOPPViewBase::chooseFilesDialog_().

◆ preferencesDialog

◆ rerunTOPPTool

void rerunTOPPTool ( )
slot

◆ resetZoom

◆ runTOPPTool_()

◆ saveLayerAll

void saveLayerAll ( ) const
slot

Saves the whole current layer data.

References TOPPViewBase::getActiveCanvas(), and PlotCanvas::saveCurrentLayer().

◆ saveLayerVisible

void saveLayerVisible ( ) const
slot

Saves the visible layer data.

References TOPPViewBase::getActiveCanvas(), and PlotCanvas::saveCurrentLayer().

◆ savePreferences()

◆ setDrawMode1D

◆ setIntensityMode

◆ showCurrentPeaksAs2D

◆ showCurrentPeaksAs3D

◆ showCurrentPeaksAsDIA

◆ showCurrentPeaksAsIonMobility

◆ showCursorStatus

void showCursorStatus ( const String x,
const String y 
)
slot

shows X/Y axis mouse values in the status bar

References TOPPViewBase::message_label_, String::toQString(), TOPPViewBase::x_label_, and TOPPViewBase::y_label_.

Referenced by TOPPViewBase::showPlotWidgetInWindow().

◆ showGoToDialog

void showGoToDialog ( ) const
slot

shows the DB dialog for opening files

References TOPPViewBase::getActivePlotWidget(), and PlotWidget::showGoToDialog().

◆ showPlotWidgetInWindow()

void showPlotWidgetInWindow ( PlotWidget sw)

Opens the provided spectrum widget in a new window.

References EnhancedWorkspace::addSubWindow(), EnhancedTabBarWidgetInterface::addToTabBar(), PlotWidget::canvas(), TOPPViewBase::copyLayer(), PlotWidget::dropReceived(), PlotCanvas::getCurrentLayer(), LayerDataBase::getDecoratedName(), Plot2DWidget::getProjectionOntoX(), Plot2DWidget::getProjectionOntoY(), EnhancedTabBarWidgetInterface::getWindowId(), TOPPViewBase::layerActivated(), PlotCanvas::layerActivated(), PlotCanvas::layerModficationChange(), PlotCanvas::layerZoomChanged(), PlotCanvas::preferencesChange(), TOPPViewBase::selection_view_, PlotWidget::sendCursorStatus(), PlotWidget::sendStatusMessage(), TOPPViewBase::showCurrentPeaksAs2D(), Plot1DWidget::showCurrentPeaksAs2D(), Plot3DWidget::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), Plot1DWidget::showCurrentPeaksAs3D(), Plot2DWidget::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), Plot1DWidget::showCurrentPeaksAsDIA(), TOPPViewBase::showCurrentPeaksAsIonMobility(), Plot1DWidget::showCurrentPeaksAsIonMobility(), Plot2DWidget::showCurrentPeaksAsIonMobility(), TOPPViewBase::showCursorStatus(), DataSelectionTabs::showSpectrumAsNew1D(), Plot2DWidget::showSpectrumAsNew1D(), TOPPViewBase::showStatusMessage(), TOPPViewBase::showWindow(), TOPPViewBase::tab_bar_, TOPPViewBase::updateLayerBar(), TOPPViewBase::ws_, and TOPPViewBase::zoomOtherWindows().

Referenced by TOPPViewBase::addData(), TOPPViewBase::showCurrentPeaksAs2D(), TOPPViewBase::showCurrentPeaksAs3D(), TOPPViewBase::showCurrentPeaksAsDIA(), and TOPPViewBase::showCurrentPeaksAsIonMobility().

◆ showPreferences

void showPreferences ( ) const
slot

Shows current layer preferences.

References TOPPViewBase::getActiveCanvas(), and PlotCanvas::showCurrentLayerPreferences().

◆ showSpectrumAlignmentDialog

◆ showSpectrumBrowser

void showSpectrumBrowser ( )
protectedslot

shows the spectrum browser and updates it

References TOPPViewBase::updateViewBar(), and TOPPViewBase::views_dockwidget_.

◆ showSpectrumGenerationDialog

◆ showSpectrumMetaData

void showSpectrumMetaData ( int  spectrum_index) const
slot

shows a spectrum's metadata with index spectrum_index from the currently active canvas

References TOPPViewBase::getActiveCanvas(), and PlotCanvas::showMetaData().

◆ showStatusMessage

void showStatusMessage ( const std::string &  msg,
OpenMS::UInt  time 
)
slot

Shows a status message in the status bar.

If 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 time ms.

References TOPPViewBase::message_label_.

Referenced by TOPPViewBase::showPlotWidgetInWindow().

◆ showTOPPDialog

void showTOPPDialog ( )
slot

Apply TOPP tool.

References TOPPViewBase::showTOPPDialog_().

◆ showTOPPDialog_()

◆ showWindow

void showWindow ( int  id)
protectedslot

Raises the window corresponding to the data of the tab with identifier id.

References EnhancedWorkspace::getWidget(), and TOPPViewBase::ws_.

Referenced by TOPPViewBase::showPlotWidgetInWindow(), and TOPPViewBase::TOPPViewBase().

◆ toggleAxisLegends

void toggleAxisLegends ( ) const
slot

Toggles the axis legends.

References TOPPViewBase::getActivePlotWidget(), and PlotWidget::showLegend().

◆ toggleGridLines

void toggleGridLines ( ) const
slot

Toggles the grid lines.

References TOPPViewBase::getActiveCanvas(), and PlotCanvas::showGridLines().

◆ toggleInterestingMZs

void toggleInterestingMZs ( ) const
slot

Toggles drawing of interesting MZs.

References TOPPViewBase::getActive1DWidget().

◆ toggleProjections

◆ updateBarsAndMenus

void updateBarsAndMenus ( )
slot

calls update*Bar and updateMenu_() to make sure the interface matches the current data

References TOPPViewBase::layerActivated(), and TOPPViewBase::updateMenu().

Referenced by TOPPViewBase::closeByTab(), and TOPPViewBase::TOPPViewBase().

◆ updateCurrentPath

void updateCurrentPath ( )
slot

◆ updateFilterBar

void updateFilterBar ( )
slot

◆ updateLayerBar

void updateLayerBar ( )
slot

◆ updateMenu

◆ updateProcessLog

void updateProcessLog ( )
protectedslot

Appends process output to log window.

References LogWindow::appendText(), TOPPViewBase::log_, and TOPPViewBase::topp_.

Referenced by TOPPViewBase::runTOPPTool_().

◆ updateToolBar

◆ updateViewBar

void updateViewBar ( )
slot

◆ zoomOtherWindows

Friends And Related Function Documentation

◆ TestTOPPView

friend class TestTOPPView
friend

Member Data Documentation

◆ add_2d_context_

QMenu* add_2d_context_
protected

Additional context menu for 2D layers.

◆ CAPTION_3D_SUFFIX_

const String CAPTION_3D_SUFFIX_
staticprivate

Suffix appended to caption of tabs when layer is shown in 3D.

◆ current_path_

String current_path_
protected

The current path (used for loading and storing). Depending on the preferences this is static or changes with the current window/layer.

Referenced by TOPPViewBase::annotateWithAMS(), TOPPViewBase::annotateWithID(), TOPPViewBase::annotateWithOSW(), TOPPViewBase::chooseFilesDialog_(), TOPPViewBase::showTOPPDialog_(), TOPPViewBase::TOPPViewBase(), and TOPPViewBase::updateCurrentPath().

◆ dm_elements_2d_

QAction* dm_elements_2d_
protected

◆ dm_hull_2d_

◆ dm_hulls_2d_

◆ dm_ident_2d_

◆ dm_label_2d_

QToolButton* dm_label_2d_
protected

◆ dm_precursors_2d_

QAction* dm_precursors_2d_
protected

◆ dm_unassigned_2d_

QToolButton* dm_unassigned_2d_
protected

◆ draw_group_1d_

◆ filter_dock_widget_

QDockWidget* filter_dock_widget_
protected

◆ filter_list_

FilterList* filter_list_
protected

◆ group_label_2d_

QActionGroup* group_label_2d_
protected

◆ group_unassigned_2d_

QActionGroup* group_unassigned_2d_
protected

◆ intensity_button_group_

QButtonGroup* intensity_button_group_
protected

◆ lastActiveSubwindow_

QMdiSubWindow* lastActiveSubwindow_ = nullptr
protected

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:
).

Referenced by TOPPViewBase::TOPPViewBase().

◆ layer_dock_widget_

QDockWidget* layer_dock_widget_
protected

◆ layers_view_

LayerListView* layers_view_
protected

◆ log_

◆ menu_

TOPPViewMenu menu_
protected

manages the menu items (active/inactive) and recent files etc

Referenced by TOPPViewBase::TOPPViewBase(), and TOPPViewBase::updateMenu().

◆ message_label_

QLabel* message_label_
protected

Label for messages in the status bar.

Referenced by TOPPViewBase::showCursorStatus(), TOPPViewBase::showStatusMessage(), and TOPPViewBase::TOPPViewBase().

◆ projections_2d_

QAction* projections_2d_
protected

◆ recent_files_

RecentFilesMenu recent_files_
protected

manages recent list of filenames and the menu that goes with it

Referenced by TOPPViewBase::addRecentFile_(), TOPPViewBase::loadPreferences(), TOPPViewBase::savePreferences(), and TOPPViewBase::TOPPViewBase().

◆ scan_mode_

TOOL_SCAN scan_mode_
protected

Determines TVToolDiscovery scans for tools and generates new params.

Referenced by TOPPViewBase::loadPreferences(), and TOPPViewBase::savePreferences().

◆ selection_view_

◆ spec_gen_dialog_

TheoreticalSpectrumGenerationDialog spec_gen_dialog_
private

This dialog is a member so that its settings can be perserved upon closing.

Referenced by TOPPViewBase::showSpectrumGenerationDialog().

◆ tab_bar_

EnhancedTabBar tab_bar_
protected

Tab bar. The address of the corresponding window to a tab is stored as an int in tabData()

Referenced by TOPPViewBase::getActivePlotWidget(), TOPPViewBase::showPlotWidgetInWindow(), and TOPPViewBase::TOPPViewBase().

◆ tool_bar_

QToolBar* tool_bar_
protected

◆ tool_bar_1d_

QToolBar* tool_bar_1d_
protected

◆ tool_bar_2d_cons_

QToolBar* tool_bar_2d_cons_
protected

◆ tool_bar_2d_feat_

QToolBar* tool_bar_2d_feat_
protected

◆ tool_bar_2d_ident_

QToolBar* tool_bar_2d_ident_
protected

◆ tool_bar_2d_peak_

QToolBar* tool_bar_2d_peak_
protected

◆ tool_scanner_

◆ 

◆ verbosity_

VERBOSITY verbosity_
protected

Verbosity of TV.

Referenced by TOPPViewBase::TOPPViewBase().

◆ views_dockwidget_

QDockWidget* views_dockwidget_
protected

◆ watcher_

FileWatcher* watcher_ = nullptr
protected

Watcher that tracks file changes (in order to update the data in the different views)

Referenced by TOPPViewBase::addDataFile(), TOPPViewBase::fileChanged_(), and TOPPViewBase::TOPPViewBase().

◆ watcher_msgbox_

bool watcher_msgbox_ = false
protected

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)

Referenced by TOPPViewBase::fileChanged_().

◆ ws_

◆ x_label_

QLabel* x_label_
protected

x-axis label for messages in the status bar

Referenced by TOPPViewBase::showCursorStatus(), and TOPPViewBase::TOPPViewBase().

◆ y_label_

QLabel* y_label_
protected

y-axis label for messages in the status bar

Referenced by TOPPViewBase::showCursorStatus(), and TOPPViewBase::TOPPViewBase().

◆ zoom_together_

bool zoom_together_ = false
protected

Stores whether the individual windows should zoom together (be linked) or not.

Referenced by TOPPViewBase::linkZoom(), and TOPPViewBase::zoomOtherWindows().