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§
Sourcefn on_start_model(&mut self) -> Result<()>
fn on_start_model(&mut self) -> Result<()>
Called when the model element starts.
Sourcefn on_end_model(&mut self) -> Result<()>
fn on_end_model(&mut self) -> Result<()>
Called when the model element ends.
Sourcefn on_metadata(&mut self, _name: &str, _value: &str) -> Result<()>
fn on_metadata(&mut self, _name: &str, _value: &str) -> Result<()>
Called upon encountering metadata.
Sourcefn on_start_resources(&mut self) -> Result<()>
fn on_start_resources(&mut self) -> Result<()>
Called when the resources container starts.
Sourcefn on_end_resources(&mut self) -> Result<()>
fn on_end_resources(&mut self) -> Result<()>
Called when the resources container ends.
Sourcefn on_base_materials(
&mut self,
_id: ResourceId,
_group: &BaseMaterialsGroup,
) -> Result<()>
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.
Sourcefn on_color_group(&mut self, _id: ResourceId, _group: &ColorGroup) -> Result<()>
fn on_color_group(&mut self, _id: ResourceId, _group: &ColorGroup) -> Result<()>
Called when a ColorGroup is fully parsed.
Sourcefn on_start_mesh(&mut self, _id: ResourceId) -> Result<()>
fn on_start_mesh(&mut self, _id: ResourceId) -> Result<()>
Called when a Mesh object starts.
Sourcefn on_vertex(&mut self, _x: f32, _y: f32, _z: f32) -> Result<()>
fn on_vertex(&mut self, _x: f32, _y: f32, _z: f32) -> Result<()>
Called for each vertex in the current mesh.
Sourcefn on_triangle(&mut self, _v1: u32, _v2: u32, _v3: u32) -> Result<()>
fn on_triangle(&mut self, _v1: u32, _v2: u32, _v3: u32) -> Result<()>
Called for each triangle in the current mesh.
Sourcefn on_end_mesh(&mut self) -> Result<()>
fn on_end_mesh(&mut self) -> Result<()>
Called when a Mesh object ends.
Sourcefn on_start_build(&mut self) -> Result<()>
fn on_start_build(&mut self) -> Result<()>
Called when the build container starts.
Sourcefn on_end_build(&mut self) -> Result<()>
fn on_end_build(&mut self) -> Result<()>
Called when the build container ends.
Sourcefn on_build_item(&mut self, _item: &BuildItem) -> Result<()>
fn on_build_item(&mut self, _item: &BuildItem) -> Result<()>
Called for each item in the build.