コード例 #1
0
        /// <summary>
        /// Handles <see cref="MaterialImportPackage.AddMaterial"/> as a wrapper around <seealso cref="MaterialData.AddRenderMaterial"/>
        /// </summary>
        /// <param name="mat"></param>
        private void AddMaterialHandler(RenderMaterial mat)
        {
            // get data access
            var materialData = new MaterialData(_doc);

            // add a different type of preview geometry, depending on the settings
            switch (RhinoBridgePlugIn.Instance.PreviewType)
            {
            case Settings.TexturePreviewGeometryType.Sphere:
                materialData.AddTexturedSphere(mat);
                break;

            case Settings.TexturePreviewGeometryType.Plane:
                materialData.AddTexturedPlane(mat);
                break;

            case Settings.TexturePreviewGeometryType.Cube:
                materialData.AddTexturedCube(mat);
                break;

            case Settings.TexturePreviewGeometryType.None:
                materialData.AddRenderMaterial(mat);
                break;
            }
        }