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


C# IPolyline.GetPoints方法代码示例

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


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

示例1: ProjectBoreholes

        public static ProjectBoreholeResult ProjectBoreholes(List<Tuple<Borehole, IMapPoint>> input,
            IPolyline projLine, GeoProjSettings geoProjSettings)
        {
            if (input == null || projLine == null)
                return null;

            // remove the boreholes that do not have geology infos,
            // so called 'empty' boreholes
            //
            input.RemoveAll(x =>
                x.Item1.Geologies == null || x.Item1.Geologies.Count == 0
                || x.Item1.Top == x.Item1.Base);

            // sort the boreholes according to their projected position on the projection line
            //
            List<ProjectedBorehole> sortedList = new List<ProjectedBorehole>();
            foreach (var tuple in input)
            {
                Borehole bh = tuple.Item1;
                IMapPoint p = tuple.Item2;

                double distance = 0;
                IMapPoint prjPnt = null;
                bool canProject = GeomUtil.ProjectPointToPolyline(p,
                    projLine.GetPoints(), ref distance, ref prjPnt);
                if (geoProjSettings.clipInProjectionLine == true && canProject == false)
                    continue;

                distance /= geoProjSettings.scale;
                distance += geoProjSettings.xOffset;
                ProjectedBorehole prjBorehole = new ProjectedBorehole();
                prjBorehole.Borehole = bh;
                prjBorehole.Distance = distance;
                prjBorehole.Pos = p;
                sortedList.Add(prjBorehole);
            }
            if (sortedList.Count == 0)
                return null;

            sortedList.Sort((x, y) => x.Distance.CompareTo(y.Distance));

            // extend borholes to same depth
            //
            if (geoProjSettings.extendBorehole)
            {
                ExtendBoreholes(input);
            }

            // perform the projection
            //
            ProjectBoreholeResult result = new ProjectBoreholeResult();

            List<STGraphic> stResults = new List<STGraphic>();
            ProjectedBorehole previousBh = null;
            foreach (ProjectedBorehole projectedBorehole in sortedList)
            {
                Borehole bh = projectedBorehole.Borehole;

                // draw strata
                if (geoProjSettings.drawStratum)
                {
                    if (previousBh == null)
                    {
                        previousBh = projectedBorehole;
                    }
                    else
                    {
                        List<STGraphic> stGraphics = LinkBorehole(
                            previousBh.Borehole, projectedBorehole.Borehole,
                            previousBh.Distance, projectedBorehole.Distance,
                            geoProjSettings.zScale);
                        previousBh = projectedBorehole;
                        stResults.AddRange(stGraphics);
                    }
                }

                // draw borehole
                if (geoProjSettings.drawBorehole)
                {
                    IGraphicCollection gc = ProjectBorehole(bh,
                        projectedBorehole.Distance, geoProjSettings.zScale);
                    result.bhGraphics[bh.id] = gc;
                }
            }

            // transfrom strata results
            foreach (STGraphic stGraphic in stResults)
            {
                int id = stGraphic.StratumID;
                if (result.stGraphics.ContainsKey(id))
                {
                    IGraphicCollection gc = result.stGraphics[id];
                    gc.Add(stGraphic.Graphic);
                }
                else
                {
                    IGraphicCollection gc = NewGraphicCollection();
                    gc.Add(stGraphic.Graphic);
                    result.stGraphics[id] = gc;
                }
//.........这里部分代码省略.........
开发者ID:iS3-Project,项目名称:iS3,代码行数:101,代码来源:SimpleProfileAnalysis.cs


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