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


C# PolylineClass.ReverseOrientation方法代码示例

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


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

示例1: GetLRParallelPnts

        /// <summary>
        /// 构造平行线的边点坐标串
        /// </summary>
        /// <params name="centerPts">中心线的坐标集合</params>
        /// <params name="lineSpace">巷道宽度的一半</params>
        /// <params name="flag">方向</params>
        /// <returns>返回平行线的坐标串</returns>
        public List<IPoint> GetLRParallelPnts(List<IPoint> centerPts, double lineSpace, int flag)
        {
            List<IPoint> results = new List<IPoint>();
            IPolyline plin = new PolylineClass();//获得的平行线

            IPolyline centerline = new PolylineClass();
            centerline.SpatialReference = Global.spatialref;
            IPointCollection centerlinecols = centerline as IPointCollection;
            for (int i = 0; i < centerPts.Count; i++)
            {
                centerlinecols.AddPoint(centerPts[i]);
            }
            //ITopologicalOperator4 top4 = centerline as ITopologicalOperator4;
            //if (!top4.IsSimple)
            //    top4.Simplify();
            if (flag == 1)//右侧
                plin = ConstructOffset(centerline, lineSpace / 2);
            else//左侧
            {
                plin = ConstructOffset(centerline, -lineSpace / 2);
                plin.ReverseOrientation();//将左侧平行线的点方向逆转
            }
            IPointCollection plincols = plin as IPointCollection;
            for (int i = 0; i < plincols.PointCount; i++)
            {
                IPoint pnttmp = new PointClass();
                pnttmp.PutCoords(plincols.get_Point(i).X, plincols.get_Point(i).Y);
                pnttmp.Z = 0;
                results.Add(pnttmp);
            }

            //for (int i = 0; i < centerPts.Count - 1; i++)
            //{
            //    IPoint offsetPoint = new PointClass();//偏移坐标A
            //    IPoint movePoint = new PointClass();//移动点的坐标
            //    IPoint downPoint = new PointClass();
            //    downPoint = centerPts[i];
            //    movePoint = centerPts[i + 1];
            //    double angle = PointToAngle(downPoint, movePoint);
            //    if (centerPts.Count >= 1)
            //    {
            //        if (flag == 1)//右平行线
            //        {
            //            offsetPoint.X = (float)(Math.Cos(angle + 0.5f * Math.PI) * lineSpace + downPoint.X);
            //            offsetPoint.Y = (float)(Math.Sin(angle + 0.5f * Math.PI) * lineSpace + downPoint.Y);
            //            offsetPoint.Z = downPoint.Z;
            //        }
            //        if (flag == 0)//左平行线
            //        {
            //            offsetPoint.X = (float)(Math.Cos(angle - 0.5f * Math.PI) * lineSpace + downPoint.X);
            //            offsetPoint.Y = (float)(Math.Sin(angle - 0.5f * Math.PI) * lineSpace + downPoint.Y);
            //            offsetPoint.Z = downPoint.Z;
            //        }
            //        Point pt = new PointClass();
            //        pt.X = movePoint.X + offsetPoint.X - downPoint.X;
            //        pt.Y = movePoint.Y + offsetPoint.Y - downPoint.Y;
            //        pt.Z = downPoint.Z;
            //        results.Add(offsetPoint);
            //        results.Add(pt);
            //    }
            //}
            return results;
        }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:70,代码来源:ConstructParallel.cs


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