Skip to content

Commit 8e11fe7

Browse files
authored
Merge pull request #7 from rerun-io/emilk/code-cleanup
Slight code cleanup
2 parents 0977050 + 98cfc94 commit 8e11fe7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/main.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#include <iostream>
2+
13
#include <eigen3/Eigen/Core>
24
#include <eigen3/Eigen/Dense>
3-
#include <iostream>
45
#include <opencv2/core.hpp>
56
#include <opencv2/highgui.hpp>
67
#include <opencv2/imgcodecs.hpp>
@@ -9,42 +10,41 @@
910

1011
// Adapters so we can log eigen vectors as rerun positions:
1112
template <>
12-
struct rerun::ComponentBatchAdapter<rerun::components::Position3D, std::vector<Eigen::Vector3f>> {
13+
struct rerun::ComponentBatchAdapter<rerun::Position3D, std::vector<Eigen::Vector3f>> {
1314
// 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));
1617

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()),
2121
container.size()
2222
);
2323
}
2424

25-
ComponentBatch<components::Position3D> operator()(std::vector<Eigen::Vector3f>&& container) {
25+
ComponentBatch<rerun::Position3D> operator()(std::vector<Eigen::Vector3f>&& container) {
2626
throw std::runtime_error("Not implemented for temporaries");
2727
}
2828
};
2929

3030
// Adapters so we can log an eigen matrix as rerun positions:
3131
template <>
32-
struct rerun::ComponentBatchAdapter<rerun::components::Position3D, Eigen::Matrix3Xf> {
32+
struct rerun::ComponentBatchAdapter<rerun::Position3D, Eigen::Matrix3Xf> {
3333
// Sanity check that this is binary compatible.
3434
static_assert(
35-
sizeof(components::Position3D) ==
35+
sizeof(rerun::Position3D) ==
3636
sizeof(Eigen::Matrix3Xf::Scalar) * Eigen::Matrix3Xf::RowsAtCompileTime
3737
);
38-
static_assert(alignof(components::Position3D) <= alignof(Eigen::Matrix3Xf));
38+
static_assert(alignof(rerun::Position3D) <= alignof(Eigen::Matrix3Xf));
3939

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()),
4343
matrix.cols()
4444
);
4545
}
4646

47-
ComponentBatch<components::Position3D> operator()(std::vector<Eigen::Matrix3Xf>&& container) {
47+
ComponentBatch<rerun::Position3D> operator()(std::vector<Eigen::Matrix3Xf>&& container) {
4848
throw std::runtime_error("Not implemented for temporaries");
4949
}
5050
};

0 commit comments

Comments
 (0)