Table of Contents

Class InstructionBuilder

Namespace
EncDotNet.S100.Portrayals.Application
Assembly
EncDotNet.S100.Portrayals.dll

Builds the S-100 Part 9 drawing instructions of a portrayal defined in code: point symbols, text, lines and areas. The builder carries what a catalogue rule would set before its drawing commands (viewing group, drawing priority, display plane and scale limits) and stamps them on every instruction it builds.

public sealed record InstructionBuilder : IEquatable<InstructionBuilder>
Inheritance
InstructionBuilder
Implements
Inherited Members

Remarks

The builder is immutable. Derive a variant with a with expression, e.g. labels that share the symbols' plane and priority but are only shown at larger scales:

var symbols = new InstructionBuilder { ViewingGroup = 31050, DrawingPriority = 15 };
var labels = symbols with { ScaleMinimum = 100_000 };

The instructions are ordinary DrawingInstructions, so they follow the same rules as a catalogue product's: viewing groups, SCAMIN, symbol and text scale, label declutter and picking.

Properties

DrawingPriority

The drawing priority stamped on each instruction. Defaults to 0.

public int DrawingPriority { get; init; }

Property Value

int

Plane

The display plane stamped on each instruction. Defaults to UnderRadar, as Plane does.

public DisplayPlane Plane { get; init; }

Property Value

DisplayPlane

ScaleMaximum

The scale maximum stamped on each instruction: the smallest scale denominator it is drawn at. null (the default) sets no limit.

public double? ScaleMaximum { get; init; }

Property Value

double?

ScaleMinimum

The scale minimum (SCAMIN) stamped on each instruction: the largest scale denominator it is drawn at. null (the default) draws it at every scale.

public double? ScaleMinimum { get; init; }

Property Value

double?

ViewingGroup

The viewing group stamped on each instruction. Defaults to 0.

public int ViewingGroup { get; init; }

Property Value

int

Methods

Area(string, string, double?)

Builds a solid colour-fill area instruction.

public AreaInstruction Area(string featureReference, string fillColorToken, double? transparency = null)

Parameters

featureReference string

The feature whose surface is filled.

fillColorToken string

The fill's colour token.

transparency double?

The fill's transparency, 0 (opaque) to 1 (fully transparent), or null for opaque.

Returns

AreaInstruction

AreaPattern(string, string)

Builds a pattern-fill area instruction: the area tiled with an area fill's symbol, such as hatching. The fill is resolved by name through the sub-layer's area fill provider, and its symbol through the symbol provider (see SymbolSet).

public AreaInstruction AreaPattern(string featureReference, string areaFillReference)

Parameters

featureReference string

The feature whose surface is filled.

areaFillReference string

The area fill's name.

Returns

AreaInstruction

Line(string, string, double, double, double)

Builds a simple-line instruction (the SimpleLineStyleReference style): one colour and width, solid or dashed.

public LineInstruction Line(string featureReference, string colorToken, double width, double dashLength = 0, double gapLength = 0)

Parameters

featureReference string

The feature whose curve is stroked.

colorToken string

The stroke's colour token.

width double

The pen width in millimetres.

dashLength double

The dash length in millimetres; 0 for a solid line.

gapLength double

The gap between dashes in millimetres; 0 for a solid line.

Returns

LineInstruction

Point(string, string, double?, SymbolRotationCrs)

Builds a point-symbol instruction.

public PointInstruction Point(string featureReference, string symbolReference, double? rotation = null, SymbolRotationCrs rotationCrs = SymbolRotationCrs.Portrayal)

Parameters

featureReference string

The feature the symbol is drawn at.

symbolReference string

The symbol name, resolved by the sub-layer's symbol provider (see SymbolSet).

rotation double?

Clockwise rotation in degrees, or null for upright.

rotationCrs SymbolRotationCrs

The frame rotation is measured in.

Returns

PointInstruction

Text(string, string, TextInstructionStyle)

Builds a text instruction.

public TextInstruction Text(string featureReference, string text, TextInstructionStyle style)

Parameters

featureReference string

The feature the text is anchored at.

text string

The text.

style TextInstructionStyle

The font, colours, halo, alignment and offset.

Returns

TextInstruction