예제 #1
0
파일: MainForm.cs 프로젝트: batuZ/Samples
        private void btnIntersection_Click(object sender, EventArgs e)
        {
            ITopologicalOperator2D topoOpera = geo1 as ITopologicalOperator2D;

            if (topoOpera == null)
            {
                return;
            }
            IGeometry geo = topoOpera.Intersection2D(geo2);

            draw(geo);
        }
예제 #2
0
파일: MainForm.cs 프로젝트: batuZ/Samples
        private void btnIntersection_Click(object sender, EventArgs e)
        {
            IGeometry p = polygonList[0];

            for (int i = 0; i < polygonList.Count - 1; i++)
            {
                IPolygon piplus = polygonList[i + 1];
                ITopologicalOperator2D topoOpera = p as ITopologicalOperator2D;
                if (topoOpera == null)
                {
                    continue;
                }
                p = topoOpera.Intersection2D(piplus);
            }
            if (p.GeometryType == gviGeometryType.gviGeometryMultiPolygon)
            {
                _multiPolygon = p as IMultiPolygon;
            }
            else if (p.GeometryType == gviGeometryType.gviGeometryPolygon)
            {
                _multiPolygon.AddGeometry(p);
            }
        }