Beispiel #1
0
        //构造交点
        private void button4_Click(object sender, EventArgs e)
        {
            delFeature("point");
            IPoint[] points = new IPoint[4];
            for (int i = 0; i < 4; i++)
            {
                points[i] = new PointClass();
            }

            points[0].PutCoords(15, 10);
            points[1].PutCoords(20, 60);
            points[2].PutCoords(40, 60);
            points[3].PutCoords(45, 10);
            addFeature("point", points[0]);
            addFeature("point", points[1]);
            addFeature("point", points[2]);
            addFeature("point", points[3]);
            //构造Bezier曲线
            IBezierCurveGEN bezierCurve = new BezierCurveClass();

            bezierCurve.PutCoords(ref points);
            IPoint centerPoint = new PointClass();

            centerPoint.PutCoords(30, 30);
            IPoint fromPoint = new PointClass();

            fromPoint.PutCoords(10, 10);
            IPoint toPoint = new PointClass();

            toPoint.PutCoords(50, 10);
            //构造圆弧
            IConstructCircularArc circularArcConstruction = new CircularArcClass();

            circularArcConstruction.ConstructThreePoints(fromPoint, centerPoint, toPoint, false);


            object param0;
            object param1;
            object isTangentPoint;
            IConstructMultipoint constructMultipoint = new MultipointClass();

            constructMultipoint.ConstructIntersection(circularArcConstruction as ISegment, esriSegmentExtension.esriNoExtension, bezierCurve as ISegment, esriSegmentExtension.esriNoExtension, out param0, out param1, out isTangentPoint);
            IMultipoint      multipoint      = constructMultipoint as IMultipoint;
            IPointCollection pointCollection = multipoint as IPointCollection;

            for (int i = 0; i < pointCollection.PointCount; i++)
            {
                addFeature("point", pointCollection.get_Point(i));
            }

            axMapControl1.Extent = multipoint.Envelope;
            axMapControl1.Refresh();
        }