OpenMS  2.7.0
Public Types | Public Slots | Signals | Public Member Functions | List of all members
TOPPASEdge Class Reference

An edge representing a data flow in TOPPAS. More...

#include <OpenMS/VISUAL/TOPPASEdge.h>

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

Public Types

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 , ES_TOOL_API_CHANGED ,
  ES_UNKNOWN
}
 The status of this edge. More...
 

Public Slots

void sourceHasChanged ()
 Called by the source vertex when it has changed. More...
 

Signals

void somethingHasChanged ()
 Emitted when something has changed. More...
 

Public Member Functions

 TOPPASEdge ()
 Standard constructor. More...
 
 TOPPASEdge (TOPPASVertex *from, const QPointF &hover_pos)
 Constructor. More...
 
 TOPPASEdge (const TOPPASEdge &rhs)
 Copy constructor. More...
 
 ~TOPPASEdge () override
 Destructor. More...
 
TOPPASEdgeoperator= (const TOPPASEdge &rhs)
 Assignment operator. More...
 
String toString ()
 for debug output More...
 
QRectF boundingRect () const override
 Returns the bounding rectangle of this item. More...
 
QPainterPath shape () const override
 Returns a more precise shape. More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 Paints the item. More...
 
QPointF startPos () const
 Returns the start position of this edge. More...
 
QPointF endPos () const
 Returns the end position of this edge. More...
 
void setHoverPos (const QPointF &pos)
 Sets the position of the hovering end while edge is being created. More...
 
void setSourceVertex (TOPPASVertex *tv)
 Sets the source vertex of this edge. More...
 
void setTargetVertex (TOPPASVertex *tv)
 Sets the target vertex of this edge. More...
 
TOPPASVertexgetSourceVertex ()
 Returns the source vertex. More...
 
TOPPASVertexgetTargetVertex ()
 Returns the target vertex. More...
 
void prepareResize ()
 Call this before changing the item geometry. More...
 
void setColor (const QColor &color)
 Sets the color. More...
 
EdgeStatus getEdgeStatus ()
 Returns the status of this edge. More...
 
void setSourceOutParam (int out)
 Sets the source output parameter index. More...
 
int getSourceOutParam ()
 Returns the source output parameter index. More...
 
QString getSourceOutParamName ()
 Returns the source output parameter name. More...
 
void setTargetInParam (int in)
 Sets the target input parameter index. More...
 
int getTargetInParam ()
 Returns the target input parameter index. More...
 
QString getTargetInParamName ()
 Returns the target input parameter index. More...
 
void updateColor ()
 Updates the edge color. More...
 
void emitChanged ()
 Emits the somethingHasChanged() signal. More...
 
void showIOMappingDialog ()
 Shows the I/O mapping dialog. More...
 

Protected Member Functions

reimplemented Qt events
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *e) override
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override
 

helper methods of getEdgeStatus()

TOPPASVertexfrom_
 Pointer to the source of this edge. More...
 
TOPPASVertexto_
 Pointer to the target of this edge. More...
 
QPointF hover_pos_
 Position of hovering end while edge is being created. More...
 
QColor color_
 The color. More...
 
int source_out_param_
 The source output parameter index. More...
 
int target_in_param_
 The target input parameter index. More...
 
EdgeStatus getToolToolStatus_ (TOPPASToolVertex *source, int source_param_index, TOPPASToolVertex *target, int target_param_index)
 
EdgeStatus getListToolStatus_ (TOPPASInputFileListVertex *source, TOPPASToolVertex *target, int target_param_index)
 
QPointF borderPoint_ (bool atTargetVertex=true) const
 point where the current edge touches the source or target (default) vertex More...
 
QPointF nearestPoint_ (const QPointF &origin, const QList< QPointF > &list) const
 Returns the point in the list that is nearest to origin. More...
 

Detailed Description

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.

Member Enumeration Documentation

◆ EdgeStatus

enum EdgeStatus

The status of this edge.

Enumerator
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 
ES_TOOL_API_CHANGED 
ES_UNKNOWN 

Constructor & Destructor Documentation

◆ TOPPASEdge() [1/3]

Standard constructor.

◆ TOPPASEdge() [2/3]

TOPPASEdge ( TOPPASVertex from,
const QPointF &  hover_pos 
)

Constructor.

◆ TOPPASEdge() [3/3]

TOPPASEdge ( const TOPPASEdge rhs)

Copy constructor.

◆ ~TOPPASEdge()

~TOPPASEdge ( )
override

Destructor.

Member Function Documentation

◆ borderPoint_()

QPointF borderPoint_ ( bool  atTargetVertex = true) const
protected

point where the current edge touches the source or target (default) vertex

◆ boundingRect()

QRectF boundingRect ( ) const
override

Returns the bounding rectangle of this item.

◆ contextMenuEvent()

void contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
overrideprotected

◆ emitChanged()

void emitChanged ( )

Emits the somethingHasChanged() signal.

◆ endPos()

QPointF endPos ( ) const

Returns the end position of this edge.

◆ getEdgeStatus()

EdgeStatus getEdgeStatus ( )

Returns the status of this edge.

◆ getListToolStatus_()

EdgeStatus getListToolStatus_ ( TOPPASInputFileListVertex source,
TOPPASToolVertex target,
int  target_param_index 
)
protected

◆ getSourceOutParam()

int getSourceOutParam ( )

Returns the source output parameter index.

◆ getSourceOutParamName()

QString getSourceOutParamName ( )

Returns the source output parameter name.

◆ getSourceVertex()

TOPPASVertex* getSourceVertex ( )

Returns the source vertex.

◆ getTargetInParam()

int getTargetInParam ( )

Returns the target input parameter index.

◆ getTargetInParamName()

QString getTargetInParamName ( )

Returns the target input parameter index.

◆ getTargetVertex()

TOPPASVertex* getTargetVertex ( )

Returns the target vertex.

◆ getToolToolStatus_()

EdgeStatus getToolToolStatus_ ( TOPPASToolVertex source,
int  source_param_index,
TOPPASToolVertex target,
int  target_param_index 
)
protected

◆ mouseDoubleClickEvent()

void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  e)
overrideprotected

◆ nearestPoint_()

QPointF nearestPoint_ ( const QPointF &  origin,
const QList< QPointF > &  list 
) const
protected

Returns the point in the list that is nearest to origin.

◆ operator=()

TOPPASEdge& operator= ( const TOPPASEdge rhs)

Assignment operator.

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget widget 
)
override

Paints the item.

◆ prepareResize()

void prepareResize ( )

Call this before changing the item geometry.

◆ setColor()

void setColor ( const QColor &  color)

Sets the color.

◆ setHoverPos()

void setHoverPos ( const QPointF &  pos)

Sets the position of the hovering end while edge is being created.

◆ setSourceOutParam()

void setSourceOutParam ( int  out)

Sets the source output parameter index.

◆ setSourceVertex()

void setSourceVertex ( TOPPASVertex tv)

Sets the source vertex of this edge.

◆ setTargetInParam()

void setTargetInParam ( int  in)

Sets the target input parameter index.

◆ setTargetVertex()

void setTargetVertex ( TOPPASVertex tv)

Sets the target vertex of this edge.

◆ shape()

QPainterPath shape ( ) const
override

Returns a more precise shape.

◆ showIOMappingDialog()

void showIOMappingDialog ( )

Shows the I/O mapping dialog.

◆ somethingHasChanged

void somethingHasChanged ( )
signal

Emitted when something has changed.

◆ sourceHasChanged

void sourceHasChanged ( )
slot

Called by the source vertex when it has changed.

◆ startPos()

QPointF startPos ( ) const

Returns the start position of this edge.

◆ toString()

String toString ( )

for debug output

◆ updateColor()

void updateColor ( )

Updates the edge color.

Member Data Documentation

◆ color_

QColor color_
protected

The color.

◆ from_

TOPPASVertex* from_
protected

Pointer to the source of this edge.

◆ hover_pos_

QPointF hover_pos_
protected

Position of hovering end while edge is being created.

◆ source_out_param_

int source_out_param_
protected

The source output parameter index.

◆ target_in_param_

int target_in_param_
protected

The target input parameter index.

◆ to_

TOPPASVertex* to_
protected

Pointer to the target of this edge.