阅读:1337回复:1
请教关于三维图层设置基高的问题
<DIV >以下是我设置基高所采用的主要函数,但是程序执行时sceneviewer中图层不见了,请帮忙指教,很着急! <BR> HRESULT hr;<BR> int index = m_combo_currentlayer.GetCurSel();<BR> ILayerPtr pCurrentLayer = (ILayer *)m_combo_currentlayer.GetItemDataPtr(index);<BR> index = m_combo_layers.GetCurSel();<BR> ILayerPtr ppbasehLayer = (ILayer *)m_combo_layers.GetItemDataPtr(index);<BR> IRasterSurfacePtr pRSurface(CLSID_RasterSurface);<BR> IRasterLayerPtr prbasehLyer(ppbasehLayer);<BR> ISurfacePtr pSurface;<BR> if(prbasehLyer!=NULL)<BR> {<BR> IRasterPtr ipR;<BR> prbasehLyer ->get_Raster(;ipR);<BR> IRasterBandCollectionPtr pRasterBands(ipR);<BR> IRasterBandPtr pRasterBand;<BR> pRasterBands ->Item(0,;pRasterBand);<BR> pSurface = pRSurface;<BR> }<BR> ITinLayerPtr pTbasehLyer(ppbasehLayer);<BR> ITinPtr ipT;<BR> if (pTbasehLyer != NULL)<BR> {<BR> pTbasehLyer ->get_Dataset(;ipT);<BR> pSurface = ipT;<BR> }<BR> I3DPropertiesPtr pDDD;<BR> ILayerExtensionsPtr pLayerExts(pCurrentLayer);<BR> long count;<BR> pLayerExts ->get_ExtensionCount(;count);<BR> IUnknownPtr p3DProps;<BR> for (long i=0;i<count;i++)<BR> {<BR> pLayerExts ->get_Extension(i,;p3DProps);<BR> if (p3DProps != NULL)<BR> {<BR> pDDD = p3DProps;<BR> break;<BR> }<BR> }<BR> pDDD ->put_BaseOption(esriBaseSurface);<BR> hr = pDDD->putref_BaseSurface(pSurface);<BR> if (FAILED(hr))<BR> {<BR> return;<BR> }<BR> hr = pDDD ->Apply3DProperties(pCurrentLayer);<BR> <BR> ISceneGraphPtr ipSceneGrap;<BR> ipScene ->get_SceneGraph(;ipSceneGrap);<BR> hr = ipSceneGrap ->RefreshViewers();<BR></DIV>
|
|
1楼#
发布于:2007-03-05 16:12
问题已解决,虽然没人关注,但还是谢谢大家!<img src="images/post/smile/dvbbs/em04.gif" />
|
|