BimApiWithTwin
Hierarchy
- BimApi
- BimApiWithTwin
Index
Constructors
Properties
Accessors
Methods
Constructors
publicconstructor
Parameters
canvas: HTMLCanvasElement
apiClient: TwinfinityApiClientWithTwin
optionalbimApiOptions: BimApiOptions
Returns BimApiWithTwin
Properties
readonlycamera
readonlyviewer
Exposes viewer internals. Use this to access BabylonJS API. Disclaimer! Accessing BabylonJS internals is considered advanced usage and you are effectively bypassing BimCoreApi (and subclasses). We cannot make guarantees that:
- BabylonJS APIs will remain backwards compatible. Therefore, your application may break when BabylonJS is updated to a new version.
- Babylonjs data that BimCoreApi creates, such as scene hierarchy, lights, camera etc., will remain backwards compatible between versions. Relying on this may break your application.
- Your modifications to BabylonJS data (such as scene hierarchy, lights, cameras etc.) will not be changed by code in this package.
- Other bugs will not occur as a result of direct usage of BabylonJS APIs. https://doc.babylonjs.com/api/classes/babylon.scene
staticrunRenderLoopbeta
Extension point for applications that need to run the renderloop outside their own change handling (AngularJs is one such example). Assignment should be done before creation of a BimCoreApi instance.
Accessors
axes
Gets or sets a value indicating whether to hide or show coordinate system axes.
Returns boolean
Parameters
isEnabled: boolean
Returns void
publicbackend
Returns TwinfinityApiClientWithTwin
currentContainerInfo
Gives information on currently selected container such as title, language and also details of the current user.
Returns BimContainerInfo
grid
Gets or sets options for 3D help grid visualization.
Returns GridOptions
isSkyboxEnabled
Gets or sets a value indicating whether to show or hide skybox.
Returns boolean
Parameters
enabled: boolean
Returns void
onPointerObservable
Subscribe to get access to pointer events (mouse, touchpad etc) and to determine what (if anything) a mouse click interacted with (what object was ‘picked’ in the 3D scene).
Returns Observable<DeepImmutableObject<PointerInfoWithTimings>>
selectables
Exposes methods related to selection operations. For example, what the user actually clicked on.
Returns Selectables
Methods
applyVisualChanges
Returns Promise<void>
clear
Clears api (any loaded IFC files etc are unloaded).
Returns void
createCoordinateTracker
Gets a CoordinateTracker instance.
Type parameters
- Tracked3D: Vertex3 = any
Returns CoordinateTracker<Tracked3D>
filter
Iterate the BimIfcObject instances and return those that match the specified predicate.
Parameters
predicate: BimIfcObjectForEachPredicate
Predicate. Items matching this will be returned in array format.
Returns BimIfcObject[]
Array with BimIfcObject instances matched by the specified predicate.
foreach
Use this function to iterate over all BIM objects.
Parameters
a: BimIfcObjectForEachAction
Returns void
getIntersections
Intersects all visible BIM objects using ray from origin towards direction
Parameters
origin: Vector3
direction: Vector3
optionalobjects: BimIfcObject[]
Returns undefined | Intersection[]
Intersection[] | undefined
info
General Twinfinity information such as customer portal name, Twinfinity API version etc.
Returns TwinfinityInfo
loadPropertySets
Loads all BIM property sets for all loaded files.
Returns Promise<void>
on
Sets a handler to event of given type
Parameters
type: click
Type of event. For now only “click” is supported
clickEventHandler: ClickEventHandler
Returns void
products
Create a iterator that can be used to iterate over all BimIfcObject‘s. Same as foreach but with a iterator instead.
Returns IterableIterator<BimIfcObject>
Iterator that can be used to iterate over all BimIfcObject‘s.
setBackgroundColor
Sets background color in viewer
Parameters
color: Color | Color3
RGB in range 0-1
Returns void
setContainer
Parameters
containerOrUrl: URL | BimContainer
Container object or absolute URL Example: https://bim.foo.com/sites/portal/projects/{project name}
optionaloptions: BimApiLoadOptions
Loading options
Returns Promise<void>
setHighlightColor
Sets highlight color in viewer
Parameters
color: Color3
RGB in range 0-1
highlightIndex: ColoredHighlightIndexes
The highlight index tgo change, it’s restricted to One, Two and Three because it makes no sense to change the color of the Empty index (since it’s only there to denote that a productMesh has no highlight). The highlight index defaults to One
Returns void
withVisibleBimObjects
Makes it possible to perform API operations, that operate on the set of visible BIM objects, on a smaller set of (still visible) BIM objects
Type parameters
- T
Parameters
visibleBimObjects: BimIfcObject[]
Visible objects to run operation on
action: (objects: BimIfcObject[]) => T
Operation
Returns T
zoomToExtent
This function zooms the camera to contain BIM objects in view frustum.
Parameters
products: BimIfcObject[]
Returns void
publicstaticcreate
Parameters
_htmlElementOrId: string | HTMLElement
apiClient: TwinfinityApiClientWithTwin
optionaloptions: BimApiOptions
Returns Promise<BimApiWithTwin>
staticcreateApi
Type parameters
- TBimApi: BimCoreApi<TBimApi>
Parameters
_htmlElementOrId: string | HTMLElement
apiFactory: (canvas: HTMLCanvasElement) => TBimApi
Returns Promise<TBimApi>
Camera is an instance of BimCamera and used for manipulating the 3D camera view of the BIM viewer.