pub struct E57Writer<T: Read + Write + Seek> { /* private fields */ }Expand description
Main interface for creating and writing E57 files.
Implementations§
source§impl<T: Write + Read + Seek> E57Writer<T>
impl<T: Write + Read + Seek> E57Writer<T>
sourcepub fn new(writer: T, guid: &str) -> Result<Self>
pub fn new(writer: T, guid: &str) -> Result<Self>
Creates a new E57 generator from a writer that must also implement Read and Seek.
File::create() will not work as input because it only opens the file for writing.
Most typical use cases should prefer E57Writer::from_file() over this constructor.
sourcepub fn set_coordinate_metadata(&mut self, value: Option<String>)
pub fn set_coordinate_metadata(&mut self, value: Option<String>)
Set optional coordinate metadata string (empty by default).
sourcepub fn set_creation(&mut self, value: Option<DateTime>)
pub fn set_creation(&mut self, value: Option<DateTime>)
Set optional creation date time (empty by default).
sourcepub fn add_pointcloud(
&mut self,
guid: &str,
prototype: Vec<Record>,
) -> Result<PointCloudWriter<'_, T>>
pub fn add_pointcloud( &mut self, guid: &str, prototype: Vec<Record>, ) -> Result<PointCloudWriter<'_, T>>
Creates a new writer for adding a new point cloud to the E57 file.
sourcepub fn add_blob(&mut self, reader: &mut dyn Read) -> Result<Blob>
pub fn add_blob(&mut self, reader: &mut dyn Read) -> Result<Blob>
Adds a new binary data section to the E57 file. This feature is only required for custom data and extensions!
sourcepub fn add_image(&mut self, guid: &str) -> Result<ImageWriter<'_, T>>
pub fn add_image(&mut self, guid: &str) -> Result<ImageWriter<'_, T>>
Creates a new image writer for adding an image to the E57 file.
sourcepub fn register_extension(&mut self, extension: Extension) -> Result<()>
pub fn register_extension(&mut self, extension: Extension) -> Result<()>
Registers a new E57 extension used by this file.
sourcepub fn finalize(&mut self) -> Result<()>
pub fn finalize(&mut self) -> Result<()>
Needs to be called after adding all point clouds and images.
This will generate and write the XML metadata to finalize and complete the E57 file. Without calling this method before dropping the E57 file will be incomplete and invalid!
sourcepub fn finalize_customized_xml(
&mut self,
transformer: impl Fn(String) -> Result<String>,
) -> Result<()>
pub fn finalize_customized_xml( &mut self, transformer: impl Fn(String) -> Result<String>, ) -> Result<()>
Same as finalize() but with additional XML transformation step.
Allows customizing the XML data before its written into the E57 file. This is required for adding E57 extension data to the XML. The transformer receives an XML string and must return an XML string. The client is responsible for parsing, modifying and serializing th XML again in a non-destructive way. The E57 library will not validate the XML string before writing it into the E57 file! If the transformer fails, the finalization is aborted and any error is forwarded.