diff --git a/conanfile.txt b/conanfile.txt index a36eeb58..f82c46a4 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,6 +1,6 @@ [requires] -fmt/8.1.1 -spdlog/1.10.0 +fmt/9.1.0 +spdlog/1.11.0 catch2/2.13.7 fakeit/2.0.9 cli11/2.3.2 diff --git a/src/crayg/src/basics/BoundingBox.h b/src/crayg/src/basics/BoundingBox.h index c6bf6824..daabc1ed 100644 --- a/src/crayg/src/basics/BoundingBox.h +++ b/src/crayg/src/basics/BoundingBox.h @@ -3,6 +3,7 @@ #include "Ray.h" #include "Vector3f.h" +#include #include namespace crayg { @@ -32,4 +33,6 @@ class BoundingBox { } +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_BOUNDINGBOX_H diff --git a/src/crayg/src/basics/Color.h b/src/crayg/src/basics/Color.h index 656e6bcd..869b2072 100644 --- a/src/crayg/src/basics/Color.h +++ b/src/crayg/src/basics/Color.h @@ -1,6 +1,7 @@ #ifndef CRAYG_COLOR_H #define CRAYG_COLOR_H +#include #include #include @@ -55,4 +56,7 @@ class Color { }; } // namespace crayg + +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_COLOR_H diff --git a/src/crayg/src/basics/Gradient.h b/src/crayg/src/basics/Gradient.h index 00d631cf..5adaec42 100644 --- a/src/crayg/src/basics/Gradient.h +++ b/src/crayg/src/basics/Gradient.h @@ -4,6 +4,7 @@ #include "Color.h" #include "utils/ToStringHelper.h" #include +#include #include #include @@ -85,4 +86,8 @@ template T Gradient::lerp(const T &firstValue, const T &secondVa } // crayg +template struct fmt::formatter> : ostream_formatter {}; + +template struct fmt::formatter> : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_GRADIENT_H_ diff --git a/src/crayg/src/basics/Matrix4x4f.h b/src/crayg/src/basics/Matrix4x4f.h index b2096044..57f3cfb7 100644 --- a/src/crayg/src/basics/Matrix4x4f.h +++ b/src/crayg/src/basics/Matrix4x4f.h @@ -2,6 +2,7 @@ #define CRAYG_SRC_CRAYG_SRC_BASICS_MATRIX4X4F_H_ #include "Vector3f.h" +#include #include namespace crayg { @@ -32,4 +33,7 @@ class Matrix4x4f { }; } + +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_MATRIX4X4F_H_ diff --git a/src/crayg/src/basics/OrthonormalBasis.h b/src/crayg/src/basics/OrthonormalBasis.h index a743e1d4..c413939e 100644 --- a/src/crayg/src/basics/OrthonormalBasis.h +++ b/src/crayg/src/basics/OrthonormalBasis.h @@ -3,6 +3,7 @@ #include "Vector3f.h" #include "utils/ToStringHelper.h" +#include #include namespace crayg { @@ -30,4 +31,6 @@ class OrthonormalBasis { } // crayg +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_ORTHONORMALBASIS_H_ diff --git a/src/crayg/src/basics/Ray.h b/src/crayg/src/basics/Ray.h index be5500bf..8d6d8749 100644 --- a/src/crayg/src/basics/Ray.h +++ b/src/crayg/src/basics/Ray.h @@ -2,6 +2,7 @@ #define CRAYG_RAY_H #include "Vector3f.h" +#include #include namespace crayg { @@ -32,4 +33,6 @@ struct Ray { } +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_RAY_H diff --git a/src/crayg/src/basics/Resolution.h b/src/crayg/src/basics/Resolution.h index f7cbadab..749f885e 100644 --- a/src/crayg/src/basics/Resolution.h +++ b/src/crayg/src/basics/Resolution.h @@ -1,6 +1,7 @@ #ifndef CRAYG_SRC_CRAYG_SRC_BASICS_RESOLUTION_H_ #define CRAYG_SRC_CRAYG_SRC_BASICS_RESOLUTION_H_ +#include #include namespace crayg { @@ -27,4 +28,6 @@ struct Resolution { } +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_RESOLUTION_H_ diff --git a/src/crayg/src/basics/Transform.h b/src/crayg/src/basics/Transform.h index 5dc38106..90c91791 100644 --- a/src/crayg/src/basics/Transform.h +++ b/src/crayg/src/basics/Transform.h @@ -3,6 +3,7 @@ #include "Matrix4x4f.h" #include "Ray.h" +#include #include namespace crayg { @@ -32,4 +33,6 @@ class Transform { } +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_TRANSFORM_H_ diff --git a/src/crayg/src/basics/Vector2.h b/src/crayg/src/basics/Vector2.h index b74adb77..1cf13aeb 100644 --- a/src/crayg/src/basics/Vector2.h +++ b/src/crayg/src/basics/Vector2.h @@ -2,6 +2,7 @@ #define CRAYG_SRC_CRAYG_SRC_BASICS_VECTOR2_H_ #include "utils/ToStringHelper.h" +#include #include namespace crayg { @@ -53,4 +54,6 @@ typedef Vector2 Vector2i; } +template struct fmt::formatter> : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_VECTOR2_H_ diff --git a/src/crayg/src/basics/Vector3f.h b/src/crayg/src/basics/Vector3f.h index a8cdc827..cddac288 100644 --- a/src/crayg/src/basics/Vector3f.h +++ b/src/crayg/src/basics/Vector3f.h @@ -2,6 +2,7 @@ #define CRAYG_VECTOR3F_H #include +#include #include #include @@ -49,4 +50,7 @@ class Vector3f { }; } + +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_VECTOR3F_H diff --git a/src/crayg/src/image/ImageBucket.h b/src/crayg/src/image/ImageBucket.h index 5fe6f849..4c59d5a9 100644 --- a/src/crayg/src/image/ImageBucket.h +++ b/src/crayg/src/image/ImageBucket.h @@ -2,6 +2,7 @@ #define CRAYG_SRC_CRAYG_SRC_IMAGE_IMAGEBUCKET_H_ #include "basics/Vector2.h" +#include #include namespace crayg { @@ -32,4 +33,6 @@ template <> struct hash { }; } +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_IMAGE_IMAGEBUCKET_H_ diff --git a/src/crayg/src/image/PixelBuffer.h b/src/crayg/src/image/PixelBuffer.h index 31327d80..8996b848 100644 --- a/src/crayg/src/image/PixelBuffer.h +++ b/src/crayg/src/image/PixelBuffer.h @@ -5,6 +5,7 @@ #include "basics/Color.h" #include "basics/Resolution.h" #include "basics/Vector2.h" +#include #include #include #include @@ -51,4 +52,6 @@ class PixelBuffer { } // crayg +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_IMAGE_PIXELBUFFER_H_ diff --git a/src/crayg/src/integrators/IntegratorSettings.h b/src/crayg/src/integrators/IntegratorSettings.h index 97f05a52..baf41f7b 100644 --- a/src/crayg/src/integrators/IntegratorSettings.h +++ b/src/crayg/src/integrators/IntegratorSettings.h @@ -1,5 +1,6 @@ #ifndef CRAYG_SRC_CRAYG_SRC_INTEGRATORS_INTEGRATORSETTINGS_H_ #define CRAYG_SRC_CRAYG_SRC_INTEGRATORS_INTEGRATORSETTINGS_H_ +#include #include #include #include @@ -22,4 +23,6 @@ class IntegratorSettings { } // crayg +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_INTEGRATORS_INTEGRATORSETTINGS_H_ diff --git a/src/crayg/src/scene/camera/Camera.h b/src/crayg/src/scene/camera/Camera.h index 9e872ee0..594f82d2 100644 --- a/src/crayg/src/scene/camera/Camera.h +++ b/src/crayg/src/scene/camera/Camera.h @@ -5,6 +5,7 @@ #include "scene/Transformable.h" #include "spdlog/fmt/ostr.h" #include "utils/ToStringHelper.h" +#include #include namespace crayg { @@ -51,4 +52,7 @@ class Camera : public Transformable { }; } + +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_CAMERA_H diff --git a/src/crayg/src/scene/lights/Light.h b/src/crayg/src/scene/lights/Light.h index a75160cb..5ed8b358 100644 --- a/src/crayg/src/scene/lights/Light.h +++ b/src/crayg/src/scene/lights/Light.h @@ -45,4 +45,7 @@ class Light : public Transformable, public Imageable { }; } + +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_L \ No newline at end of file diff --git a/src/crayg/src/scene/primitives/trianglemesh/BarycentricCoordinates.h b/src/crayg/src/scene/primitives/trianglemesh/BarycentricCoordinates.h index bbbbb9fc..9e13cf7e 100644 --- a/src/crayg/src/scene/primitives/trianglemesh/BarycentricCoordinates.h +++ b/src/crayg/src/scene/primitives/trianglemesh/BarycentricCoordinates.h @@ -2,6 +2,7 @@ #define CRAYG_SRC_CRAYG_SRC_BASICS_BARYCENTRICCOORDINATES_H_ #include "scene/primitives/trianglemesh/Triangle.h" +#include #include namespace crayg { @@ -28,4 +29,6 @@ template T BarycentricCoordinates::interpolateLinear(const T &value } // crayg +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_BASICS_BARYCENTRICCOORDINATES_H_ diff --git a/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerFacePrimVar.h b/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerFacePrimVar.h index 039d88bf..5f3a5eb6 100644 --- a/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerFacePrimVar.h +++ b/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerFacePrimVar.h @@ -4,6 +4,7 @@ #include "TriangleMeshAbstractPrimVar.h" #include "scene/primitives/trianglemesh/BarycentricCoordinates.h" #include "utils/ToStringHelper.h" +#include #include namespace crayg { @@ -58,4 +59,6 @@ template class TriangleMeshPerFacePrimVar : public TriangleMeshAbst }; } +template struct fmt::formatter> : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_SCENE_TRIANGLEMESHPERFACEPRIMVAR_H_ diff --git a/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerPointPrimVar.h b/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerPointPrimVar.h index 5d82bdb4..d7141504 100644 --- a/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerPointPrimVar.h +++ b/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerPointPrimVar.h @@ -4,6 +4,7 @@ #include "TriangleMeshAbstractPrimVar.h" #include "scene/primitives/trianglemesh/BarycentricCoordinates.h" #include "utils/ToStringHelper.h" +#include namespace crayg { @@ -41,7 +42,7 @@ template class TriangleMeshPerPointPrimVar : public TriangleMeshAbs } template - friend std::ostream &operator<<(std::ostream &os, const TriangleMeshPerPointPrimVar &var) { + friend std::ostream &operator<<(std::ostream &os, const TriangleMeshPerPointPrimVar &var) { os << ToStringHelper("TriangleMeshPerPointPrimVar").addMember("pointData", var.pointData).finish(); return os; } @@ -64,4 +65,6 @@ template class TriangleMeshPerPointPrimVar : public TriangleMeshAbs } // crayg +template struct fmt::formatter> : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_SCENE_TRIANGLEMESHPERPOINTPRIMVAR_H_ diff --git a/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerVertexPrimVar.h b/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerVertexPrimVar.h index 9b32b41b..e3c8e55a 100644 --- a/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerVertexPrimVar.h +++ b/src/crayg/src/scene/primitives/trianglemesh/primvars/TriangleMeshPerVertexPrimVar.h @@ -4,6 +4,7 @@ #include "TriangleMeshAbstractPrimVar.h" #include "scene/primitives/trianglemesh/BarycentricCoordinates.h" #include "utils/ToStringHelper.h" +#include #include namespace crayg { @@ -74,7 +75,7 @@ template class TriangleMeshPerVertexPrimVar : public TriangleMeshAb } template - friend std::ostream &operator<<(std::ostream &os, const TriangleMeshPerVertexPrimVar &var) { + friend std::ostream &operator<<(std::ostream &os, const TriangleMeshPerVertexPrimVar &var) { os << ToStringHelper("TriangleMeshPerVertexPrimVar").addMember("vertexData", var.vertexData).finish(); return os; } @@ -96,4 +97,8 @@ template class TriangleMeshPerVertexPrimVar : public TriangleMeshAb }; } +template struct fmt::formatter> : ostream_formatter {}; + +template struct fmt::formatter> : ostream_formatter {}; + #endif // CRAYG_SRC_CRAYG_SRC_SCENE_TRIANGLEMESHPERVERTEXPRIMVAR_H_ diff --git a/src/crayg/src/sceneIO/usd/CraygUsdBase.h b/src/crayg/src/sceneIO/usd/CraygUsdBase.h index 36e2f76d..8596b7be 100644 --- a/src/crayg/src/sceneIO/usd/CraygUsdBase.h +++ b/src/crayg/src/sceneIO/usd/CraygUsdBase.h @@ -3,6 +3,7 @@ #include #include #include +#include template <> struct fmt::formatter { template constexpr auto parse(ParseContext &ctx) { @@ -24,4 +25,14 @@ template <> struct fmt::formatter { }; }; +template <> struct fmt::formatter { + template constexpr auto parse(ParseContext &ctx) { + return ctx.begin(); + } + + template auto format(pxr::SdfValueTypeName const &sdfValueTypeName, FormatContext &ctx) { + return fmt::format_to(ctx.out(), sdfValueTypeName.GetAsToken().GetString()); + }; +}; + #endif // CRAYG_SRC_CRAYGUSD_SRC_CRAYGUSDBASE_H_ diff --git a/src/crayg/src/utils/DtoUtils.h b/src/crayg/src/utils/DtoUtils.h index 06673434..20399623 100644 --- a/src/crayg/src/utils/DtoUtils.h +++ b/src/crayg/src/utils/DtoUtils.h @@ -11,7 +11,8 @@ template <> struct fmt::formatter> { \ template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \ \ - template auto format(std::vector const &dtos, FormatContext &ctx) { \ + template \ + auto format(std::vector const &dtos, FormatContext &ctx) const { \ return fmt::format_to(ctx.out(), "[{}]", fmt::join(dtos, ", ")); \ }; \ }; @@ -38,7 +39,7 @@ template <> struct fmt::formatter { \ template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \ \ - template auto format(crayg::Name const &dto, FormatContext &ctx) { \ + template auto format(crayg::Name const &dto, FormatContext &ctx) const { \ return fmt::format_to(ctx.out(), "{}{{{}={},{}={}}}", #Name, #FirstName, dto.FirstName, #SecondName, \ dto.SecondName); \ }; \ @@ -72,7 +73,7 @@ template <> struct fmt::formatter { \ template constexpr auto parse(ParseContext &ctx) { return ctx.begin(); } \ \ - template auto format(crayg::Name const &dto, FormatContext &ctx) { \ + template auto format(crayg::Name const &dto, FormatContext &ctx) const { \ return fmt::format_to(ctx.out(), "{}{{{}={},{}={},{}={}}}", #Name, #FirstName, dto.FirstName, #SecondName, \ dto.SecondName, #ThirdName, dto.ThirdName); \ }; \ diff --git a/src/standalonegui/widgets/PanAndZoomArea.h b/src/standalonegui/widgets/PanAndZoomArea.h index ef2b1e7c..5331b56d 100644 --- a/src/standalonegui/widgets/PanAndZoomArea.h +++ b/src/standalonegui/widgets/PanAndZoomArea.h @@ -55,4 +55,6 @@ class PanAndZoomArea : public QScrollArea { } // crayg +template <> struct fmt::formatter : ostream_formatter {}; + #endif // CRAYG_SRC_STANDALONEGUI_PANANDZOOMAREA_H_