Started obj port and gave up.

This commit is contained in:
zy4n
2025-03-31 21:41:24 +02:00
parent 0acfe36118
commit bc065bc657
20 changed files with 422 additions and 593 deletions

View File

@@ -16,19 +16,18 @@
assets::kitti_parser::parser_context::parser_context(
const pose_list_id_lookup& pose_list_lookup,
const pose_list_store& pose_list_store,
store_type& m_store,
std::mutex& m_store_mutex
store_type& m_store
) :
m_pose_list_lookup{ &pose_list_lookup },
m_pose_list_store{ &pose_list_store },
m_store{ &m_store },
m_store_mutex{ &m_store_mutex }
m_store{ &m_store }
{
m_buffer.positions().reserve(8192);
m_buffer.normals().reserve(8192);
m_buffer.colors().reserve(8192);
constexpr auto expected_vertex_count = 8192;
m_buffer.positions().reserve(expected_vertex_count);
m_buffer.normals().reserve(expected_vertex_count);
m_buffer.colors().reserve(expected_vertex_count);
}
5
void assets::kitti_parser::parser_context::reset()
{
m_buffer.clear();
@@ -73,7 +72,7 @@ void assets::kitti_parser::parser_context::operator()(lookup_type::const_pointer
return;
}
clear();
reset();
if (const auto e = load_point_file(filename, m_buffer))
{
@@ -83,10 +82,7 @@ void assets::kitti_parser::parser_context::operator()(lookup_type::const_pointer
transform_point_cloud(m_buffer.positions(), pose);
{
auto lock = std::lock_guard{ *m_store_mutex };
m_store->insert(id, m_buffer);
}
m_store->insert(id, m_buffer);
}
ztu::result<std::filesystem::path> assets::kitti_parser::parent_directory(
@@ -147,8 +143,6 @@ std::error_code assets::kitti_parser::load(
m_path_buffer.clear();
lookups.point_clouds.by_extension(".bin", m_path_buffer);
auto store_mutex = std::mutex{};
std::for_each(
std::execution::parallel_unsequenced_policy{},
m_path_buffer.begin(),
@@ -156,8 +150,7 @@ std::error_code assets::kitti_parser::load(
parser_context{
lookups.pose_lists,
stores.pose_lists,
stores.point_clouds,
store_mutex
stores.point_clouds
}
);