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


C# IPolyline.SimplifyNetwork方法代码示例

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


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

示例1: MakeHatchesEndsOnly

        public static void MakeHatchesEndsOnly(IPolyline pPL, bool Ends, IPolyline pMajor, IPolyline pMinor, double dHatchLen, double dTxtInterval, double dHatchOffset)
        {
            //���������
            ITopologicalOperator pTopo = pPL as ITopologicalOperator;
            pTopo.Simplify();
            //���ǽ��ڶμ����д洢HATCH
            ISegmentCollection pSCMajor = pMajor as ISegmentCollection;
            ISegmentCollection pSCMinor = pMinor as ISegmentCollection;

            //Break the polyline into parts here ... Ideally, there should be one part
            //per route. In cases where there is mSEETARD than one part, and there is no physical
            // separation in the parts, the results can look like they are wrong (i.e. there
            //appears to be text where there should not be).
            IGeometryCollection pGC = pPL as IGeometryCollection;
            int cnt = pGC.GeometryCount - 1;
            object missing = Type.Missing;
            object distances;
            double dist;
            for (int i = 0; i <= pGC.GeometryCount - 1; i++)
            {
                IPath pPath = pGC.get_Geometry(i) as IPath;
                IGeometryCollection pSubPL = new PolylineClass();
                pSubPL.AddGeometry(pPath, ref missing, ref missing);
                IMAware pMAware = pSubPL as IMAware;
                pMAware.MAware = true;
                IMSegmentation pPLM = pSubPL as IMSegmentation;
                double Mmin = pPLM.MMin;
                double Mmax = pPLM.MMax;
                ISegment pSeg = MakeOneHatch(pSubPL as IPolyline, Mmin, Mmin, 1, dTxtInterval, dHatchLen, dHatchOffset);
                if (pSeg.Length >= ((Math.Abs(dHatchLen) * 0.5) + 0.001))
                    pSCMajor.AddSegment(pSeg, ref  missing, ref missing);
                else
                    pSCMinor.AddSegment(pSeg, ref missing, ref missing);
                distances = pPLM.GetDistancesAtM(false, Mmax);
                IArray pArray = (IArray)distances;
                for (int j = 0; j <= pArray.Count - 1; j++)
                {
                    dist = (double)pArray.get_Element(j);
                    pSeg = MakeOneHatch(pSubPL as IPolyline, dist, Mmax, 1, dTxtInterval, dHatchLen, dHatchOffset);
                    if (pSeg.Length >= (Math.Abs(dHatchLen) * 0.5) + 0.001)
                    {
                        pSCMajor.AddSegment(pSeg, ref missing, ref missing);
                    }
                    else
                    {
                        pSCMinor.AddSegment(pSeg, ref missing, ref missing);
                    }
                }
            }
            pMajor.SimplifyNetwork();
            pMinor.SimplifyNetwork();
        }
开发者ID:lovelll,项目名称:MyDatapreMenu,代码行数:52,代码来源:UtilityFunction.cs


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