| 1170 | } |
| 1171 | |
| 1172 | void TOPPASBase::insertNewVertex_(double x, double y, QTreeWidgetItem* item) |
| 1173 | { |
| 1174 | if (!activeSubWindow_() || !activeSubWindow_()->getScene() || !tools_tree_view_) |
| 1175 | { |
| 1176 | return; |
| 1177 | } |
| 1178 | |
| 1179 | TOPPASScene* scene = activeSubWindow_()->getScene(); |
| 1180 | QTreeWidgetItem* current_tool = item ? item : tools_tree_view_->currentItem(); |
| 1181 | String tool_name = String(current_tool->text(0)); |
| 1182 | TOPPASVertex* tv = nullptr; |
| 1183 | |
| 1184 | if (tool_name == "<Input files>") |
| 1185 | { |
| 1186 | tv = new TOPPASInputFileListVertex(); |
| 1187 | } |
| 1188 | else if (tool_name == "<Output files>") |
| 1189 | { |
| 1190 | tv = new TOPPASOutputFileListVertex(); |
| 1191 | TOPPASOutputFileListVertex* oflv = dynamic_cast<TOPPASOutputFileListVertex*>(tv); |
| 1192 | connect(oflv, SIGNAL(outputFileWritten(const String &)), this, SLOT(outputVertexFinished(const String &))); |
| 1193 | scene->connectOutputVertexSignals(oflv); |
| 1194 | } |
| 1195 | else if (tool_name == "<Merger>") |
| 1196 | { |
| 1197 | tv = new TOPPASMergerVertex(true); |
| 1198 | connect(tv, SIGNAL(mergeFailed(const QString)), this, SLOT(updateTOPPOutputLog(const QString &))); |
| 1199 | } |
| 1200 | else if (tool_name == "<Collector>") |
| 1201 | { |
| 1202 | tv = new TOPPASMergerVertex(false); |
| 1203 | connect(tv, SIGNAL(mergeFailed(const QString)), this, SLOT(updateTOPPOutputLog(const QString &))); |
| 1204 | } |
| 1205 | else if (tool_name == "<Splitter>") |
| 1206 | { |
| 1207 | tv = new TOPPASSplitterVertex(); |
| 1208 | } |
| 1209 | else // node is a TOPP tool |
| 1210 | { |
| 1211 | if (current_tool->childCount() > 0) |
| 1212 | { |
| 1213 | // category or tool name with types is selected (instead of a concrete type) |
| 1214 | return; |
| 1215 | } |
| 1216 | String tool_type; |
| 1217 | if (current_tool->parent() != nullptr && current_tool->parent()->parent() != nullptr) |
| 1218 | { |
| 1219 | // selected item is a type |
| 1220 | tool_type = String(current_tool->text(0)); |
| 1221 | tool_name = String(current_tool->parent()->text(0)); |
| 1222 | } |
| 1223 | else |
| 1224 | { |
| 1225 | // normal tool which does not have type selected |
| 1226 | tool_name = String(current_tool->text(0)); |
| 1227 | tool_type = ""; |
| 1228 | } |
| 1229 |
nothing calls this directly
no test coverage detected