comparison framework/SVFileReader.cpp @ 233:8aace2d9f1c2

Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author Chris Cannam
date Tue, 14 Jun 2011 15:27:12 +0100
parents 8c13e8219903
children ecbf3b75c562
comparison
equal deleted inserted replaced
232:025065fd5b49 233:8aace2d9f1c2
440 return false; 440 return false;
441 } 441 }
442 442
443 QString name = attributes.value("name"); 443 QString name = attributes.value("name");
444 444
445 DEBUG << "SVFileReader::readModel: model name \"" << name << "\"" << endl; 445 SVDEBUG << "SVFileReader::readModel: model name \"" << name << "\"" << endl;
446 446
447 READ_MANDATORY(int, sampleRate, toInt); 447 READ_MANDATORY(int, sampleRate, toInt);
448 448
449 QString type = attributes.value("type").trimmed(); 449 QString type = attributes.value("type").trimmed();
450 bool mainModel = (attributes.value("mainModel").trimmed() == "true"); 450 bool mainModel = (attributes.value("mainModel").trimmed() == "true");
952 { 952 {
953 bool ok = false; 953 bool ok = false;
954 954
955 READ_MANDATORY(int, frame, toInt); 955 READ_MANDATORY(int, frame, toInt);
956 956
957 // DEBUG << "SVFileReader::addPointToDataset: frame = " << frame << endl; 957 // SVDEBUG << "SVFileReader::addPointToDataset: frame = " << frame << endl;
958 958
959 SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *> 959 SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *>
960 (m_currentDataset); 960 (m_currentDataset);
961 961
962 if (sodm) { 962 if (sodm) {
1014 if (tm) { 1014 if (tm) {
1015 // std::cerr << "Current dataset is a text model" << std::endl; 1015 // std::cerr << "Current dataset is a text model" << std::endl;
1016 float height = 0.0; 1016 float height = 0.0;
1017 height = attributes.value("height").trimmed().toFloat(&ok); 1017 height = attributes.value("height").trimmed().toFloat(&ok);
1018 QString label = attributes.value("label"); 1018 QString label = attributes.value("label");
1019 // DEBUG << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label << ", ok = " << ok << endl; 1019 // SVDEBUG << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label << ", ok = " << ok << endl;
1020 tm->addPoint(TextModel::Point(frame, height, label)); 1020 tm->addPoint(TextModel::Point(frame, height, label));
1021 return ok; 1021 return ok;
1022 } 1022 }
1023 1023
1024 PathModel *pm = dynamic_cast<PathModel *>(m_currentDataset); 1024 PathModel *pm = dynamic_cast<PathModel *>(m_currentDataset);
1025 1025
1026 if (pm) { 1026 if (pm) {
1027 // std::cerr << "Current dataset is a path model" << std::endl; 1027 // std::cerr << "Current dataset is a path model" << std::endl;
1028 int mapframe = attributes.value("mapframe").trimmed().toInt(&ok); 1028 int mapframe = attributes.value("mapframe").trimmed().toInt(&ok);
1029 // DEBUG << "SVFileReader::addPointToDataset: PathModel: frame = " << frame << ", mapframe = " << mapframe << ", ok = " << ok << endl; 1029 // SVDEBUG << "SVFileReader::addPointToDataset: PathModel: frame = " << frame << ", mapframe = " << mapframe << ", ok = " << ok << endl;
1030 pm->addPoint(PathModel::Point(frame, mapframe)); 1030 pm->addPoint(PathModel::Point(frame, mapframe));
1031 return ok; 1031 return ok;
1032 } 1032 }
1033 1033
1034 ImageModel *im = dynamic_cast<ImageModel *>(m_currentDataset); 1034 ImageModel *im = dynamic_cast<ImageModel *>(m_currentDataset);
1035 1035
1036 if (im) { 1036 if (im) {
1037 // std::cerr << "Current dataset is an image model" << std::endl; 1037 // std::cerr << "Current dataset is an image model" << std::endl;
1038 QString image = attributes.value("image"); 1038 QString image = attributes.value("image");
1039 QString label = attributes.value("label"); 1039 QString label = attributes.value("label");
1040 // DEBUG << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image << ", label = " << label << ", ok = " << ok << endl; 1040 // SVDEBUG << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image << ", label = " << label << ", ok = " << ok << endl;
1041 im->addPoint(ImageModel::Point(frame, image, label)); 1041 im->addPoint(ImageModel::Point(frame, image, label));
1042 return ok; 1042 return ok;
1043 } 1043 }
1044 1044
1045 std::cerr << "WARNING: SV-XML: Point element found in non-point dataset" << std::endl; 1045 std::cerr << "WARNING: SV-XML: Point element found in non-point dataset" << std::endl;
1183 if (type == "transform") { 1183 if (type == "transform") {
1184 m_currentTransformIsNewStyle = true; 1184 m_currentTransformIsNewStyle = true;
1185 return true; 1185 return true;
1186 } else { 1186 } else {
1187 m_currentTransformIsNewStyle = false; 1187 m_currentTransformIsNewStyle = false;
1188 DEBUG << "NOTE: SV-XML: Reading old-style derivation element" 1188 SVDEBUG << "NOTE: SV-XML: Reading old-style derivation element"
1189 << endl; 1189 << endl;
1190 } 1190 }
1191 1191
1192 QString transformId = attributes.value("transform"); 1192 QString transformId = attributes.value("transform");
1193 1193
1366 } 1366 }
1367 1367
1368 bool 1368 bool
1369 SVFileReader::readMeasurement(const QXmlAttributes &attributes) 1369 SVFileReader::readMeasurement(const QXmlAttributes &attributes)
1370 { 1370 {
1371 DEBUG << "SVFileReader::readMeasurement: inLayer " 1371 SVDEBUG << "SVFileReader::readMeasurement: inLayer "
1372 << m_inLayer << ", layer " << m_currentLayer << endl; 1372 << m_inLayer << ", layer " << m_currentLayer << endl;
1373 1373
1374 if (!m_inLayer) { 1374 if (!m_inLayer) {
1375 std::cerr << "WARNING: SV-XML: Measurement found outside layer" << std::endl; 1375 std::cerr << "WARNING: SV-XML: Measurement found outside layer" << std::endl;
1376 return false; 1376 return false;