internal static void Populate(IGeometrySink sink, IList<PointNode> points, GeometryType type) { if (points.Count>0) { if (type!=GeometryType.LineString) sink.BeginGeometry(GeometryType.Point); sink.BeginFigure(points[0].X, points[0].Y, null); if (type==GeometryType.MultiPoint) sink.EndFigure(); for (int i=1; i<points.Count; ++i) if (type==GeometryType.MultiPoint) { sink.BeginFigure(points[i].X, points[i].Y, null); sink.EndFigure(); } else sink.AddLine(points[i].X, points[i].Y, null); if (type!=GeometryType.MultiPoint) sink.EndFigure(); if (type!=GeometryType.LineString) sink.EndGeometry(); } }
public void Populate(IGeometrySink sink) { sink.SetCoordinateSystem(CoordinateSystem); sink.BeginGeometry(GeometryType.Polygon); if ( (lowerCorner!=null) && (lowerCorner.TypedValue!=null) && (lowerCorner.TypedValue.Count==2) && (upperCorner!=null) && (upperCorner.TypedValue!=null) && (upperCorner.TypedValue.Count==2) ) { double minlon=Math.Min(lowerCorner.TypedValue[0], upperCorner.TypedValue[0]); double maxlon=Math.Max(lowerCorner.TypedValue[0], upperCorner.TypedValue[0]); double minlat=Math.Min(lowerCorner.TypedValue[1], upperCorner.TypedValue[1]); double maxlat=Math.Max(lowerCorner.TypedValue[1], upperCorner.TypedValue[1]); sink.BeginFigure(minlon, minlat, null); sink.AddLine(maxlon, minlat, null); sink.AddLine(maxlon, maxlat, null); sink.AddLine(minlon, maxlat, null); sink.AddLine(minlon, minlat, null); sink.EndFigure(); } sink.EndGeometry(); }
private static void CreateFigure(IGeometrySink sink, IList <SmGeometries.Point> points) { if ((points == null) || (points.Count == 0)) { return; } var p0 = points[0]; var p03 = p0 as SmGeometries.Point3D; if (p03 != null) { sink.BeginFigure(p03.X, p03.Y, p03.Z); } else { sink.BeginFigure(p0.X, p0.Y, null); } for (int i = 1; i < points.Count; ++i) { var pi = points[i]; var pi3 = pi as SmGeometries.Point3D; if (pi3 != null) { sink.AddLine(pi3.X, pi3.Y, pi3.Z); } else { sink.AddLine(pi.X, pi.Y, null); } } sink.EndFigure(); }
public void Populate(IGeometrySink sink) { sink.SetCoordinateSystem(CoordinateSystem); sink.BeginGeometry(GeometryType.Polygon); if ( (lowerCorner != null) && (lowerCorner.TypedValue != null) && (lowerCorner.TypedValue.Count == 2) && (upperCorner != null) && (upperCorner.TypedValue != null) && (upperCorner.TypedValue.Count == 2) ) { double minlon = Math.Min(lowerCorner.TypedValue[0], upperCorner.TypedValue[0]); double maxlon = Math.Max(lowerCorner.TypedValue[0], upperCorner.TypedValue[0]); double minlat = Math.Min(lowerCorner.TypedValue[1], upperCorner.TypedValue[1]); double maxlat = Math.Max(lowerCorner.TypedValue[1], upperCorner.TypedValue[1]); sink.BeginFigure(minlon, minlat, null); sink.AddLine(maxlon, minlat, null); sink.AddLine(maxlon, maxlat, null); sink.AddLine(minlon, maxlat, null); sink.AddLine(minlon, minlat, null); sink.EndFigure(); } sink.EndGeometry(); }
public void EndFigure() { if (m_depth == 0) { m_sink.EndFigure(); } }
internal protected override void InternalPopulate(IGeometrySink sink) { int dim = 2; if (srsDimension.HasValue) { dim = Convert.ToInt32(srsDimension.Value); } sink.BeginGeometry(GeometryType.Point); //if (pos!=null) if (Untyped.Descendants("{http://www.opengis.net/gml}pos").Any <XElement>()) { if (pos.srsDimension.HasValue) { dim = Convert.ToInt32(pos.srsDimension.Value); } if ((pos.TypedValue != null) && (pos.TypedValue.Count >= dim)) { sink.BeginFigure(pos.TypedValue[0], pos.TypedValue[1], dim > 2 ? pos.TypedValue[2] : (double?)null); sink.EndFigure(); } } sink.EndGeometry(); }
private void PopulateFigure(IGeometrySink sink) { m_figure[0].BeginFigure(sink); for (int i = 1; i < m_figure.Count; i++) { m_figure[i].AddLine(sink); } sink.EndFigure(); }
/// <summary>Applies a geometry type call sequence to the specified <paramref name="sink" />.</summary> /// <param name="sink">The sink to populate.</param> public void Populate(IGeometrySink sink) { sink.BeginGeometry(GeometryType.Point); if (_Point!=null) { sink.BeginFigure(_Point.X, _Point.Y, null); sink.EndFigure(); } sink.EndGeometry(); }
/// <summary>Applies a geometry type call sequence to the specified <paramref name="sink" />.</summary> /// <param name="sink">The sink to populate.</param> public void Populate(IGeometrySink sink) { sink.BeginGeometry(GeometryType.Point); if (_Point != null) { sink.BeginFigure(_Point.X, _Point.Y, null); sink.EndFigure(); } sink.EndGeometry(); }
internal static void Populate(IGeometrySink sink, IList <PointNode> points, GeometryType type) { if (points.Count > 0) { if (type != GeometryType.LineString) { sink.BeginGeometry(GeometryType.Point); } sink.BeginFigure(points[0].X, points[0].Y, null); if (type == GeometryType.MultiPoint) { sink.EndFigure(); } for (int i = 1; i < points.Count; ++i) { if (type == GeometryType.MultiPoint) { sink.BeginFigure(points[i].X, points[i].Y, null); sink.EndFigure(); } else { sink.AddLine(points[i].X, points[i].Y, null); } } if (type != GeometryType.MultiPoint) { sink.EndFigure(); } if (type != GeometryType.LineString) { sink.EndGeometry(); } } }
protected internal override void InternalPopulate(IGeometrySink sink) { int dim=2; if (srsDimension.HasValue) dim=Convert.ToInt32(srsDimension.Value); if (posList.srsDimension.HasValue) dim=Convert.ToInt32(posList.srsDimension.Value); sink.BeginFigure(posList.TypedValue[0], posList.TypedValue[1], dim>2 ? posList.TypedValue[2] : (double?)null); for (int i=dim; i<posList.TypedValue.Count; i+=dim) sink.AddLine(posList.TypedValue[i], posList.TypedValue[i+1], dim>2 ? posList.TypedValue[i+2] : (double?)null); sink.EndFigure(); }
public void EndFigure() { if (m_insidePolygon) { if (!IsThinRing()) { PopulateFigure(m_sink); } } else { m_sink.EndFigure(); } }
public void EndFigure() { if (m_insideLineString) { if (!IsShortLineString()) { PopulateFigure(m_sink); } } else { m_sink.EndFigure(); } }
/// <summary>Applies a geometry type call sequence to the specified <paramref name="sink" />.</summary> /// <param name="sink">The sink to populate.</param> /// <remarks> /// <para>The call sequence is a set of figures, lines, and points for geometry types.</para> /// </remarks> public void Populate(IGeometrySink sink) { sink.SetCoordinateSystem(CoordinateSystem); sink.BeginGeometry(GeometryType.Polygon); sink.BeginFigure(_Envelope.MinX, _Envelope.MinY, null); sink.AddLine(_Envelope.MaxX, _Envelope.MinY, null); sink.AddLine(_Envelope.MaxX, _Envelope.MaxY, null); sink.AddLine(_Envelope.MinX, _Envelope.MaxY, null); sink.AddLine(_Envelope.MinX, _Envelope.MinY, null); sink.EndFigure(); sink.EndGeometry(); }
internal protected override void InternalPopulate(IGeometrySink sink) { sink.BeginGeometry(GeometryType.LineString); //if (posList!=null) if (Untyped.Descendants("{http://www.opengis.net/gml}posList").Any<XElement>()) if ((posList.TypedValue!=null) && (posList.TypedValue.Count>=2)) { sink.BeginFigure(posList.TypedValue[0], posList.TypedValue[1], null); for (int i=2; i<posList.TypedValue.Count; i+=2) sink.AddLine(posList.TypedValue[i], posList.TypedValue[i+1], null); sink.EndFigure(); } sink.EndGeometry(); }
internal protected override void InternalPopulate(IGeometrySink sink) { sink.BeginGeometry(GeometryType.LineString); //if (posList!=null) if (Untyped.Descendants("{http://www.opengis.net/gml}posList").Any <XElement>()) { if ((posList.TypedValue != null) && (posList.TypedValue.Count >= 2)) { sink.BeginFigure(posList.TypedValue[0], posList.TypedValue[1], null); for (int i = 2; i < posList.TypedValue.Count; i += 2) { sink.AddLine(posList.TypedValue[i], posList.TypedValue[i + 1], null); } sink.EndFigure(); } } sink.EndGeometry(); }
protected internal override void InternalPopulate(IGeometrySink sink) { int dim = 2; if (srsDimension.HasValue) { dim = Convert.ToInt32(srsDimension.Value); } if (posList.srsDimension.HasValue) { dim = Convert.ToInt32(posList.srsDimension.Value); } sink.BeginFigure(posList.TypedValue[0], posList.TypedValue[1], dim > 2 ? posList.TypedValue[2] : (double?)null); for (int i = dim; i < posList.TypedValue.Count; i += dim) { sink.AddLine(posList.TypedValue[i], posList.TypedValue[i + 1], dim > 2 ? posList.TypedValue[i + 2] : (double?)null); } sink.EndFigure(); }
internal protected override void InternalPopulate(IGeometrySink sink) { int dim=2; if (srsDimension.HasValue) dim=Convert.ToInt32(srsDimension.Value); sink.BeginGeometry(GeometryType.Point); //if (pos!=null) if (Untyped.Descendants("{http://www.opengis.net/gml}pos").Any<XElement>()) { if (pos.srsDimension.HasValue) dim=Convert.ToInt32(pos.srsDimension.Value); if ((pos.TypedValue!=null) && (pos.TypedValue.Count>=dim)) { sink.BeginFigure(pos.TypedValue[0], pos.TypedValue[1], dim>2 ? pos.TypedValue[2] : (double?)null); sink.EndFigure(); } } sink.EndGeometry(); }
private void AddRandomFigure(IGeometrySink sink, int segmentCount) { previousPoint = null; sink.BeginFigure( RandomNearPoint(), CoinFlip ? FigureBegin.Filled : FigureBegin.Hollow); FigureEnd end = CoinFlip ? FigureEnd.Closed : FigureEnd.Closed; if (end == FigureEnd.Closed) { segmentCount--; } if (CoinFlip) { for (int i = 0; i < segmentCount; i++) { AddRandomSegment(sink); } } else { double which = Random.NextDouble(); if (which < 0.33) { sink.AddLines(RandomLines(segmentCount)); } else if (which < 0.67) { sink.AddQuadraticBeziers(RandomQuadraticBeziers(segmentCount)); } else { sink.AddBeziers(RandomBeziers(segmentCount)); } } sink.EndFigure(end); }
private static void CreateFigure(IGeometrySink sink, FGeometry.DirectPositionCollection positions) { if ((positions == null) || (positions.Count == 0)) { return; } using (FGeometry.IDirectPosition p0 = positions[0]) { if (p0.Dimensionality > 2) { sink.BeginFigure(p0.X, p0.Y, p0.Z); } else { sink.BeginFigure(p0.X, p0.Y, null); } } for (int i = 1; i < positions.Count; ++i) { using (FGeometry.IDirectPosition pi = positions[i]) { if (pi.Dimensionality > 2) { sink.AddLine(pi.X, pi.Y, pi.Z); } else { sink.AddLine(pi.X, pi.Y, null); } } } sink.EndFigure(); }
// Just pass through without change. public void EndFigure() { _target.EndFigure(); }
private void AddRandomFigure(IGeometrySink sink, int segmentCount) { previousPoint = null; sink.BeginFigure( RandomNearPoint(), CoinFlip ? FigureBegin.Filled : FigureBegin.Hollow); FigureEnd end = CoinFlip ? FigureEnd.Closed : FigureEnd.Closed; if (end == FigureEnd.Closed) segmentCount--; if (CoinFlip) for (int i = 0; i < segmentCount; i++) AddRandomSegment(sink); else { double which = Random.NextDouble(); if (which < 0.33) sink.AddLines(RandomLines(segmentCount)); else if (which < 0.67) sink.AddQuadraticBeziers(RandomQuadraticBeziers(segmentCount)); else sink.AddBeziers(RandomBeziers(segmentCount)); } sink.EndFigure(end); }
public void EndFigure() { _sink.EndFigure(); }
private static void CreateFigure(IGeometrySink sink, FGeometry.DirectPositionCollection positions) { if ((positions==null) || (positions.Count==0)) return; using (FGeometry.IDirectPosition p0=positions[0]) { if (p0.Dimensionality>2) sink.BeginFigure(p0.X, p0.Y, p0.Z); else sink.BeginFigure(p0.X, p0.Y, null); } for (int i=1; i<positions.Count; ++i) using (FGeometry.IDirectPosition pi=positions[i]) { if (pi.Dimensionality>2) sink.AddLine(pi.X, pi.Y, pi.Z); else sink.AddLine(pi.X, pi.Y, null); } sink.EndFigure(); }
private static void CreateFigure(IGeometrySink sink, IList<SmGeometries.Point> points) { if ((points==null) || (points.Count==0)) return; var p0=points[0]; var p03=p0 as SmGeometries.Point3D; if (p03!=null) sink.BeginFigure(p03.X, p03.Y, p03.Z); else sink.BeginFigure(p0.X, p0.Y, null); for (int i=1; i<points.Count; ++i) { var pi=points[i]; var pi3=pi as SmGeometries.Point3D; if (pi3!=null) sink.AddLine(pi3.X, pi3.Y, pi3.Z); else sink.AddLine(pi.X, pi.Y, null); } sink.EndFigure(); }