Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
TOPPASEdge.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Johannes Veit $
32 // $Authors: Johannes Junker, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_VISUAL_TOPPASEDGE_H
36 #define OPENMS_VISUAL_TOPPASEDGE_H
37 
38 // OpenMS_GUI config
39 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
40 
41 #include <QtGui/QGraphicsItem>
42 
43 namespace OpenMS
44 {
45  class TOPPASVertex;
46  class TOPPASToolVertex;
47  class TOPPASInputFileListVertex;
48 
49  class String;
50 
60  class OPENMS_GUI_DLLAPI TOPPASEdge :
61  public QObject,
62  public QGraphicsItem
63  {
64  Q_OBJECT
65  Q_INTERFACES(QGraphicsItem)
66 public:
67 
70  {
77  ES_NOT_READY_YET, // no input files given. We cannot know if the types will match.
79  ES_UNKNOWN
80  };
81 
83  TOPPASEdge();
85  TOPPASEdge(TOPPASVertex * from, const QPointF & hover_pos);
87  TOPPASEdge(const TOPPASEdge & rhs);
89  virtual ~TOPPASEdge();
91  TOPPASEdge & operator=(const TOPPASEdge & rhs);
92 
94  String toString();
95 
97  QRectF boundingRect() const;
99  QPainterPath shape() const;
101  void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);
103  QPointF startPos() const;
105  QPointF endPos() const;
107  void setHoverPos(const QPointF & pos);
109  void setSourceVertex(TOPPASVertex * tv);
111  void setTargetVertex(TOPPASVertex * tv);
113  TOPPASVertex * getSourceVertex();
115  TOPPASVertex * getTargetVertex();
117  void prepareResize();
119  void setColor(const QColor & color);
121  EdgeStatus getEdgeStatus();
123  void setSourceOutParam(int out);
125  int getSourceOutParam();
127  QString getSourceOutParamName();
129  void setTargetInParam(int in);
131  int getTargetInParam();
133  QString getTargetInParamName();
135  void updateColor();
137  void emitChanged();
139  void showIOMappingDialog();
140 
141 public slots:
142 
144  void sourceHasChanged();
145 
146 signals:
147 
149  void somethingHasChanged();
150 
151 protected:
152 
154 
155  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * e);
156  void contextMenuEvent(QGraphicsSceneContextMenuEvent * event);
158 
160 
161  EdgeStatus getToolToolStatus_(TOPPASToolVertex * source, int source_param_index, TOPPASToolVertex * target, int target_param_index);
162  EdgeStatus getListToolStatus_(TOPPASInputFileListVertex * source, TOPPASToolVertex * target, int target_param_index);
164 
166  QPointF borderPoint_(bool atTargetVertex = true) const;
167 
169  QPointF nearestPoint_(const QPointF & origin, const QList<QPointF> & list) const;
175  QPointF hover_pos_;
177  QColor color_;
182  };
183 }
184 
185 #endif
Definition: TOPPASEdge.h:78
QPointF hover_pos_
Position of hovering end while edge is being created.
Definition: TOPPASEdge.h:175
A more convenient string class.
Definition: String.h:57
A vertex representing a TOPP tool.
Definition: TOPPASToolVertex.h:60
The base class of the different vertex classes.
Definition: TOPPASVertex.h:101
TOPPASVertex * from_
Pointer to the source of this edge.
Definition: TOPPASEdge.h:171
Definition: TOPPASEdge.h:74
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
An edge representing a data flow in TOPPAS.
Definition: TOPPASEdge.h:60
Definition: TOPPASEdge.h:71
A vertex representing an input file list.
Definition: TOPPASInputFileListVertex.h:50
int source_out_param_
The source output parameter index.
Definition: TOPPASEdge.h:179
QColor color_
The color.
Definition: TOPPASEdge.h:177
EdgeStatus
The status of this edge.
Definition: TOPPASEdge.h:69
Definition: TOPPASEdge.h:73
TOPPASVertex * to_
Pointer to the target of this edge.
Definition: TOPPASEdge.h:173
Definition: TOPPASEdge.h:72
int target_in_param_
The target input parameter index.
Definition: TOPPASEdge.h:181
Definition: TOPPASEdge.h:77
String toString(T i)
toString functions (single argument)
Definition: StringUtils.h:69

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:04 using doxygen 1.8.13