comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 838:33fca917c800

Add toDelimitedDataString alternative with frame extents
author Chris Cannam
date Wed, 09 Oct 2013 14:47:19 +0100
parents 1424aa29ae95
children e802e550a1f2
comparison
equal deleted inserted replaced
837:1de00ee53be1 838:33fca917c800
481 s += list.join(delimiter) + "\n"; 481 s += list.join(delimiter) + "\n";
482 } 482 }
483 return s; 483 return s;
484 } 484 }
485 485
486 QString
487 EditableDenseThreeDimensionalModel::toDelimitedDataString(QString delimiter, size_t f0, size_t f1) const
488 {
489 QReadLocker locker(&m_lock);
490 QString s;
491 for (size_t i = 0; i < m_data.size(); ++i) {
492 size_t fr = m_startFrame + i * m_resolution;
493 if (fr >= f0 && fr < f1) {
494 QStringList list;
495 for (size_t j = 0; j < m_data.at(i).size(); ++j) {
496 list << QString("%1").arg(m_data.at(i).at(j));
497 }
498 s += list.join(delimiter) + "\n";
499 }
500 }
501 return s;
502 }
503
486 void 504 void
487 EditableDenseThreeDimensionalModel::toXml(QTextStream &out, 505 EditableDenseThreeDimensionalModel::toXml(QTextStream &out,
488 QString indent, 506 QString indent,
489 QString extraAttributes) const 507 QString extraAttributes) const
490 { 508 {