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
Plane
The display plane stamped on each instruction. Defaults to UnderRadar, as Plane does.
public DisplayPlane Plane { get; init; }
Property Value
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
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
ViewingGroup
The viewing group stamped on each instruction. Defaults to 0.
public int ViewingGroup { get; init; }
Property Value
Methods
Area(string, string, double?)
Builds a solid colour-fill area instruction.
public AreaInstruction Area(string featureReference, string fillColorToken, double? transparency = null)
Parameters
featureReferencestringThe feature whose surface is filled.
fillColorTokenstringThe fill's colour token.
transparencydouble?The fill's transparency, 0 (opaque) to 1 (fully transparent), or null for opaque.
Returns
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
featureReferencestringThe feature whose surface is filled.
areaFillReferencestringThe area fill's name.
Returns
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
featureReferencestringThe feature whose curve is stroked.
colorTokenstringThe stroke's colour token.
widthdoubleThe pen width in millimetres.
dashLengthdoubleThe dash length in millimetres; 0 for a solid line.
gapLengthdoubleThe gap between dashes in millimetres; 0 for a solid line.
Returns
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
featureReferencestringThe feature the symbol is drawn at.
symbolReferencestringThe symbol name, resolved by the sub-layer's symbol provider (see SymbolSet).
rotationdouble?Clockwise rotation in degrees, or null for upright.
rotationCrsSymbolRotationCrsThe frame
rotationis measured in.
Returns
Text(string, string, TextInstructionStyle)
Builds a text instruction.
public TextInstruction Text(string featureReference, string text, TextInstructionStyle style)
Parameters
featureReferencestringThe feature the text is anchored at.
textstringThe text.
styleTextInstructionStyleThe font, colours, halo, alignment and offset.