Mercurial > hg > svapp
diff framework/Document.cpp @ 368:f1cab64363d7 warnfix_no_size_t
Merge from branch tony_integration
author | Chris Cannam |
---|---|
date | Wed, 18 Jun 2014 08:45:13 +0100 |
parents | 0876ea394902 f5c914661f6f |
children | a4c2a4685cf1 |
line wrap: on
line diff
--- a/framework/Document.cpp Tue Jun 17 17:00:26 2014 +0100 +++ b/framework/Document.cpp Wed Jun 18 08:45:13 2014 +0100 @@ -275,24 +275,33 @@ } vector<Layer *> layers = m_doc->createLayersForDerivedModels (models, names); - m_handler->layersCreated(m_primary, layers); + m_handler->layersCreated(this, m_primary, layers); delete this; } void noMoreModelsAvailable() { std::cerr << "AdditionalModelConverter::noMoreModelsAvailable" << std::endl; - m_handler->layersCreated(m_primary, vector<Layer *>()); + m_handler->layersCreated(this, m_primary, vector<Layer *>()); delete this; } + void cancel() { + foreach (Layer *layer, m_primary) { + Model *model = layer->getModel(); + if (model) { + model->abandon(); + } + } + } + private: Document *m_doc; vector<Layer *> m_primary; Document::LayerCreationHandler *m_handler; //!!! how to handle destruction of this? }; -void +Document::LayerCreationAsyncHandle Document::createDerivedLayersAsync(const Transforms &transforms, const ModelTransformer::Input &input, LayerCreationHandler *handler) @@ -318,10 +327,21 @@ if (newModels.empty()) { //!!! This identifier may be wrong! emit modelGenerationFailed(transforms[0].getIdentifier(), message); + //!!! what to do with amc? } else if (message != "") { //!!! This identifier may be wrong! emit modelGenerationWarning(transforms[0].getIdentifier(), message); + //!!! what to do with amc? } + + return amc; +} + +void +Document::cancelAsyncLayerCreation(Document::LayerCreationAsyncHandle h) +{ + AdditionalModelConverter *conv = static_cast<AdditionalModelConverter *>(h); + conv->cancel(); } vector<Layer *>