private ContourMap CreateContourMap() { ContourMap contour = new ContourMap(m_sceneControl.Scene); contour.Interval = m_countourLineInterval; contour.Opacity = m_opacity; contour.LineColor = m_contourLineColor; contour.BorderVisible = m_bShowBorer; contour.BorderColor = m_BorderColor; //设置等高线颜色表 ColorDictionary colorDict = new ColorDictionary(); /////////////////////////////////////////////////////////////// ///////北京地形//////////////////////// colorDict[0] = Color.Blue; colorDict[800] = Color.Green; colorDict[1500] = Color.Red; contour.ColorDictTable = colorDict; contour.MaxVisibleAltitude = m_maxVisibleAlt; contour.MinVisibleAltitude = m_minVisibleAlt; contour.DisplayStyle = m_fillMode; contour.Build(); return(contour); }
//窗口关闭事件 private void DlgContourMap_FormClosing(object sender, FormClosingEventArgs e) { this.RegisterEvents(false); if (m_contour != null) { m_contour.Clear(); m_contour = null; } m_sceneControl.Action = Action3D.Pan; }
//清除所有分析结果 private void btn_Clear_Click(object sender, EventArgs e) { this.RegisterEvents(false); if (m_contour != null) { m_contour.Clear(); m_contour = null; } m_sceneControl.Action = Action3D.Pan; this.btn_StartAnalyst.Enabled = true; this.btn_Clear.Enabled = false; this.btn_StopAnalysis.Enabled = false; }
//开始分析 private void btn_StartAnalyst_Click(object sender, EventArgs e) { this.RegisterEvents(false); this.RegisterEvents(true); m_sceneControl.Action = SuperMap.UI.Action3D.CreateRectangle; if (m_contour == null) { m_contour = CreateContourMap(); } this.btn_StartAnalyst.Enabled = false; this.btn_StopAnalysis.Enabled = true; this.btn_Clear.Enabled = true; }
void Start() { topoMap = ContourMap.FromRawHeightmap16bpp(heightmapPath); if (topoMap == null) { Debug.Log("Creation of topomap failed."); } else { Debug.Log("Creation of topomap was successful."); } if (outputMaterial != null) { outputMaterial.mainTexture = topoMap; } }
//清除所有分析结果 private void btn_Clear_Click(object sender, EventArgs e) { this.RegisterEvents(false); if (m_timer != null) { m_timer.Enabled = false; m_timer.Stop(); } if (m_contour != null) { m_contour.Clear(); m_contour = null; } m_sceneControl.Scene.TrackingLayer.Clear(); this.m_panelDiagram.Visible = false; this.btn_Clear.Enabled = false; }
//窗口关闭事件 private void DlgFloodAnalysis_FormClosing(object sender, FormClosingEventArgs e) { this.RegisterEvents(false); if (m_contour != null) { m_contour.Clear(); m_contour.Dispose(); m_contour = null; } if (m_timer != null) { m_timer.Stop(); m_timer.Enabled = false; } m_sceneControl.Scene.TrackingLayer.Clear(); m_panelDiagram.Visible = false; }
private void btn_DrawAnalystRange_Click(object sender, EventArgs e) { if (m_timer != null && m_timer.Enabled) { m_timer.Enabled = false; m_timer.Stop(); } if (m_contour == null) { m_contour = new ContourMap(m_sceneControl.Scene); m_contour.DisplayStyle = ContourMap.DisplayMode.Face; m_contour.Opacity = 50; m_contour.BorderVisible = true; //设置等高线颜色表 ColorDictionary colorDict = new ColorDictionary(); colorDict[0] = Color.FromArgb(36, 65, 171); colorDict[100] = Color.FromArgb(80, 107, 191); colorDict[500] = Color.FromArgb(124, 149, 210); colorDict[800] = Color.FromArgb(168, 191, 230); colorDict[1200] = Color.FromArgb(212, 233, 250); m_contour.ColorDictTable = colorDict; } m_contour.MinVisibleAltitude = m_minVisibleAltidute; m_contour.MaxVisibleAltitude = m_minVisibleAltidute + 5; this.RegisterEvents(false); this.RegisterEvents(true); m_oldAction = m_sceneControl.Action; m_sceneControl.Action = SuperMap.UI.Action3D.CreateLine; m_contour.Build(); m_contour.BorderColor = Color.Blue; this.btn_StartAnalysis.Enabled = true; this.btn_Clear.Enabled = true; }