//解算绝对定向元素 private void 解算绝对定向元素ToolStripMenuItem_Click(object sender, EventArgs e) { List <MyPoint> GCP, PCP; string title; //读取控制点坐标 bool flag; title = "选择控制点的地面摄影测量坐标"; GCP = GetPoints(title, out flag); if (flag == false) { return; } title = "选择控制点的摄影测量坐标"; PCP = GetPoints(title, out flag); if (flag == false) { return; } //解算 ao = new AbsoluteOrientation(); ao.CalAOE(GCP, PCP); //保存绝对定向元素 SaveAOE(); }
//从文件读取绝对定向元素 private void 输入绝对定向元素ToolStripMenuItem_Click(object sender, EventArgs e) { EElements ee = new EElements(); float lamda; float dx, dy, dz; OpenFileDialog dialog = new OpenFileDialog(); dialog.RestoreDirectory = true; dialog.Title = "选择绝对定向元素"; dialog.Filter = "文本文件(*.txt)|*.txt"; DialogResult flag = dialog.ShowDialog(); if (flag == DialogResult.Cancel) { return; } else if (flag == DialogResult.OK) { string filename = dialog.FileName; string[] data; using (StreamReader sr = new StreamReader(filename)) { lamda = float.Parse(sr.ReadLine()); data = sr.ReadLine().Split(','); dx = float.Parse(data[0]); dy = float.Parse(data[1]); dz = float.Parse(data[2]); data = sr.ReadLine().Split(','); ee.Phi = (float)(float.Parse(data[0]) / 180 * Math.PI); ee.Omega = (float)(float.Parse(data[1]) / 180 * Math.PI); ee.Kappa = (float)(float.Parse(data[2]) / 180 * Math.PI); ao = new AbsoluteOrientation(ee, lamda, dx, dy, dz); } } }