ShapeStyle

sealed interface ShapeStyle

A shape's primary appearance — its interior fill for shapes that have one (e.g. com.tcsappdev.worldwinddraw.core.geometry.DrawnPolygon), or its stroke/line color for shapes that don't (e.g. com.tcsappdev.worldwinddraw.core.geometry.DrawnMarker). DrawableEntity deliberately has just one style: ShapeStyle field shared by every entity kind (see ChangeStyleCommand's KDoc) — which of "fill" or "stroke" a given ShapeStyle resolves to is a wwk-adapter mapper decision (interior for a polygon, outline for a polyline), not something core encodes.

Sealed so every place that renders a ShapeStyle (e.g. a when in wwk-adapter) is guaranteed by the compiler to handle all kinds below.

No gradient fill: dropped deliberately in Faz 5 — WWK's ShapeAttributes only has a single interiorColor, so a real gradient would need custom shader work that isn't worth it for a feature judged not important enough to invest in right now.

Inheritors

Types

Link copied to clipboard
data class Hatch(val pattern: HatchPattern, val color: ColorRgba, val backgroundColor: ColorRgba? = null, val spacing: Int = 12, val thickness: Float = 2.0f) : ShapeStyle

The shape is filled with a hatching: lines, a cross or dots in color, one tile of spacing pixels repeated across it, with backgroundColor (when set) behind them. The gaps stay empty otherwise, so the map shows through, which is what makes it fit for marking an area (disputed, occupied, restricted) without hiding what is under it.

Link copied to clipboard
data class ImageFill(val image: ImageRef, val fit: ImageFit = ImageFit.Contain, val scale: Float = 1.0f, val opacity: Float = 1.0f, val backgroundColor: ColorRgba? = null, val repeat: Boolean = false, val anchorX: Float? = null, val anchorY: Float? = null, val extendEdges: Boolean = false, val edgeSoftness: Float = 0.0f) : ShapeStyle

The shape is filled with ONE copy of image — placed per fit, not repeated — drawn at opacity and clipped to the shape. This is the fill for a flag, a floor plan or a photo inside a shape; use ImagePattern for a small tile repeated across it.

Link copied to clipboard
data class ImagePattern(val image: ImageRef, val opacity: Float = 1.0f) : ShapeStyle

The shape is filled with image, repeated as a pattern, drawn at opacity.

Link copied to clipboard
data class SolidColor(val color: ColorRgba) : ShapeStyle

A single, flat color.