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


C# ILine.QueryPoint方法代码示例

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


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

示例1: CreateDual

        private static bool CreateDual(ref IApplication app, ref  IEditor editor, IFeature pointFeature, IFeature pointFeature2, ILine distanceLine,
                                                          IFeatureLayer matchLineFLayer,
                                                          IFeatureLayer targetLineFLayer, IEditTemplate targetLineEditTemplate,
                                                          List<pointAlongSettings> pointAlongLayers,
                                                          bool deleteExistingLines, bool startAtMain, bool squareDualLines,
                                                         FromToField[] fromToPairs, double doglegDistance, bool DistAsPercent, double tolerenceForDelete, bool store, bool SearchOnLayer, int searchDistance, double angle, bool checkSelection)
        {
            IPoint point = null;
            IPoint point2 = null;
            IPoint turnPoint = null;
            IPoint toPoint = null;
            IPoint joinPoint = null;
            IPoint sqPoint1 = null;
            IPoint sqPoint2 = null;
            IPoint midPoint = null;
            IFeature lineFeature = null;
            IPolyline polyline = null;
            IFeature pLineFeat = null;
            ICurve mainCurve = null;
            try
            {
                point = (IPoint)pointFeature.Shape;
                point2 = (IPoint)pointFeature2.Shape;

                //Determine mid point
                midPoint = new PointClass();
                distanceLine.QueryPoint(esriSegmentExtension.esriNoExtension, 0.5, true, midPoint);

                // Get closest main to midpoint (if a single main was not selected)

                lineFeature = Globals.GetClosestFeature(midPoint, matchLineFLayer, Convert.ToDouble(searchDistance), SearchOnLayer, checkSelection);

                if (lineFeature != null)
                {
                    //Delete any existing lateral lines at these locations
                    if (deleteExistingLines)
                    {
                        DeleteExistingFeatures(pointFeature, targetLineFLayer, pointAlongLayers, tolerenceForDelete);
                        DeleteExistingFeatures(pointFeature2, targetLineFLayer, pointAlongLayers, tolerenceForDelete);
                    }

                    //Determine To and Turn Points (and possible square points)
                    mainCurve = lineFeature.ShapeCopy as ICurve;
                    CreateToAndTurnPointsDual(mainCurve, midPoint, distanceLine, out toPoint, out turnPoint,
                                                            out joinPoint, out  sqPoint1, out  sqPoint2, doglegDistance, DistAsPercent,
                                                            squareDualLines, tolerenceForDelete);

                    //Create the new base line (possibly hooked)

                    polyline = Globals.CreatePolylineFromPointsNewTurn(joinPoint, turnPoint, toPoint, ref matchLineFLayer, ref lineFeature, SearchOnLayer, angle,editor.Map.SpatialReference);

                    //If requested, store pipe id in the point
                    StorePipeInfoPointFeature(lineFeature, pointFeature, fromToPairs, store);
                    StorePipeInfoPointFeature(lineFeature, pointFeature2, fromToPairs, store);

                    if (polyline.Length != 0.0)
                    {
                        if (startAtMain)
                            polyline.ReverseOrientation();

                        if (targetLineEditTemplate != null)
                        {
                            pLineFeat = Globals.CreateFeature(polyline as IGeometry, targetLineEditTemplate, editor, app, false, false, true);
                        }
                        else
                        {
                            pLineFeat = Globals.CreateFeature(polyline as IGeometry, targetLineFLayer, editor, app, false, false, true);
                        }

                        pLineFeat.Store();

                        // Globals.SetFlowDirection(pLineFeat, targetLineFLayer, ((IMxDocument)app.Document).FocusMap);
                        if (pointAlongLayers != null)
                        {
                            foreach (pointAlongSettings pPointAlongLayer in pointAlongLayers)
                            {
                                if (pPointAlongLayer.PolygonIntersectLayer != null)
                                    Globals.AddPointAlongLineWithIntersect(ref app, ref editor, polyline as ICurve, pPointAlongLayer.PointAlongLayer, pPointAlongLayer.PointAlongDistance, pPointAlongLayer.DistanceIsPercent, pPointAlongLayer.PointAlongEditTemplate, pPointAlongLayer.PolygonIntersectLayer, pPointAlongLayer.PolygonIntersectSide);

                                else
                                    Globals.AddPointAlongLine(ref app, ref editor, polyline as ICurve, pPointAlongLayer.PointAlongLayer, pPointAlongLayer.PointAlongDistance, pPointAlongLayer.DistanceIsPercent, pPointAlongLayer.PointAlongEditTemplate);

                            }
                        }

                        if (squareDualLines)
                        {
                            //Create Arm 1
                            polyline = Globals.CreatePolylineFromPoints(point, sqPoint1, joinPoint);
                            if (startAtMain)
                                polyline.ReverseOrientation();

                            if (targetLineEditTemplate != null)
                            {
                                pLineFeat = Globals.CreateFeature(polyline as IGeometry, targetLineEditTemplate, editor, app, false, false, true);
                            }
                            else
                            {
                                pLineFeat = Globals.CreateFeature(polyline as IGeometry, targetLineFLayer, editor, app, false, false, true);
                            }
//.........这里部分代码省略.........
开发者ID:tuyndv,项目名称:local-government-desktop-addins,代码行数:101,代码来源:ConstructionTools.cs


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