Lagrange
Loading...
Searching...
No Matches
DeserializeOptions Struct Reference

Options for deserialization (load/deserialize functions). More...

#include <lagrange/serialization/types.h>

Public Attributes

bool allow_scene_conversion = false
 Allow converting between meshes and scenes during deserialization.
 
bool allow_type_cast = false
 Allow casting scalar and index types during deserialization.
 
bool quiet = false
 Suppress warnings during deserialization.
 

Detailed Description

Options for deserialization (load/deserialize functions).

Member Data Documentation

◆ allow_scene_conversion

bool allow_scene_conversion = false

Allow converting between meshes and scenes during deserialization.

When enabled, deserializing a buffer that contains a different type than requested will attempt automatic conversion. For example, calling deserialize_mesh() on a buffer containing a Scene will convert the scene to a single mesh using scene_to_mesh().

When disabled (the default), a type mismatch will throw an exception.

Note
A warning is logged when a conversion is performed, unless quiet is set.

◆ allow_type_cast

bool allow_type_cast = false

Allow casting scalar and index types during deserialization.

When enabled, deserializing a buffer serialized with different Scalar/Index types than the requested template parameters will cast the data accordingly. For example, deserializing a mesh saved as <float, uint32_t> into a SurfaceMesh<double, uint64_t>.

This applies to all contained meshes, including those inside Scene and SimpleScene objects. For SimpleScene, instance transforms are also cast to the target scalar type.

When disabled (the default), a scalar/index type mismatch will throw an exception.

Note
A warning is logged when a type mismatch is detected and casting is performed, unless quiet is set. If the stored types already match the requested types, no casting or warning occurs regardless of this setting.

◆ quiet

bool quiet = false

Suppress warnings during deserialization.

When set to true, suppresses the warnings that are normally logged when scene conversion (via allow_scene_conversion) or type casting (via allow_type_cast) is performed.


The documentation for this struct was generated from the following file: