예제 #1
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     mLayer.RemoveAllFeature();
     mLayer.AddFeatures(mFeaturesOld);
     mGlobeControl.Refresh();
     this.Close();
 }
예제 #2
0
        //导出
        private void button2_Click(object sender, EventArgs e)
        {
            button4_Click(null, null);
            GSOFeatures feats = getFeatures();

            if (feats == null || feats.Length == 0)
            {
                MessageBox.Show("没有符合条件的对象!");
                return;
            }
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "(*.lgd)|*.lgd||";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                GSOLayer layer = globeControl1.Globe.Layers.Add(dlg.FileName);
                layer.AddFeatures(feats);
                layer.Visible = false;
                layer.Save();
            }
        }
        private void buttonOK_Click(object sender, EventArgs e)
        {
            string   filename = textbox1.Text.Trim();
            GSOLayer newlayer = mGlobeControl.Globe.Layers.Add(filename);

            int    indexCount      = filename.LastIndexOf('.') - filename.LastIndexOf('\\') - 1;
            string newlayerCaption = "";

            if (indexCount > 0)
            {
                newlayerCaption  = filename.Substring(filename.LastIndexOf('\\') + 1, indexCount);
                newlayer.Caption = newlayerCaption;
            }

            for (int i = 0; i < mListPolygon.Count; i++)
            {
                GSOGeoPolygon3D polygon = mListPolygon[i];
                string          caption = "";
                if (comboBoxLayerName.SelectedIndex >= 0)
                {
                    caption = comboBoxLayerName.SelectedItem.ToString().Trim();
                }
                GSOLayer    layer = mGlobeControl.Globe.Layers.GetLayerByCaption(caption);
                GSOFeatures feats = new GSOFeatures();
                if (layer != null)
                {
                    feats = layer.FindFeaturesInPolygon(polygon, false);
                }
                if (feats != null)
                {
                    newlayer.AddFeatures(feats);
                }
            }
            if (newlayer != null)
            {
                newlayer.SaveAs(filename);
                MessageBox.Show("导出成功!", "提示");
            }
            this.Close();
        }
예제 #4
0
파일: MainFrm.cs 프로젝트: StarU/qkKL6Dgf12
 private GSOFeatures getFeatureByPolygon(GSOLayer layer,GSOFeatures features, GSOPoint3d point, double allowValue)
 {
     if (layer == null || point == null || allowValue <= 0)
     {
         return null;
     }
     GSOGeoPolyline3D bufferLine = new GSOGeoPolyline3D();
     GSOPoint3ds points = new GSOPoint3ds();
     points.Add(point);
     GSOPoint3d newPoint = new GSOPoint3d();
     newPoint.X = point.X + 0.00001;
     newPoint.Y = point.Y;
     newPoint.Z = point.Z;
     points.Add(newPoint);
     bufferLine.AddPart(points);
     GSOGeoPolygon3D polygon = bufferLine.CreateBuffer(allowValue, true, 12, false, false);
     layer.RemoveAllFeature();
     layer.AddFeatures(features);
     GSOFeatures featuresInPolygon = layer.FindFeaturesInPolygon(polygon, false);
     return featuresInPolygon;
 }