SegmentNode

open class SegmentNode(segment: Segment, var style: ShapeStyle = ShapeStyle.SEGMENT, var tags: Set<String> = emptySet()) : Segment, CompositeNode

A scene-graph leaf that is a Segment: the segment's geometry carrying the concrete style it renders with, plus optional tags.

Construction rebuilds the segment from segment's endpoints — the given endpoint instances are kept by reference, and rebuilding them into a segment reproduces the geometry exactly for any finite segment. Everything a Segment offers is inherited, and every operation typed against Segment accepts the leaf as-is — the shape-preserving operations, canonical included, return through copy and come back as the leaf, style and tags riding along; everything else returns plain shapes.

Parameters

segment

The geometry to decorate; its endpoints are kept by reference.

style

The concrete paint; the segment default when omitted.

tags

Free-form tokens riding the leaf; empty by default.

Throws

when segment's endpoints rebuild no dipole — reachable only for a segment derived from an at-infinity dipole, whose endpoints degenerate.

Constructors

Link copied to clipboard
constructor(segment: Segment, style: ShapeStyle = ShapeStyle.SEGMENT, tags: Set<String> = emptySet())

Builds the leaf around segment's endpoints.

constructor(node: SegmentNode, style: ShapeStyle = node.style, tags: Set<String> = node.tags)

Builds the leaf as a copy of node: the same geometry, and node's own style and tags unless either is overridden.

Properties

Link copied to clipboard
Link copied to clipboard
open val canonical: Segment
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val gx: Double
Link copied to clipboard
val gy: Double
Link copied to clipboard
val gz: Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val px: Double
Link copied to clipboard
val py: Double
Link copied to clipboard
val pz: Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var style: ShapeStyle
Link copied to clipboard
open override var tags: Set<String>
Link copied to clipboard

Functions

Link copied to clipboard
open override fun copy(segment: Segment): SegmentNode

Returns a SegmentNode around segment, carrying this leaf's style and tags.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Rounded, style-inclusive identity: equal when the geometry matches at the SCALE quantum and style and tags match exactly.

Link copied to clipboard
open override fun hashCode(): Int

Returns the geometry hash combined with style's and tags', consistent with equals.

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.

Link copied to clipboard
open override fun toString(): String

Returns the raw geometry with the style and tags — full stored precision, no rounding.

Link copied to clipboard