/// <summary> /// 在三维场景中由两点生成线的绘制 20110609 /// </summary> /// <param name="Point1">前一个点要素</param> /// <param name="Point2">后一点要素</param> /// <param name="r"></param> /// <param name="g"></param> /// <param name="b"></param> /// <param name="Width">线符号宽</param> /// <returns></returns> public static IElement PointToPolyline(IPoint Point1, IPoint Point2, int r, int g, int b, double Width) { ILine line = new LineClass(); line.PutCoords(Point1, Point2); object missing = Type.Missing; ISegmentCollection segColl = new PolylineClass(); segColl.AddSegment(line as ISegment, ref missing, ref missing); IPolyline pPolyline = new PolylineClass(); pPolyline = segColl as IPolyline; IZAware pZAware = new PolylineClass(); pZAware = pPolyline as IZAware; pZAware.ZAware = true; IElement lineElement = new LineElementClass(); ISimpleLine3DSymbol pSimpleLine3DSymbol = new SimpleLine3DSymbolClass(); pSimpleLine3DSymbol.Style = esriSimple3DLineStyle.esriS3DLSWall; pSimpleLine3DSymbol.ResolutionQuality = 1; ILineSymbol pLineSymbol = pSimpleLine3DSymbol as ILineSymbol; pLineSymbol.Color = getRGB(r, g, b); pLineSymbol.Width = Width; lineElement.Geometry = pZAware as IGeometry; ILineElement lineElement2 = lineElement as ILineElement; lineElement2.Symbol = pLineSymbol; return(lineElement); }
public static IElement ConstructPolylineElement(IGeometry geometry, IColor color, esriSimple3DLineStyle style, double width) { ISimpleLine3DSymbol simpleLine3DSymbol = new SimpleLine3DSymbolClass(); simpleLine3DSymbol.Style = style; simpleLine3DSymbol.ResolutionQuality = HighResolution; ILineSymbol lineSymbol = simpleLine3DSymbol as ILineSymbol; lineSymbol.Color = color; lineSymbol.Width = width; ILine3DPlacement line3DPlacement = lineSymbol as ILine3DPlacement; line3DPlacement.Units = Units; ILineElement lineElement = new LineElementClass(); lineElement.Symbol = lineSymbol; IElement element = lineElement as IElement; element.Geometry = geometry; return(element); }
private ILineSymbol CreateNewSymbol(int type) { ILineSymbol simpleLineSymbolClass = null; switch (type) { case 0: { simpleLineSymbolClass = new SimpleLineSymbolClass(); break; } case 1: { simpleLineSymbolClass = new CartographicLineSymbolClass(); break; } case 2: { simpleLineSymbolClass = new MarkerLineSymbolClass(); break; } case 3: { simpleLineSymbolClass = new HashLineSymbolClass(); break; } case 4: { simpleLineSymbolClass = new PictureLineSymbolClass(); break; } case 5: { simpleLineSymbolClass = new SimpleLine3DSymbolClass(); break; } case 6: { simpleLineSymbolClass = new TextureLineSymbolClass(); break; } } return(simpleLineSymbolClass); }
//function for adding line graphics elements public void addLineGraphicElements(ESRI.ArcGIS.Geometry.IPolyline inLine, int symbolColor) { IElement pElement = new LineElementClass();// MarkerElementClass(); ISimpleLine3DSymbol symbol3d = new SimpleLine3DSymbolClass(); string markerStyle = ""; if (theCamForm.symbolTypeListBox.SelectedItem != null) { markerStyle = theCamForm.symbolTypeListBox.SelectedItem.ToString(); } if (markerStyle == "Strip") { symbol3d.Style = esriSimple3DLineStyle.esriS3DLSStrip; } else if (markerStyle == "Wall") { symbol3d.Style = esriSimple3DLineStyle.esriS3DLSWall; } else { symbol3d.Style = esriSimple3DLineStyle.esriS3DLSTube; } symbol3d.ResolutionQuality = 1; IColor pColor = new RgbColorClass(); pColor.RGB = symbolColor; ILineSymbol pLineSymbol; pLineSymbol = (ILineSymbol)symbol3d; pLineSymbol.Color = pColor; pLineSymbol.Width = 1; pElement.Geometry = inLine; ILineElement pLineElement; pLineElement = (ILineElement)pElement; pLineElement.Symbol = pLineSymbol; graphicsLayer.AddElement(pElement, 1); }
public static IElement ConstructPolylineElement(IGeometry geometry, IColor color, esriSimple3DLineStyle style, double width) { ISimpleLine3DSymbol simpleLine3DSymbol = new SimpleLine3DSymbolClass(); simpleLine3DSymbol.Style = style; simpleLine3DSymbol.ResolutionQuality = HighResolution; ILineSymbol lineSymbol = simpleLine3DSymbol as ILineSymbol; lineSymbol.Color = color; lineSymbol.Width = width; ILine3DPlacement line3DPlacement = lineSymbol as ILine3DPlacement; line3DPlacement.Units = Units; ILineElement lineElement = new LineElementClass(); lineElement.Symbol = lineSymbol; IElement element = lineElement as IElement; element.Geometry = geometry; return element; }
/// <summary> /// 三维场景中绘制线要素 20110609 /// </summary> /// <param name="pGeometry">线要素</param> /// <param name="r"></param> /// <param name="g"></param> /// <param name="b"></param> /// <param name="Width">线符号宽</param> /// <returns></returns> public static IElement DrawPolylineZ(IGeometry pGeometry, int r, int g, int b, double Width) { IPolyline pPolyline = (IPolyline)pGeometry; IZAware pZAware = new PolylineClass(); pZAware = pPolyline as IZAware; //ISimpleLine3DSymbol pSimpleLine3DSymbol = new SimpleLine3DSymbolClass(); pZAware.ZAware = true; IElement lineElement = new LineElementClass(); ISimpleLine3DSymbol pSimpleLine3DSymbol = new SimpleLine3DSymbolClass(); pSimpleLine3DSymbol.Style = esriSimple3DLineStyle.esriS3DLSWall; pSimpleLine3DSymbol.ResolutionQuality = 1; ILineSymbol pLineSymbol = pSimpleLine3DSymbol as ILineSymbol; pLineSymbol.Color = getRGB(r, g, b); pLineSymbol.Width = Width; lineElement.Geometry = pZAware as IGeometry; ILineElement lineElement2 = lineElement as ILineElement; lineElement2.Symbol = pLineSymbol; return(lineElement); }
//function for adding line graphics elements public void addLineGraphicElements(ESRI.ArcGIS.Geometry.IPolyline inLine, int symbolColor) { IElement pElement = new LineElementClass();// MarkerElementClass(); ISimpleLine3DSymbol symbol3d = new SimpleLine3DSymbolClass(); string markerStyle = ""; if (theCamForm.symbolTypeListBox.SelectedItem != null) { markerStyle = theCamForm.symbolTypeListBox.SelectedItem.ToString(); } if (markerStyle == "Strip") symbol3d.Style = esriSimple3DLineStyle.esriS3DLSStrip; else if (markerStyle == "Wall") symbol3d.Style = esriSimple3DLineStyle.esriS3DLSWall; else symbol3d.Style = esriSimple3DLineStyle.esriS3DLSTube; symbol3d.ResolutionQuality = 1; IColor pColor = new RgbColorClass(); pColor.RGB = symbolColor; ILineSymbol pLineSymbol; pLineSymbol = (ILineSymbol)symbol3d; pLineSymbol.Color = pColor; pLineSymbol.Width = 1; pElement.Geometry = inLine; ILineElement pLineElement; pLineElement = (ILineElement)pElement; pLineElement.Symbol = pLineSymbol; graphicsLayer.AddElement(pElement, 1); }