伟景行Citymaker管廊三维Gis实现鼠标点选功能

在Citymaker三维Gis平台上用C#实现点选功能
效果如下 (技术交流可加群:161154103)

首先设置鼠标为点击选择状态,代码如下:
  this .axRenderControl .MouseSelectMode = gviMouseSelectMode .gviMouseSelectClick;
  this .axRenderControl .MouseSelectObjectMask = gviMouseSelectObjectMask .gviSelectAll;  
设置三维Gis上鼠标点击监听事件
this .axRenderControl.RcMouseClickSelect += new CityMaker.Controls. _IRenderControlEvents_RcMouseClickSelectEventHandler (axRenderControl_RcMouseClickSelect);

具体的鼠标事件函数:
  public void axRenderControl_RcMouseClickSelect( object sender, _IRenderControlEvents_RcMouseClickSelectEvent e)
 {
        if (e.pickResult == null )
           return ;
        IFeatureLayerPickResult layerresault = e.pickResult as IFeatureLayerPickResult ;
        if (layerresault != null )
       {
             //高亮选中的要素
             layerresault.FeatureLayer.HighlightFeature(layerresault.FeatureId, 0xffff0000);
            //利用ITableLabel进行展示
            ITableLabel tableLabel = this .axRenderControl.ObjectManager.CreateTableLabel(7, 2, Guid .Empty);
            tableLabel.VisibleMask = gviViewportMask .gviViewNone;
            tableLabel.Position = pos;
            tableLabel.SetColumnWidth(0, 80);
            tableLabel.TitleText = "烟感器:详细信息" ;
            tableLabel.SetRecord(0, 0, "链接状态" );
            tableLabel.SetRecord(0, 1, "良    好" );
            tableLabel.SetRecord(1, 0, "所属分区" );
            tableLabel.SetRecord(1, 1, "1#防火分区" );
            tableLabel.SetRecord(2, 0, "所属仓位" );
            tableLabel.SetRecord(2, 1, "第二仓" );
            tableLabel.SetRecord(3, 0, "所属位置" );
            tableLabel.SetRecord(3, 1, "第三支线8米" );
            tableLabel.SetRecord(4, 0, "重量" );
            tableLabel.SetRecord(4, 1, "120g" );
            tableLabel.SetRecord(5, 0, "保护级别" );
            tableLabel.SetRecord(6, 1, "IP23" );
            tableLabel.SetRecord(6, 0, "执行标准" );
            tableLabel.SetRecord(6, 1, "GB 4715—2005" );
            tableLabel.TitleBackgroundColor = 0xffffffff;
            TextAttribute capitalTextAttribute = new TextAttribute ();
            capitalTextAttribute.TextColor = 0xff000000;
            capitalTextAttribute.Font = "宋体" ;
            capitalTextAttribute.TextSize = 14;
            capitalTextAttribute.MultilineJustification = gviMultilineJustification .gviMultilineLeft;
            //capitalTextAttribute.Bold = true;
            tableLabel.TitleTextAttribute = capitalTextAttribute;
            tableLabel.TableBackgroundColor = 0xd0000000;
            TextAttribute TextAttribute = new TextAttribute ();
            TextAttribute.TextColor = 0xffffffff;
            TextAttribute.Font = "宋体" ;
            TextAttribute.TextSize = 12;
            TextAttribute.MultilineJustification = gviMultilineJustification .gviMultilineLeft;
            //TextAttribute.Bold = true;
            tableLabel.SetColumnTextAttribute(0, TextAttribute);
            tableLabel.VisibleMask = gviViewportMask .gviViewAllNormalView;
       }
}
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

凡梦_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值