OpenVDB 13.2.0
Loading...
Searching...
No Matches
ReadOptions Struct Reference

Global read configuration passed to every codec during deserialization. More...

#include <openvdb/io/Codec.h>

Public Attributes

BBoxd clipBBox = BBoxd()
ReadMode readMode = ReadMode::Original
std::unordered_map< std::string, ReadTypedOptions::Ptr > typeData

Detailed Description

Global read configuration passed to every codec during deserialization.

An instance of this struct is threaded through all codec readTopology() and readBuffers() calls so that site-wide policy (clipping, read mode) and any type-specific overrides are available in a single place.

Clipping
When clipBBox is non-empty (i.e. !clipBBox.empty()), codecs should restrict the voxel data they load to the region that intersects that world-space bounding box. An empty bbox (the default) means no clipping is applied.
Read mode
readMode controls the granularity and on-the-fly conversion applied during deserialization. The default, ReadMode::Original, loads both topology and value buffers without modification. ReadMode::Half, ReadMode::Bool, and ReadMode::Mask request in-place type conversion as data is read. ReadMode::TopologyOnly skips value buffers entirely, which can be significantly faster when only the active-voxel mask is needed. ReadMode::MetadataOnly skips both topology and value buffers, reading only grid metadata and transform.
Per-type options
typeData allows callers to attach codec-specific configuration for individual grid types. Entries are keyed by the grid type string (e.g. "Vec3SGrid") and hold a ReadTypedOptions-derived object. Codecs retrieve their entry via ReadTypedOptions::cast<T>().

Member Data Documentation

◆ clipBBox

BBoxd clipBBox = BBoxd()

World-space bounding box used to spatially clip the read. An empty bbox (the default) disables clipping.

◆ readMode

Controls which portions of each grid are deserialized. Defaults to ReadMode::Original (full topology + value buffers).

◆ typeData

std::unordered_map<std::string, ReadTypedOptions::Ptr> typeData

Optional per-grid-type codec configuration, keyed by grid type string. Values are ReadTypedOptions subclass instances; use ReadTypedOptions::cast<T>() to retrieve the concrete type.