fixes
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "assets/prefetch_queue.hpp"
|
||||
#include "assets/components/material_components.hpp"
|
||||
#include "assets/dynamic_read_buffers/dynamic_material_library_buffer.hpp"
|
||||
#include "assets/dynamic_data_stores/dynamic_material_library_store.hpp"
|
||||
#include "assets/prefetch_lookups/material_library_prefetch_lookup.hpp"
|
||||
#include "generic/base_dynamic_loader.hpp"
|
||||
|
||||
#include "assets/data_loaders/mtl_loader.hpp"
|
||||
#include "util/string_list.hpp"
|
||||
|
||||
class dynamic_material_library_loader : public base_dynamic_loader<
|
||||
components::material::flags,
|
||||
mtl_loader
|
||||
> {
|
||||
public:
|
||||
|
||||
[[nodiscard]] std::error_code prefetch(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] std::error_code load(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
dynamic_material_library_store& store,
|
||||
dynamic_material_store& material_store,
|
||||
material_library_prefetch_lookup& id_lookup,
|
||||
bool pedantic = false
|
||||
);
|
||||
|
||||
private:
|
||||
dynamic_material_library_buffer m_buffer{};
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "assets/prefetch_queue.hpp"
|
||||
#include "assets/components/material_components.hpp"
|
||||
#include "generic/base_dynamic_loader.hpp"
|
||||
|
||||
#include "assets/data_loaders/mtl_loader.hpp"
|
||||
#include "assets/dynamic_data_stores/dynamic_material_store.hpp"
|
||||
#include "assets/prefetch_lookups/material_prefetch_lookup.hpp"
|
||||
#include "util/string_list.hpp"
|
||||
|
||||
class dynamic_material_loader : public base_dynamic_loader<
|
||||
components::material::flags
|
||||
// TODO no loaders
|
||||
> {
|
||||
public:
|
||||
|
||||
[[nodiscard]] std::error_code prefetch(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] std::error_code load(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
dynamic_material_store& store,
|
||||
material_prefetch_lookup& id_lookup,
|
||||
bool pedantic = false
|
||||
);
|
||||
|
||||
private:
|
||||
dynamic_material_buffer m_buffer{};
|
||||
};
|
||||
35
include/assets/dynamic_data_loaders/dynamic_mesh_loader.hpp
Normal file
35
include/assets/dynamic_data_loaders/dynamic_mesh_loader.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "generic/base_dynamic_loader.hpp"
|
||||
#include <filesystem>
|
||||
|
||||
#include "assets/dynamic_read_buffers/dynamic_mesh_buffer.hpp"
|
||||
#include "assets/dynamic_data_stores/dynamic_mesh_store.hpp"
|
||||
#include "assets/data_loaders/obj_loader.hpp"
|
||||
#include "assets/data_loaders/stl_loader.hpp"
|
||||
#include "assets/prefetch_lookups/mesh_prefetch_lookup.hpp"
|
||||
|
||||
|
||||
class dynamic_mesh_loader : public base_dynamic_loader<
|
||||
components::mesh_vertex::flags,
|
||||
obj_loader,
|
||||
stl_loader
|
||||
> {
|
||||
public:
|
||||
[[nodiscard]] std::error_code prefetch(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] std::error_code load(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
dynamic_mesh_store& store,
|
||||
mesh_prefetch_lookup& id_lookup,
|
||||
bool pedantic = false
|
||||
);
|
||||
|
||||
private:
|
||||
dynamic_mesh_buffer m_buffer{};
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <system_error>
|
||||
|
||||
#include "assets/prefetch_queue.hpp"
|
||||
#include "generic/base_dynamic_loader.hpp"
|
||||
#include "assets/dynamic_read_buffers/dynamic_point_cloud_buffer.hpp"
|
||||
#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
|
||||
|
||||
#include "assets/data_loaders/kitti_loader.hpp"
|
||||
#include "assets/data_loaders/uos_loader.hpp"
|
||||
#include "assets/data_loaders/uos_normal_loader.hpp"
|
||||
#include "assets/data_loaders/uos_rgb_loader.hpp"
|
||||
#include "assets/data_loaders/uosr_loader.hpp"
|
||||
#include "assets/prefetch_lookups/point_cloud_prefetch_lookup.hpp"
|
||||
|
||||
#include "util/string_list.hpp"
|
||||
|
||||
class dynamic_point_cloud_loader : public base_dynamic_loader<
|
||||
components::point_cloud_vertex::flags,
|
||||
kitti_loader,
|
||||
uos_loader,
|
||||
uos_normal_loader,
|
||||
uos_rgb_loader,
|
||||
uos_loader,
|
||||
uosr_loader
|
||||
> {
|
||||
public:
|
||||
[[nodiscard]] std::error_code prefetch(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] std::error_code load(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
dynamic_point_cloud_store& store,
|
||||
point_cloud_prefetch_lookup& id_lookup,
|
||||
bool pedantic = false
|
||||
);
|
||||
|
||||
private:
|
||||
dynamic_point_cloud_buffer m_buffer{};
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <filesystem>
|
||||
#include "util/uix.hpp"
|
||||
#include "util/id_type.hpp"
|
||||
#include "util/string_lookup.hpp"
|
||||
#include "util/result.hpp"
|
||||
|
||||
#include "assets/components/texture_components.hpp"
|
||||
#include "assets/dynamic_read_buffers/dynamic_texture_buffer.hpp"
|
||||
#include "assets/dynamic_data_stores/dynamic_texture_store.hpp"
|
||||
#include "assets/dynamic_data_loader_ctx.hpp"
|
||||
#include "assets/prefetch_queue.hpp"
|
||||
#include "assets/prefetch_lookups/texture_prefetch_lookup.hpp"
|
||||
#include "util/string_list.hpp"
|
||||
|
||||
/*
|
||||
* [[nodiscard]] std::error_code prefetch(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] std::error_code load(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
dynamic_point_cloud_store& store,
|
||||
point_cloud_prefetch_lookup& id_lookup,
|
||||
bool pedantic = false
|
||||
);
|
||||
*/
|
||||
|
||||
class dynamic_texture_loader
|
||||
{
|
||||
public:
|
||||
using loader_id_type = ztu::id_type_for<dynamic_texture_loader, ztu::u8>;
|
||||
|
||||
explicit dynamic_texture_loader(components::texture::flags enabled_components);
|
||||
|
||||
[[nodiscard]] std::optional<loader_id_type> find_loader(const std::string_view& name);
|
||||
|
||||
[[nodiscard]] std::error_code prefetch(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] std::error_code load(
|
||||
loader_id_type loader_id,
|
||||
const ztu::string_list& directories,
|
||||
dynamic_texture_store& store,
|
||||
texture_prefetch_lookup& id_lookup,
|
||||
bool pedantic = false
|
||||
);
|
||||
|
||||
private:
|
||||
ztu::string_lookup<loader_id_type> m_loader_id_lookup{};
|
||||
components::texture::flags m_enabled_components{ components::texture::flags::none };
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <tuple>
|
||||
|
||||
#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
|
||||
#include "util/uix.hpp"
|
||||
#include "util/string_lookup.hpp"
|
||||
#include "util/id_type.hpp"
|
||||
#include "util/result.hpp"
|
||||
|
||||
template<typename C, class... Loaders>
|
||||
class base_dynamic_loader
|
||||
{
|
||||
public:
|
||||
using loader_id_type = ztu::id_type_for<base_dynamic_loader, ztu::u32>;
|
||||
|
||||
explicit base_dynamic_loader(C enabled_components);
|
||||
|
||||
[[nodiscard]] std::optional<loader_id_type> find_loader(std::string_view name);
|
||||
|
||||
[[nodiscard]] static consteval std::optional<loader_id_type> find_loader_static(std::string_view name);
|
||||
|
||||
template<loader_id_type ID>
|
||||
auto& get_loader();
|
||||
|
||||
protected:
|
||||
|
||||
template<typename F>
|
||||
ztu::result<dynamic_point_cloud_store::id_type> invoke_with_matching_loader(loader_id_type loader_id, F&& f);
|
||||
|
||||
std::tuple<Loaders...> m_loaders{};
|
||||
ztu::string_lookup<loader_id_type> m_loader_id_lookup{};
|
||||
C m_enabled_components{ 0 };
|
||||
};
|
||||
|
||||
#define INCLUDE_BASE_DYNAMIC_LOADER_IMPLEMENTATION
|
||||
#include "assets/dynamic_data_loaders/generic/base_dynamic_loader.ipp"
|
||||
#undef INCLUDE_BASE_DYNAMIC_LOADER_IMPLEMENTATION
|
||||
Reference in New Issue
Block a user