Example #1
0
 private void 逐点插入法ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //交互-格网与TIN
     if (逐点插入法ToolStripMenuItem.Checked == true)
     {
         //修改显示
         this.UserOperation = UserOperationType.DisplayInTIN;
         this.ShowTin       = true;
         this.显示隐藏TINToolStripMenuItem.Checked = true;
         CreateTIN createTin = new CreateTIN(this.mPointSet);
         Edge[]    tinEdges  = createTin.PointByPointInsertion2();
         Edge[]    tinEdges2 = createTin.GeneTIN().ToArray();
         TinEdges = tinEdges;
         TriangleSet triSet  = EdgeSet.TopologyGenerateTriangleSet(tinEdges, mPointSet);
         Triangle[]  triList = triSet.TriangleList.ToArray();
         TinContourLinePen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
         agisControl.Refresh();
     }
     else
     {
         //修改显示
         this.UserOperation = UserOperationType.None;
         this.ShowTin       = false;
         this.显示隐藏TINToolStripMenuItem.Checked = false;
     }
 }
Example #2
0
        private void 生成等值线ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.ShowContourLine = (this.生成等值线ToolStripMenuItem1.Checked == true);
            if (this.ShowContourLine == false)
            {
                this.agisControl.Refresh(); return;
            }
            ContourLineSettingForm settingForm = new ContourLineSettingForm();

            if (settingForm.ShowDialog(this) == DialogResult.OK)
            {
                //生成Tin
                CreateTIN createTin = new CreateTIN(this.mPointSet);
                Edge[]    tinEdges  = createTin.PointByPointInsertion2();
                TinEdges = tinEdges;
                TriangleSet triSet           = EdgeSet.TopologyGenerateTriangleSet(tinEdges, mPointSet);
                Triangle[]  triList          = triSet.TriangleList.ToArray();
                List <Edge> contourLinesList = new List <Edge>();
                //计算等值线条数
                int lineCount = (int)((settingForm.MaxValue - settingForm.MinValue) / settingForm.IntervalValue);
                for (int i = 0; i <= lineCount; i++)
                {
                    for (int j = 0; j < triList.Length; j++)
                    {
                        Edge contourLine = triList[j].GetContourLine(settingForm.MaxValue - i * settingForm.IntervalValue);
                        if (contourLine != null)
                        {
                            contourLinesList.Add(contourLine);
                        }
                    }
                    this.TinContourLineList = contourLinesList.ToArray();
                }
            }
            TinContourLinePen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
            agisControl.Refresh();
        }