当前位置: 首页>>代码示例>>C#>>正文


C# Surface.Identity方法代码示例

本文整理汇总了C#中Surface.Identity方法的典型用法代码示例。如果您正苦于以下问题:C# Surface.Identity方法的具体用法?C# Surface.Identity怎么用?C# Surface.Identity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Surface的用法示例。


在下文中一共展示了Surface.Identity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OutPutSurfaceType

        /// <summary>
        /// 输出基础面类型
        /// </summary>
        /// <param name="typeOfSurface"></param>
        private static void OutPutSurfaceType(Surface surface) {
            if (surface == null) {
                return;
            }

            switch (surface.Identity()) {
                case (int)swSurfaceTypes_e.PLANE_TYPE:
                    Debug.Print("平面:");
                    Debug.Print("\t中心点:[" + (double)surface.PlaneParams[0] + "," + (double)surface.PlaneParams[1] + "," +
                        (double)surface.PlaneParams[2] + "]");
                    Debug.Print("\t法向量:[" + (double)surface.PlaneParams[3] + "," + (double)surface.PlaneParams[4] + "," +
                        (double)surface.PlaneParams[5] + "]");
                    break;
                case (int)swSurfaceTypes_e.SPHERE_TYPE:
                    Debug.Print("球面:");
                    Debug.Print("\t圆心:[" + (double)surface.SphereParams[0] + "," + (double)surface.SphereParams[1] + "," +
                        (double)surface.SphereParams[2] + "]");
                    Debug.Print("\t半径:[" + (double)surface.SphereParams[3] + "]");
                    break;
                case (int)swSurfaceTypes_e.CYLINDER_TYPE:
                    Debug.Print("圆柱面:");
                    Debug.Print("\t中心点:[" + (double)surface.CylinderParams[0] + "," + (double)surface.CylinderParams[1] + "," +
                        (double)surface.CylinderParams[2] + "]");
                    Debug.Print("\t旋转:[" + (double)surface.CylinderParams[3] + "," + (double)surface.CylinderParams[4] + "," +
                        (double)surface.CylinderParams[5] + "]");
                    Debug.Print("\t半径:[" + (double)surface.CylinderParams[6] + "]");
                    break;
                case (int)swSurfaceTypes_e.CONE_TYPE:
                    Debug.Print("圆锥面:");
                    Debug.Print("\t中心点:[" + (double)surface.ConeParams[0] + "," + (double)surface.ConeParams[1] + "," +
                        (double)surface.ConeParams[2] + "]");
                    Debug.Print("\t旋转:[" + (double)surface.ConeParams[3] + "," + (double)surface.ConeParams[4] + "," +
                        (double)surface.ConeParams[5] + "]");
                    Debug.Print("\t半径:[" + (double)surface.ConeParams[6] + "]");
                    Debug.Print("\t半角弧度:[" + (double)surface.ConeParams[7] + "]");
                    break;
                case (int)swSurfaceTypes_e.TORUS_TYPE:
                    Debug.Print("圆环面:");
                    Debug.Print("\t中心点:[" + (double)surface.TorusParams[0] + "," + (double)surface.TorusParams[1] + "," +
                        (double)surface.TorusParams[2] + "]");
                    Debug.Print("\t旋转:[" + (double)surface.TorusParams[3] + "," + (double)surface.TorusParams[4] + "," +
                        (double)surface.TorusParams[5] + "]");
                    Debug.Print("\t大圆半径:[" + (double)surface.TorusParams[6] + "]");
                    Debug.Print("\t小圆半径:[" + (double)surface.TorusParams[7] + "]");
                    break;
                case (int)swSurfaceTypes_e.SREV_TYPE:
                    Debug.Print("旋转曲面:");
                    break;
                case (int)swSurfaceTypes_e.BLEND_TYPE:
                    Debug.Print("混合曲面:");
                    break;
                case (int)swSurfaceTypes_e.BSURF_TYPE:
                    Debug.Print("平滑曲面:");
                    break;
                case (int)swSurfaceTypes_e.EXTRU_TYPE:
                    Debug.Print("挤压曲面:");
                    break;
                case (int)swSurfaceTypes_e.OFFSET_TYPE:
                    Debug.Print("偏移曲面:");
                    break;
            }
        }
开发者ID:flair2005,项目名称:dlnuvaar,代码行数:66,代码来源:Program.cs

示例2: CreateSWSurface

        /// <summary>
        /// 创建面的几何信息对象
        /// </summary>
        /// <param name="surface"></param>
        /// <returns></returns>
        private static SWSurface CreateSWSurface(Surface surface) {
            if (surface == null)
                return null;

            int i = 0;
            SWSurface swSurface = new SWSurface();

            switch (surface.Identity()) {
                case (int)swSurfaceTypes_e.PLANE_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.PLANE;
                    for (i = 0; i < 6; ++i) {
                        swSurface.Params[i] = surface.PlaneParams[i];
                    }
                    break;
                case (int)swSurfaceTypes_e.SPHERE_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.SPHERE;
                    for (i = 0; i < 4; ++i) {
                        swSurface.Params[i] = surface.SphereParams[i];
                    }
                    break;
                case (int)swSurfaceTypes_e.CYLINDER_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.CYLINDER;
                    for (i = 0; i < 7; ++i) {
                        swSurface.Params[i] = surface.CylinderParams[i];
                    }
                    break;
                case (int)swSurfaceTypes_e.CONE_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.CONE;
                    for (i = 0; i < 8; ++i) {
                        swSurface.Params[i] = surface.ConeParams[i];
                    }
                    break;
                case (int)swSurfaceTypes_e.TORUS_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.TORUS;
                    for (i = 0; i < 8; ++i) {
                        swSurface.Params[i] = surface.TorusParams[i];
                    }
                    break;
                case (int)swSurfaceTypes_e.SREV_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.SREV;
                    break;
                case (int)swSurfaceTypes_e.BLEND_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.BLEND;
                    break;
                case (int)swSurfaceTypes_e.BSURF_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.BSURF;
                    break;
                case (int)swSurfaceTypes_e.EXTRU_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.EXTRU;
                    break;
                case (int)swSurfaceTypes_e.OFFSET_TYPE:
                    swSurface.SurfaceType = SWSurfaceType.OFFSET;
                    break;
            }

            return swSurface;
        }
开发者ID:flair2005,项目名称:dlnuvaar,代码行数:62,代码来源:Program.cs


注:本文中的Surface.Identity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。