⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 AE+vb来实现的最短路径的实现功能!gis
💻 CS
📖 第 1 页 / 共 5 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
//
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.MapControl;
using ESRI.ArcGIS.NetworkAnalyst;
using ESRI.ArcGIS.Geodatabase;

//Ismael Chivite
//ESRI Redlands
//March 2005

namespace EvacuationRoutes
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TabControl tabControl1;
		private System.Windows.Forms.TabPage tabPage1;
		private ESRI.ArcGIS.ToolbarControl.AxToolbarControl Toolbar2D;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.CheckedListBox ChkRestrictions;
		private ESRI.ArcGIS.TOCControl.AxTOCControl TOC2D;
		private System.Windows.Forms.ComboBox LstFloors;


		private string m_mxd = "EvacuationRoutes.mxd" ;
		private string m_sRouteLayer = "Route";
		private string m_s2DRouteGroup = "Route2D";
		private string m_s2DRouteActive = "Route2D Active Floor";
		private string m_s2DRouteNoActive = "Route2D No Active Floor";
		private string m_sFloorsGroupLayer = "Floors";
		private string m_sAgentMotionLayer2D = "AgentMotion";

		private string m_sClosestFacilityLayer = "Closest Facility";
		private string m_sServiceAreaLayer = "Service Area";
		private string m_sFloorNames = "Floor_3,Floor_2,Floor_1";
		private string m_sFloorHeights = "863,849,835";
		private string m_sServiceArea2D = "ServiceArea2D";
		private string m_sPolygonBarriers2D = "PolygonBarriers";
		

		private string m_sxd = "Building2.sxd";
		private string m_EmergencyExits3DLayer = "Emergency Exits";
		private string m_sStops3D = "Stops3D";
		private string m_sRoute3D = "Route3D";
		private string m_sServiceArea3D = "ServiceArea3D";
		private string m_sPolygonBarriers3D = "PolygonBarriers";
		private string m_sAgentMotionLayer3D = "Agent Animation";

		private ILayer m_pRoute2DActiveLayer = null;
		private ILayer m_Route2DNoActiveLayer = null;
		private IFeatureLayerDefinition m_AgentAnimation2DLayer = null;
		private IFeatureLayerDefinition m_AgentAnimation3DLayer = null;


		private string[] m_FloorNames = null;
		private double[] m_FloorHeights= null;
		

		private AppProperties.AppProperties m_pAppProperties = new AppProperties.AppProperties();
		private ESRI.ArcGIS.LicenseControl.AxLicenseControl axLicenseControl1;
		private System.Windows.Forms.Button BtnGO;
		private System.Windows.Forms.Button BtnClean;
		private System.Windows.Forms.TabPage tabPage2;
		private ESRI.ArcGIS.ToolbarControl.AxToolbarControl ToolBar3D;
		private ESRI.ArcGIS.TOCControl.AxTOCControl TOC3D;
		private ESRI.ArcGIS.SceneControl.AxSceneControl Map3D;
		private System.Windows.Forms.ComboBox LstSolvers;
		private ESRI.ArcGIS.MapControl.AxMapControl Map2D;
		private System.Windows.Forms.TrackBar SliderSeconds;
		private System.Windows.Forms.Label LblSlider;
		private System.Windows.Forms.ComboBox LstImpendances;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.StatusBar statusBar1;
		private System.Windows.Forms.StatusBarPanel HelpPanel;
		private System.Windows.Forms.StatusBarPanel StatusPanel;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Splitter splitter2;
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Splitter splitter3;
		private System.Windows.Forms.Panel panel3;
		private System.Windows.Forms.Panel panel4;
		private System.Windows.Forms.Panel panel5;
		private System.Windows.Forms.Splitter splitter1;
		private System.Windows.Forms.Panel panel6;
		private System.Windows.Forms.Button BtnAnimate;
		private System.Windows.Forms.Timer timer1;
		private System.Windows.Forms.CheckBox chkAnimationLoop;
		private System.Windows.Forms.GroupBox groupClosestFacility;
		private System.Windows.Forms.Label LblAreaOfReachUnits;
		private System.Windows.Forms.TrackBar SliderAreaOfReach;
		private System.Windows.Forms.GroupBox groupBoxAreaOfReach;
		private System.ComponentModel.IContainer components;

		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.tabControl1 = new System.Windows.Forms.TabControl();
			this.tabPage1 = new System.Windows.Forms.TabPage();
			this.Toolbar2D = new ESRI.ArcGIS.ToolbarControl.AxToolbarControl();
			this.panel6 = new System.Windows.Forms.Panel();
			this.Map2D = new ESRI.ArcGIS.MapControl.AxMapControl();
			this.splitter1 = new System.Windows.Forms.Splitter();
			this.panel5 = new System.Windows.Forms.Panel();
			this.TOC2D = new ESRI.ArcGIS.TOCControl.AxTOCControl();
			this.tabPage2 = new System.Windows.Forms.TabPage();
			this.ToolBar3D = new ESRI.ArcGIS.ToolbarControl.AxToolbarControl();
			this.panel3 = new System.Windows.Forms.Panel();
			this.Map3D = new ESRI.ArcGIS.SceneControl.AxSceneControl();
			this.splitter3 = new System.Windows.Forms.Splitter();
			this.panel2 = new System.Windows.Forms.Panel();
			this.TOC3D = new ESRI.ArcGIS.TOCControl.AxTOCControl();
			this.LstFloors = new System.Windows.Forms.ComboBox();
			this.BtnClean = new System.Windows.Forms.Button();
			this.BtnGO = new System.Windows.Forms.Button();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.groupBoxAreaOfReach = new System.Windows.Forms.GroupBox();
			this.SliderAreaOfReach = new System.Windows.Forms.TrackBar();
			this.LblAreaOfReachUnits = new System.Windows.Forms.Label();
			this.groupClosestFacility = new System.Windows.Forms.GroupBox();
			this.chkAnimationLoop = new System.Windows.Forms.CheckBox();
			this.SliderSeconds = new System.Windows.Forms.TrackBar();
			this.BtnAnimate = new System.Windows.Forms.Button();
			this.LblSlider = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.LstImpendances = new System.Windows.Forms.ComboBox();
			this.LstSolvers = new System.Windows.Forms.ComboBox();
			this.ChkRestrictions = new System.Windows.Forms.CheckedListBox();
			this.axLicenseControl1 = new ESRI.ArcGIS.LicenseControl.AxLicenseControl();
			this.statusBar1 = new System.Windows.Forms.StatusBar();
			this.HelpPanel = new System.Windows.Forms.StatusBarPanel();
			this.StatusPanel = new System.Windows.Forms.StatusBarPanel();
			this.panel1 = new System.Windows.Forms.Panel();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.splitter2 = new System.Windows.Forms.Splitter();
			this.panel4 = new System.Windows.Forms.Panel();
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.tabControl1.SuspendLayout();
			this.tabPage1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.Toolbar2D)).BeginInit();
			this.panel6.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.Map2D)).BeginInit();
			this.panel5.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.TOC2D)).BeginInit();
			this.tabPage2.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.ToolBar3D)).BeginInit();
			this.panel3.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.Map3D)).BeginInit();
			this.panel2.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.TOC3D)).BeginInit();
			this.groupBox2.SuspendLayout();
			this.groupBoxAreaOfReach.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.SliderAreaOfReach)).BeginInit();
			this.groupClosestFacility.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.SliderSeconds)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.axLicenseControl1)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.HelpPanel)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.StatusPanel)).BeginInit();
			this.panel1.SuspendLayout();
			this.groupBox1.SuspendLayout();
			this.panel4.SuspendLayout();
			this.SuspendLayout();
			// 
			// tabControl1
			// 
			this.tabControl1.Controls.Add(this.tabPage1);
			this.tabControl1.Controls.Add(this.tabPage2);
			this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.tabControl1.Location = new System.Drawing.Point(0, 0);
			this.tabControl1.Name = "tabControl1";
			this.tabControl1.SelectedIndex = 0;
			this.tabControl1.Size = new System.Drawing.Size(1028, 592);
			this.tabControl1.TabIndex = 0;
			// 
			// tabPage1
			// 
			this.tabPage1.Controls.Add(this.Toolbar2D);
			this.tabPage1.Controls.Add(this.panel6);
			this.tabPage1.Controls.Add(this.splitter1);
			this.tabPage1.Controls.Add(this.panel5);
			this.tabPage1.Location = new System.Drawing.Point(4, 22);
			this.tabPage1.Name = "tabPage1";
			this.tabPage1.Size = new System.Drawing.Size(1020, 566);
			this.tabPage1.TabIndex = 0;
			this.tabPage1.Text = "2D View";
			this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
			// 
			// Toolbar2D
			// 
			this.Toolbar2D.ContainingControl = this;
			this.Toolbar2D.Location = new System.Drawing.Point(16, 16);
			this.Toolbar2D.Name = "Toolbar2D";
			this.Toolbar2D.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("Toolbar2D.OcxState")));
			this.Toolbar2D.Size = new System.Drawing.Size(440, 48);
			this.Toolbar2D.TabIndex = 2;
			// 
			// panel6
			// 
			this.panel6.Controls.Add(this.Map2D);
			this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panel6.Location = new System.Drawing.Point(0, 0);
			this.panel6.Name = "panel6";
			this.panel6.Size = new System.Drawing.Size(817, 566);
			this.panel6.TabIndex = 6;
			// 
			// Map2D
			// 
			this.Map2D.ContainingControl = this;
			this.Map2D.Dock = System.Windows.Forms.DockStyle.Fill;
			this.Map2D.Location = new System.Drawing.Point(0, 0);
			this.Map2D.Name = "Map2D";
			this.Map2D.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("Map2D.OcxState")));
			this.Map2D.Size = new System.Drawing.Size(817, 566);
			this.Map2D.TabIndex = 3;
			this.Map2D.OnKeyDown += new ESRI.ArcGIS.MapControl.IMapControlEvents2_OnKeyDownEventHandler(this.Map2D_OnKeyDown);
			// 
			// splitter1
			// 
			this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
			this.splitter1.Location = new System.Drawing.Point(817, 0);
			this.splitter1.Name = "splitter1";
			this.splitter1.Size = new System.Drawing.Size(3, 566);
			this.splitter1.TabIndex = 5;
			this.splitter1.TabStop = false;
			// 
			// panel5
			// 
			this.panel5.Controls.Add(this.TOC2D);
			this.panel5.Dock = System.Windows.Forms.DockStyle.Right;
			this.panel5.Location = new System.Drawing.Point(820, 0);
			this.panel5.Name = "panel5";
			this.panel5.Size = new System.Drawing.Size(200, 566);
			this.panel5.TabIndex = 4;
			// 
			// TOC2D
			// 
			this.TOC2D.ContainingControl = this;
			this.TOC2D.Dock = System.Windows.Forms.DockStyle.Fill;
			this.TOC2D.Location = new System.Drawing.Point(0, 0);
			this.TOC2D.Name = "TOC2D";
			this.TOC2D.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("TOC2D.OcxState")));
			this.TOC2D.Size = new System.Drawing.Size(200, 566);
			this.TOC2D.TabIndex = 1;
			this.TOC2D.OnKeyDown += new ESRI.ArcGIS.TOCControl.ITOCControlEvents_OnKeyDownEventHandler(this.TOC2D_OnKeyDown);
			// 
			// tabPage2
			// 
			this.tabPage2.Controls.Add(this.ToolBar3D);
			this.tabPage2.Controls.Add(this.panel3);
			this.tabPage2.Controls.Add(this.splitter3);
			this.tabPage2.Controls.Add(this.panel2);
			this.tabPage2.Location = new System.Drawing.Point(4, 22);
			this.tabPage2.Name = "tabPage2";
			this.tabPage2.Size = new System.Drawing.Size(1020, 566);
			this.tabPage2.TabIndex = 1;
			this.tabPage2.Text = "3D Scene";
			this.tabPage2.Click += new System.EventHandler(this.tabPage2_Click);
			// 
			// ToolBar3D
			// 
			this.ToolBar3D.ContainingControl = this;
			this.ToolBar3D.Location = new System.Drawing.Point(16, 16);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -