diff --git a/src/main.cpp b/src/main.cpp index 33708a3..be4c68e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,7 @@ +#include + #include #include -#include #include #include #include @@ -9,42 +10,41 @@ // Adapters so we can log eigen vectors as rerun positions: template <> -struct rerun::ComponentBatchAdapter> { +struct rerun::ComponentBatchAdapter> { // Sanity check that this is binary compatible. - static_assert(sizeof(components::Position3D) == sizeof(Eigen::Vector3f)); - static_assert(alignof(components::Position3D) <= alignof(Eigen::Vector3f)); + static_assert(sizeof(rerun::Position3D) == sizeof(Eigen::Vector3f)); + static_assert(alignof(rerun::Position3D) <= alignof(Eigen::Vector3f)); - ComponentBatch operator()(const std::vector& container - ) { - return ComponentBatch::borrow( - reinterpret_cast(container.data()), + ComponentBatch operator()(const std::vector& container) { + return ComponentBatch::borrow( + reinterpret_cast(container.data()), container.size() ); } - ComponentBatch operator()(std::vector&& container) { + ComponentBatch operator()(std::vector&& container) { throw std::runtime_error("Not implemented for temporaries"); } }; // Adapters so we can log an eigen matrix as rerun positions: template <> -struct rerun::ComponentBatchAdapter { +struct rerun::ComponentBatchAdapter { // Sanity check that this is binary compatible. static_assert( - sizeof(components::Position3D) == + sizeof(rerun::Position3D) == sizeof(Eigen::Matrix3Xf::Scalar) * Eigen::Matrix3Xf::RowsAtCompileTime ); - static_assert(alignof(components::Position3D) <= alignof(Eigen::Matrix3Xf)); + static_assert(alignof(rerun::Position3D) <= alignof(Eigen::Matrix3Xf)); - ComponentBatch operator()(const Eigen::Matrix3Xf& matrix) { - return ComponentBatch::borrow( - reinterpret_cast(matrix.data()), + ComponentBatch operator()(const Eigen::Matrix3Xf& matrix) { + return ComponentBatch::borrow( + reinterpret_cast(matrix.data()), matrix.cols() ); } - ComponentBatch operator()(std::vector&& container) { + ComponentBatch operator()(std::vector&& container) { throw std::runtime_error("Not implemented for temporaries"); } };