Home Reference Source
import {BimSurfer} from 'bimsurfer3/viewer/bimsurfer.js'
public class | source

BimSurfer

Extends:

viewer/eventhandler.js~EventHandler → BimSurfer

Entry point for the public BimSurfer API.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
Private Members
private

_api: *

private

Method Summary

Public Methods
public

addSelectedHandler(handler: {handler: ?Function})

Add a handler which is called when an object is selected in the viewer

public
public

getCamera(): {type: String, eye: Float32Array, target: Float32Array, up: Float32Array, fovy: ?Number}

Gets a javascript representation of the current camera orientation

public

Gets the currently selected elements

public

load(params: {username: String, password: String, roid: Number, domNode: HTMLElement}): Promise

Loads a BIMserver project into the specified domNode for rendering.

public

reset(params: {cameraPosition: ?Boolean, colors: ?Boolean, visibility: ?Boolean})

Resets part of the viewer to its default state.

public

resetColor(params: {ids: Number[]}): *

Resets the color for the specified elements (to their original color)

public

setCamera(params: {type: String, eye: Float32Array, target: Float32Array, up: Float32Array, fovy: ?Number})

Sets the current camera orientation based on specified parameters

public

setColor(params: {ids: Number[], color: {r: Number, g: Number, b: Number, a: Number}}): *

Sets the color for the specified elements

public

setSelectionState(params: {ids: Number[], selected: Boolean, clear: ?Boolean}): *

Sets the selection state for the specified elements

public

setVisibility(params: {ids: Number[], visible: Boolean}): *

Sets the visibility for the specified elements

public

viewFit(params: {ids: Number[]}): *

Zooms the current camera in or out the fit the specified elements in the viewport

Private Methods
private

loadModel(project: Object, domNode: HTMLElement): *

private

loadProjects(roid: Number): *

Loads project meta-data} from a BIMserver and searches for the specified revision id.

private

loadRevision(project: Object, domNode: HTMLElement): *

Public Constructors

public constructor() source

Public Members

public settings: * source

Private Members

private _api: * source

private _bimServerViewer: * source

Public Methods

public addSelectedHandler(handler: {handler: ?Function}) source

Add a handler which is called when an object is selected in the viewer

Params:

NameTypeAttributeDescription
handler {handler: ?Function}

Handler (function)

public cleanup() source

public getCamera(): {type: String, eye: Float32Array, target: Float32Array, up: Float32Array, fovy: ?Number} source

Gets a javascript representation of the current camera orientation

Return:

{type: String, eye: Float32Array, target: Float32Array, up: Float32Array, fovy: ?Number}

Camera parameters

public getSelected(): Number[] source

Gets the currently selected elements

Return:

Number[]

Identifiers of selected elements

public load(params: {username: String, password: String, roid: Number, domNode: HTMLElement}): Promise source

Loads a BIMserver project into the specified domNode for rendering.

Params:

NameTypeAttributeDescription
params {username: String, password: String, roid: Number, domNode: HTMLElement}

Function arguments

Return:

Promise

public reset(params: {cameraPosition: ?Boolean, colors: ?Boolean, visibility: ?Boolean}) source

Resets part of the viewer to its default state.

Params:

NameTypeAttributeDescription
params {cameraPosition: ?Boolean, colors: ?Boolean, visibility: ?Boolean}

Parts of the viewer state to reset

public resetColor(params: {ids: Number[]}): * source

Resets the color for the specified elements (to their original color)

Params:

NameTypeAttributeDescription
params {ids: Number[]}

Return:

*

public setCamera(params: {type: String, eye: Float32Array, target: Float32Array, up: Float32Array, fovy: ?Number}) source

Sets the current camera orientation based on specified parameters

Params:

NameTypeAttributeDescription
params {type: String, eye: Float32Array, target: Float32Array, up: Float32Array, fovy: ?Number}

Camera parameters

public setColor(params: {ids: Number[], color: {r: Number, g: Number, b: Number, a: Number}}): * source

Sets the color for the specified elements

Params:

NameTypeAttributeDescription
params {ids: Number[], color: {r: Number, g: Number, b: Number, a: Number}}

Return:

*

public setSelectionState(params: {ids: Number[], selected: Boolean, clear: ?Boolean}): * source

Sets the selection state for the specified elements

Params:

NameTypeAttributeDescription
params {ids: Number[], selected: Boolean, clear: ?Boolean}

Function arguments

Return:

*

public setVisibility(params: {ids: Number[], visible: Boolean}): * source

Sets the visibility for the specified elements

Params:

NameTypeAttributeDescription
params {ids: Number[], visible: Boolean}

Function arguments

Return:

*

public viewFit(params: {ids: Number[]}): * source

Zooms the current camera in or out the fit the specified elements in the viewport

Params:

NameTypeAttributeDescription
params {ids: Number[]}

Return:

*

Private Methods

private loadModel(project: Object, domNode: HTMLElement): * source

Params:

NameTypeAttributeDescription
project Object

Project meta-data object

domNode HTMLElement

The parent HTMLElement in which to create a CANVAS for WebGL rendering

Return:

*

private loadProjects(roid: Number): * source

Loads project meta-data} from a BIMserver and searches for the specified revision id.

Params:

NameTypeAttributeDescription
roid Number

Revision id to load

Return:

*

private loadRevision(project: Object, domNode: HTMLElement): * source

Params:

NameTypeAttributeDescription
project Object

Project meta-data object

domNode HTMLElement

The parent HTMLElement in which to create a CANVAS for WebGL rendering

Return:

*