Table of Contents

Class S111PortrayalCatalogue

Namespace
EncDotNet.S100.Datasets.S111
Assembly
EncDotNet.S100.Datasets.S111.dll

Portrayal catalogue for S-111 Surface Currents (Ed 2.0.0). Loads the official IHO colour profile (Day/Dusk/Night) and the surface-current speed-band table from the bundled portrayal catalogue assets.

public class S111PortrayalCatalogue : ICoverageStyle, IPortrayalCatalogue
Inheritance
S111PortrayalCatalogue
Implements
Inherited Members

Remarks

Palettes are cached on the shared IPortrayalAssetCache (PR-3 / PR-4 of the asset-caching audit). The parsed speed-band table is cached on the catalogue instance itself rather than on the shared cache: the table is the only consumer, the parser runs once per catalogue lifetime, and a per-instance field avoids growing IPortrayalAssetCache's public surface for a single-spec asset.

The speed-band table, symbol references and the three scale constants are parsed from Rules/select_arrow.xsl via S111SpeedBandReader; no spec-derived constants are hard-coded in this catalogue.

Constructors

S111PortrayalCatalogue(PortrayalCatalogueProvider)

Creates a catalogue backed by a real portrayal catalogue provider. Colours come from the bundled colour profile; speed bands from the bundled XSLT rules.

public S111PortrayalCatalogue(PortrayalCatalogueProvider provider)

Parameters

provider PortrayalCatalogueProvider

Fields

NominalArrowLengthMillimetres

The length of a SCAROW arrow at scale 1: 10 mm. S-111 Ed 2.0.0 Figure 9-1 (and Annex H Rule 1) puts the arrow's tip at y = -5 mm and its tail at y = +5 mm; the bundled SCAROW01–09 SVGs use the same path, and the catalogue's scale factors (0.40 / 0.20 × speed / 2.60) are Href · min(max(Slow, S), Shigh) / Sref (Eqn 9.1) divided by this Href. Thinning spaces arrows by this length times their scale.

public const double NominalArrowLengthMillimetres = 10

Field Value

double

Properties

ActivePalette

The currently active colour palette.

public ColorPalette ActivePalette { get; }

Property Value

ColorPalette

Remarks

Implementations start at the empty Default until the first SwitchPaletteAsync(PaletteType, CancellationToken) call; never null.

CatalogueRef

The identity of the underlying portrayal catalogue XML, when available.

public CatalogueRef? CatalogueRef { get; }

Property Value

CatalogueRef?

Contours

Contour line styles to draw over the coverage, one per contour value. Empty when the style defines no contours (the case for every bundled style today).

public IReadOnlyList<ContourStyle> Contours { get; }

Property Value

IReadOnlyList<ContourStyle>

Remarks

Always empty: S-111 is portrayed with arrow symbols only.

Edition

The edition of the underlying portrayal catalogue (matches PortrayalCatalogue.Version).

public string Edition { get; }

Property Value

string

Remarks

Falls back to 2.0.0 when the catalogue does not declare a version.

Spec

The product specification (name + edition) this catalogue targets.

public SpecRef Spec { get; }

Property Value

SpecRef

Methods

ResolveColorScheme(MarinerSettings)

Returns null: the bundled S-111 Edition 2.0.0 portrayal catalogue defines arrow symbology only — see content/S111/pc/Rules/select_arrow.xsl, which emits a <coverageInstruction> with per-band <symbol> elements and no <color> child. Overlaying a synthetic speed-band colour fill on top of S-101 ENC obscures the base chart, so this catalogue intentionally does not produce one. Renderers consult ResolveSymbolScheme(MarinerSettings) instead.

public CoverageColorScheme? ResolveColorScheme(MarinerSettings settings)

Parameters

settings MarinerSettings

Returns

CoverageColorScheme

ResolveSymbolScheme(MarinerSettings)

Returns a symbol scheme for oriented overlay symbols (e.g. current arrows), or null if this style does not define one.

public CoverageSymbolScheme ResolveSymbolScheme(MarinerSettings settings)

Parameters

settings MarinerSettings

Mariner display preferences.

Returns

CoverageSymbolScheme

The symbol scheme, or null. The default implementation returns null.

Remarks

Returns the arrow symbol bands from the bundled portrayal catalogue: symbols are selected by surfaceCurrentSpeed and rotated by surfaceCurrentDirection. Never returns null.

Exceptions

InvalidOperationException

The implementation requires pre-loaded assets and SwitchPaletteAsync(PaletteType, CancellationToken) has not been awaited yet.

InvalidOperationException

SwitchPaletteAsync(PaletteType, CancellationToken) has not been called yet, so the speed bands are not loaded.

SwitchPaletteAsync(PaletteType, CancellationToken)

Switches the active colour palette to type and pre-loads the assets the synchronous resolve methods need.

public ValueTask SwitchPaletteAsync(PaletteType type, CancellationToken cancellationToken = default)

Parameters

type PaletteType

The palette mood (Day, Dusk, or Night).

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

Remarks

When the style has no palette for type, implementations keep a usable palette active (the current one, or Day) rather than failing.