/// <summary> /// Creates a new element representing a poly line. /// </summary> /// <param name="line"></param> /// <param name="argb"></param> /// <param name="width"></param> public ElementLine(ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine> line, int color_argb, double width) { _color = color_argb; _width = width; _line = line; _fixed_width = false; this.Style = LineStyle.Solid; this.StartCap = LineCap.Round; this.EndCap = LineCap.Round; }
/// <summary> /// Creates a new element representing a poly line. /// </summary> /// <param name="line"></param> /// <param name="argb"></param> /// <param name="width"></param> public ElementLine(ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine> line, int color_argb, double width, bool fixed_width) { _color = color_argb; _width = width; _line = line; _fixed_width = fixed_width; }
/// <summary> /// Adds a line to this layer. /// </summary> /// <param name="dot"></param> /// <returns></returns> public ElementLine AddLine(ElementLine line, GeoCoordinate dot, bool create_dot) { lock (_elements) { // remove the old line. _elements.Remove(line); } // add new dot. if (create_dot) { this.AddDot(dot); } // create polyline. List<GeoCoordinate> coordinates = new List<GeoCoordinate>(); coordinates.AddRange(line.Line.Points); coordinates.Add(dot); ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine> polyline = new ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine>( PrimitiveGeoFactory.Instance, coordinates.ToArray()); // create the line element. ElementLine element = new ElementLine( polyline, Color.Black.ToArgb(), 0.0002f, true); lock (_elements) { _elements.Add(element); } return element; }
/// <summary> /// Adds a line to this layer. /// </summary> /// <param name="dot"></param> /// <returns></returns> public ElementLine AddLine( GeoCoordinate dot1, GeoCoordinate dot2, bool create_dot, double width, bool width_fixed, int color) { // add new dot. if (create_dot) { this.AddDot(dot1); this.AddDot(dot2); } // create polyline. List<GeoCoordinate> coordinates = new List<GeoCoordinate>(); coordinates.Add(dot1); coordinates.Add(dot2); ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine> line = new ShapePolyLineF<GeoCoordinate, GeoCoordinateBox, GeoCoordinateLine>( PrimitiveGeoFactory.Instance, coordinates.ToArray()); // create the line element. ElementLine element = new ElementLine( line, color, width, width_fixed); //ElementLine element = new ElementLine( // line, // Color.FromArgb(230,Color.Blue).ToArgb(), // 0.0002f, // true); lock (_elements) { _elements.Add(element); } return element; }