125 [[nodiscard]] std::optional<Kakshya::VolumeData> load(
143 [[nodiscard]] std::optional<Kakshya::VolumeData> load(
144 const std::string& filepath,
158 [[nodiscard]] std::optional<Kakshya::VolumeData> extract(
168 [[nodiscard]] std::optional<Kakshya::VolumeData> extract(
176 [[nodiscard]]
bool can_read(
const std::string& filepath)
const override;
178 bool open(
const std::string& filepath,
181 void close()
override;
183 [[nodiscard]]
bool is_open()
const override {
return m_is_open; }
185 [[nodiscard]] std::optional<FileMetadata> get_metadata()
const override;
187 [[nodiscard]] std::vector<FileRegion>
get_regions()
const override {
return {}; }
188 std::vector<Kakshya::DataVariant>
read_all()
override {
return {}; }
195 std::shared_ptr<Kakshya::SignalSourceContainer>
create_container()
override;
201 bool load_into_container(
202 std::shared_ptr<Kakshya::SignalSourceContainer> container)
override;
205 bool seek(
const std::vector<uint64_t>& )
override {
return true; }
210 return typeid(std::vector<uint8_t>);
218 [[nodiscard]] std::string
get_last_error()
const override {
return m_last_error; }
228 bool m_is_open {
false };
240 [[nodiscard]] std::optional<Kakshya::VolumeData> materialize(
241 const std::vector<size_t>& indices,
245 void set_error(std::string msg)
const { m_last_error = std::move(msg); }
Abstract interface for reading various file formats into containers.
bool is_open() const override
Check if a file is currently open.
std::vector< FileRegion > get_regions() const override
Get semantic regions from the file.
void set_error(std::string msg) const
std::vector< std::string > get_supported_extensions() const override
Get supported file extensions for this reader.
bool seek(const std::vector< uint64_t > &) override
Seek to a specific position in the file.
std::unique_ptr< Detail::VDBArchive > m_archive
bool supports_streaming() const override
Check if streaming is supported for the current file.
std::vector< Kakshya::DataVariant > read_region(const FileRegion &) override
Read a specific region of data.
size_t get_num_dimensions() const override
Get the dimensionality of the file data.
std::type_index get_data_type() const override
Get the data type this reader produces.
std::vector< uint64_t > get_read_position() const override
Get current read position in primary dimension.
uint64_t get_preferred_chunk_size() const override
Get the preferred chunk size for streaming.
std::string get_last_error() const override
Get the last error message.
std::type_index get_container_type() const override
Get the container type this reader creates.
std::vector< uint64_t > get_dimension_sizes() const override
Get size of each dimension in the file data.
std::vector< Kakshya::DataVariant > read_all() override
Read all data from the file into memory.
tinyvdb-backed loader for volumetric grid files.
FileReadOptions
Generic options for file reading behavior.
auto create_container(Args &&... args) -> std::shared_ptr< ContainerType >
creates a new container of the specified type
Generic region descriptor for any file type.
std::vector< std::string > field_names
Grids to load, matched by name.
Configuration for volume reading.
A regular subdivision of an AABB3D into a cell count per axis.