27using TextureResolver = std::function<std::shared_ptr<Core::VKImage>(
const std::string& path)>;
75 [[nodiscard]] std::vector<Kakshya::MeshData> load(
const std::string& filepath);
85 [[nodiscard]] std::vector<Kakshya::MeshData> extract_meshes()
const;
100 [[nodiscard]] std::vector<std::shared_ptr<Buffers::MeshBuffer>>
118 [[nodiscard]] std::shared_ptr<Nodes::Network::MeshNetwork>
125 [[nodiscard]]
bool can_read(
const std::string& filepath)
const override;
127 bool open(
const std::string& filepath,
130 void close()
override;
132 [[nodiscard]]
bool is_open()
const override {
return m_is_open; }
134 [[nodiscard]] std::optional<FileMetadata> get_metadata()
const override;
136 [[nodiscard]] std::vector<FileRegion> get_regions()
const override;
138 std::vector<Kakshya::DataVariant> read_all()
override;
140 std::vector<Kakshya::DataVariant> read_region(
const FileRegion& region)
override;
146 std::shared_ptr<Kakshya::SignalSourceContainer>
create_container()
override;
152 bool load_into_container(
153 std::shared_ptr<Kakshya::SignalSourceContainer> container)
override;
155 [[nodiscard]] std::vector<uint64_t> get_read_position()
const override;
157 bool seek(
const std::vector<uint64_t>&
position)
override;
159 [[nodiscard]] std::vector<std::string> get_supported_extensions()
const override;
163 return typeid(std::vector<uint8_t>);
171 [[nodiscard]] std::string
get_last_error()
const override {
return m_last_error; }
182 bool m_is_open {
false };
187 const void* ai_scene,
188 std::string_view mesh_name,
189 std::string_view material_name)
const;
191 void set_error(std::string msg)
const { m_last_error = std::move(msg); }
Abstract interface for reading various file formats into containers.
std::unique_ptr< Impl > m_impl
std::type_index get_data_type() const override
Get the data type this reader produces.
std::string get_last_error() const override
Get the last error message.
void set_error(std::string msg) const
std::vector< uint64_t > get_dimension_sizes() const override
Get size of each dimension in the file data.
std::type_index get_container_type() const override
Get the container type this reader creates.
bool is_open() const override
Check if a file is currently open.
size_t get_num_dimensions() const override
Get the dimensionality of the file data.
uint64_t get_preferred_chunk_size() const override
Get the preferred chunk size for streaming.
bool supports_streaming() const override
Check if streaming is supported for the current file.
Assimp-backed loader for 3D model files.
FileReadOptions
Generic options for file reading behavior.
std::function< std::shared_ptr< Core::VKImage >(const std::string &path)> TextureResolver
Callable that maps a raw material texture path to a GPU image.
auto create_container(Args &&... args) -> std::shared_ptr< ContainerType >
creates a new container of the specified type
Generic region descriptor for any file type.
Owning CPU-side representation of a loaded or generated mesh.