MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ load() [2/2]

std::optional< Kakshya::VolumeData > MayaFlux::IO::VolumeReader::load ( const std::string &  filepath,
const VolumeReadOptions options = {} 
)

Load every selected grid from a file in one call.

Opens, reads, extracts and closes in a single synchronous operation. The output lattice is the union of active bboxes; see the class docs.

Parameters
filepathPath to the .vdb file.
optionsGrid selection.
Returns
Populated VolumeData, or nullopt on failure; check get_last_error().

Definition at line 122 of file VolumeReader.cpp.

124{
125 if (!open(filepath)) {
126 return std::nullopt;
127 }
128 auto result = extract(options);
129 close();
130 return result;
131}
bool open(const std::string &filepath, FileReadOptions options=FileReadOptions::ALL) override
Open a file for reading.
void close() override
Close the currently open file.
std::optional< Kakshya::VolumeData > extract(const VolumeReadOptions &options={}) const
Extract every selected grid after open() has already been called.

References close(), extract(), and open().

Referenced by MayaFlux::IO::IOManager::load_volume().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: