public static void DrawLine(IGraphicsContainer3D lineGraphicsContainer3D, IPointCollection linePointCollection) { const esriSimple3DLineStyle lineStyle = esriSimple3DLineStyle.esriS3DLSTube; const double lineWidth = 0.25; IColor lineColor = ColorUtilities.GetColor(255, 0, 0); GeometryUtilities.MakeZAware(linePointCollection as IGeometry); GraphicsLayer3DUtilities.AddLineToGraphicsLayer3D(lineGraphicsContainer3D, linePointCollection as IGeometry, lineColor, lineStyle, lineWidth); }
public static void DrawPoint(IGraphicsContainer3D lineGraphicsContainer3D, IPoint point, IColor color, double size) { const esriSimple3DMarkerStyle markerStyle = esriSimple3DMarkerStyle.esriS3DMSCube; //const double size = 20; //IColor markerColor = ColorUtilities.GetColor(0, 255, 0); GeometryUtilities.MakeZAware(point as IGeometry); GraphicsLayer3DUtilities.AddPointToGraphicsLayer3D(lineGraphicsContainer3D, point as IGeometry, color, markerStyle, size); }
public static void DrawMultiPatch(IGraphicsContainer3D multiPatchGraphicsContainer3D, IGeometry geometry) { const int Yellow_R = 255; const int Yellow_G = 255; const int Yellow_B = 0; IColor multiPatchColor = ColorUtilities.GetColor(Yellow_R, Yellow_G, Yellow_B); multiPatchGraphicsContainer3D.DeleteAllElements(); GraphicsLayer3DUtilities.AddMultiPatchToGraphicsLayer3D(multiPatchGraphicsContainer3D, geometry, multiPatchColor); }
public static void DrawOutline(IGraphicsContainer3D outlineGraphicsContainer3D, IGeometry geometry) { const esriSimple3DLineStyle OutlineStyle = esriSimple3DLineStyle.esriS3DLSTube; const double OutlineWidth = 0.1; const int Black_R = 0; const int Black_G = 0; const int Black_B = 0; IColor outlineColor = ColorUtilities.GetColor(Black_R, Black_G, Black_B); outlineGraphicsContainer3D.DeleteAllElements(); GraphicsLayer3DUtilities.AddOutlineToGraphicsLayer3D(outlineGraphicsContainer3D, GeometryUtilities.ConstructMultiPatchOutline(geometry), outlineColor, OutlineStyle, OutlineWidth); }
/// <summary> /// 获取指定名称的图层 /// </summary> /// <param name="layerName"></param> /// <returns></returns> public ILayer GetLayer(string layerName) { ILayer layer = null; if (this.m_sceneControl != null) { int n = this.m_sceneControl.Scene.LayerCount; for (int i = 0; i < this.m_sceneControl.Scene.LayerCount; i++) { layer = this.SceneControl.Scene.get_Layer(i); if (layer is IGroupLayer) { ICompositeLayer pGroupLayer = layer as ICompositeLayer; IFeatureLayer pFeatLayer = null; for (int j = 0; j < pGroupLayer.Count; j++) { if (pGroupLayer.get_Layer(j) is IFeatureLayer) { pFeatLayer = pGroupLayer.get_Layer(j) as IFeatureLayer; if (pFeatLayer.Name.ToUpper() == layerName.ToUpper()) { return(pFeatLayer); } } } } else if (layer.Name.ToUpper() == layerName.ToUpper()) { return(layer); } } if (layerName == LayerNames.Rays) { IGraphicsContainer3D raysGraphicsContainer3D = GraphicsLayer3DUtilities.ConstructGraphicsLayer3D(LayerNames.Rays); AddLayer(raysGraphicsContainer3D as ILayer); return(raysGraphicsContainer3D as ILayer); } } return(null); }