ArcGlobe中浏览三维模型时,对于高程变化较小、起伏不大的模型再对图层高程进行夸张拉伸后 ,能够很好地观察细节局部结构和走势,本文介绍如何在ArcGIS Engine下实现这个功能。
在下面功能实现的代码中主要用到了IGlobeLayerInfo 、IGlobeLayerProperties 、ILayerExtensions接口,关于此三个接口的详细描述请查阅AO开发帮助
IGlobeLayerInfo pGlobeLyrInfo = pLayer as IGlobeLayerInfo;
IGlobeLayerProperties pGlobeLyrProps = null;
ILayerExtensions pLyrExtensions;
pLyrExtensions = (ILayerExtensions)pLayer;
for (int i = 0; i < pLyrExtensions.ExtensionCount; i++)
{
if (pLyrExtensions.get_Extension(i) is IGlobeLayerProperties)
{
pGlobeLyrProps = (IGlobeLayerProperties)pLyrExtensions.get_Extension(i);
break;
}
}
pGlobeLyrProps.HeightProperties.ZFactor = zfactor;//zfacotr夸张倍数
pGlobeLyrProps.HeightProperties.Apply(m_globeControl.Globe, pLayer);
IGlobeDisplayLayers2 pGDPlayer = m_globeControl.GlobeDisplay as IGlobeDisplayLayers2;
pGDPlayer.RefreshLayer(pLayer);//别忘记刷新图层,重新创建缓存