mcc_pcm.h: add mccDefaultPCMTypeString free function

mcc_pcm_fit.h: computeModel now accepts PCM data type of MccDefaultPCM-
class descendants
This commit is contained in:
2026-05-14 18:08:29 +03:00
parent fb70e9099b
commit af0268218a
2 changed files with 16 additions and 2 deletions

View File

@@ -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 <MccMountType MOUNT_TYPE>
class MccDefaultPCM : public mcc_pcm_interface_t<std::error_code>
{
@@ -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

View File

@@ -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<MOUNT_TYPE>::pcm_data_t& pcm_data,
compute_params_t const& comp_params = {})
template <typename PCM_DATA_T>
compute_result_t computeModel(PCM_DATA_T& pcm_data, compute_params_t const& comp_params = {})
requires(std::derived_from<typename PCM_DATA_T::pcm_t, MccDefaultPCM<MOUNT_TYPE>>)
{
compute_result_t result{.pcm_type = pcm_data.type, .error = MccPCMFitterErrorCode::ERROR_OK};