Mercurial > hg > svcore
comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 318:7a4bd2c8585c
* Some export fixes, and avoid clipping on resampling on import
author | Chris Cannam |
---|---|
date | Mon, 22 Oct 2007 09:45:35 +0000 |
parents | 70a232b1f12a |
children | 1afaf98dbf11 |
comparison
equal
deleted
inserted
replaced
317:c324d410b096 | 318:7a4bd2c8585c |
---|---|
268 emit completionChanged(); | 268 emit completionChanged(); |
269 } | 269 } |
270 } | 270 } |
271 } | 271 } |
272 | 272 |
273 QString | |
274 EditableDenseThreeDimensionalModel::toDelimitedDataString(QString delimiter) const | |
275 { | |
276 QString s; | |
277 for (size_t i = 0; i < m_data.size(); ++i) { | |
278 QStringList list; | |
279 for (size_t j = 0; j < m_data[i].size(); ++j) { | |
280 list << QString("%1").arg(m_data[i][j]); | |
281 } | |
282 s += list.join(delimiter) + "\n"; | |
283 } | |
284 return s; | |
285 } | |
286 | |
273 void | 287 void |
274 EditableDenseThreeDimensionalModel::toXml(QTextStream &out, | 288 EditableDenseThreeDimensionalModel::toXml(QTextStream &out, |
275 QString indent, | 289 QString indent, |
276 QString extraAttributes) const | 290 QString extraAttributes) const |
277 { | 291 { |
278 // For historical reasons we read and write "resolution" as "windowSize" | 292 // For historical reasons we read and write "resolution" as "windowSize" |
293 | |
294 std::cerr << "EditableDenseThreeDimensionalModel::toXml" << std::endl; | |
279 | 295 |
280 Model::toXml | 296 Model::toXml |
281 (out, indent, | 297 (out, indent, |
282 QString("type=\"dense\" dimensions=\"3\" windowSize=\"%1\" yBinCount=\"%2\" minimum=\"%3\" maximum=\"%4\" dataset=\"%5\" %6") | 298 QString("type=\"dense\" dimensions=\"3\" windowSize=\"%1\" yBinCount=\"%2\" minimum=\"%3\" maximum=\"%4\" dataset=\"%5\" %6") |
283 .arg(m_resolution) | 299 .arg(m_resolution) |
305 for (size_t j = 0; j < m_data[i].size(); ++j) { | 321 for (size_t j = 0; j < m_data[i].size(); ++j) { |
306 if (j > 0) out << " "; | 322 if (j > 0) out << " "; |
307 out << m_data[i][j]; | 323 out << m_data[i][j]; |
308 } | 324 } |
309 out << QString("</row>\n"); | 325 out << QString("</row>\n"); |
326 out.flush(); | |
310 } | 327 } |
311 | 328 |
312 out << indent + "</dataset>\n"; | 329 out << indent + "</dataset>\n"; |
313 } | 330 } |
314 | 331 |