Finally refactored all stores!

This commit is contained in:
zy4n
2025-04-02 17:45:41 +02:00
parent 27977c1738
commit 835c645da4
11 changed files with 469 additions and 648 deletions

View File

@@ -13,7 +13,7 @@
#include "assets/data/point_cloud_data.hpp"
#include "assets/data_stores/point_cloud_store.hpp"
namespace assets
namespace assets::detail
{
template<bool Normal, bool Color, bool Reflectance>
@@ -47,41 +47,27 @@ protected:
protected:
void reset();
z3d::vertex_index find_or_push_vertex(const component_indices& vertex_comp_indices);
[[nodiscard]] std::optional<texture_id> fetch_texture_id(
const std::filesystem::path& mtl_dir,
std::string_view filename,
std::string_view texture_type_name
);
private:
path_id_lookups* m_id_lookups;
data_stores* m_stores;
data_type m_mesh{};
std::vector<mesh_vertex_components::position> m_position_buffer{};
std::vector<mesh_vertex_components::normal> m_normal_buffer{};
std::vector<mesh_vertex_components::tex_coord> m_tex_coord_buffer{};
std::unordered_map<component_indices, z3d::vertex_index> m_vertex_comp_indices_to_vertex_index{};
data_type m_point_cloud{};
std::filesystem::path m_last_pose_path{};
pose_list_view m_last_pose_list{};
};
[[nodiscard]] static ztu::result<pose_prefetch_lookup::index_type> parse_index(
[[nodiscard]] static ztu::result<std::size_t> parse_scan_index(
std::string_view filename
);
ztu::result<std::pair<ztu::u32, std::chars_format>> analyze_component_format(
std::string_view line
);
void transform_point_cloud(
std::span<point_cloud_vertex_components::position::value_type> points,
const glm::mat4& pose
);
private:
std::error_code read_point_file(
protected:
[[nodiscard]] static std::error_code parse_file(
const std::filesystem::path& filename,
dynamic_point_cloud_buffer& point_cloud
data_type& point_cloud
);
static void transform_point_cloud(
std::span<point_cloud_vertex_components::position> points,
const pose_data& pose
);
private: