OpenMS
2.4.0
|
The base class of the different vertex classes. More...
#include <OpenMS/VISUAL/TOPPASVertex.h>
Classes | |
class | TOPPASFilenames |
struct | VertexRoundPackage |
Info for one edge and round, to be passed to next node. More... | |
Public Types | |
enum | DFS_COLOR { DFS_WHITE, DFS_GRAY, DFS_BLACK } |
The color of a vertex during depth-first search. More... | |
enum | SUBSTREESTATUS { TV_ALLFINISHED, TV_UNFINISHED, TV_UNFINISHED_INBRANCH } |
The color of a vertex during depth-first search. More... | |
typedef QList< TOPPASEdge * > | EdgeContainer |
The container for in/out edges. More... | |
typedef EdgeContainer::iterator | EdgeIterator |
A mutable iterator for in/out edges. More... | |
typedef EdgeContainer::const_iterator | ConstEdgeIterator |
A const iterator for in/out edges. More... | |
typedef std::map< Int, VertexRoundPackage > | RoundPackage |
typedef RoundPackage::const_iterator | RoundPackageConstIt |
typedef RoundPackage::iterator | RoundPackageIt |
typedef std::vector< RoundPackage > | RoundPackages |
all information a node needs to process all rounds More... | |
Public Slots | |
virtual void | inEdgeHasChanged () |
Called by an incoming edge when it has changed. More... | |
virtual void | outEdgeHasChanged () |
Called by an outgoing edge when it has changed. More... | |
Signals | |
void | clicked () |
Emitted when this item is clicked. More... | |
void | released () |
Emitted when this item is released. More... | |
void | hoveringEdgePosChanged (const QPointF &new_pos) |
Emitted when the position of the hovering edge changes. More... | |
void | newHoveringEdge (const QPointF &pos) |
Emitted when a new out edge is supposed to be created. More... | |
void | finishHoveringEdge () |
Emitted when the mouse is released after having dragged a new edge somewhere. More... | |
void | somethingHasChanged () |
Emitted when something has changed. More... | |
void | itemDragged (qreal dx, qreal dy) |
Emitted when the item is dragged. More... | |
void | parameterChanged (const bool invalidates_running_pipeline) |
Public Member Functions | |
TOPPASVertex () | |
Default Constructor. More... | |
TOPPASVertex (const TOPPASVertex &rhs) | |
Copy constructor. More... | |
~TOPPASVertex () override | |
Destructor. More... | |
TOPPASVertex & | operator= (const TOPPASVertex &rhs) |
Assignment operator. More... | |
bool | buildRoundPackages (RoundPackages &pkg, String &error_msg) |
bool | isUpstreamFinished () const |
check if all upstream nodes are ready to go ( 'finished_' is true) More... | |
QRectF | boundingRect () const override=0 |
Returns the bounding rectangle of this item. More... | |
QPainterPath | shape () const override=0 |
Returns a more precise shape. More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override=0 |
Paints the item. More... | |
ConstEdgeIterator | outEdgesBegin () const |
Returns begin() iterator of outgoing edges. More... | |
ConstEdgeIterator | outEdgesEnd () const |
Returns end() iterator of outgoing edges. More... | |
ConstEdgeIterator | inEdgesBegin () const |
Returns begin() iterator of incoming edges. More... | |
ConstEdgeIterator | inEdgesEnd () const |
Returns end() iterator of incoming edges. More... | |
Size | incomingEdgesCount () |
Returns the number of incoming edges. More... | |
Size | outgoingEdgesCount () |
Returns the number of outgoing edges. More... | |
void | addInEdge (TOPPASEdge *edge) |
Adds an incoming edge. More... | |
void | addOutEdge (TOPPASEdge *edge) |
Adds an outgoing edge. More... | |
void | removeInEdge (TOPPASEdge *edge) |
Removes an incoming edge. More... | |
void | removeOutEdge (TOPPASEdge *edge) |
Removes an outgoing edge. More... | |
DFS_COLOR | getDFSColor () |
Returns the DFS color of this node. More... | |
void | setDFSColor (DFS_COLOR color) |
Sets the DFS color of this node. More... | |
TOPPASVertex * | getDFSParent () |
Returns the DFS parent of this node. More... | |
void | setDFSParent (TOPPASVertex *parent) |
Sets the DFS parent of this node. More... | |
TOPPASVertex::SUBSTREESTATUS | getSubtreeStatus () const |
Checks if all tools in the subtree below this node are finished. More... | |
bool | isTopoSortMarked () |
Returns whether the vertex has been marked already (during topological sort) More... | |
void | setTopoSortMarked (bool b) |
(Un)marks the vertex (during topological sort) More... | |
UInt | getTopoNr () |
Returns the topological sort number. More... | |
virtual void | setTopoNr (UInt nr) |
Sets the topological sort number (overridden in tool and output vertices) More... | |
virtual void | reset (bool reset_all_files=false) |
virtual void | markUnreachable () |
Marks this node (and everything further downstream) as unreachable. Overridden behavior in mergers. More... | |
bool | isReachable () |
Returns whether this node is reachable. More... | |
bool | isFinished () const |
Returns whether this node has already been processed during the current pipeline execution. More... | |
virtual void | run () |
virtual bool | invertRecylingMode () |
invert status of recycling More... | |
bool | isRecyclingEnabled () const |
get status of recycling More... | |
void | setRecycling (const bool is_enabled) |
set status of recycling More... | |
virtual String | getName () const =0 |
QStringList | getFileNames (int param_index, int round) const |
gets filenames for a certain output parameter (from this vertex), for a certain TOPPAS round More... | |
QStringList | getFileNames () const |
get all output files for all parameters for all rounds More... | |
const RoundPackages & | getOutputFiles () const |
bool | allInputsReady () |
check if all upstream nodes are finished More... | |
Protected Member Functions | |
virtual void | moveNewEdgeTo_ (const QPointF &pos) |
Moves the target pos of the edge which is just being created to pos . More... | |
String | get3CharsNumber_ (UInt number) const |
Returns a three character string (i.e. 001 instead of 1) for the given number . More... | |
void | debugOut_ (const String &) const |
Displays the debug output message , if TOPPAS_DEBUG is defined. More... | |
reimplemented Qt events | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *e) override |
void | mousePressEvent (QGraphicsSceneMouseEvent *e) override |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *e) override |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *e) override |
void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override |
Protected Attributes | |
EdgeContainer | in_edges_ |
The list of incoming edges. More... | |
EdgeContainer | out_edges_ |
The list of outgoing edges. More... | |
bool | edge_being_created_ |
Indicates whether a new out edge is currently being created. More... | |
QColor | pen_color_ |
The color of the pen. More... | |
QColor | brush_color_ |
The color of the brush. More... | |
DFS_COLOR | dfs_color_ |
The DFS color of this node. More... | |
TOPPASVertex * | dfs_parent_ |
The DFS parent of this node. More... | |
bool | topo_sort_marked_ |
"marked" flag for topological sort More... | |
UInt | topo_nr_ |
The number in a topological sort of the entire graph. More... | |
RoundPackages | output_files_ |
Stores the current output file names for each output parameter. More... | |
int | round_total_ |
number of rounds this node will do ('Merge All' nodes will pass everything, thus do only one round) More... | |
int | round_counter_ |
currently finished number of rounds (TODO: do we need that?) More... | |
bool | finished_ |
Stores whether this node has already been processed during the current pipeline execution. More... | |
bool | reachable_ |
Indicates whether this node is reachable (i.e. there is an input node somewhere further upstream) More... | |
bool | allow_output_recycling_ |
shall subsequent tools be allowed to recycle the output of this node to match the number of rounds imposed by other parent nodes? More... | |
The base class of the different vertex classes.
This class contains the common functionality (such as event handling for mouse clicks and drags) and holds the common members of all different kinds of vertices (e.g., containers for all in and out edges, the vertex ID, the number of a topological sort of the whole graph, etc.)
typedef EdgeContainer::const_iterator ConstEdgeIterator |
A const iterator for in/out edges.
typedef QList<TOPPASEdge *> EdgeContainer |
The container for in/out edges.
typedef EdgeContainer::iterator EdgeIterator |
A mutable iterator for in/out edges.
typedef std::map<Int, VertexRoundPackage> RoundPackage |
all infos to process one round for a vertex (from all incoming vertices) indexing via "parameter_index" of adjacent edge (could later be param_name) -> filenames Index for input and output edges is (-1) implicitly, thus we need signed type warning: the index refers to either input OR output (depending on if this structure is used for input files storage or output files storage)
typedef RoundPackage::const_iterator RoundPackageConstIt |
typedef RoundPackage::iterator RoundPackageIt |
typedef std::vector<RoundPackage> RoundPackages |
all information a node needs to process all rounds
enum DFS_COLOR |
enum SUBSTREESTATUS |
TOPPASVertex | ( | ) |
Default Constructor.
TOPPASVertex | ( | const TOPPASVertex & | rhs | ) |
Copy constructor.
|
override |
Destructor.
void addInEdge | ( | TOPPASEdge * | edge | ) |
Adds an incoming edge.
void addOutEdge | ( | TOPPASEdge * | edge | ) |
Adds an outgoing edge.
bool allInputsReady | ( | ) |
check if all upstream nodes are finished
|
overridepure virtual |
Returns the bounding rectangle of this item.
Implemented in TOPPASToolVertex, TOPPASMergerVertex, TOPPASInputFileListVertex, TOPPASSplitterVertex, and TOPPASOutputFileListVertex.
bool buildRoundPackages | ( | RoundPackages & | pkg, |
String & | error_msg | ||
) |
get the round package for this node from upstream – indices in 'RoundPackage' mapping are thus referring to incoming edges of this node returns false on failure
|
signal |
Emitted when this item is clicked.
|
overrideprotected |
|
inlineprotected |
Displays the debug output message
, if TOPPAS_DEBUG is defined.
|
signal |
Emitted when the mouse is released after having dragged a new edge somewhere.
Returns a three character string (i.e. 001 instead of 1) for the given number
.
DFS_COLOR getDFSColor | ( | ) |
Returns the DFS color of this node.
TOPPASVertex* getDFSParent | ( | ) |
Returns the DFS parent of this node.
QStringList getFileNames | ( | int | param_index, |
int | round | ||
) | const |
gets filenames for a certain output parameter (from this vertex), for a certain TOPPAS round
QStringList getFileNames | ( | ) | const |
get all output files for all parameters for all rounds
|
pure virtual |
Implemented in TOPPASToolVertex, TOPPASMergerVertex, TOPPASSplitterVertex, TOPPASInputFileListVertex, and TOPPASOutputFileListVertex.
const RoundPackages& getOutputFiles | ( | ) | const |
TOPPASVertex::SUBSTREESTATUS getSubtreeStatus | ( | ) | const |
Checks if all tools in the subtree below this node are finished.
UInt getTopoNr | ( | ) |
Returns the topological sort number.
Referenced by TOPPASBase::toolStarted().
|
signal |
Emitted when the position of the hovering edge changes.
Size incomingEdgesCount | ( | ) |
Returns the number of incoming edges.
|
virtualslot |
Called by an incoming edge when it has changed.
ConstEdgeIterator inEdgesBegin | ( | ) | const |
Returns begin() iterator of incoming edges.
ConstEdgeIterator inEdgesEnd | ( | ) | const |
Returns end() iterator of incoming edges.
|
virtual |
invert status of recycling
Reimplemented in TOPPASToolVertex.
bool isFinished | ( | ) | const |
Returns whether this node has already been processed during the current pipeline execution.
bool isReachable | ( | ) |
Returns whether this node is reachable.
bool isRecyclingEnabled | ( | ) | const |
get status of recycling
bool isTopoSortMarked | ( | ) |
Returns whether the vertex has been marked already (during topological sort)
bool isUpstreamFinished | ( | ) | const |
check if all upstream nodes are ready to go ( 'finished_' is true)
|
signal |
Emitted when the item is dragged.
|
virtual |
Marks this node (and everything further downstream) as unreachable. Overridden behavior in mergers.
Reimplemented in TOPPASMergerVertex, and TOPPASSplitterVertex.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
protectedvirtual |
Moves the target pos of the edge which is just being created to pos
.
|
signal |
Emitted when a new out edge is supposed to be created.
TOPPASVertex& operator= | ( | const TOPPASVertex & | rhs | ) |
Assignment operator.
|
virtualslot |
Called by an outgoing edge when it has changed.
ConstEdgeIterator outEdgesBegin | ( | ) | const |
Returns begin() iterator of outgoing edges.
ConstEdgeIterator outEdgesEnd | ( | ) | const |
Returns end() iterator of outgoing edges.
Size outgoingEdgesCount | ( | ) |
Returns the number of outgoing edges.
|
overridepure virtual |
Paints the item.
Implemented in TOPPASToolVertex, TOPPASMergerVertex, TOPPASInputFileListVertex, TOPPASSplitterVertex, and TOPPASOutputFileListVertex.
|
signal |
Emitted if an INI parameter or recycling mode or whatever was edited by the user - depending on the current state of the tool an action is taken each node type decides itself if this will invalidate the pipeline, depending on its internal status
|
signal |
Emitted when this item is released.
void removeInEdge | ( | TOPPASEdge * | edge | ) |
Removes an incoming edge.
void removeOutEdge | ( | TOPPASEdge * | edge | ) |
Removes an outgoing edge.
|
virtual |
Resets the status
reset_all_files | Not used in this implementation, but in derived classes |
Reimplemented in TOPPASToolVertex, and TOPPASOutputFileListVertex.
|
virtual |
run the tool (either ToolVertex, Merger, or OutputNode)
NotImplemented |
Reimplemented in TOPPASToolVertex, TOPPASMergerVertex, TOPPASOutputFileListVertex, TOPPASInputFileListVertex, and TOPPASSplitterVertex.
void setDFSColor | ( | DFS_COLOR | color | ) |
Sets the DFS color of this node.
void setDFSParent | ( | TOPPASVertex * | parent | ) |
Sets the DFS parent of this node.
void setRecycling | ( | const bool | is_enabled | ) |
set status of recycling
|
virtual |
Sets the topological sort number (overridden in tool and output vertices)
Reimplemented in TOPPASToolVertex, and TOPPASOutputFileListVertex.
void setTopoSortMarked | ( | bool | b | ) |
(Un)marks the vertex (during topological sort)
|
overridepure virtual |
Returns a more precise shape.
Implemented in TOPPASToolVertex, TOPPASMergerVertex, TOPPASInputFileListVertex, TOPPASSplitterVertex, and TOPPASOutputFileListVertex.
|
signal |
Emitted when something has changed.
|
protected |
shall subsequent tools be allowed to recycle the output of this node to match the number of rounds imposed by other parent nodes?
|
protected |
The color of the brush.
|
protected |
The DFS color of this node.
|
protected |
The DFS parent of this node.
|
protected |
Indicates whether a new out edge is currently being created.
|
protected |
Stores whether this node has already been processed during the current pipeline execution.
|
protected |
The list of incoming edges.
|
protected |
The list of outgoing edges.
|
protected |
Stores the current output file names for each output parameter.
|
protected |
The color of the pen.
|
protected |
Indicates whether this node is reachable (i.e. there is an input node somewhere further upstream)
|
protected |
currently finished number of rounds (TODO: do we need that?)
|
protected |
number of rounds this node will do ('Merge All' nodes will pass everything, thus do only one round)
|
protected |
The number in a topological sort of the entire graph.
|
protected |
"marked" flag for topological sort