diff --git a/FrmLoading.Designer.cs b/FrmLoading.Designer.cs new file mode 100644 index 0000000..da0d483 --- /dev/null +++ b/FrmLoading.Designer.cs @@ -0,0 +1,46 @@ +namespace Cyberpipe +{ + partial class FrmLoading + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FrmLoading + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(616, 76); + this.Name = "FrmLoading"; + this.Text = "FrmLoading"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/FrmLoading.Designer.cs b/FrmLoading.Designer.cs new file mode 100644 index 0000000..da0d483 --- /dev/null +++ b/FrmLoading.Designer.cs @@ -0,0 +1,46 @@ +namespace Cyberpipe +{ + partial class FrmLoading + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FrmLoading + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(616, 76); + this.Name = "FrmLoading"; + this.Text = "FrmLoading"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/FrmLoading.cs b/FrmLoading.cs new file mode 100644 index 0000000..9501246 --- /dev/null +++ b/FrmLoading.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Cyberpipe +{ + public partial class FrmLoading : Form + { + public FrmLoading() + { + InitializeComponent(); + } + + } +} diff --git a/FrmLoading.Designer.cs b/FrmLoading.Designer.cs new file mode 100644 index 0000000..da0d483 --- /dev/null +++ b/FrmLoading.Designer.cs @@ -0,0 +1,46 @@ +namespace Cyberpipe +{ + partial class FrmLoading + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FrmLoading + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(616, 76); + this.Name = "FrmLoading"; + this.Text = "FrmLoading"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/FrmLoading.cs b/FrmLoading.cs new file mode 100644 index 0000000..9501246 --- /dev/null +++ b/FrmLoading.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Cyberpipe +{ + public partial class FrmLoading : Form + { + public FrmLoading() + { + InitializeComponent(); + } + + } +} diff --git a/FrmLoading.resx b/FrmLoading.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FrmLoading.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FrmLoading.Designer.cs b/FrmLoading.Designer.cs new file mode 100644 index 0000000..da0d483 --- /dev/null +++ b/FrmLoading.Designer.cs @@ -0,0 +1,46 @@ +namespace Cyberpipe +{ + partial class FrmLoading + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // FrmLoading + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(616, 76); + this.Name = "FrmLoading"; + this.Text = "FrmLoading"; + this.ResumeLayout(false); + + } + + #endregion + } +} \ No newline at end of file diff --git a/FrmLoading.cs b/FrmLoading.cs new file mode 100644 index 0000000..9501246 --- /dev/null +++ b/FrmLoading.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Cyberpipe +{ + public partial class FrmLoading : Form + { + public FrmLoading() + { + InitializeComponent(); + } + + } +} diff --git a/FrmLoading.resx b/FrmLoading.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FrmLoading.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MainFrm.cs b/MainFrm.cs index 0a61081..f874bc3 100644 --- a/MainFrm.cs +++ b/MainFrm.cs @@ -511,9 +511,10 @@ //加载两个地球数据 private void loadData() { - Thread t1 = new Thread(doLoadDataForGlobalControl); - t1.IsBackground = true; - t1.Start(); + //Thread t1 = new Thread(doLoadDataForGlobalControl); + //t1.IsBackground = true; + //t1.Start(); + doLoadDataForGlobalControl(); } //delegate void LoadDataForGlobalControl(); @@ -533,6 +534,10 @@ { try { + FrmLoading frmLoading = new FrmLoading(); + frmLoading.Show(); + + frmLoading.Text = "加载lrc文件"; String lrcMap = Application.StartupPath + "\\lrc\\tianditu.lrc"; String lrcBz = Application.StartupPath + "\\lrc\\biaozhu.lrc"; String lrcDl = Application.StartupPath + "\\lrc\\daolu.lrc"; @@ -549,6 +554,7 @@ globeControl1.Globe.Layers.MoveDown(10000); //加载实测管线数据 + frmLoading.Text = "加载实测管线数据"; Utility.dataSource = globeControl1.Globe.DataManager.OpenOracleDataSource( Utility.DBServer.Trim() + "/" + Utility.dbdatabase.Trim(), "", "", Utility.userID, @@ -562,6 +568,7 @@ if (dataset != null && Utility.layerNameSet.Contains(dataset.Caption)) { dataset.Caption = dataset.Name; + frmLoading.Text = "加载" + dataset.Name; globeControl1.Globe.Layers.Add(dataset); } } @@ -1467,24 +1474,38 @@ if (高度量算ToolStripMenuItem1.Checked && globeControl1.Globe.Action == EnumAction3D.SelectObject) // 高度量算菜单 { - double z = globeControl1.Globe.GetZ(point.X, point.Y); - double modelZ = 0; - if (feature1 != null) - { - modelZ = feature1.Geometry.GeoBottomCenterPoint.Z; - } - GSOGeoPolyline3D line = new GSOGeoPolyline3D(); - GSOPoint3ds pts = new GSOPoint3ds(); - GSOPoint3d pt1 = new GSOPoint3d(); - pt1.X = point.X; - pt1.Y = point.Y; - pt1.Z = point.Z - z; - pts.Add(pt1); - pts.Add(point); - line.AddPart(pts); GSOFeature feat = new GSOFeature(); - line.AltitudeMode = EnumAltitudeMode.Absolute; - feat.Geometry = line; + + double z = globeControl1.Globe.GetZ(point.X, point.Y); + // 高度测量按钮,原先代码的逻辑是创建一条垂直的线,加标签,标签无法显示。经测试线在垂直状态时加不了标签,其他状态下可以。 + // 改成在圆柱上加标签,用圆柱代替线 + //double modelZ = 0; + //if (feature1 != null) + //{ + // modelZ = feature1.Geometry.GeoBottomCenterPoint.Z; + //} + //GSOGeoPolyline3D line = new GSOGeoPolyline3D(); + //GSOPoint3ds pts = new GSOPoint3ds(); + //GSOPoint3d pt1 = new GSOPoint3d(); + //pt1.X = point.X + 0.0001; + //pt1.Y = point.Y; + //pt1.Z = point.Z; + //pts.Add(pt1); + //pts.Add(point); + //line.AddPart(pts); + //line.AltitudeMode = EnumAltitudeMode.Absolute; + + //feat.Geometry = line; + + + GSOGeoFrustumEntity frustumEntity = new GSOGeoFrustumEntity(); + frustumEntity.Position = point; + frustumEntity.Length = z; //高度,单位:米 + frustumEntity.BottomRadius = 0.1; //底面半径 + frustumEntity.TopRadius = 0.1; //顶面半径 + feat.Geometry = frustumEntity;//将几何对象加入要素中 + + GSOLabel label = new GSOLabel(); GSOLabelStyle style = new GSOLabelStyle(); style.OutlineColor = Color.Transparent;