// @generated by tools/generate_api_shims.py; do not edit by hand.
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::must_use_candidate)]
#![allow(clippy::all, clippy::pedantic, dead_code, unused_variables)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

/// C# type: `T:LibreMetaverse.Rendering.MeshFoundry`.
///
/// Native Rust mapping of C# `LibreMetaverse.Rendering.MeshFoundry` using decision
/// `native_metacrate_type`. See the [pinned C# source](https://github.com/cinderblocks/libremetaverse/tree/2aa70bb68513b39795da5d13c88f31b86e85a3ba).
pub use crate::mesh_foundry::MeshFoundry;
impl MeshFoundry {
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.#ctor`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.MeshFoundry()`.
    /// Mapping contract: ownership `none`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn new() -> Result<Self, crate::Error> {
        /* reviewed native compatibility body */
        Self::native_new()
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedMesh(LibreMetaverse.Primitive,LibreMetaverse.Rendering.DetailLevel)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.FacetedMesh LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedMesh(LibreMetaverse.Primitive prim, LibreMetaverse.Rendering.DetailLevel lod)`.
    /// Mapping contract: ownership `shared_self,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn generate_faceted_mesh(
        &self,
        prim: libremetaverse::Primitive,
        lod: libremetaverse::rendering::DetailLevel,
    ) -> Result<Option<libremetaverse::rendering::FacetedMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_faceted_mesh(prim, lod)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedMeshMesh(LibreMetaverse.Primitive,System.Byte[])`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.FacetedMesh LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedMeshMesh(LibreMetaverse.Primitive prim, System.Byte[] meshData)`.
    /// Mapping contract: ownership `shared_self,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `descriptive_overload_name`; kind `method`.
    pub fn generate_faceted_mesh_mesh_with_primitive_bytes(
        &self,
        prim: libremetaverse::Primitive,
        mesh_data: Vec<u8>,
    ) -> Result<Option<libremetaverse::rendering::FacetedMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_faceted_mesh_mesh(
            prim,
            mesh_data,
            libremetaverse::rendering::DetailLevel::Highest,
        )
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedMeshMesh(LibreMetaverse.Primitive,System.Byte[],LibreMetaverse.Rendering.DetailLevel)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.FacetedMesh LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedMeshMesh(LibreMetaverse.Primitive prim, System.Byte[] meshData, LibreMetaverse.Rendering.DetailLevel lod)`.
    /// Mapping contract: ownership `shared_self,owned,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `descriptive_overload_name`; kind `method`.
    pub fn generate_faceted_mesh_mesh_with_primitive_bytes_detail_level(
        &self,
        prim: libremetaverse::Primitive,
        mesh_data: Vec<u8>,
        lod: libremetaverse::rendering::DetailLevel,
    ) -> Result<Option<libremetaverse::rendering::FacetedMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_faceted_mesh_mesh(prim, mesh_data, lod)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedSculptMesh(LibreMetaverse.Primitive,LibreMetaverse.Imaging.ManagedImage,LibreMetaverse.Rendering.DetailLevel)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.FacetedMesh LibreMetaverse.Rendering.MeshFoundry.GenerateFacetedSculptMesh(LibreMetaverse.Primitive prim, LibreMetaverse.Imaging.ManagedImage sculptTexture, LibreMetaverse.Rendering.DetailLevel lod)`.
    /// Mapping contract: ownership `shared_self,owned,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn generate_faceted_sculpt_mesh(
        &self,
        prim: libremetaverse::Primitive,
        sculpt_texture: libremetaverse_imaging::ManagedImage,
        lod: libremetaverse::rendering::DetailLevel,
    ) -> Result<Option<libremetaverse::rendering::FacetedMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_faceted_sculpt_mesh(prim, sculpt_texture, lod)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateSimpleMesh(LibreMetaverse.Primitive,LibreMetaverse.Rendering.DetailLevel)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.SimpleMesh LibreMetaverse.Rendering.MeshFoundry.GenerateSimpleMesh(LibreMetaverse.Primitive prim, LibreMetaverse.Rendering.DetailLevel lod)`.
    /// Mapping contract: ownership `shared_self,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn generate_simple_mesh(
        &self,
        prim: libremetaverse::Primitive,
        lod: libremetaverse::rendering::DetailLevel,
    ) -> Result<Option<libremetaverse::rendering::SimpleMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_simple_mesh(prim, lod, false)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateSimpleMeshWithNormals(LibreMetaverse.Primitive,LibreMetaverse.Rendering.DetailLevel)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.SimpleMesh LibreMetaverse.Rendering.MeshFoundry.GenerateSimpleMeshWithNormals(LibreMetaverse.Primitive prim, LibreMetaverse.Rendering.DetailLevel lod)`.
    /// Mapping contract: ownership `shared_self,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn generate_simple_mesh_with_normals(
        &self,
        prim: libremetaverse::Primitive,
        lod: libremetaverse::rendering::DetailLevel,
    ) -> Result<Option<libremetaverse::rendering::SimpleMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_simple_mesh(prim, lod, true)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.GenerateSimpleSculptMesh(LibreMetaverse.Primitive,LibreMetaverse.Imaging.ManagedImage,LibreMetaverse.Rendering.DetailLevel)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.SimpleMesh LibreMetaverse.Rendering.MeshFoundry.GenerateSimpleSculptMesh(LibreMetaverse.Primitive prim, LibreMetaverse.Imaging.ManagedImage sculptTexture, LibreMetaverse.Rendering.DetailLevel lod)`.
    /// Mapping contract: ownership `shared_self,owned,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn generate_simple_sculpt_mesh(
        &self,
        prim: libremetaverse::Primitive,
        sculpt_texture: libremetaverse_imaging::ManagedImage,
        lod: libremetaverse::rendering::DetailLevel,
    ) -> Result<Option<libremetaverse::rendering::SimpleMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_generate_simple_sculpt_mesh(prim, sculpt_texture, lod)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.MeshSubMeshAsConvexHulls(LibreMetaverse.Primitive,System.Byte[])`.
    ///
    /// C# signature: `System.Collections.Generic.List<System.Collections.Generic.List<LibreMetaverse.Vector3>> LibreMetaverse.Rendering.MeshFoundry.MeshSubMeshAsConvexHulls(LibreMetaverse.Primitive prim, System.Byte[] compressedMeshData)`.
    /// Mapping contract: ownership `shared_self,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `descriptive_overload_name`; kind `method`.
    pub fn mesh_sub_mesh_as_convex_hulls_with_primitive_bytes(
        &self,
        prim: libremetaverse::Primitive,
        compressed_mesh_data: Vec<u8>,
    ) -> Result<Vec<Vec<libremetaverse_types::Vector3>>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_mesh_sub_mesh_as_convex_hulls(prim, compressed_mesh_data, None)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.MeshSubMeshAsConvexHulls(LibreMetaverse.Primitive,System.Byte[],System.Collections.Generic.List{LibreMetaverse.Vector3}@)`.
    ///
    /// C# signature: `System.Collections.Generic.List<System.Collections.Generic.List<LibreMetaverse.Vector3>> LibreMetaverse.Rendering.MeshFoundry.MeshSubMeshAsConvexHulls(LibreMetaverse.Primitive prim, System.Byte[] compressedMeshData, out System.Collections.Generic.List<LibreMetaverse.Vector3>& boundingHull)`.
    /// Mapping contract: ownership `shared_self,owned,owned,mutable_output`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `descriptive_overload_name`; kind `method`.
    pub fn mesh_sub_mesh_as_convex_hulls_with_primitive_bytes_list(
        &self,
        prim: libremetaverse::Primitive,
        compressed_mesh_data: Vec<u8>,
        bounding_hull: &mut Vec<libremetaverse_types::Vector3>,
    ) -> Result<Vec<Vec<libremetaverse_types::Vector3>>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_mesh_sub_mesh_as_convex_hulls(prim, compressed_mesh_data, Some(bounding_hull))
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.MeshSubMeshAsSimpleMesh(LibreMetaverse.Primitive,System.Byte[])`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.SimpleMesh LibreMetaverse.Rendering.MeshFoundry.MeshSubMeshAsSimpleMesh(LibreMetaverse.Primitive prim, System.Byte[] compressedMeshData)`.
    /// Mapping contract: ownership `shared_self,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn mesh_sub_mesh_as_simple_mesh(
        &self,
        prim: libremetaverse::Primitive,
        compressed_mesh_data: Vec<u8>,
    ) -> Result<Option<libremetaverse::rendering::SimpleMesh>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_mesh_sub_mesh_as_simple_mesh(prim, compressed_mesh_data)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.TerrainMesh(System.Single[0:,0:],System.Single,System.Single,System.Single,System.Single)`.
    ///
    /// C# signature: `LibreMetaverse.Rendering.Face LibreMetaverse.Rendering.MeshFoundry.TerrainMesh(System.Single[,] zMap, System.Single xBegin, System.Single xEnd, System.Single yBegin, System.Single yEnd)`.
    /// Mapping contract: ownership `shared_self,owned,owned,owned,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn terrain_mesh(
        &self,
        z_map: Vec<Vec<f32>>,
        x_begin: f32,
        x_end: f32,
        y_begin: f32,
        y_end: f32,
    ) -> Result<libremetaverse::rendering::Face, crate::Error> {
        /* reviewed native compatibility body */
        self.native_terrain_mesh(z_map, x_begin, x_end, y_begin, y_end)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.TransformTexCoords(System.Collections.Generic.List{LibreMetaverse.Rendering.Vertex},LibreMetaverse.Vector3,LibreMetaverse.Primitive.TextureEntryFace,LibreMetaverse.Vector3)`.
    ///
    /// C# signature: `System.Void LibreMetaverse.Rendering.MeshFoundry.TransformTexCoords(System.Collections.Generic.List<LibreMetaverse.Rendering.Vertex> vertices, LibreMetaverse.Vector3 center, LibreMetaverse.Primitive.TextureEntryFace teFace, LibreMetaverse.Vector3 primScale)`.
    /// Mapping contract: ownership `shared_self,mutable_borrow,owned,owned,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn transform_tex_coords(
        &self,
        vertices: &mut Vec<libremetaverse::rendering::Vertex>,
        center: libremetaverse_types::Vector3,
        te_face: libremetaverse::PrimitiveTextureEntryFace,
        prim_scale: libremetaverse_types::Vector3,
    ) -> Result<(), crate::Error> {
        /* reviewed native compatibility body */
        self.native_transform_tex_coords(vertices, center, te_face, prim_scale)
    }
    /// C# member: `M:LibreMetaverse.Rendering.MeshFoundry.UnpackMesh(System.Byte[])`.
    ///
    /// C# signature: `LibreMetaverse.StructuredData.OSDMap LibreMetaverse.Rendering.MeshFoundry.UnpackMesh(System.Byte[] assetData)`.
    /// Mapping contract: ownership `shared_self,owned`; async `sync`;
    /// errors `Result<_, crate::Error>`; overload `direct_snake_case`; kind `method`.
    pub fn unpack_mesh(
        &self,
        asset_data: Vec<u8>,
    ) -> Result<Option<libremetaverse_structured_data::OSDMap>, crate::Error> {
        /* reviewed native compatibility body */
        self.native_unpack_mesh(asset_data).map(Some)
    }
}
