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(); }
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 BeginFigure(double latitude, double longitude, Nullable <double> z, Nullable <double> m) { double x, y; _projection.ProjectPoint(latitude, longitude, out x, out y); _sink.BeginFigure(x, y, z, m); }
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(); }
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 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 BeginFigure(double x, double y, double?z, double?m) { if (m_depth == 0) { m_sink.BeginFigure(x, y, z, m); } }
public void BeginFigure(double latitude, double longitude, double?z, double?m) { while (m_types.Count > 0) { m_sink.BeginGeometry(m_types.Dequeue()); } m_sink.BeginFigure(latitude, longitude, z, m); }
public void BeginFigure(double latitude, double longitude, Nullable<double> z, Nullable<double> m) { double[] fromPoint = { longitude, latitude }; double[] toPoint = _trans.MathTransform.Transform(fromPoint); double x = toPoint[0]; double y = toPoint[1]; _sink.BeginFigure(x, y, z, m); }
public void BeginFigure(double x, double y, Nullable <double> z, Nullable <double> m) { double[] fromPoint = { x, y }; double[] toPoint = _trans.MathTransform.Transform(fromPoint); double tox = toPoint[0]; double toy = toPoint[1]; _sink.BeginFigure(tox, toy, z, m); }
/// <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(); }
public void BeginFigure(double x, double y, double?z, double?m) { if (m_insidePolygon) { m_figure.Clear(); m_figure.Add(new Vertex(x, y, z, m)); } else { m_sink.BeginFigure(x, y, z, m); } }
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(); }
/// <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(); }
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(); }
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) { 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) { 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); }
public void BeginFigure(IGeometrySink sink) { sink.BeginFigure(x, y, z, m); }
// Each BeginFigure call will just move the start point by the required amount. public void BeginFigure(double x, double y, double?z, double?m) { _target.BeginFigure(x + _xShift, y + _yShift, z, m); }
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 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 BeginFigure(double x, double y, double?z, double?m) { _sink.BeginFigure(_transform.GetX(x, y), _transform.GetY(x, y), z, m); }
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 BeginFigure(double latitude, double longitude, double?z, double?m) { _target.BeginFigure(longitude, latitude, z, m); }