diff --git a/include/vde/foundation/format_utils.h b/include/vde/foundation/format_utils.h index 712f2f2..74b7e16 100644 --- a/include/vde/foundation/format_utils.h +++ b/include/vde/foundation/format_utils.h @@ -26,7 +26,7 @@ inline std::string fmt_double(double v, int precision = 12) { } /// Format for IGES: uses D exponent -inline std::string fmt_iges_real(double v) { +inline std::string fmt_iges_real(double v, int /*precision*/ = 12) { auto s = fmt_double(v, 12); auto pos = s.find('e'); if (pos != std::string::npos) s[pos] = 'D'; @@ -35,8 +35,9 @@ inline std::string fmt_iges_real(double v) { /// Format a Point3D as comma-separated reals inline std::string fmt_point(const core::Point3D& p, bool use_d = false) { - auto format_fn = use_d ? fmt_iges_real : fmt_double; - return format_fn(p.x()) + "," + fmt(p.y()) + "," + fmt(p.z()); + using FmtFn = std::string (*)(double, int); + FmtFn fn = use_d ? static_cast(fmt_iges_real) : fmt_double; + return fn(p.x(), 12) + "," + fn(p.y(), 12) + "," + fn(p.z(), 12); } /// Pad a string to exactly 72 characters with spaces diff --git a/src/brep/iges_import.cpp b/src/brep/iges_import.cpp index 6ae60e2..5e4c4c6 100644 --- a/src/brep/iges_import.cpp +++ b/src/brep/iges_import.cpp @@ -94,7 +94,7 @@ private: bool parse_section(char section_type, std::string& out_content); bool parse_directory_entries(const std::vector& records); bool parse_parameter_data(const std::vector& records); - +}; IgesParser::IgesParser(const std::string& data) : data_(data) {}