ArcEngine 二维地图map选择范围,加到三维arcscene控件中显示、渲染(c#)

11 篇文章 1 订阅

1.绘制区域选择范围

地图的二维点击事件

try
{
IactiveView activeView=axMapControl.Map as IactiveView ;
IScreenDisplay pScreenDisplay=activeView.ScreenDisplay;
IRubberBand pRubberPolygon=new RubberPolygonClass();
ISimpleFillSymbol pFillSymbol=new SimbolFillSymbolClass();
IRgbColor color=new RgbColorClass();
color.Red=0;
color.Green=53;
color.Blue=53;
pFillSymbol.Color=color;
IPolygon pPolygon=pRubberPolygon.TrackNew(pSreenDisplay,(ISymbol)pFillsymbol)as IPolygon ;
//向弹出窗体传入区域参数
frm3D fem3d=new frm3D (pPolygon);
fem3d.Show();
}
catch(Exception ex)
{
}

2.对原图层进行查询过滤,查询结果3D符号化

public void Scene3dShow()
{
ISpatialFilter pFilter=new SpatialFilterClass();
pFilter.SpatialRel=esriSpatialRelEnum.esriSpatialRelIntersects;
//以将绘制的区域定义为全局变量
pFilter.Geometry=_pGeometry;
IFeatureLayer pFeatureLayer = axMapControl1.Map.get_Layer(0) as IFeatureLayer;
IFeatureLayerDefinition pFeatLyrDef = pFeatureLayer as IFeatureLayerDefinition;
IFeatureSelection pFeatSel = pFeatureLayer as IFeatureSelection;
pFeatSel.SelectFeatures(pFilter, esriSelectionResultEnum.esriSelectionResultNew, false);
IFeatureLayer pNewFeat = pFeatLyrDef.CreateSelectionLayer("New Layer", true, null, null);  //新建的图层包括上面两者的交集部分!
pFeatSel.Clear();
//3d符号化
IGeoFeatureLayer geiLayer=pNewFeat  as IGeoFeatureLayer ;
ISimbolRender simbolRender=new SimbolRenderClass();
ILineSymbol pLineSymbol3D=new SimbolLine3DSymbolClass();
((ISymbolLine3DSymbol)pLineSymbol3D).style=esriSimbol3DLineStyle.esriS3DLSTube;
pLineSymbol3D.Width=5;
pLineSymbol3D.Color=GetRGBColor(255,0,0,255);
simbolRender.Symbol=(ISymbol)pLineSymbol3D;
geoLayer.Renderer=(IFeatureRender)simbolRender;
axSceneControl1.Map.AddLayer(geoLayer);
}


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值