Table of Contents

Class IsolineScene

Namespace
EncDotNet.S100.Renderers.Skia.Scene
Assembly
EncDotNet.S100.Renderers.Skia.dll

Prepared isolines for repeated drawing in screen space: the viewer draws a scene every frame through a Mapsui style renderer, and the headless composite draws it once. Lines are dashed and labelled in screen pixels, so the dash and label spacing stay constant at every zoom. When land areas are supplied the lines are clipped to water (issue #483; R-101-104-B).

public sealed class IsolineScene : IDisposable
Inheritance
IsolineScene
Implements
Inherited Members

Remarks

Geometry is held relative to an origin inside the scene so single-precision path coordinates keep sub-metre precision; each draw maps it to the screen with one affine matrix.

Constructors

IsolineScene(IReadOnlyList<IsolinePolyline>, IsolineAppearance, IReadOnlyList<FeatureGeometry>?)

Builds a scene from lines, clipped against landAreas when given.

public IsolineScene(IReadOnlyList<IsolinePolyline> lines, IsolineAppearance appearance, IReadOnlyList<FeatureGeometry>? landAreas = null)

Parameters

lines IReadOnlyList<IsolinePolyline>

The isolines.

appearance IsolineAppearance

How to draw them.

landAreas IReadOnlyList<FeatureGeometry>

Land-area surfaces in WGS84 to clip the lines out of, or null to draw them everywhere.

Properties

Appearance

How the scene is drawn.

public IsolineAppearance Appearance { get; }

Property Value

IsolineAppearance

IsEmpty

Whether the scene has no lines.

public bool IsEmpty { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Draw(SKCanvas, Func<double, double, SKPoint>, float, bool)

Draws the lines (and, unless drawLabels is false, the labels) onto canvas.

public void Draw(SKCanvas canvas, Func<double, double, SKPoint> mercatorToScreen, float opacity = 1, bool drawLabels = true)

Parameters

canvas SKCanvas

The canvas, in screen pixels.

mercatorToScreen Func<double, double, SKPoint>

Projects Web Mercator metres to screen pixels.

opacity float

Overall opacity, 0 to 1.

drawLabels bool

Whether to draw the labels with the lines.

DrawLabelsRotated(SKCanvas, Func<double, double, SKPoint>, double, float, float, SKRect)

Draws only the labels, each at its anchor turned by rotationDegrees about (centerX, centerY) and kept upright. Used by the headless composite on a rotated display, which draws the lines north-up and rotates them as an image.

public void DrawLabelsRotated(SKCanvas canvas, Func<double, double, SKPoint> mercatorToScreen, double rotationDegrees, float centerX, float centerY, SKRect cullBounds)

Parameters

canvas SKCanvas

The canvas, in screen pixels.

mercatorToScreen Func<double, double, SKPoint>

Projects Web Mercator metres to north-up screen pixels.

rotationDegrees double

Display rotation, clockwise.

centerX float

Rotation centre X.

centerY float

Rotation centre Y.

cullBounds SKRect

Labels whose turned anchor falls outside are skipped.