在SceneControl中实现ArcMap中的柱状图
在SceneControl中实现ArcMap中的柱状图
IRasterLayer pTinLyr = new RasterLayerClass();
pTinLyr = (IRasterLayer)SC1.Scene.get_Layer(1);
IRaster pRaster = pTinLyr.Raster;
IFeatureLayer pFeatureLyr = (IFeatureLayer)SC1.Scene.get_Layer(0);
I3DProperties pI3DProperties = new Feature3DPropertiesClass();
IRasterSurface pRasterSurface = new RasterSurfaceClass();
pRasterSurface.PutRaster(pRaster, 0);
ISurface pISurface = (ISurface)pRasterSurface;
ILayerExtensions p = (ILayerExtensions)pFeatureLyr;
object pp;
for (int i = 0; i < p.ExtensionCount; i++)
{
pp = p.get_Extension(i);
if (pp != null)
{
pI3DProperties = (I3DProperties)p.get_Extension(i);
break;
}
}
pI3DProperties.BaseOption = esriBaseOption.esriBaseSurface; //.esriBaseSurface;
pI3DProperties.DepthPriorityValue = 0;
pI3DProperties.BaseSurface = pISurface;
pI3DProperties.DepthPriorityValue = 0;
pI3DProperties.ExtrusionExpressionString = "Z";
pI3DProperties.ExtrusionType = esriExtrusionType.esriExtrusionAbsolute;
pI3DProperties.FaceCulling = esri3DFaceCulling.esriFaceCullingNone;
pI3DProperties.RenderMode = esriRenderMode.esriRenderCache; pI3DProperties.RenderRefreshRate = 0.75;
pI3DProperties.RenderVisibility = esriRenderVisibility.esriRenderAlways;
pI3DProperties.SmoothShading = true;
pI3DProperties.Apply3DProperties(pFeatureLyr);
pI3DProperties.ZFactor = 1;
IRgbColor pColor = new RgbColorClass();
pColor.Red = 255;
pColor.Green = 255;
ISimpleRenderer pSimpleRenderer = new SimpleRendererClass();
ISimpleMarkerSymbol pSMS = new SimpleMarkerSymbolClass();
pSMS.Size = 20;
pSMS.Color = pColor;
pSimpleRenderer.Symbol = (ISymbol)pSMS;
IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)pFeatureLyr;
pGeoFeatureLayer.Renderer = (IFeatureRenderer)pSimpleRenderer;
SC1.Scene.SceneGraph.Invalidate(pGeoFeatureLayer, true, true);
SC1.SceneGraph.RefreshViewers();
TOCControl1.Update();
posted on 2009-07-21 19:11 kisstome88 阅读(1299) 评论(4) 编辑 收藏 举报