ModelVisitor

Trait ModelVisitor 

Source
pub trait ModelVisitor {
Show 14 methods // Provided methods fn on_start_model(&mut self) -> Result<()> { ... } fn on_end_model(&mut self) -> Result<()> { ... } fn on_metadata(&mut self, _name: &str, _value: &str) -> Result<()> { ... } fn on_start_resources(&mut self) -> Result<()> { ... } fn on_end_resources(&mut self) -> Result<()> { ... } fn on_base_materials( &mut self, _id: ResourceId, _group: &BaseMaterialsGroup, ) -> Result<()> { ... } fn on_color_group( &mut self, _id: ResourceId, _group: &ColorGroup, ) -> Result<()> { ... } fn on_start_mesh(&mut self, _id: ResourceId) -> Result<()> { ... } fn on_vertex(&mut self, _x: f32, _y: f32, _z: f32) -> Result<()> { ... } fn on_triangle(&mut self, _v1: u32, _v2: u32, _v3: u32) -> Result<()> { ... } fn on_end_mesh(&mut self) -> Result<()> { ... } fn on_start_build(&mut self) -> Result<()> { ... } fn on_end_build(&mut self) -> Result<()> { ... } fn on_build_item(&mut self, _item: &BuildItem) -> Result<()> { ... }
}
Expand description

Trait for receiving callback events during streaming parsing of a 3MF model. This allows for processing massive files with constant memory usage.

Provided Methods§

Source

fn on_start_model(&mut self) -> Result<()>

Called when the model element starts.

Source

fn on_end_model(&mut self) -> Result<()>

Called when the model element ends.

Source

fn on_metadata(&mut self, _name: &str, _value: &str) -> Result<()>

Called upon encountering metadata.

Source

fn on_start_resources(&mut self) -> Result<()>

Called when the resources container starts.

Source

fn on_end_resources(&mut self) -> Result<()>

Called when the resources container ends.

Source

fn on_base_materials( &mut self, _id: ResourceId, _group: &BaseMaterialsGroup, ) -> Result<()>

Called when a BaseMaterials group is fully parsed. Since these are typically small, we pass the full object.

Source

fn on_color_group(&mut self, _id: ResourceId, _group: &ColorGroup) -> Result<()>

Called when a ColorGroup is fully parsed.

Source

fn on_start_mesh(&mut self, _id: ResourceId) -> Result<()>

Called when a Mesh object starts.

Source

fn on_vertex(&mut self, _x: f32, _y: f32, _z: f32) -> Result<()>

Called for each vertex in the current mesh.

Source

fn on_triangle(&mut self, _v1: u32, _v2: u32, _v3: u32) -> Result<()>

Called for each triangle in the current mesh.

Source

fn on_end_mesh(&mut self) -> Result<()>

Called when a Mesh object ends.

Source

fn on_start_build(&mut self) -> Result<()>

Called when the build container starts.

Source

fn on_end_build(&mut self) -> Result<()>

Called when the build container ends.

Source

fn on_build_item(&mut self, _item: &BuildItem) -> Result<()>

Called for each item in the build.

Implementors§