BimLines
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
scene: Scene
options: BimLinesOptions = {}
Returns BimLines
Properties
readonlyaggregator
Shared aggregator: add() registers sources here.
Accessors
renderer
Renderer for Babylon rendering group 0, provisioned on first access. Public as an escape hatch for renderer-level tweaks; most consumers only need add.
Returns LineRenderer
Methods
add
Register a slab of line segments and return a handle to it. The handle owns the underlying source's lifecycle; use it to toggle visibility, restyle, transform, replace content, or remove.
Parameters
slab: SegmentSlab
options: LineAddOptions = {}
Returns LineHandle
dispose
Remove every issued handle (they become inert, exactly as after their own
remove()), then tear down every renderer this instance provisioned plus the aggregator. Renderers handed over via useRenderer are left to their owner. Idempotent; the host scene's disposal does the same automatically.Returns void
isDisposed
True once this instance can no longer be used — after dispose, or after the host scene's disposal took the aggregator (and every renderer) with it. Agrees with the guard add throws on.
Returns boolean
removeAll
Remove every handle this façade issued (equivalent to calling LineHandle.remove on each). Handles a consumer still holds become inert, as they would after their own
remove(). Sources registered directly on aggregator are untouched.The rebuilds coalesce into one upload per affected group.
Returns void
useRenderer
Hand a consumer-built renderer to this façade for
groupId, so add routes that group to it instead of provisioning a default one. Use when a group needs renderer wiring beyondrendererOptions(e.g. an existing renderer shared with other systems).The renderer stays the caller's to dispose — dispose leaves it alone.
Parameters
groupId: number
renderer: LineRenderer
Returns void
Convenience bundle wired onto
BimCoreApiasapi.lines. The easy path for drawing lines: call add with a slab and get back a LineHandle to toggle, restyle, move, or remove it — noStandardLineSource/LineAggregatorbookkeeping.A default LineRenderer is provisioned per rendering group the first time add targets it, so overlay layers work by passing
renderingGroupIdto add — no manualonRebuildwiring. Renderers are built lazily, including group 0's: anapi.linesnobody draws with costs no mesh and no shader compile.A group needing renderer options this façade does not expose (world-space widths, depth participation) has two routes: pass
rendererOptionsto the add that first targets the group, or construct the renderer yourself and hand it over with useRenderer. Ownership of a group is explicit and single-claim — a second claim throws rather than silently double-drawing the same segments through two renderers.Self-disposes when the host scene is disposed (the renderers and aggregator each subscribe to
scene.onDisposeObservable); dispose tears down early.