Mercurial > hg > svapp
diff framework/Document.cpp @ 295:14b1768e5406 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 14:39:57 +0000 |
parents | 94bf7d7f2d6f 933b5aed341a |
children | 19282182e60d |
line wrap: on
line diff
--- a/framework/Document.cpp Fri Nov 22 10:41:36 2013 +0000 +++ b/framework/Document.cpp Tue Nov 26 14:39:57 2013 +0000 @@ -61,7 +61,7 @@ //the document, be nice to fix that #ifdef DEBUG_DOCUMENT - std::cerr << "\n\nDocument::~Document: about to clear command history" << std::endl; + cerr << "\n\nDocument::~Document: about to clear command history" << endl; #endif CommandHistory::getInstance()->clear(); @@ -142,7 +142,7 @@ LayerFactory::getInstance()->getValidLayerTypes(model); if (types.empty()) { - std::cerr << "WARNING: Document::importLayer: no valid display layer for model" << std::endl; + cerr << "WARNING: Document::importLayer: no valid display layer for model" << endl; return 0; } @@ -222,7 +222,7 @@ LayerFactory::getInstance()->getValidLayerTypes(newModel); if (types.empty()) { - std::cerr << "WARNING: Document::createLayerForTransformer: no valid display layer for output of transform " << transform.getIdentifier() << std::endl; + cerr << "WARNING: Document::createLayerForTransformer: no valid display layer for output of transform " << transform.getIdentifier() << endl; newModel->aboutToDelete(); emit modelAboutToBeDeleted(newModel); m_models.erase(newModel); @@ -345,14 +345,14 @@ // delete any of the models. #ifdef DEBUG_DOCUMENT - std::cerr << "Document::setMainModel: Have " - << m_layers.size() << " layers" << std::endl; - std::cerr << "Models now: "; + cerr << "Document::setMainModel: Have " + << m_layers.size() << " layers" << endl; + cerr << "Models now: "; for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) { - std::cerr << i->first << " "; + cerr << i->first << " "; } - std::cerr << std::endl; - std::cerr << "Old main model: " << oldMainModel << std::endl; + cerr << endl; + cerr << "Old main model: " << oldMainModel << endl; #endif for (LayerSet::iterator i = m_layers.begin(); i != m_layers.end(); ++i) { @@ -361,30 +361,30 @@ Model *model = layer->getModel(); #ifdef DEBUG_DOCUMENT - std::cerr << "Document::setMainModel: inspecting model " + cerr << "Document::setMainModel: inspecting model " << (model ? model->objectName(): "(null)") << " in layer " - << layer->objectName() << std::endl; + << layer->objectName() << endl; #endif if (model == oldMainModel) { #ifdef DEBUG_DOCUMENT - std::cerr << "... it uses the old main model, replacing" << std::endl; + cerr << "... it uses the old main model, replacing" << endl; #endif LayerFactory::getInstance()->setModel(layer, m_mainModel); continue; } if (!model) { - std::cerr << "WARNING: Document::setMainModel: Null model in layer " - << layer << std::endl; + cerr << "WARNING: Document::setMainModel: Null model in layer " + << layer << endl; // get rid of this hideous degenerate obsoleteLayers.push_back(layer); continue; } if (m_models.find(model) == m_models.end()) { - std::cerr << "WARNING: Document::setMainModel: Unknown model " - << model << " in layer " << layer << std::endl; + cerr << "WARNING: Document::setMainModel: Unknown model " + << model << " in layer " << layer << endl; // and this one obsoleteLayers.push_back(layer); continue; @@ -394,7 +394,7 @@ (m_models[model].source == oldMainModel)) { #ifdef DEBUG_DOCUMENT - std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl; + cerr << "... it uses a model derived from the old main model, regenerating" << endl; #endif // This model was derived from the previous main @@ -414,8 +414,8 @@ message); if (!replacementModel) { - std::cerr << "WARNING: Document::setMainModel: Failed to regenerate model for transform \"" - << transformId << "\"" << " in layer " << layer << std::endl; + cerr << "WARNING: Document::setMainModel: Failed to regenerate model for transform \"" + << transformId << "\"" << " in layer " << layer << endl; if (failedTransformers.find(transformId) == failedTransformers.end()) { emit modelRegenerationFailed(layer->objectName(), @@ -431,20 +431,20 @@ message); } #ifdef DEBUG_DOCUMENT - std::cerr << "Replacing model " << model << " (type " + cerr << "Replacing model " << model << " (type " << typeid(*model).name() << ") with model " << replacementModel << " (type " << typeid(*replacementModel).name() << ") in layer " << layer << " (name " << layer->objectName() << ")" - << std::endl; + << endl; #endif RangeSummarisableTimeValueModel *rm = dynamic_cast<RangeSummarisableTimeValueModel *>(replacementModel); #ifdef DEBUG_DOCUMENT if (rm) { - std::cerr << "new model has " << rm->getChannelCount() << " channels " << std::endl; + cerr << "new model has " << rm->getChannelCount() << " channels " << endl; } else { - std::cerr << "new model " << replacementModel << " is not a RangeSummarisableTimeValueModel!" << std::endl; + cerr << "new model " << replacementModel << " is not a RangeSummarisableTimeValueModel!" << endl; } #endif setModel(layer, replacementModel); @@ -496,16 +496,16 @@ Model *outputModelToAdd) { if (m_models.find(outputModelToAdd) != m_models.end()) { - std::cerr << "WARNING: Document::addDerivedModel: Model already added" - << std::endl; + cerr << "WARNING: Document::addDerivedModel: Model already added" + << endl; return; } #ifdef DEBUG_DOCUMENT if (input.getModel()) { - std::cerr << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << std::endl; + cerr << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << endl; } else { - std::cerr << "Document::addDerivedModel: source is " << input.getModel() << std::endl; + cerr << "Document::addDerivedModel: source is " << input.getModel() << endl; } #endif @@ -521,11 +521,11 @@ #ifdef DEBUG_DOCUMENT SVDEBUG << "Document::addDerivedModel: Added model " << outputModelToAdd << endl; - std::cerr << "Models now: "; + cerr << "Models now: "; for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) { - std::cerr << i->first << " "; + cerr << i->first << " "; } - std::cerr << std::endl; + cerr << endl; #endif emit modelAdded(outputModelToAdd); @@ -536,8 +536,8 @@ Document::addImportedModel(Model *model) { if (m_models.find(model) != m_models.end()) { - std::cerr << "WARNING: Document::addImportedModel: Model already added" - << std::endl; + cerr << "WARNING: Document::addImportedModel: Model already added" + << endl; return; } @@ -549,11 +549,11 @@ #ifdef DEBUG_DOCUMENT SVDEBUG << "Document::addImportedModel: Added model " << model << endl; - std::cerr << "Models now: "; + cerr << "Models now: "; for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) { - std::cerr << i->first << " "; + cerr << i->first << " "; } - std::cerr << std::endl; + cerr << endl; #endif if (m_autoAlignment) alignModel(model); @@ -599,7 +599,7 @@ .getPluginVersion()); if (!model) { - std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier() << std::endl; + cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier() << endl; } else { addDerivedModel(applied, input, model); } @@ -624,16 +624,16 @@ if (m_models.find(model) != m_models.end()) { if (m_models[model].refcount == 0) { - std::cerr << "WARNING: Document::releaseModel: model " << model - << " reference count is zero already!" << std::endl; + cerr << "WARNING: Document::releaseModel: model " << model + << " reference count is zero already!" << endl; } else { if (--m_models[model].refcount == 0) { toDelete = true; } } } else { - std::cerr << "WARNING: Document::releaseModel: Unfound model " - << model << std::endl; + cerr << "WARNING: Document::releaseModel: Unfound model " + << model << endl; toDelete = true; } @@ -661,11 +661,11 @@ #ifdef DEBUG_DOCUMENT SVDEBUG << "Document::releaseModel: Deleted model " << model << endl; - std::cerr << "Models now: "; + cerr << "Models now: "; for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) { - std::cerr << i->first << " "; + cerr << i->first << " "; } - std::cerr << std::endl; + cerr << endl; #endif delete model; @@ -678,15 +678,15 @@ if (m_layerViewMap.find(layer) != m_layerViewMap.end() && m_layerViewMap[layer].size() > 0) { - std::cerr << "WARNING: Document::deleteLayer: Layer " + cerr << "WARNING: Document::deleteLayer: Layer " << layer << " [" << layer->objectName() << "]" << " is still used in " << m_layerViewMap[layer].size() - << " views!" << std::endl; + << " views!" << endl; if (force) { #ifdef DEBUG_DOCUMENT - std::cerr << "(force flag set -- deleting from all views)" << std::endl; + cerr << "(force flag set -- deleting from all views)" << endl; #endif for (std::set<View *>::iterator j = m_layerViewMap[layer].begin(); @@ -730,11 +730,11 @@ if (model && model != m_mainModel && m_models.find(model) == m_models.end()) { - std::cerr << "ERROR: Document::setModel: Layer " << layer - << " (\"" << layer->objectName().toStdString() + cerr << "ERROR: Document::setModel: Layer " << layer + << " (\"" << layer->objectName() << "\") wants to use unregistered model " << model << ": register the layer's model before setting it!" - << std::endl; + << endl; return; } @@ -785,9 +785,9 @@ } else { if (model != m_mainModel && m_models.find(model) == m_models.end()) { - std::cerr << "ERROR: Document::addLayerToView: Layer " << layer + cerr << "ERROR: Document::addLayerToView: Layer " << layer << " has unregistered model " << model - << " -- register the layer's model before adding the layer!" << std::endl; + << " -- register the layer's model before adding the layer!" << endl; return; } } @@ -811,9 +811,9 @@ if (m_layerViewMap[layer].find(view) != m_layerViewMap[layer].end()) { - std::cerr << "WARNING: Document::addToLayerViewMap:" + cerr << "WARNING: Document::addToLayerViewMap:" << " Layer " << layer << " -> view " << view << " already in" - << " layer view map -- internal inconsistency" << std::endl; + << " layer view map -- internal inconsistency" << endl; } m_layerViewMap[layer].insert(view); @@ -826,9 +826,9 @@ { if (m_layerViewMap[layer].find(view) == m_layerViewMap[layer].end()) { - std::cerr << "WARNING: Document::removeFromLayerViewMap:" + cerr << "WARNING: Document::removeFromLayerViewMap:" << " Layer " << layer << " -> view " << view << " not in" - << " layer view map -- internal inconsistency" << std::endl; + << " layer view map -- internal inconsistency" << endl; } m_layerViewMap[layer].erase(view); @@ -993,7 +993,7 @@ (transformOutput); if (!path) { - std::cerr << "Document::alignModel: ERROR: Failed to create alignment path (no MATCH plugin?)" << std::endl; + cerr << "Document::alignModel: ERROR: Failed to create alignment path (no MATCH plugin?)" << endl; emit alignmentFailed(id, message); delete transformOutput; delete aggregateModel;