Example #1
0
 /// <summary>
 /// 分析范围画完事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void globeControl1_TrackPolygonEndEvent(object sender, TrackPolygonEndEventArgs e)
 {
     if (e.Polygon != null)
     {
         if (trackPolygonType == "填挖方分析")
         {
             globeControl1.Globe.Action = EnumAction3D.ActionNull;
             FrmAnalysisDigFillOfTerrain frm = new FrmAnalysisDigFillOfTerrain(globeControl1, e.Polygon);
             frm.Show(this);
         }
     }
 }
Example #2
0
        private void setMouse()
        {
            globeControl1.MouseDown += (sender, e) =>
            {
                mouseDown = e.Location;
            };

            globeControl1.MouseUp += (sender, e) =>
            {
                if (mouseDown != e.Location)
                {
                    return;
                }

                if (e.Button == MouseButtons.Left)
                {
                    if (globeControl1.Globe.Action == EnumAction3D.SelectObject)
                    {
                        if (mouseClikeInfo == "填挖方分析")
                        {
                            GSOFeature feature = globeControl1.Globe.SelectedObject;
                            if (feature == null ||
                                feature.Geometry == null ||
                                feature.Geometry.Type != EnumGeometryType.GeoPolygon3D)
                            {
                                MessageBox.Show("请选择一个面");
                                return;
                            }
                            globeControl1.Globe.Action = EnumAction3D.ActionNull;
                            GSOGeoPolygon3D             polygon = feature.Geometry as GSOGeoPolygon3D;
                            FrmAnalysisDigFillOfTerrain frm     = new FrmAnalysisDigFillOfTerrain(globeControl1, polygon);
                            frm.Show(this);
                        }
                    }
                }
            };
        }