! * copy the non-nan and not masked values of the current column * into the vector \c data. */
| 535 | * into the vector \c data. |
| 536 | */ |
| 537 | void QQPlotPrivate::copyValidData(QVector<double>& data) const { |
| 538 | const int rowCount = dataColumn->rowCount(); |
| 539 | data.reserve(rowCount); |
| 540 | double val; |
| 541 | if (dataColumn->columnMode() == AbstractColumn::ColumnMode::Double) { |
| 542 | auto* rowValues = reinterpret_cast<QVector<double>*>(reinterpret_cast<const Column*>(dataColumn)->data()); |
| 543 | for (int row = 0; row < rowCount; ++row) { |
| 544 | val = rowValues->value(row); |
| 545 | if (std::isnan(val) || dataColumn->isMasked(row)) |
| 546 | continue; |
| 547 | |
| 548 | data.push_back(val); |
| 549 | } |
| 550 | } else if (dataColumn->columnMode() == AbstractColumn::ColumnMode::Integer) { |
| 551 | auto* rowValues = reinterpret_cast<QVector<int>*>(reinterpret_cast<const Column*>(dataColumn)->data()); |
| 552 | for (int row = 0; row < rowCount; ++row) { |
| 553 | val = rowValues->value(row); |
| 554 | if (std::isnan(val) || dataColumn->isMasked(row)) |
| 555 | continue; |
| 556 | |
| 557 | data.push_back(val); |
| 558 | } |
| 559 | } else if (dataColumn->columnMode() == AbstractColumn::ColumnMode::BigInt) { |
| 560 | auto* rowValues = reinterpret_cast<QVector<qint64>*>(reinterpret_cast<const Column*>(dataColumn)->data()); |
| 561 | for (int row = 0; row < rowCount; ++row) { |
| 562 | val = rowValues->value(row); |
| 563 | if (std::isnan(val) || dataColumn->isMasked(row)) |
| 564 | continue; |
| 565 | |
| 566 | data.push_back(val); |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | if (data.size() < rowCount) |
| 571 | data.squeeze(); |
| 572 | } |
| 573 | |
| 574 | /*! |
| 575 | recalculates the outer bounds and the shape of the curve. |