private static void DrawLinestring(Geometry.Linestring linestring, Geometry.Box box, Graphics graphics, Settings settings, Geometry.Traits traits) { LocalCS cs = new LocalCS(box, graphics); Drawer drawer = new Drawer(graphics, settings.color); if (traits.Unit == Geometry.Unit.None) { for (int i = 1; i < linestring.Count; ++i) { PointF p0 = cs.Convert(linestring[i - 1]); PointF p1 = cs.Convert(linestring[i]); drawer.DrawLine(p0, p1); if (settings.showDir) { drawer.DrawDir(p0, p1); } } } else // Radian, Degree { Drawer.PeriodicDrawableRange pd = new Drawer.PeriodicDrawableRange(cs, linestring, false, traits.Unit, settings.densify); Geometry.Interval interval = RelativeEnvelopeLon(linestring, false, traits.Unit); drawer.DrawPeriodic(cs, box, interval, traits.Unit, pd, false, settings.showDir, settings.showDots); } }
public void Draw(Geometry.Box box, Graphics graphics, Settings settings, Geometry.Traits traits) { LocalCS cs = new LocalCS(box, graphics); Drawer drawer = new Drawer(graphics, settings.color); if (traits.Unit == Geometry.Unit.None) { PointF[] dst_points = cs.Convert(this); if (dst_points != null) { drawer.FillPolygon(dst_points); drawer.DrawPolygon(dst_points); if (settings.showDir) { drawer.DrawDirs(dst_points, true); drawer.DrawPoint(dst_points[0].X, dst_points[0].Y); } } } else { Drawer.PeriodicDrawableRange pd = new Drawer.PeriodicDrawableRange(cs, this, true, traits.Unit, settings.densify); Geometry.Interval interval = RelativeEnvelopeLon(this, true, traits.Unit); drawer.DrawPeriodic(cs, box, interval, traits.Unit, pd, true, settings.showDir, settings.showDots); if (settings.showDir && this.Count > 0) { drawer.DrawPeriodicPoint(cs, this[0], box, traits.Unit, settings.showDots); } } }
public void Draw(Geometry.Box box, Graphics graphics, Settings settings, Geometry.Traits traits) { LocalCS cs = new LocalCS(box, graphics); Drawer drawer = new Drawer(graphics, settings.color); if (traits.Unit == Geometry.Unit.None) { PointF p0 = cs.Convert(this[0]); PointF p1 = cs.Convert(this[1]); drawer.DrawLine(p0, p1); if (settings.showDir) { drawer.DrawDir(p0, p1); } } else // Radian, Degree { Drawer.PeriodicDrawableRange pd = new Drawer.PeriodicDrawableRange(cs, this, false, traits.Unit, settings.densify); Geometry.Interval interval = RelativeEnvelopeLon(this, false, traits.Unit); drawer.DrawPeriodic(cs, box, interval, traits.Unit, pd, false, settings.showDir, settings.showDots); } }