Reference·JavaScript · @bimworks/viewer3dJavaScript

FigureLayerHandle

Interface in @bimworks/viewer3d.

API catalogue · @bimworks/viewer3d · Interface

TypeScript#
interface FigureLayerHandle

Members#

Member Kind Description
destroy Method
getBounds Method Render-space bounds of one entry or of every figure, null while nothing is placed
getEntry Method
off Method
on Method A click on a figure; on merged area figures resolved from the picked point
on Method Hovering names line, dimension and box figures only: area figures are merged into one mesh per state
on Method The figures are gone: destroy(), another layer added under the same key, or a viewer reset
select Method One entry drawn as selected, the previous one no longer; null clears
setStateVisible Method
update Method Changes an entry; a new state moves it to that state's colour
viewDirectionOf Method The direction viewFit(id) looks at an entry's area from, as ViewFitOptions.viewDirection takes it: out of its face, tilted up; null for an entry without an a…
viewFit Method Fits the camera to one entry or every figure; false while nothing is placed

destroy#

TypeScript#
destroy(): void

getBounds#

TypeScript#
getBounds(id?: string): AxisAlignedBoundingBox3D | null

Render-space bounds of one entry or of every figure, null while nothing is placed

Parameters#

Name Type Description
id string

getEntry#

TypeScript#
getEntry(id: string): FigureEntry | undefined

Parameters#

Name Type Description
id string

off#

TypeScript#
off(event: string, handler: (...args: (any)[]) => void): void

Parameters#

Name Type Description
event string
handler (...args: (any)[]) => void

on#

TypeScript#
on(event: "click", handler: (id: string) => void): void

A click on a figure; on merged area figures resolved from the picked point

Parameters#

Name Type Description
event "click"
handler (id: string) => void

on#

TypeScript#
on(event: "hover", handler: (id: string | null) => void): void

Hovering names line, dimension and box figures only: area figures are merged into one mesh per state

Parameters#

Name Type Description
event "hover"
handler (id: string | null) => void

on#

TypeScript#
on(event: "cleared", handler: () => void): void

The figures are gone: destroy(), another layer added under the same key, or a viewer reset

Parameters#

Name Type Description
event "cleared"
handler () => void

select#

TypeScript#
select(id: string | null): void

One entry drawn as selected, the previous one no longer; null clears

Parameters#

Name Type Description
id string | null

setStateVisible#

TypeScript#
setStateVisible(state: FigureState, visible: boolean): void

Parameters#

Name Type Description
state FigureState
visible boolean

update#

TypeScript#
update(id: string, patch: Partial<FigureEntry>): boolean

Changes an entry; a new state moves it to that state's colour

Parameters#

Name Type Description
id string
patch Partial<FigureEntry>

viewDirectionOf#

TypeScript#
viewDirectionOf(id: string): (number)[] | null

The direction viewFit(id) looks at an entry's area from, as ViewFitOptions.viewDirection takes it: out of its face, tilted up; null for an entry without an area or not placed yet

Parameters#

Name Type Description
id string

viewFit#

TypeScript#
viewFit(id?: string): boolean

Fits the camera to one entry or every figure; false while nothing is placed

Parameters#

Name Type Description
id string