public void init(int programID, AxMapControl mc, AxToolbarControl tc, MainWindow mw) { inited = true; program = new Program(); program.id = programID; program.select(); mapControl = mc; toolbarControl = tc; mainWindow = mw; mainRoadList = program.getAllRelatedMainRoad(); if (mainRoadList == null) mainRoadList = new ObservableCollection<MainRoad>(); foreach (MainRoad mainRoad in mainRoadList) { GisUtil.DrawPolylineElement(mainRoad.lineElement, mapControl); } valid = isValid(); dirty = false; mapControlMouseDown = null; MainRoadListBox.ItemsSource = mainRoadList; }
public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of, MainWindow mw) { inited = true; if (program == null) program = new Program(); program.id = programID; program.select(); if (project == null) project = new Project(); project.id = program.projectID; project.select(); NetSizeUserControl.init(program.id); ConditionUserControl.init(program.id); mapControl = mc; onFinish = of; mainWindow = mw; mapControlMouseDown = null; //在初始化时就要对valid进行判断. Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { valid = true; onFinish(true); IFeatureClass resultFeatureClass; if ((resultFeatureClass = GisUtil.getFeatureClass(System.IO.Path.GetDirectoryName(project.path), "评价结果.shp")) != null) { IFeatureLayer resultFeatureLayer = new FeatureLayerClass(); resultFeatureLayer.FeatureClass = resultFeatureClass; mapControl.AddLayer(resultFeatureLayer); } else { SiteSelector siteSelector = new SiteSelector(mapControl, program.id); siteSelector.startSelectSite(); } } }); }); t.Start(); }
public void init(int programID, AxMapControl mc, AxToolbarControl tc, MainWindow mw) { if (inited) return; inited = true; program = new Program(); program.id = programID; program.select(); mapControl = mc; toolbarControl = tc; mainWindow = mw; innerRoadList = program.getAllRelatedInnerRoad(); if (innerRoadList == null) { innerRoadList = new ObservableCollection<InnerRoad>(); ObservableCollection<Village> villageList = program.getAllRelatedVillage(); foreach (Village village in villageList) { if (village.inUse) { InnerRoad innerRoad = new InnerRoad(); innerRoad.programID = program.id; innerRoad.villageID = village.id; innerRoadList.Add(innerRoad); } } } else { foreach (InnerRoad innerRoad in innerRoadList) { GisUtil.DrawPolylineElement(innerRoad.lineElement, mapControl); } } valid = isValid(); dirty = false; mapControlMouseDown = null; InnerRoadListBox.ItemsSource = innerRoadList; }
public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of) { inited = true; if (program == null) program = new Program(); program.id = programID; program.select(); if (project == null) project = new Project(); project.id = program.projectID; project.select(); NetSizeUserControl.init(program.id); ConditionUserControl.init(program.id); mapControl = mc; onFinish = of; mapControlMouseDown = null; //在初始化时就要对valid进行判断. Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { valid = true; onFinish(true); SiteSelector siteSelector = new SiteSelector(mapControl, program.id); siteSelector.startSelectSite(); } }); }); t.Start(); }
public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of) { inited = true; onFinish = of; program = new Program(); program.id = programID; program.select(); housePlacerIndexCount = 0; villageList = program.getAllRelatedVillage(); if (villageList == null) { villageList = new ObservableCollection<Village>(); } else { ObservableCollection<Village> inUseVillageList = new ObservableCollection<Village>(); foreach (Village village in villageList) { if (village.inUse) { inUseVillageList.Add(village); CommonHouse commonHouse = village.getRelatedCommonHouse(); if (commonHouse == null) { commonHouse = CommonHouse.GetDefaultCommonHouse(); commonHouse.villageID = village.id; } village.commonHouse = commonHouse; ObservableCollection<House> houseList = village.getAllRelatedHouse(); if (houseList == null) houseList = new ObservableCollection<House>(); else { foreach (House house in houseList) { house.housePlacerListIndex = housePlacerIndexCount++; } } village.houseList = houseList; village.innerRoad = village.getRelatedInnerRoad(); } } villageList = inUseVillageList; } mapControl = mc; dirty = false; prePlaced = false; mapControlMouseDown = null; HousePlacerListBox.ItemsSource = villageList; Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { valid = true; onFinish(true); } }); }); t.Start(); }
public bool onMapControlMouseDown() { IPolyline mainRoadPolyline = mapControl.TrackLine() as IPolyline; ILineElement mainRoadLineElement = new LineElementClass(); IElement element = mainRoadLineElement as IElement; element.Geometry = mainRoadPolyline; mainRoadList[mainRoadList.Count - 1].lineElement = mainRoadLineElement; mainRoadList[mainRoadList.Count - 1].updatePath(); GisUtil.DrawPolylineElement(mainRoadLineElement, mapControl); mapControlMouseDown = null; mainWindow.unmask(); return true; }
private void AddMainRoadButtonClick(object sender, RoutedEventArgs e) { MainRoad mainRoad = new MainRoad(); mainRoad.programID = program.id; mainRoadList.Add(mainRoad); //把左栏遮盖, 让用户在右侧画线. mainWindow.mask(); mapControlMouseDown = delegate(object sender2, IMapControlEvents2_OnMouseDownEvent e2) { GisUtil.ResetToolbarControl(toolbarControl); onMapControlMouseDown(); return true; }; }
public void init(int programID, AxMapControl mc, AxToolbarControl tc, Intersect.ProgramStepUserControl.OnFinish of, MainWindow mw) { inited = true; villageColorRandomer = new VillageColorRandomer(); program = new Program(); program.id = programID; program.select(); villageList = program.getAllRelatedVillage(); if (villageList == null) { villageList = new ObservableCollection<Village>(); } else { foreach (Village village in villageList) { village.polygonElementColorString = villageColorRandomer.randomColor(); InnerRoad innerRoad = village.getRelatedInnerRoad(); village.innerRoad = innerRoad; } } mapControl = mc; toolbarControl = tc; mainWindow = mw; foreach (Village village in villageList) { GisUtil.drawPolygonElement(village.polygonElement, mapControl); GisUtil.UpdatePolygonElementColor(village.polygonElement, mapControl , VillageColorRandomer.GetRedFromColorString(village.polygonElementColorString) , VillageColorRandomer.GetGreenFromColorString(village.polygonElementColorString) , VillageColorRandomer.GetBlueFromColorString(village.polygonElementColorString)); if (village.innerRoad.lineElement != null) GisUtil.DrawPolylineElement(village.innerRoad.lineElement, mapControl); if (village.inUse) { string reverseColorString = VillageColorRandomer.GetReverseVillageColorString(village.polygonElementColorString); GisUtil.UpdatePolygonElementOutline(village.polygonElement, mapControl , VillageColorRandomer.GetRedFromColorString(reverseColorString) , VillageColorRandomer.GetGreenFromColorString(reverseColorString) , VillageColorRandomer.GetBlueFromColorString(reverseColorString)); } } valid = isValid(); dirty = false; onFinish = of; mapControlMouseDown = null; VillageListBox.ItemsSource = villageList; }
private void InnerRoadRedrawButtonClick(object sender, RoutedEventArgs e) { mainWindow.mask(); Button innerRoadRedrawButton = sender as Button; Grid innerRoadGrid = innerRoadRedrawButton.Parent as Grid; Grid villageGrid = innerRoadGrid.Parent as Grid; TextBlock villageIDTextBlock = villageGrid.FindName("VillageIDTextBlock") as TextBlock; int villageID = Int32.Parse(villageIDTextBlock.Text); foreach (Village village in villageList) { if (village.id == villageID) { mapControlMouseDown = delegate(object sender2, IMapControlEvents2_OnMouseDownEvent e2) { GisUtil.ResetToolbarControl(toolbarControl); onMapControlMouseDown(village); mapControlMouseDown = null; return true; }; return; } } }
private void InnerRoadRedrawButtonClick(object sender, RoutedEventArgs e) { Button innerRoadRedrawButton = sender as Button; Grid innerRoadGrid = innerRoadRedrawButton.Parent as Grid; TextBlock innerRoadIDTextBlock = innerRoadGrid.FindName("InnerRoadIDTextBlock") as TextBlock; int innerRoadID = Int32.Parse(innerRoadIDTextBlock.Text); mainWindow.mask(); foreach (InnerRoad innerRoad in innerRoadList) { if (innerRoad.id == innerRoadID) { if(innerRoad.lineElement != null) GisUtil.ErasePolylineElement(innerRoad.lineElement, mapControl); mapControlMouseDown = delegate(object sender2, IMapControlEvents2_OnMouseDownEvent e2) { onMapControlMouseDown(sender2, e2, innerRoad); mapControlMouseDown = null; return true; }; } } }
public void init(int programID, Intersect.ProgramStepUserControl.OnFinish of, AxMapControl mc, AxToolbarControl tc, MainWindow mainWindow) { inited = true; onFinish = of; Pager.nowStep = 1; Pager.totalStep = 2; Pager.update(); Pager.nextStepButtonCheck = nextStepCheckValid; Pager.nextStepButtonClick += new EventHandler(nextStepClick); Pager.previewStepButtonClick += new EventHandler(previewStepClick); mapControl = mc; toolbarControl = tc; mapControlMouseDown = onMapControlMouseDown; SelectMainRoadUserControl.init(programID, mapControl, toolbarControl, mainWindow); SelectVillageUserControl.init(programID, mapControl, toolbarControl, of, mainWindow); Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { onFinish(true); } }); }); t.Start(); }