------------------------------------------------------------------------------------------------
| 59 | |
| 60 | // ------------------------------------------------------------------------------------------------ |
| 61 | void BaseProcess::ExecuteOnScene(Importer *pImp) { |
| 62 | ai_assert( nullptr != pImp ); |
| 63 | if (pImp == nullptr) { |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | ai_assert(nullptr != pImp->Pimpl()->mScene); |
| 68 | if (pImp->Pimpl()->mScene == nullptr) { |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | progress = pImp->GetProgressHandler(); |
| 73 | ai_assert(nullptr != progress); |
| 74 | if (progress == nullptr) { |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | SetupProperties(pImp); |
| 79 | |
| 80 | // catch exceptions thrown inside the PostProcess-Step |
| 81 | try { |
| 82 | Execute(pImp->Pimpl()->mScene); |
| 83 | } catch (const std::exception &err) { |
| 84 | |
| 85 | // extract error description |
| 86 | pImp->Pimpl()->mErrorString = err.what(); |
| 87 | ASSIMP_LOG_ERROR(pImp->Pimpl()->mErrorString); |
| 88 | |
| 89 | // and kill the partially imported data |
| 90 | delete pImp->Pimpl()->mScene; |
| 91 | pImp->Pimpl()->mScene = nullptr; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | // ------------------------------------------------------------------------------------------------ |
| 96 | void BaseProcess::SetupProperties(const Importer * /*pImp*/) { |
no test coverage detected