private IElement GetElement(IGeometry geometry, double size, esriSimple3DMarkerStyle simple3DMarkerStyle) { IElement element; IMarkerElement markerElement = new MarkerElementClass(); element = markerElement as IElement; ISimpleMarker3DSymbol simpleMarker3DSymbol = new SimpleMarker3DSymbolClass(); simpleMarker3DSymbol.Style = simple3DMarkerStyle; simpleMarker3DSymbol.ResolutionQuality = GetResolutionQuality(); IMarkerSymbol markerSymbol = simpleMarker3DSymbol as IMarkerSymbol; markerSymbol.Color = ColorSelection.GetColor(); markerSymbol.Size = size; IMarker3DPlacement marker3DPlacement = markerSymbol as IMarker3DPlacement; SetMarker3DPlacement(marker3DPlacement, markerSymbol.Size); element.Geometry = geometry; markerElement.Symbol = markerSymbol; return(element); }
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); }
/// <summary> /// 根据传入的点集合绘制符号 /// </summary> /// <param name="points">传入的点集合</param> /// <param name="symbolStyle">符号样式</param> /// <param name="symbolColor">符号颜色</param> /// <param name="symbolSize">符号大小</param> public static void AddGraphics(IScene pScene, IPoint point, string name) { try { esriSimple3DMarkerStyle symbolStyle = esriSimple3DMarkerStyle.esriS3DMSSphere; IRgbColor symbolColor = GetRGBColor(255, 0, 0); int symbolSize = 1; ISimpleMarker3DSymbol pSimpleMarker3DSymbol; pSimpleMarker3DSymbol = new SimpleMarker3DSymbolClass(); pSimpleMarker3DSymbol.Style = symbolStyle; pSimpleMarker3DSymbol.ResolutionQuality = 0.1; IMarker3DPlacement pMarker3DPlacement; pMarker3DPlacement = (IMarker3DPlacement)pSimpleMarker3DSymbol; pMarker3DPlacement.Color = symbolColor; pMarker3DPlacement.Width = 1; pMarker3DPlacement.Size = symbolSize; pMarker3DPlacement.Depth = 1; pMarker3DPlacement.SetRotationAngles(0, 0, 0); IGraphicsContainer3D pGC3D; pGC3D = pScene.BasicGraphicsLayer as IGraphicsContainer3D; MarkerElementClass pElement = new MarkerElementClass(); IMarkerElement pPointElement; pPointElement = (IMarkerElement)pElement; IMarkerSymbol pMarkerSymbol; pMarkerSymbol = (IMarkerSymbol)pSimpleMarker3DSymbol; pMarkerSymbol.Color = symbolColor; pPointElement.Symbol = pMarkerSymbol; (pPointElement as IElementProperties).Name = name; pElement.Geometry = point; pGC3D.AddElement(pElement); } catch (Exception ex) { Console.WriteLine(ex.Message + ex.StackTrace); } }
private IElement GetElement(IGeometry geometry, double size, esriSimple3DMarkerStyle simple3DMarkerStyle) { IElement element; IMarkerElement markerElement = new MarkerElementClass(); element = markerElement as IElement; ISimpleMarker3DSymbol simpleMarker3DSymbol = new SimpleMarker3DSymbolClass(); simpleMarker3DSymbol.Style = simple3DMarkerStyle; simpleMarker3DSymbol.ResolutionQuality = GetResolutionQuality(); IMarkerSymbol markerSymbol = simpleMarker3DSymbol as IMarkerSymbol; markerSymbol.Color = ColorSelection.GetColor(); markerSymbol.Size = size; IMarker3DPlacement marker3DPlacement = markerSymbol as IMarker3DPlacement; SetMarker3DPlacement(marker3DPlacement, markerSymbol.Size); element.Geometry = geometry; markerElement.Symbol = markerSymbol; return element; }
public PointElement(IGeometry geometry, double size, esriSimple3DMarkerStyle simple3DMarkerStyle) { _element = GetElement(geometry, size, simple3DMarkerStyle); _elementProperties = GetElementProperties(); }
public static void AddPointToGraphicsLayer3D(IGraphicsContainer3D graphicsContainer3D, IGeometry geometry, IColor color, esriSimple3DMarkerStyle style, double size) { graphicsContainer3D.AddElement(ElementUtilities.ConstructPointElement(geometry, color, style, size)); }
public static IElement ConstructPointElement(IGeometry geometry, IColor color, esriSimple3DMarkerStyle style, double size) { ISimpleMarker3DSymbol simpleMarker3DSymbol = new SimpleMarker3DSymbolClass(); simpleMarker3DSymbol.Style = style; simpleMarker3DSymbol.ResolutionQuality = HighResolution; IMarkerSymbol markerSymbol = simpleMarker3DSymbol as IMarkerSymbol; markerSymbol.Color = color; markerSymbol.Size = size; IMarker3DPlacement marker3DPlacement = markerSymbol as IMarker3DPlacement; marker3DPlacement.Units = Units; IMarkerElement markerElement = new MarkerElementClass(); markerElement.Symbol = markerSymbol; IElement element = markerElement as IElement; element.Geometry = geometry; return(element); }