OpenMS
Loading...
Searching...
No Matches
TOPPASEdge.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Johannes Veit $
6// $Authors: Johannes Junker, Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11// OpenMS_GUI config
12#include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13
14#include <QtWidgets/QGraphicsItem>
15
16namespace OpenMS
17{
18 class TOPPASVertex;
19 class TOPPASToolVertex;
20 class TOPPASInputFileListVertex;
21
22
32 class OPENMS_GUI_DLLAPI TOPPASEdge :
33 public QObject,
34 public QGraphicsItem
35 {
36 Q_OBJECT
37 Q_INTERFACES(QGraphicsItem)
38public:
39
53
57 TOPPASEdge(TOPPASVertex * from, const QPointF & hover_pos);
59 TOPPASEdge(const TOPPASEdge & rhs);
61 ~TOPPASEdge() override;
64
66 std::string toString();
67
69 QRectF boundingRect() const override;
71 QPainterPath shape() const override;
73 void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) override;
75 QPointF startPos() const;
77 QPointF endPos() const;
79 void setHoverPos(const QPointF & pos);
91 void setColor(const QColor & color);
95 void setSourceOutParam(int out);
97 int getSourceOutParam() const;
101 void setTargetInParam(int in);
103 int getTargetInParam() const;
112
113public slots:
114
117
118signals:
119
122
123protected:
124
126
127 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * e) override;
128 void contextMenuEvent(QGraphicsSceneContextMenuEvent * event) override;
130
132
133 EdgeStatus getToolToolStatus_(TOPPASToolVertex * source, int source_param_index, TOPPASToolVertex * target, int target_param_index);
134 EdgeStatus getListToolStatus_(TOPPASInputFileListVertex * source, TOPPASToolVertex * target, int target_param_index);
136
138 QPointF borderPoint_(bool atTargetVertex = true) const;
139
145 QPointF hover_pos_;
147 QColor color_;
152 };
153}
154
An edge representing a data flow in TOPPAS.
Definition TOPPASEdge.h:35
QPointF borderPoint_(bool atTargetVertex=true) const
point where the current edge touches the source or target (default) vertex
QPainterPath shape() const override
Returns a more precise shape.
QPointF hover_pos_
Position of hovering end while edge is being created.
Definition TOPPASEdge.h:145
void sourceHasChanged()
Called by the source vertex when it has changed.
void showIOMappingDialog()
Shows the I/O mapping dialog.
~TOPPASEdge() override
Destructor.
void prepareResize()
Call this before changing the item geometry.
EdgeStatus getToolToolStatus_(TOPPASToolVertex *source, int source_param_index, TOPPASToolVertex *target, int target_param_index)
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
EdgeStatus getListToolStatus_(TOPPASInputFileListVertex *source, TOPPASToolVertex *target, int target_param_index)
QString getSourceOutParamName()
Returns the source output parameter name.
EdgeStatus getEdgeStatus()
Returns the status of this edge.
void updateColor()
Updates the edge color.
int target_in_param_
The target input parameter index.
Definition TOPPASEdge.h:151
int getSourceOutParam() const
Returns the source output parameter index.
EdgeStatus
The status of this edge.
Definition TOPPASEdge.h:42
@ ES_MERGER_EXT_MISMATCH
Definition TOPPASEdge.h:47
@ ES_VALID
Definition TOPPASEdge.h:43
@ ES_NOT_READY_YET
Definition TOPPASEdge.h:49
@ ES_TOOL_API_CHANGED
Definition TOPPASEdge.h:50
@ ES_NO_TARGET_PARAM
Definition TOPPASEdge.h:44
@ ES_MERGER_WITHOUT_TOOL
Definition TOPPASEdge.h:48
@ ES_FILE_EXT_MISMATCH
Definition TOPPASEdge.h:46
@ ES_NO_SOURCE_PARAM
Definition TOPPASEdge.h:45
QString getTargetInParamName()
Returns the target input parameter index.
QPointF startPos() const
Returns the start position of this edge.
TOPPASEdge & operator=(const TOPPASEdge &rhs)
Assignment operator.
int getTargetInParam() const
Returns the target input parameter index.
QColor color_
The color.
Definition TOPPASEdge.h:147
TOPPASEdge(const TOPPASEdge &rhs)
Copy constructor.
TOPPASEdge(TOPPASVertex *from, const QPointF &hover_pos)
Constructor.
TOPPASVertex * to_
Pointer to the target of this edge.
Definition TOPPASEdge.h:143
TOPPASVertex * getSourceVertex()
Returns the source vertex.
TOPPASVertex * from_
Pointer to the source of this edge.
Definition TOPPASEdge.h:141
int source_out_param_
The source output parameter index.
Definition TOPPASEdge.h:149
void setColor(const QColor &color)
Sets the color.
QPointF endPos() const
Returns the end position of this edge.
TOPPASEdge()
Standard constructor.
void setSourceVertex(TOPPASVertex *tv)
Sets the source vertex of this edge.
void setTargetVertex(TOPPASVertex *tv)
Sets the target vertex of this edge.
TOPPASVertex * getTargetVertex()
Returns the target vertex.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e) override
void setHoverPos(const QPointF &pos)
Sets the position of the hovering end while edge is being created.
std::string toString()
for debug output
void setTargetInParam(int in)
Sets the target input parameter index.
QRectF boundingRect() const override
Returns the bounding rectangle of this item.
void somethingHasChanged()
Emitted when something has changed.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Paints the item.
void setSourceOutParam(int out)
Sets the source output parameter index.
void emitChanged()
Emits the somethingHasChanged() signal.
A vertex representing an input file list.
Definition TOPPASInputFileListVertex.h:24
A vertex representing a TOPP tool.
Definition TOPPASToolVertex.h:36
The base class of the different vertex classes.
Definition TOPPASVertex.h:78
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19