mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Warning hunt session followup
This commit is contained in:
parent
9ffd294f07
commit
ce22251707
4 changed files with 37 additions and 82 deletions
|
@ -49,29 +49,31 @@ typedef double coordf_t;
|
|||
//inline coord_t scale_(coordf_t v) { return coord_t(floor(v / SCALING_FACTOR + 0.5f)); }
|
||||
#define scale_(val) ((val) / SCALING_FACTOR)
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1910)
|
||||
template<class Tf> inline coord_t scaled(Tf val)
|
||||
#define SCALED_EPSILON scale_(EPSILON)
|
||||
|
||||
#define SLIC3R_DEBUG_OUT_PATH_PREFIX "out/"
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
# define SLIC3R_CONSTEXPR
|
||||
# define SLIC3R_NOEXCEPT
|
||||
#else
|
||||
template<class Tf> inline constexpr coord_t scaled(Tf val)
|
||||
#endif // _MSC_VER
|
||||
#define SLIC3R_CONSTEXPR constexpr
|
||||
#define SLIC3R_NOEXCEPT noexcept
|
||||
#endif
|
||||
|
||||
template<class Tf> inline SLIC3R_CONSTEXPR coord_t scaled(Tf val)
|
||||
{
|
||||
static_assert (std::is_floating_point<Tf>::value, "Floating point only");
|
||||
return coord_t(val / Tf(SCALING_FACTOR));
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1910)
|
||||
template<class Tf> inline Tf unscaled(coord_t val)
|
||||
#else
|
||||
template<class Tf> inline constexpr Tf unscaled(coord_t val)
|
||||
#endif // _MSC_VER
|
||||
template<class Tf = double> inline SLIC3R_CONSTEXPR Tf unscaled(coord_t val)
|
||||
{
|
||||
static_assert (std::is_floating_point<Tf>::value, "Floating point only");
|
||||
return Tf(val * Tf(SCALING_FACTOR));
|
||||
}
|
||||
|
||||
#define SCALED_EPSILON scale_(EPSILON)
|
||||
|
||||
#define SLIC3R_DEBUG_OUT_PATH_PREFIX "out/"
|
||||
inline SLIC3R_CONSTEXPR float unscaledf(coord_t val) { return unscaled<float>(val); }
|
||||
|
||||
inline std::string debug_out_path(const char *name, ...)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue