Reference·JavaScript · @bimworks/viewercommonJavaScript

BvlHelper

Class in @bimworks/viewercommon.

API catalogue · @bimworks/viewercommon · Class

TypeScript#
class BvlHelper

The BVL runtime: shows resolved BVL actions (the server's ResolvedActions JSON, documented with the BVL language) in the viewers - colours, visibility, selection, labels, annotations, shapes, routes and check overlays (docs/ui-api-wp5/README.md §2.6)

Members#

Member Kind Description
constructor Method
iconRoot Property Where the app's img/ folder is, for svg("glyphicons-…") icons: the page's own folder ("") by default
applyDelta Method Applies a pick's actions on top of what is shown: only colours (also COLOR RESULT), ON_TOP, SHOW of hidden objects and annotations, the ones that can be take…
execute Method Resolves BVL input on the server (ResolveBvl) and shows the result; rejects when the server refuses it. options.ui: the part of the UI a person asked this …
objectsToFit Method The objects resolved BVL actions are about, to fit the view to once processResults applied them: the VIEWFIT objects when the script names any; else those it…
processResults Method Shows resolved BVL actions; by default it first takes away the previous result (Viewer3d.resetResults). Resolves to the Transition once its state is in when …
undoDelta Method Takes a pick away again: what applyDelta returned

constructor#

TypeScript#
constructor(objectStateManager: ObjectStateManager, viewer3d?: unknown)

Parameters#

Name Type Description
objectStateManager ObjectStateManager
viewer3d unknown a Viewer3d; without one only colours, visibility, selection and labels are applied (no shapes, routes, overlays or measurements)

iconRoot#

TypeScript#
static iconRoot: string

Where the app's img/ folder is, for svg("glyphicons-…") icons: the page's own folder ("") by default

applyDelta#

TypeScript#
applyDelta(actions: object, options?: { resultColorOf?: (qid: string) => string | null | null }): Promise<BvlUndo>

Applies a pick's actions on top of what is shown: only colours (also COLOR RESULT), ON_TOP, SHOW of hidden objects and annotations, the ones that can be taken away again; returns how to

Parameters#

Name Type Description
actions object
options { resultColorOf?: (qid: string) => string | null | null }

execute#

TypeScript#
execute(versionUuids: (string)[], input: string | object, options?: { ui?: string }): Promise<void>

Resolves BVL input on the server (ResolveBvl) and shows the result; rejects when the server refuses it. options.ui: the part of the UI a person asked this from, sent as the request's ui

Parameters#

Name Type Description
versionUuids (string)[]
input string | object
options { ui?: string }

objectsToFit#

TypeScript#
objectsToFit(resolved: (object)[]): QidSet

The objects resolved BVL actions are about, to fit the view to once processResults applied them: the VIEWFIT objects when the script names any; else those it shows, selects, puts on top, labels, annotates, gives a shape or a colour less than half transparent; else every object it colours. Never the ones it hides, and only those the viewer shows. Empty when there are none

Parameters#

Name Type Description
resolved (object)[]

processResults#

TypeScript#
processResults(resolved: (object)[], options?: BvlProcessOptions): Promise<void | Transition>

Shows resolved BVL actions; by default it first takes away the previous result (Viewer3d.resetResults). Resolves to the Transition once its state is in when it applies one (options.transition, or the script's TRANSITION header)

Parameters#

Name Type Description
resolved (object)[]
options BvlProcessOptions

undoDelta#

TypeScript#
undoDelta(undo: BvlUndo | null): Promise<void>

Takes a pick away again: what applyDelta returned

Parameters#

Name Type Description
undo BvlUndo | null