BcfService
-
class
wvc.BcfService() Provides BCF operations while encapsulating direct WebViewer access.
Constructors
-
wvc.BcfService.constructor() - BcfService():
BcfServiceReturns:
BcfService
Properties
-
wvc.BcfService.serviceName readonly
serviceName: “BcfService”
Accessors
-
wvc.BcfService.webViewer() - get webViewer(): (undefined | WebViewer)
Returns: (undefined | WebViewer)
set webViewer(value: (undefined | WebViewer)): voidParameters
value: (undefined | WebViewer)Returns: void
Methods
-
wvc.BcfService.activateTopicAndRestoreMarkup() - activateTopicAndRestoreMarkup(topic: BCFTopic, markupViewId: string): Promise
Activates the first viewpoint of the given topic and, if a markup view ID is provided, restores the corresponding markup overlay and arms the camera auto-deactivation callback.
Parameters
topic: BCFTopic
The BCF topic whose viewpoint should be activated.markupViewId: string
Optional ID of the markup view to restore.Returns: Promise
-
wvc.BcfService.addBCFFromBuffer() - addBCFFromBuffer(buffer: ArrayBuffer, fileName: string): Promise
Imports a BCF archive from an
ArrayBuffer(e.g., from a file upload) and registers its contents.Parameters
buffer: ArrayBuffer
The raw BCF archive data.fileName: string
The original file name, used as the BCF data set identifier.Returns: Promise
-
wvc.BcfService.addTopicComment() - addTopicComment(topic: BCFTopic, text: string, captureView: unknown): Promise
Creates a comment on a BCF topic, including its viewpoint and snapshot.
Parameters
topic: BCFTopic
The BCF topic to add the comment to.text: string
The comment text.captureView: unknown
The active markup view to capture in the comment viewpoint, or null/undefined.Returns: Promise
An object containing the new comment’s ID.
-
wvc.BcfService.captureSnapshotPng() - captureSnapshotPng(): Promise
Captures the current viewer state as a PNG image using
WebViewer.takeSnapshot().Returns: Promise
PNG bytes of the snapshot, or null if capture fails or viewer is not initialized.
-
wvc.BcfService.clearActiveTopicMarkup() - clearActiveTopicMarkup(): Promise
Clears currently active topic markup overlays from the viewer.
This centralizes direct markup-manager interactions behind the service API.
Returns: Promise
-
wvc.BcfService.clearTopicMarkupAutoDeactivate() - clearTopicMarkupAutoDeactivate(): void
Cancels the camera-change callback that automatically deactivates markup overlays when the camera moves after topic activation.
Returns: void
-
wvc.BcfService.createBCFData() - createBCFData(name: string): BCFData
Creates a new, empty BCF data set with the provided name and registers it with the viewer.
Parameters
name: string
The display name for the new BCF data set.Returns: BCFData
-
wvc.BcfService.createTopic() - createTopic(bcfData: BCFData, topicId: string): BCFTopic
Creates a bare BCF topic shell within the given data set. Prefer
setupTopicfor creating a fully initialized topic with markup, viewpoint, and snapshot.Parameters
bcfData: BCFData
The BCF data set to add the topic to.topicId: string
The unique ID (UUID) to assign to the new topic.Returns: BCFTopic
-
wvc.BcfService.createViewpoint() - createViewpoint(viewpointFilename: string, captureView: unknown): Promise
Creates and returns a BCF viewpoint capturing the current viewer camera state, optionally including markup from
captureView.Parameters
viewpointFilename: string
The filename to assign to the viewpoint within the BCF archive.captureView: unknown
The markup view to include in the viewpoint, or null/undefined.Returns: Promise
-
wvc.BcfService.getBCFData() - getBCFData(id: number): (None | BCFData)
Returns the BCF data set with the given ID, or
nullif not found or the viewer is unavailable.Parameters
id: number
The numeric ID of the BCF data set to retrieve.Returns: (None | BCFData)
-
wvc.BcfService.getBCFMap() - getBCFMap(): Map
Returns all BCF data sets currently loaded in the viewer, keyed by their numeric IDs.
Returns: Map
-
wvc.BcfService.getMarkupViewForBcfCapture() - getMarkupViewForBcfCapture(): unknown
Resolves the best available markup view for viewpoint capture.
Returns the currently active markup view if one exists, or falls back to the most recently modified non-empty view. Returns
nullif no suitable view is found.Returns: unknown
-
wvc.BcfService.removeBCFData() - removeBCFData(id: number): void
Removes the BCF data set with the given ID from the viewer.
Parameters
id: number
The numeric ID of the BCF data set to remove.Returns: void
-
wvc.BcfService.setupTopic() - setupTopic(bcfData: BCFData, title: string, captureView: unknown): Promise
Creates a fully initialized BCF topic: markup, title, viewpoint, snapshot, and registers it on the BCF data.
Parameters
bcfData: BCFData
The BCF data set to add the topic to.title: string
The human-readable topic title.captureView: unknown
The active markup view to capture in the topic viewpoint, or null/undefined.Returns: Promise
The fully initialized BCF topic.