Loading src/UsgsAstroPlugin.cpp +14 −3 Original line number Original line Diff line number Diff line Loading @@ -123,7 +123,10 @@ bool UsgsAstroPlugin::canModelBeConstructedFromState( csm::WarningList *warnings) const { csm::WarningList *warnings) const { try { try { csm::Model *model = constructModelFromState(modelState, warnings); csm::Model *model = constructModelFromState(modelState, warnings); return static_cast<bool>(model); if (model) { delete model; return true; } } catch (std::exception &e) { } catch (std::exception &e) { std::string msg = "Could not create model ["; std::string msg = "Could not create model ["; msg += modelName; msg += modelName; Loading Loading @@ -157,7 +160,10 @@ bool UsgsAstroPlugin::canModelBeConstructedFromISD( try { try { csm::Model *model = csm::Model *model = constructModelFromISD(imageSupportData, modelName, warnings); constructModelFromISD(imageSupportData, modelName, warnings); return static_cast<bool>(model); if (model) { delete model; return true; } } catch (std::exception &e) { } catch (std::exception &e) { if (warnings) { if (warnings) { std::string msg = "Could not create model ["; std::string msg = "Could not create model ["; Loading Loading @@ -273,7 +279,9 @@ std::string UsgsAstroPlugin::convertISDToModelState( MESSAGE_LOG("Running convertISDToModelState"); MESSAGE_LOG("Running convertISDToModelState"); csm::Model *sensor_model = csm::Model *sensor_model = constructModelFromISD(imageSupportData, modelName, warnings); constructModelFromISD(imageSupportData, modelName, warnings); return sensor_model->getModelState(); std::string stateString = sensor_model->getModelState(); delete sensor_model; return stateString; } } csm::Model *UsgsAstroPlugin::constructModelFromISD( csm::Model *UsgsAstroPlugin::constructModelFromISD( Loading @@ -291,6 +299,7 @@ csm::Model *UsgsAstroPlugin::constructModelFromISD( model->constructStateFromIsd(stringIsd, warnings)); model->constructStateFromIsd(stringIsd, warnings)); MESSAGE_LOG("Constructed model: {}", modelName); MESSAGE_LOG("Constructed model: {}", modelName); } catch (std::exception &e) { } catch (std::exception &e) { delete model; csm::Error::ErrorType aErrorType = csm::Error::ErrorType aErrorType = csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; std::string aMessage = "Could not construct model ["; std::string aMessage = "Could not construct model ["; Loading @@ -310,6 +319,7 @@ csm::Model *UsgsAstroPlugin::constructModelFromISD( model->replaceModelState( model->replaceModelState( model->constructStateFromIsd(stringIsd, warnings)); model->constructStateFromIsd(stringIsd, warnings)); } catch (std::exception &e) { } catch (std::exception &e) { delete model; csm::Error::ErrorType aErrorType = csm::Error::ErrorType aErrorType = csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; std::string aMessage = "Could not construct model ["; std::string aMessage = "Could not construct model ["; Loading @@ -329,6 +339,7 @@ csm::Model *UsgsAstroPlugin::constructModelFromISD( model->replaceModelState( model->replaceModelState( model->constructStateFromIsd(stringIsd, warnings)); model->constructStateFromIsd(stringIsd, warnings)); } catch (std::exception &e) { } catch (std::exception &e) { delete model; csm::Error::ErrorType aErrorType = csm::Error::ErrorType aErrorType = csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; std::string aMessage = "Could not construct model ["; std::string aMessage = "Could not construct model ["; Loading Loading
src/UsgsAstroPlugin.cpp +14 −3 Original line number Original line Diff line number Diff line Loading @@ -123,7 +123,10 @@ bool UsgsAstroPlugin::canModelBeConstructedFromState( csm::WarningList *warnings) const { csm::WarningList *warnings) const { try { try { csm::Model *model = constructModelFromState(modelState, warnings); csm::Model *model = constructModelFromState(modelState, warnings); return static_cast<bool>(model); if (model) { delete model; return true; } } catch (std::exception &e) { } catch (std::exception &e) { std::string msg = "Could not create model ["; std::string msg = "Could not create model ["; msg += modelName; msg += modelName; Loading Loading @@ -157,7 +160,10 @@ bool UsgsAstroPlugin::canModelBeConstructedFromISD( try { try { csm::Model *model = csm::Model *model = constructModelFromISD(imageSupportData, modelName, warnings); constructModelFromISD(imageSupportData, modelName, warnings); return static_cast<bool>(model); if (model) { delete model; return true; } } catch (std::exception &e) { } catch (std::exception &e) { if (warnings) { if (warnings) { std::string msg = "Could not create model ["; std::string msg = "Could not create model ["; Loading Loading @@ -273,7 +279,9 @@ std::string UsgsAstroPlugin::convertISDToModelState( MESSAGE_LOG("Running convertISDToModelState"); MESSAGE_LOG("Running convertISDToModelState"); csm::Model *sensor_model = csm::Model *sensor_model = constructModelFromISD(imageSupportData, modelName, warnings); constructModelFromISD(imageSupportData, modelName, warnings); return sensor_model->getModelState(); std::string stateString = sensor_model->getModelState(); delete sensor_model; return stateString; } } csm::Model *UsgsAstroPlugin::constructModelFromISD( csm::Model *UsgsAstroPlugin::constructModelFromISD( Loading @@ -291,6 +299,7 @@ csm::Model *UsgsAstroPlugin::constructModelFromISD( model->constructStateFromIsd(stringIsd, warnings)); model->constructStateFromIsd(stringIsd, warnings)); MESSAGE_LOG("Constructed model: {}", modelName); MESSAGE_LOG("Constructed model: {}", modelName); } catch (std::exception &e) { } catch (std::exception &e) { delete model; csm::Error::ErrorType aErrorType = csm::Error::ErrorType aErrorType = csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; std::string aMessage = "Could not construct model ["; std::string aMessage = "Could not construct model ["; Loading @@ -310,6 +319,7 @@ csm::Model *UsgsAstroPlugin::constructModelFromISD( model->replaceModelState( model->replaceModelState( model->constructStateFromIsd(stringIsd, warnings)); model->constructStateFromIsd(stringIsd, warnings)); } catch (std::exception &e) { } catch (std::exception &e) { delete model; csm::Error::ErrorType aErrorType = csm::Error::ErrorType aErrorType = csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; std::string aMessage = "Could not construct model ["; std::string aMessage = "Could not construct model ["; Loading @@ -329,6 +339,7 @@ csm::Model *UsgsAstroPlugin::constructModelFromISD( model->replaceModelState( model->replaceModelState( model->constructStateFromIsd(stringIsd, warnings)); model->constructStateFromIsd(stringIsd, warnings)); } catch (std::exception &e) { } catch (std::exception &e) { delete model; csm::Error::ErrorType aErrorType = csm::Error::ErrorType aErrorType = csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE; std::string aMessage = "Could not construct model ["; std::string aMessage = "Could not construct model ["; Loading