comparison framework/Document.cpp @ 296:19282182e60d tonioni_multi_transform

Update to the multi-transform api in svcore
author Chris Cannam
date Mon, 02 Dec 2013 12:29:54 +0000
parents 14b1768e5406
children 1e61f0c26593
comparison
equal deleted inserted replaced
295:14b1768e5406 296:19282182e60d
262 } 262 }
263 263
264 Layer * 264 Layer *
265 Document::createDerivedLayer(const Transform &transform, 265 Document::createDerivedLayer(const Transform &transform,
266 const ModelTransformer::Input &input, 266 const ModelTransformer::Input &input,
267 const LayerFactory::LayerType type, 267 const LayerFactory::LayerType type)
268 const FeatureExtractionModelTransformer::PreferredOutputModel outputmodel)
269 { 268 {
270 // !!! THIS IS TOTALLY REDUNDANT CODE, EXCEPT FOR THE type SETTING 269 // !!! THIS IS TOTALLY REDUNDANT CODE, EXCEPT FOR THE type SETTING
271 270
272 QString message; 271 QString message;
273 Model *newModel = addDerivedModel(transform, input, message, outputmodel); 272 Model *newModel = addDerivedModel(transform, input, message);
274 if (!newModel) { 273 if (!newModel) {
275 emit modelGenerationFailed(transform.getIdentifier(), message); 274 emit modelGenerationFailed(transform.getIdentifier(), message);
276 return 0; 275 return 0;
277 } else if (message != "") { 276 } else if (message != "") {
278 emit modelGenerationWarning(transform.getIdentifier(), message); 277 emit modelGenerationWarning(transform.getIdentifier(), message);
562 } 561 }
563 562
564 Model * 563 Model *
565 Document::addDerivedModel(const Transform &transform, 564 Document::addDerivedModel(const Transform &transform,
566 const ModelTransformer::Input &input, 565 const ModelTransformer::Input &input,
567 QString &message, 566 QString &message)
568 const FeatureExtractionModelTransformer::PreferredOutputModel outputmodel)
569 { 567 {
570 Model *model = 0; 568 Model *model = 0;
571 // model = (Model) new FlexiNoteModel(); 569 // model = (Model) new FlexiNoteModel();
572 // return model; 570 // return model;
573 571
578 std::cerr << "derived model taken from map " << std::endl; 576 std::cerr << "derived model taken from map " << std::endl;
579 return i->first; 577 return i->first;
580 } 578 }
581 } 579 }
582 580
583 // GF: TODO: propagate preferredOutputModelSelection (done)
584 model = ModelTransformerFactory::getInstance()->transform 581 model = ModelTransformerFactory::getInstance()->transform
585 (transform, input, message, outputmodel); //e.g. FeatureExtractionModelTransformer::FlexiNoteOutputModel 582 (transform, input, message);
586 583
587 // The transform we actually used was presumably identical to the 584 // The transform we actually used was presumably identical to the
588 // one asked for, except that the version of the plugin may 585 // one asked for, except that the version of the plugin may
589 // differ. It's possible that the returned message contains a 586 // differ. It's possible that the returned message contains a
590 // warning about this; that doesn't concern us here, but we do 587 // warning about this; that doesn't concern us here, but we do