ShapeNode

interface ShapeNode : Node

A leaf of the scene graph: a CGA shape carrying the concrete style it renders with, plus optional tags.

Every leaf class subclasses the shape it decorates — a LineNode is a Line — so a leaf reads and operates as its shape: properties are inherited, and every operation typed against the shape accepts the leaf as-is. The shape-preserving operations (*, the coerce pair, canonical) return through the leaf's copy override, so they come back as the leaf class with style and tags riding along; every other operation returns plain shapes — the decoration drops by contract. style and tags are mutable: restyling or retagging a leaf is an assignment, not a rebuild. Identity is exact-class and style-inclusive: a leaf never equals the plain shape with the same geometry, and two leaves compare by rounded geometry, style, and tags.

Every leaf is either a PrimitiveNode — decorating a CGA element — or a CompositeNode — decorating a shape built from primitives. ShapeNode itself is not sealed, so a when over it is never exhaustive; the two families are, so exhaustive dispatch splits on them and nests a when over each.

Inheritors

Properties

Link copied to clipboard
abstract var style: ShapeStyle

The concrete paint this leaf renders with; mutable — restyling is an assignment.

Link copied to clipboard
abstract var tags: Set<String>

Free-form tokens riding the leaf — renderer-inert; empty by default. Mutable — retagging is an assignment.

Functions

Link copied to clipboard
operator fun ShapeNode.times(versor: Versor): ShapeNode

node * Versor => ShapeNode
Returns this leaf with versor's motion applied to its geometry — style and tags untouched.