MCPcopy Create free account
hub / github.com/KDE/labplot / setRange

Method setRange

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:1421–1438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419};
1420
1421void CartesianPlot::setRange(const Dimension dim, const int index, const Range<double>& range) {
1422 Q_D(CartesianPlot);
1423 DEBUG(Q_FUNC_INFO << ", range = " << range.toStdString() << ", auto scale = " << range.autoScale())
1424
1425 if (range.start() == range.end()) {
1426 // User entered invalid range
1427 Q_EMIT rangeChanged(dim, index, this->range(dim, index)); // Feedback
1428 return;
1429 }
1430
1431 auto r = d->checkRange(range);
1432 if (index >= 0 && index < rangeCount(dim) && r.finite() && r != d->rangeConst(dim, index)) {
1433 exec(new CartesianPlotSetRangeIndexCmd(d, dim, r, index));
1434 } else if (index < 0 || index >= rangeCount(dim))
1435 DEBUG(Q_FUNC_INFO << QStringLiteral("Warning: wrong index: %1").arg(index).toStdString());
1436
1437 DEBUG(Q_FUNC_INFO << ", DONE. range = " << range.toStdString() << ", auto scale = " << range.autoScale())
1438}
1439
1440const Range<double>& CartesianPlot::dataRange(const Dimension dim, int index) {
1441 if (index == -1)

Callers 10

setTypeMethod · 0.45
redoMethod · 0.45
addHorizontalAxisMethod · 0.45
addVerticalAxisMethod · 0.45
scaleAutoMethod · 0.45
calculateDataRangeMethod · 0.45
zoomMethod · 0.45
shiftMethod · 0.45
retransformScaleMethod · 0.45

Calls 8

toStdStringMethod · 0.80
rangeMethod · 0.80
checkRangeMethod · 0.80
finiteMethod · 0.80
argMethod · 0.80
autoScaleMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected