20#ifndef _SOURCE_TF_DEBUG_H_
21#define _SOURCE_TF_DEBUG_H_
24#include <Magnum/Magnum.h>
25#include <Magnum/Math/Vector3.h>
26#include <Magnum/Math/Matrix3.h>
27#include <Corrade/Utility/Debug.h>
32inline std::ostream& operator<<(std::ostream& os,
const Magnum::Vector3& vec)
34 os <<
"{" << vec[0] <<
"," << vec[1] <<
"," << vec[2] <<
"}";
38inline std::ostream& operator<<(std::ostream& os,
const Magnum::Vector3ui& vec)
40 os <<
"{" << vec[0] <<
"," << vec[1] <<
"," << vec[2] <<
"}";
44inline std::ostream& operator<<(std::ostream& os,
const Magnum::Math::Matrix3<float>& m)
46 os <<
"{" << m.row(0) <<
"," << std::endl
47 <<
" " << m.row(1) <<
"," << std::endl
48 <<
" " << m.row(2) <<
"}" << std::endl;
53template <
typename ArrayType,
size_t Length>
54std::ostream& operator << (std::ostream& stream,
const std::array<ArrayType, Length>);
57template <
typename ArrayType>
58std::ostream& operator << (std::ostream& stream,
const std::array<ArrayType, 2> a) {
59 stream <<
"{" << a[0] <<
", " << a[1] <<
"}";
63template <
typename ArrayType>
64std::ostream& operator << (std::ostream& stream,
const std::array<ArrayType, 3> a) {
65 stream <<
"{" << a[0] <<
", " << a[1] <<
", " << a[2] <<
"}";
69template <
typename ArrayType>
70std::ostream& operator << (std::ostream& stream,
const std::array<ArrayType, 4> a) {
71 stream <<
"{" << a[0] <<
", " << a[1] <<
", " << a[2] <<
", " << a[3] <<
"}";
75template<
typename MagnumType>
76std::string to_string(
const MagnumType &val) {
77 std::ostringstream ss;