• 基于SceneControl单击查询功能的实现


     1 private void HandleIdentify_MouseDown(object sender, ISceneControlEvents_OnMouseDownEvent e)  
     2        {  
     3            this.PipeSceneControl.Scene.ClearSelection();//清除之前的选择集,去除高亮显示  
     4            IHit3DSet pHit3DSet = null;  
     5            this.PipeSceneControl.SceneGraph.LocateMultiple(this.PipeSceneControl.SceneViewer, e.x, e.y, esriScenePickMode.esriScenePickAll, false, out pHit3DSet);  
     6            pHit3DSet.OnePerLayer();  
     7            if (pHit3DSet.Hits.Count == 0)  
     8            {  
     9                MessageBox.Show("没有选中任何要素!");  
    10                return;  
    11            }  
    12            IHit3D pHit3D = pHit3DSet.Hits.get_Element(0) as IHit3D;  
    13            IFeature pFeature = pHit3D.Object as IFeature;//pHit3D.Owner其实是一个ILayer类型,pHit3D.Object是一个IFeature类型  
    14            IFields pFields = pFeature.Fields;  
    15            StringBuilder Info = new StringBuilder();  
    16            for (int i = 0; i < pFields.FieldCount;i++ )  
    17            {  
    18                IField pField = pFields.get_Field(i);  
    19                if (pField.Type != esriFieldType.esriFieldTypeGeometry)  
    20                {  
    21                    Info.Append(pField.Name + ":" + pFeature.get_Value(pFields.FindField(pField.Name)) + "
    ");  
    22                }  
    23            }  
    24            MessageBox.Show(Info.ToString());  
    25            IDisplay3D pDisplay3D = this.PipeSceneControl.SceneGraph as IDisplay3D;  
    26            pDisplay3D.FlashGeometry(pHit3D.Owner, pHit3D.Object);//闪烁一次,pHit3D.Owner是一个ILayer类型,pHit3D.Object是一个IFeature类型  
    27            //pDisplay3D.AddFlashFeature(pFeature.Shape);//保持高亮  
    28            this.PipeSceneControl.Scene.SelectFeature(pHit3D.Owner as ILayer, pFeature);//加入选择集,并自动高亮  
    29        }  

    文章来源:http://blog.csdn.net/iispring/article/details/7284077

  • 相关阅读:
    性能测试
    领域驱动设计(DDD)的实际应用
    Js模块模式
    Roslyn and NRefactory
    前端与后端分离的架构实例3
    angular + easyui 做界面验证
    java.lang.OutOfMemoryError: unable to create new native thread(转)
    oracle client server那点事
    一次处理ORA-07445的历险记(转)
    一条执行4秒的sql语句导致的系统问题 (转)
  • 原文地址:https://www.cnblogs.com/qiernonstop/p/3644658.html
Copyright © 2020-2023  润新知