FloorplanManager

class Floorplan.FloorplanManager()

Main interface into the 2D floorplan functionality for the viewer. Can show a 2-dimensional floorplan of a BIM-enabled model. The floorplan display will include an avatar that represents the camera position of the 3D view.

Methods

Floorplan.FloorplanManager.activate()
activate(): Promise

Activate the floorplan overlay.

Returns: Promise

Floorplan.FloorplanManager.deactivate()
deactivate(): Promise

Deactivate the floorplan overlay. Once explicitly deactivated via this call, auto-activation will be suppressed for any new model that is loaded. Auto-activation can be reenabled by calling [[setAutoActivate]].

Returns: Promise

Floorplan.FloorplanManager.getAvatarNodeId()
getAvatarNodeId(): (None | number)

Gets the [[NodeId]] of the floorplan avatar.

Returns: (None | number)

Floorplan.FloorplanManager.getConfiguration()
getConfiguration(): FloorplanConfig

Returns a copy of the current floorplan configuration.

Returns: FloorplanConfig

Floorplan.FloorplanManager.getCurrentFloorNodeId()
getCurrentFloorNodeId(): (None | number)

Gets the [[NodeId]] of the current storey.

Returns: (None | number)

Floorplan.FloorplanManager.getFloorLock()
getFloorLock(): boolean

Returns true if displayed floor has been locked with [[setFloorLock]].

Returns: boolean

Floorplan.FloorplanManager.insideOverlay()
insideOverlay(point: Point2): boolean

Returns true if the given point is inside the floorplan overlay and false otherwise.

Parameters

point: Point2

Returns: boolean

Floorplan.FloorplanManager.isActive()
isActive(): boolean

Returns true if the [[FloorplanManager]] is fully active.

Returns: boolean

Floorplan.FloorplanManager.setAutoActivate()
setAutoActivate(autoActivate: FloorplanAutoActivation): Promise

Sets the auto-activate capability for any models loaded after this call. See [[FloorplanConfig.autoActivate]] for detailed information.

Parameters

Returns: Promise

Floorplan.FloorplanManager.setAvatarColor()
setAvatarColor(color: Color): Promise

Sets the avatar primary color. See [[FloorplanConfig.avatarColor]] for detailed information.

Parameters

color: Color

Returns: Promise

Floorplan.FloorplanManager.setAvatarOpacity()
setAvatarOpacity(opacity: number): Promise

Sets the avatar opacity. See [[FloorplanConfig.avatarOpacity]] for detailed information.

Parameters

opacity: number

Returns: Promise

Floorplan.FloorplanManager.setAvatarOutlineColor()
setAvatarOutlineColor(color: Color): Promise

Sets the avatar outline color. See [[FloorplanConfig.avatarOutlineColor]] for detailed information.

Parameters

color: Color

Returns: Promise

Floorplan.FloorplanManager.setAvatarScale()
setAvatarScale(scale: number): Promise

Sets the avatar scale. See [[FloorplanConfig.avatarScale]] for detailed information.

Parameters

scale: number

Returns: Promise

Floorplan.FloorplanManager.setBackgroundColor()
setBackgroundColor(color: Color): Promise

Sets the overlay background color. See [[FloorplanConfig.backgroundColor]] for detailed information.

Parameters

color: Color

Returns: Promise

Floorplan.FloorplanManager.setBackgroundOpacity()
setBackgroundOpacity(opacity: number): Promise

Sets the overlay background opacity. See [[FloorplanConfig.backgroundOpacity]] for detailed information.

Parameters

opacity: number

Returns: Promise

Floorplan.FloorplanManager.setBorderColor()
setBorderColor(color: Color): Promise

Sets the overlay border color. See [[FloorplanConfig.borderColor]] for detailed information.

Parameters

color: Color

Returns: Promise

Floorplan.FloorplanManager.setBorderOpacity()
setBorderOpacity(opacity: number): Promise

Sets the overlay border opacity. See [[FloorplanConfig.borderOpacity]] for detailed information.

Parameters

opacity: number

Returns: Promise

Floorplan.FloorplanManager.setConfiguration()
setConfiguration(config: FloorplanConfig): Promise

Updates the floorplan to use the given configuration. This function allows the user to set all configuration values with a single operation. There are also set<config-value>() functions for easily setting individual configuration values.

Note that when using this function, all settings in the given configuration are used and thus overwrite any individual settings changed with a prior set<config-value>() call.

All values from the passed configuration will be copied as part of this operation.

Parameters

Returns: Promise

Floorplan.FloorplanManager.setCustomAvatar()
setCustomAvatar(customAvatarNodeId: (None | number)): Promise

Sets a custom avatar. See [[FloorplanConfig.customAvatar]] for detailed information.

Parameters

customAvatarNodeId: (None | number)

Returns: Promise

Floorplan.FloorplanManager.setFixedAvatarScale()
setFixedAvatarScale(fixedScale: boolean): Promise

Sets the avatar size to fixed scale. See [[FloorplanConfig.fixedAvatarScale]] for detailed information.

Parameters

fixedScale: boolean

Returns: Promise

Floorplan.FloorplanManager.setFloorLock()
setFloorLock(lock: boolean): Promise

Locks floorplan to current floor such that changing floors will not change the displayed floorplan.

Parameters

lock: boolean

Returns: Promise

Floorplan.FloorplanManager.setFloorplanOrientation()
setFloorplanOrientation(orientation: FloorplanOrientation): Promise

Sets the floorplan display orientation. See [[FloorplanConfig.floorplanOrientation]] for detailed information.

Parameters

Returns: Promise

Floorplan.FloorplanManager.setOverlayAnchor()
setOverlayAnchor(anchor: OverlayAnchor): Promise

Sets the anchor position of the floorplan overlay window. See [[FloorplanConfig.overlayAnchor]] for detailed information.

Parameters

Returns: Promise

Floorplan.FloorplanManager.setOverlayFeetPerPixel()
setOverlayFeetPerPixel(feetPerPixel: number): Promise

Sets the overlay scaling. See [[FloorplanConfig.overlayFeetPerPixel]] for detailed information.

Parameters

feetPerPixel: number

Returns: Promise

Floorplan.FloorplanManager.setOverlayOffset()
setOverlayOffset(offset: Point2): Promise

Sets the offset position of the floorplan overlay window. See [[FloorplanConfig.overlayOffset]] for detailed information.

Parameters

offset: Point2

Returns: Promise

Floorplan.FloorplanManager.setOverlaySize()
setOverlaySize(size: Point2, widthUnits: OverlayUnit, heightUnits: OverlayUnit): Promise

Sets the size of the floorplan overlay window. See [[FloorplanConfig.overlaySize]] for detailed information.

Parameters

size: Point2

widthUnits: OverlayUnit

heightUnits: OverlayUnit

Returns: Promise

Floorplan.FloorplanManager.setTrackCameraEnabled()
setTrackCameraEnabled(enabled: boolean): Promise

Sets the floorplan tracking mode. See [[FloorplanConfig.trackCameraEnabled]] for detailed information.

Parameters

enabled: boolean

Returns: Promise

Floorplan.FloorplanManager.setUseTightBoundings()
setUseTightBoundings(tightBoundings: boolean): Promise

Makes floorplans use tight boundings during creation which can result in a better fit for the overlay. This involves recreating any already existing floorplans. This can be significantly more time consuming than using loose boundings if your floors are complex. Defaults to false.

Parameters

tightBoundings: boolean

Returns: Promise

Floorplan.FloorplanManager.setZoomLevel()
setZoomLevel(zoomLevel: number): Promise

Sets the overlay zoom level. See [[FloorplanConfig.zoomLevel]] for detailed information.

Parameters

zoomLevel: number

Returns: Promise

Floorplan.FloorplanManager.snapAvatarToPoint()
snapAvatarToPoint(point: Point2): void

Moves the camera such that the avatar will appear at the provided point on the overlay. This is only available when the floorplan is not tracking the camera.

Parameters

point: Point2

Point in canvas within overlay

Returns: void