private void place() { foreach (Village village in villageList) { PlaceManager placeManager = new PlaceManager(village.commonHouse, new List<House>(village.houseList), mapControl); placeManager.makeArea(GisUtil.ConvertIPolygonElementToIPolygon(village.polygonElement)); if (placeManager.splitArea(GisUtil.ConvertILineElementToIPolyline(village.innerRoad.lineElement))) { placeManager.place(); for (int i = 0; i < placeManager.drawnHouseList.Count; i++) { HouseManager houseManager = placeManager.drawnHouseList[i]; ArrayList housePolygonArrayList = houseManager.makeHousePolygon(); GisUtil.drawPolygon(houseManager.makeHousePolygon()[0] as IPolygon, mapControl, GisUtil.RandomRgbColor()); foreach (IGeometry geom in housePolygonArrayList[1] as List<IGeometry>) { GisUtil.drawPolygon(geom as IPolygon, mapControl, GisUtil.RandomRgbColor()); } } Ut.M("摆放完成"); } } }
private void place() { foreach (Village village in villageList) { PlaceManager placeManager = new PlaceManager(village.commonHouse, new List<House>(village.houseList), mapControl); placeManager.makeArea(GisUtil.ConvertIPolygonElementToIPolygon(village.polygonElement)); if (placeManager.splitArea(GisUtil.ConvertILineElementToIPolyline(village.innerRoad.lineElement))) { placeManager.place(); for (int i = 0; i < placeManager.drawnHouseList.Count; i++) { HouseManager houseManager = placeManager.drawnHouseList[i]; ArrayList housePolygonArrayList = houseManager.makeHousePolygon(); GisUtil.drawPolygon(houseManager.makeHousePolygon()[0] as IPolygon, mapControl, GisUtil.RandomRgbColor()); foreach (IGeometry geom in housePolygonArrayList[1] as List<IGeometry>) { GisUtil.drawPolygon(geom as IPolygon, mapControl, GisUtil.RandomRgbColor()); } } string path = App.TEMP_PATH + "\\" + "outerground.shp"; placeManager.saveOuterGround(path); path = App.TEMP_PATH + "\\centerground.shp"; placeManager.saveCenterGround(path); path = App.TEMP_PATH + "\\result.shp"; placeManager.saveHouse(path); path = App.TEMP_PATH + "\\innerroad.shp"; placeManager.saveInnerRoad(path); path = App.TEMP_PATH + "\\road.shp"; placeManager.saveRoad(path); Ut.M("摆放完成"); } } }