diff --git a/include/mcc/mcc_pcm.h b/include/mcc/mcc_pcm.h index e8c7860..5a0cacd 100644 --- a/include/mcc/mcc_pcm.h +++ b/include/mcc/mcc_pcm.h @@ -120,6 +120,17 @@ static constexpr std::string_view MccDefaultPCMTypeString = #endif : "UNKNOWN"; + +static constexpr std::string_view mccDefaultPCMTypeString(MccDefaultPCMType type) +{ + return type == MccDefaultPCMType::PCM_TYPE_GEOMETRY ? "GEOMETRY" +#ifdef USE_BSPLINE_PCM + : type == MccDefaultPCMType::PCM_TYPE_GEOMETRY_BSPLINE ? "GEOMETRY-BSPLINE" + : type == MccDefaultPCMType::PCM_TYPE_GEOMETRY_BSPLINE ? "BSPLINE" +#endif + : "UNKNOWN"; +} + template class MccDefaultPCM : public mcc_pcm_interface_t { @@ -176,6 +187,8 @@ public: #endif struct pcm_data_t { + typedef MccDefaultPCM pcm_t; + MccDefaultPCMType type{MccDefaultPCMType::PCM_TYPE_GEOMETRY}; double siteLatitude{0.0}; // in radians diff --git a/include/mcc/mcc_pcm_fit.h b/include/mcc/mcc_pcm_fit.h index d795f70..eb25879 100644 --- a/include/mcc/mcc_pcm_fit.h +++ b/include/mcc/mcc_pcm_fit.h @@ -279,8 +279,9 @@ public: // // WARNING: the input knots for inverse B-spline are ignored so the direct and inverse B-spline coefficients are // calculated on the same mesh! - compute_result_t computeModel(MccDefaultPCM::pcm_data_t& pcm_data, - compute_params_t const& comp_params = {}) + template + compute_result_t computeModel(PCM_DATA_T& pcm_data, compute_params_t const& comp_params = {}) + requires(std::derived_from>) { compute_result_t result{.pcm_type = pcm_data.type, .error = MccPCMFitterErrorCode::ERROR_OK};