35 #ifndef OPENMS_VISUAL_TOPPASVERTEX_H
36 #define OPENMS_VISUAL_TOPPASVERTEX_H
45 #define __DEBUG_BEGIN_METHOD__ \
47 for (int dbg_indnt_cntr = 0; dbg_indnt_cntr < global_debug_indent_; ++dbg_indnt_cntr) \
51 std::cout << "BEGIN [" << topo_nr_ << "] " << __PRETTY_FUNCTION__ << std::endl; \
52 ++global_debug_indent_; \
55 #define __DEBUG_END_METHOD__ \
57 --global_debug_indent_; \
58 if (global_debug_indent_ < 0) global_debug_indent_ = 0; \
59 for (int dbg_indnt_cntr = 0; dbg_indnt_cntr < global_debug_indent_; ++dbg_indnt_cntr) \
63 std::cout << "END [" << topo_nr_ << "] " << __PRETTY_FUNCTION__ << std::endl; \
66 #define __DEBUG_BEGIN_METHOD__ {}
67 #define __DEBUG_END_METHOD__ {}
78 #include <QtGui/QPainter>
79 #include <QtGui/QPainterPath>
80 #include <QtGui/QGraphicsSceneMouseEvent>
81 #include <QtGui/QGraphicsSceneContextMenuEvent>
82 #include <QtGui/QGraphicsItem>
83 #include <QtCore/QProcess>
84 #include <QtGui/QMenu>
153 TV_UNFINISHED_INBRANCH
168 bool buildRoundPackages(RoundPackages & pkg,
String & error_msg);
171 bool isUpstreamFinished()
const;
174 virtual QRectF boundingRect()
const = 0;
176 virtual QPainterPath shape()
const = 0;
178 virtual void paint(QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget) = 0;
180 ConstEdgeIterator outEdgesBegin()
const;
182 ConstEdgeIterator outEdgesEnd()
const;
184 ConstEdgeIterator inEdgesBegin()
const;
186 ConstEdgeIterator inEdgesEnd()
const;
188 Size incomingEdgesCount();
190 Size outgoingEdgesCount();
200 DFS_COLOR getDFSColor();
202 void setDFSColor(DFS_COLOR color);
210 bool isTopoSortMarked();
212 void setTopoSortMarked(
bool b);
216 virtual void setTopoNr(
UInt nr);
218 virtual void reset(
bool reset_all_files =
false);
220 virtual void markUnreachable();
224 bool isFinished()
const;
229 virtual bool invertRecylingMode();
231 bool isRecyclingEnabled()
const;
233 void setRecycling(
const bool is_enabled);
236 virtual String getName()
const = 0;
243 QStringList getFileNames(
int param_index,
int round)
const;
246 QStringList getFileNames()
const;
249 const RoundPackages & getOutputFiles()
const;
253 bool allInputsReady();
259 virtual void inEdgeHasChanged();
261 virtual void outEdgeHasChanged();
270 void hoveringEdgePosChanged(
const QPointF & new_pos);
272 void newHoveringEdge(
const QPointF & pos);
274 void finishHoveringEdge();
276 void somethingHasChanged();
278 void itemDragged(qreal dx, qreal dy);
281 void parameterChanged(
const bool invalidates_running_pipeline);
319 static int global_debug_indent_;
324 void mouseReleaseEvent(QGraphicsSceneMouseEvent * e);
325 void mousePressEvent(QGraphicsSceneMouseEvent * e);
326 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * e);
327 void mouseMoveEvent(QGraphicsSceneMouseEvent * e);
328 void contextMenuEvent(QGraphicsSceneContextMenuEvent * event);
332 virtual void moveNewEdgeTo_(
const QPointF & pos);
344 for (
int i = 0; i < global_debug_indent_; ++i)
348 std::cout <<
"[" << topo_nr_ <<
"] " << message << std::endl;
TOPPASEdge * edge
Definition: TOPPASVertex.h:126
bool edge_being_created_
Indicates whether a new out edge is currently being created.
Definition: TOPPASVertex.h:290
QColor pen_color_
The color of the pen.
Definition: TOPPASVertex.h:292
DFS_COLOR
The color of a vertex during depth-first search.
Definition: TOPPASVertex.h:141
RoundPackage::iterator RoundPackageIt
Definition: TOPPASVertex.h:135
A more convenient string class.
Definition: String.h:57
RoundPackage::const_iterator RoundPackageConstIt
Definition: TOPPASVertex.h:134
bool finished_
Stores whether this node has already been processed during the current pipeline execution.
Definition: TOPPASVertex.h:310
Definition: TOPPASVertex.h:152
The base class of the different vertex classes.
Definition: TOPPASVertex.h:101
std::map< Int, VertexRoundPackage > RoundPackage
Definition: TOPPASVertex.h:133
Info for one edge and round, to be passed to next node.
Definition: TOPPASVertex.h:117
bool allow_output_recycling_
shall subsequent tools be allowed to recycle the output of this node to match the number of rounds im...
Definition: TOPPASVertex.h:314
TOPPASVertex * dfs_parent_
The DFS parent of this node.
Definition: TOPPASVertex.h:298
DFS_COLOR dfs_color_
The DFS color of this node.
Definition: TOPPASVertex.h:296
QStringList filenames
Definition: TOPPASVertex.h:125
An edge representing a data flow in TOPPAS.
Definition: TOPPASEdge.h:59
SUBSTREESTATUS
The color of a vertex during depth-first search.
Definition: TOPPASVertex.h:149
T round(T x)
Rounds the value.
Definition: MathFunctions.h:137
EdgeContainer::iterator EdgeIterator
A mutable iterator for in/out edges.
Definition: TOPPASVertex.h:113
EdgeContainer out_edges_
The list of outgoing edges.
Definition: TOPPASVertex.h:288
int round_total_
number of rounds this node will do ('Merge All' nodes will pass everything, thus do only one round) ...
Definition: TOPPASVertex.h:306
Definition: TOPPASVertex.h:143
void debugOut_(const String &) const
Displays the debug output message, if TOPPAS_DEBUG is defined.
Definition: TOPPASVertex.h:337
Definition: TOPPASVertex.h:151
bool reachable_
Indicates whether this node is reachable (i.e. there is an input node somewhere further upstream) ...
Definition: TOPPASVertex.h:312
std::vector< RoundPackage > RoundPackages
all information a node needs to process all rounds
Definition: TOPPASVertex.h:138
EdgeContainer in_edges_
The list of incoming edges.
Definition: TOPPASVertex.h:286
RoundPackages output_files_
Stores the current output file names for each output parameter.
Definition: TOPPASVertex.h:304
QList< TOPPASEdge * > EdgeContainer
The container for in/out edges.
Definition: TOPPASVertex.h:111
Definition: TOPPASVertex.h:144
VertexRoundPackage()
Definition: TOPPASVertex.h:119
QColor brush_color_
The color of the brush.
Definition: TOPPASVertex.h:294
EdgeContainer::const_iterator ConstEdgeIterator
A const iterator for in/out edges.
Definition: TOPPASVertex.h:115
bool topo_sort_marked_
"marked" flag for topological sort
Definition: TOPPASVertex.h:300
UInt topo_nr_
The number in a topological sort of the entire graph.
Definition: TOPPASVertex.h:302
int round_counter_
currently finished number of rounds (TODO: do we need that?)
Definition: TOPPASVertex.h:308