initial commit
This commit is contained in:
58
include/assets/data_loaders/generic/generic_3dtk_loader.hpp
Normal file
58
include/assets/data_loaders/generic/generic_3dtk_loader.hpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <charconv>
|
||||
#include <string_view>
|
||||
|
||||
#include "glm/mat4x4.hpp"
|
||||
#include "util/result.hpp"
|
||||
#include "util/string_list.hpp"
|
||||
#include "assets/prefetch_queue.hpp"
|
||||
|
||||
#include "assets/dynamic_read_buffers/dynamic_point_cloud_buffer.hpp"
|
||||
#include "assets/dynamic_data_stores/dynamic_point_cloud_store.hpp"
|
||||
#include "assets/prefetch_lookup.hpp"
|
||||
|
||||
|
||||
|
||||
template<bool Normal, bool Color, bool Reflectance>
|
||||
struct generic_3dtk_loader
|
||||
{
|
||||
[[nodiscard]] static std::error_code prefetch(
|
||||
const ztu::string_list& filenames,
|
||||
prefetch_queue& queue
|
||||
);
|
||||
|
||||
[[nodiscard]] static std::error_code load(
|
||||
dynamic_point_cloud_buffer& buffer,
|
||||
const file_dir_list& paths,
|
||||
prefetch_lookup& asset_lookup,
|
||||
dynamic_point_cloud_store& store,
|
||||
bool pedantic = false
|
||||
);
|
||||
|
||||
protected:
|
||||
|
||||
[[nodiscard]] static ztu::result<pose_prefetch_lookup::index_type> parse_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<components::point_cloud_vertex::position::value_type> points,
|
||||
const glm::mat4& pose
|
||||
);
|
||||
|
||||
private:
|
||||
std::error_code read_point_file(
|
||||
const std::filesystem::path& filename,
|
||||
dynamic_point_cloud_buffer& point_cloud
|
||||
);
|
||||
};
|
||||
|
||||
#define INCLUDE_GENERIC_3DTK_LOADER_IMPLEMENTATION
|
||||
#include "assets/data_loaders/generic/generic_3dtk_loader.ipp"
|
||||
#undef INCLUDE_GENERIC_3DTK_LOADER_IMPLEMENTATION
|
||||
Reference in New Issue
Block a user