private static IEnumerable <uint> Encode(IPuntal puntal, TileGeometryTransform tgt) { const int CoordinateIndex = 0; var geometry = (Geometry)puntal; int currentX = 0, currentY = 0; var parameters = new List <uint>(); for (int i = 0; i < geometry.NumGeometries; i++) { var point = (Point)geometry.GetGeometryN(i); (int x, int y) = tgt.Transform(point.CoordinateSequence, CoordinateIndex, ref currentX, ref currentY); if (i == 0 || x > 0 || y > 0) { parameters.Add(GenerateParameterInteger(x)); parameters.Add(GenerateParameterInteger(y)); } } // Return result yield return(GenerateCommandInteger(MapboxCommandType.MoveTo, parameters.Count / 2)); foreach (uint parameter in parameters) { yield return(parameter); } }
/// <summary> /// Method to render the Point to the <see cref="Graphics"/> object. /// </summary> /// <param name="map">The map object</param> /// <param name="points">Location where to render the Symbol</param> /// <param name="g">The graphics object to use.</param> public void Render(MapViewport map, IPuntal points, Graphics g) { foreach (var pointSymbolizer in Items) { pointSymbolizer.Render(map, points, g); } }
/// <summary> /// Method to render the Point to the <see cref="Graphics"/> object. /// </summary> /// <param name="map">The map object</param> /// <param name="points">Location where to render the Symbol</param> /// <param name="g">The graphics object to use.</param> public void Render(MapViewport map, IPuntal points, Graphics g) { var combinedArea = RectangleF.Empty; foreach (var pointSymbolizer in Items) { pointSymbolizer.Render(map, points, g); combinedArea = pointSymbolizer.CanvasArea.ExpandToInclude(combinedArea); } CanvasArea = combinedArea; }
/// <summary> /// Function to render the geometry /// </summary> /// <param name="map">The map object, mainly needed for transformation purposes.</param> /// <param name="geometry">The geometry to symbolize.</param> /// <param name="graphics">The graphics object to use.</param> public void Render(MapViewport map, IPuntal geometry, Graphics graphics) { var mp = geometry as IMultiPoint; if (mp != null) { foreach (var point in mp.Coordinates) { RenderPoint(map, point, graphics); } return; } RenderPoint(map, ((IPoint)geometry).Coordinate, graphics); }
public void Render(Map map, IPuntal geometry, Graphics graphics) { var mp = geometry as MultiPoint; if (mp != null) { foreach (Point point in mp.Points) { RenderPoint(map, point, graphics); } return; } RenderPoint(map, geometry as Point, graphics); }
/// <summary> /// Function to render the geometry /// </summary> /// <param name="map">The map object, mainly needed for transformation purposes.</param> /// <param name="geometry">The geometry to symbolize.</param> /// <param name="graphics">The graphics object to use.</param> public void Render(MapViewport map, IPuntal geometry, Graphics graphics) { var mp = geometry as IMultiPoint; if (mp != null) { var combinedArea = RectangleF.Empty; foreach (var point in mp.Coordinates) { RenderPoint(map, point, graphics); combinedArea = CanvasArea.ExpandToInclude(combinedArea); } CanvasArea = combinedArea; return; } RenderPoint(map, ((IPoint)geometry).Coordinate, graphics); }
public PreparedPoint(IPuntal point) : base((IGeometry)point) { }
/// <summary> /// Function to render the geometry /// </summary> /// <param name="map">The map object, mainly needed for transformation purposes.</param> /// <param name="geometry">The geometry to symbolize.</param> /// <param name="graphics">The graphics object to use.</param> public void Render(Map map, IPuntal geometry, IGraphics graphics) { var mp = geometry as IMultiPoint; if (mp != null) { foreach (var point in mp.Coordinates) RenderPoint(map, point, graphics); return; } RenderPoint(map, ((IPoint)geometry).Coordinate, graphics); }
///<summary> /// Computes the union of a <see cref="IPoint"/> geometry with /// another arbitrary <see cref="IGeometry"/>. /// Does not copy any component geometries. ///</summary> ///<param name="pointGeom"></param> ///<param name="otherGeom"></param> ///<returns></returns> public static IGeometry Union(IPuntal pointGeom, IGeometry otherGeom) { var unioner = new PointGeometryUnion(pointGeom, otherGeom); return unioner.Union(); }
public PointGeometryUnion(IPuntal pointGeom, IGeometry otherGeom) { _pointGeom = (IGeometry)pointGeom; _otherGeom = otherGeom; _geomFact = otherGeom.Factory; }
/// <summary> /// Computes the union of a <see cref="Point"/> geometry with /// another arbitrary <see cref="Geometry"/>. /// Does not copy any component geometries. /// </summary> /// <param name="pointGeom"></param> /// <param name="otherGeom"></param> /// <returns></returns> public static Geometry Union(IPuntal pointGeom, Geometry otherGeom) { var unioner = new PointGeometryUnion(pointGeom, otherGeom); return(unioner.Union()); }
public PointGeometryUnion(IPuntal pointGeom, Geometry otherGeom) { _pointGeom = (Geometry)pointGeom; _otherGeom = otherGeom; _geomFact = otherGeom.Factory; }
public void Render(Map map, IPuntal geometry, Graphics graphics) { var mp = geometry as MultiPoint; if (mp != null) { foreach (Point point in mp.Points) RenderPoint(map, point, graphics); return; } RenderPoint(map, geometry as Point, graphics); }