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