|
| 1 | +#include <iostream> |
| 2 | + |
1 | 3 | #include <eigen3/Eigen/Core>
|
2 | 4 | #include <eigen3/Eigen/Dense>
|
3 |
| -#include <iostream> |
4 | 5 | #include <opencv2/core.hpp>
|
5 | 6 | #include <opencv2/highgui.hpp>
|
6 | 7 | #include <opencv2/imgcodecs.hpp>
|
|
9 | 10 |
|
10 | 11 | // Adapters so we can log eigen vectors as rerun positions:
|
11 | 12 | template <>
|
12 |
| -struct rerun::ComponentBatchAdapter<rerun::components::Position3D, std::vector<Eigen::Vector3f>> { |
| 13 | +struct rerun::ComponentBatchAdapter<rerun::Position3D, std::vector<Eigen::Vector3f>> { |
13 | 14 | // Sanity check that this is binary compatible.
|
14 |
| - static_assert(sizeof(components::Position3D) == sizeof(Eigen::Vector3f)); |
15 |
| - static_assert(alignof(components::Position3D) <= alignof(Eigen::Vector3f)); |
| 15 | + static_assert(sizeof(rerun::Position3D) == sizeof(Eigen::Vector3f)); |
| 16 | + static_assert(alignof(rerun::Position3D) <= alignof(Eigen::Vector3f)); |
16 | 17 |
|
17 |
| - ComponentBatch<components::Position3D> operator()(const std::vector<Eigen::Vector3f>& container |
18 |
| - ) { |
19 |
| - return ComponentBatch<components::Position3D>::borrow( |
20 |
| - reinterpret_cast<const components::Position3D*>(container.data()), |
| 18 | + ComponentBatch<rerun::Position3D> operator()(const std::vector<Eigen::Vector3f>& container) { |
| 19 | + return ComponentBatch<rerun::Position3D>::borrow( |
| 20 | + reinterpret_cast<const rerun::Position3D*>(container.data()), |
21 | 21 | container.size()
|
22 | 22 | );
|
23 | 23 | }
|
24 | 24 |
|
25 |
| - ComponentBatch<components::Position3D> operator()(std::vector<Eigen::Vector3f>&& container) { |
| 25 | + ComponentBatch<rerun::Position3D> operator()(std::vector<Eigen::Vector3f>&& container) { |
26 | 26 | throw std::runtime_error("Not implemented for temporaries");
|
27 | 27 | }
|
28 | 28 | };
|
29 | 29 |
|
30 | 30 | // Adapters so we can log an eigen matrix as rerun positions:
|
31 | 31 | template <>
|
32 |
| -struct rerun::ComponentBatchAdapter<rerun::components::Position3D, Eigen::Matrix3Xf> { |
| 32 | +struct rerun::ComponentBatchAdapter<rerun::Position3D, Eigen::Matrix3Xf> { |
33 | 33 | // Sanity check that this is binary compatible.
|
34 | 34 | static_assert(
|
35 |
| - sizeof(components::Position3D) == |
| 35 | + sizeof(rerun::Position3D) == |
36 | 36 | sizeof(Eigen::Matrix3Xf::Scalar) * Eigen::Matrix3Xf::RowsAtCompileTime
|
37 | 37 | );
|
38 |
| - static_assert(alignof(components::Position3D) <= alignof(Eigen::Matrix3Xf)); |
| 38 | + static_assert(alignof(rerun::Position3D) <= alignof(Eigen::Matrix3Xf)); |
39 | 39 |
|
40 |
| - ComponentBatch<components::Position3D> operator()(const Eigen::Matrix3Xf& matrix) { |
41 |
| - return ComponentBatch<components::Position3D>::borrow( |
42 |
| - reinterpret_cast<const components::Position3D*>(matrix.data()), |
| 40 | + ComponentBatch<rerun::Position3D> operator()(const Eigen::Matrix3Xf& matrix) { |
| 41 | + return ComponentBatch<rerun::Position3D>::borrow( |
| 42 | + reinterpret_cast<const rerun::Position3D*>(matrix.data()), |
43 | 43 | matrix.cols()
|
44 | 44 | );
|
45 | 45 | }
|
46 | 46 |
|
47 |
| - ComponentBatch<components::Position3D> operator()(std::vector<Eigen::Matrix3Xf>&& container) { |
| 47 | + ComponentBatch<rerun::Position3D> operator()(std::vector<Eigen::Matrix3Xf>&& container) { |
48 | 48 | throw std::runtime_error("Not implemented for temporaries");
|
49 | 49 | }
|
50 | 50 | };
|
|
0 commit comments