Table of Contents

Class CellScaleRanking

Namespace
EncDotNet.S100.DataModel
Assembly
EncDotNet.S100.Core.dll

Ranks overlapping chart cells by scale, finest first. One rule for every consumer that has to choose between cells covering the same place: the display's cross-cell overlap suppression (issue #438), the headless compositor (#859) and the charted depth used by the passage check and the pick report (#938).

public static class CellScaleRanking
Inheritance
CellScaleRanking
Inherited Members

Remarks

A cell's ranking scale is its compilation scale denominator when it has one (S-57 DSPM CSCL, Appendix B.1 §7.3.1.1), and otherwise its minimum display scale (S-101 FC §3.1.1 DataCoverage.minimumDisplayScale, the coarsest scale at which the cell is meant to be shown). A smaller denominator is the finer cell. A cell with no ranking scale ranks below every cell that has one.

Only a strictly finer cell beats another: cells of the same scale are peers, so consumers combine them (the display draws both; the depth rules take the shoalest).

Methods

Compare(int?, int?)

Orders ranking scales finest first, with unranked cells last.

public static int Compare(int? x, int? y)

Parameters

x int?

The first ranking scale.

y int?

The second ranking scale.

Returns

int

A negative value when x is finer, zero for the same rank.

FinestBand<T>(IEnumerable<T>, Func<T, int?>)

The cells that share the finest ranking scale among cells, in their original order.

public static IReadOnlyList<T> FinestBand<T>(IEnumerable<T> cells, Func<T, int?> rankingScale)

Parameters

cells IEnumerable<T>

The candidate cells, for example those covering one point.

rankingScale Func<T, int?>

Reads a cell's ranking scale (see RankingScale(int?, int?)).

Returns

IReadOnlyList<T>

The finest cells; empty when cells is empty.

Type Parameters

T

The cell type.

IsFiner(int?, int?)

Whether a cell ranked at candidate is strictly finer than one ranked at other. An unranked cell is never finer, and every ranked cell is finer than an unranked one.

public static bool IsFiner(int? candidate, int? other)

Parameters

candidate int?

The candidate cell's ranking scale.

other int?

The other cell's ranking scale.

Returns

bool

true when the candidate is strictly finer.

RankingScale(int?, int?)

The scale denominator a cell is ranked by: its compilation scale when present, otherwise its minimum display scale.

public static int? RankingScale(int? compilationScale, int? minimumDisplayScale)

Parameters

compilationScale int?

The compilation scale denominator, or null.

minimumDisplayScale int?

The minimum display scale denominator, or null.

Returns

int?

The ranking denominator, or null when neither is usable.