MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / takeForArea

Method takeForArea

pj_plotting/widget/src/PlotDocker.cpp:234–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232 }
233
234 PlotWidget* takeForArea(const LayoutNode& node) {
235 const QDomElement plot_element = node.plots.isEmpty() ? QDomElement{} : node.plots.front();
236 const QString plot_id = plot_element.attribute(QStringLiteral("id"));
237 if (!plot_id.isEmpty()) {
238 auto it = plots_by_id_.find(plot_id);
239 if (it != plots_by_id_.end() && !used_.contains(it.value())) {
240 PlotWidget* plot = it.value();
241 used_.insert(plot);
242 return plot;
243 }
244 }
245
246 while (next_position_ < plots_by_position_.size()) {
247 PlotWidget* plot = plots_by_position_.at(next_position_++);
248 if (plot != nullptr && !used_.contains(plot)) {
249 used_.insert(plot);
250 return plot;
251 }
252 }
253
254 return createPlot(plot_id);
255 }
256
257 void deleteUnused() {
258 for (PlotWidget* plot : plots_by_position_) {

Callers 1

restoreNodeFunction · 0.80

Calls 8

atMethod · 0.80
isEmptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
containsMethod · 0.45
valueMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected