RoomleConfigurator.default

configurator-core/src/roomle-configurator.default

Shared API between configurator and planner

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new default(creator)

Parameters

Name
Type

creator

string

Properties

_creator_

_creator_: string

Implementation of

Context.creator

Accessors

callbacks

get callbacks(): default

Use this callbacks to hook in your functionality

Returns

default

Implementation of

ExternalEmbeddable.callbacks

Methods

calcPartsPriceSum

calcPartsPriceSum(partList): Promise<KernelPartListPrice>

Parameters

Name
Type

partList

Returns

Promise<KernelPartListPrice>


cancelDockings

cancelDockings(): void

Remove/cancel all dockings/ghosts

Returns

void


cancelSelection

cancelSelection(): void

Cancels the selection of all currently selected components

Returns

void


changeFloorMaterial

changeFloorMaterial(material): Promise<void>

Sets the material of the floor to the given RapiMaterial. If the current environment is not floor environment it will be changed

Parameters

Name
Type

material

Returns

Promise<void>

promise that resolves when material has been changed


changeFloorMaterialById

changeFloorMaterialById(materialId): Promise<void>

Sets the material of the floor to the given material id. If the current environment is not floor environment it will be changed

Example material ids are: roomle_floor:DresdenEiche roomle_floor:Ibiza roomle_floor:Palma roomle_floor:Elba roomle_floor:Manacor roomle_floor:KernEiche roomle_floor:KieferScandic roomle_floor:EicheHabsburg roomle_floor:FuldaKiefer roomle_floor:Ashton roomle_floor:EicheLondon

Parameters

Name
Type

materialId

string

Returns

Promise<void>

promise that resolves when material has been changed


changeOffset

changeOffset(offset): void

Change the camera offset

Parameters

Name
Type

offset

Returns

void


cleanup

cleanup(options?): void

Clears the scene and all components/meshes. Also unregisters configurator callbacks in kernel.

Parameters

Name
Type
Description

options

CleanupOptions

Returns

void


clearHistory

clearHistory(): void

clears current configurator history

Returns

void


disableEvents

disableEvents(): void

Returns

void


disableHDGeometry

disableHDGeometry(): Promise<void | ConfigurationLoadedResponse>

Disable the use of HD Geometry

Returns

Promise<void | ConfigurationLoadedResponse>


disableMultiselect

disableMultiselect(): void

Disable selection of multiple components. By default only one component can be selected at a time

Returns

void


enableEvents

enableEvents(): void

Returns

void


enableHDGeometry

enableHDGeometry(): Promise<void | ConfigurationLoadedResponse>

Enable the use of HD geometry. Also reloads the object with HD geometry enabled

Returns

Promise<void | ConfigurationLoadedResponse>


enableMeshSelection

enableMeshSelection(enabled): void

By default the outline pass uses the bounding box mesh of each component to highlight the object. When mesh selection is enabled, the meshes of the object are used directly. This is the recommended setting for non square/rectangular (shelf) components like sofas.

Parameters

Name
Type

enabled

boolean

Returns

void


enableMultiselect

enableMultiselect(): void

Enable the selection of multiple components. Common parameters shared between those components can then be changed at once

Returns

void

Implementation of

RubensAPI.enableMultiselect


exportCanvasScreenshot

exportCanvasScreenshot(quality?): Promise<string>

Parameters

Name
Type

quality?

number

Returns

Promise<string>

Implementation of

RubensAPI.exportCanvasScreenshot


exportImageFromCamera

exportImageFromCamera(filename?, shouldWaitForAssets?): Promise<void>

Parameters

Name
Type
Default value

filename

string

'image'

shouldWaitForAssets

boolean

false

Returns

Promise<void>

Implementation of

RubensAPI.exportImageFromCamera


formatValueToUnitString

formatValueToUnitString(value, parameter): string | number

Returns the formatted value based on the parameter.unitType

Parameters

Name
Type

value

number

parameter

Returns

string | number


generateExport

generateExport(exportType, defaultExportDefinition?): Promise<any>

Parameters

Name
Type
Default value

exportType

undefined

defaultExportDefinition

string

''

Returns

Promise<any>


generateIMOSiXExport

generateIMOSiXExport(defaultExportDefinition?): Promise<any>

Parameters

Name
Type
Default value

defaultExportDefinition

string

''

Returns

Promise<any>


generateImagesOfCurrentConfiguration

generateImagesOfCurrentConfiguration(): Promise<object>

Generates images of the current configuration

Returns

Promise<object>

Promise containing the topImage, perspectgetAdditionalContentsOfiveImage and a boolean isLocally which indicates if the images were generated while being offline


generateProductionServiceExport

generateProductionServiceExport(defaultExportDefinition?): Promise<any>

Parameters

Name
Type
Default value

defaultExportDefinition

string

''

Returns

Promise<any>


generateTCExport

generateTCExport(defaultExportDefinition?): Promise<any>

Parameters

Name
Type
Default value

defaultExportDefinition

string

''

Returns

Promise<any>


getAdditionalContentsOf

getAdditionalContentsOf(rapiItems): Promise<RapiAdditionalContent[]>

It is possible to add additional content to a configurable-item in our backend for example, product images, product videos etc. To fetch them you can use this method

Parameters

Name
Type

rapiItems

Returns

Promise<RapiAdditionalContent[]>


getCameraOffset

getCameraOffset(): CanvasOffset

Gets the available screen space for our item default: 'left: 0, top: 1, right: 1, bottom: 0'

Returns

CanvasOffset

Implementation of

GlobalAPI.getCameraOffset


getChildrenOfPlanComponent

getChildrenOfPlanComponent(componentRuntimeId, onlyPossible?, onlyVisible?): Promise<{ defaultChild: UiPossibleChild ; tags: UiPossibleChildTag[] }>

Returns all possible children and the default child for a given component

Parameters

Name
Type
Default value

componentRuntimeId

number

undefined

onlyPossible

boolean

false

onlyVisible

boolean

false

Returns

Promise<{ defaultChild: UiPossibleChild ; tags: UiPossibleChildTag[] }>


getChildrenOfPlanObject

getChildrenOfPlanObject(onlyPossible?, onlyVisible?): Promise<{ defaultChild: UiPossibleChild ; tags: UiPossibleChildTag[] }>

Returns all possible children and the default child for the plan object

Parameters

Name
Type
Default value

onlyPossible

boolean

false

onlyVisible

boolean

false

Returns

Promise<{ defaultChild: UiPossibleChild ; tags: UiPossibleChildTag[] }>


getComponent

getComponent(componentRuntimeId): KernelComponent

Returns the KernelComponent object for the given componentRuntimeId

Parameters

Name
Type

componentRuntimeId

number

Returns

KernelComponent


getConfiguratorContext

getConfiguratorContext(): default

returns class containing configurator specific data properties

Returns

default


getConfiguratorSettings

getConfiguratorSettings(id): Promise<RapiConfiguratorSettings>

Get the data which is assigned to the configurator object, especially things like allowed hosts

Parameters

Name
Type

id

string

Returns

Promise<RapiConfiguratorSettings>


getCurrentConfiguration

getCurrentConfiguration(): Promise<string>

Returns

Promise<string>

Promise with the current configuration string/hash


getCurrentConfigurationHash

getCurrentConfigurationHash(): Promise<string>

returns the current configuration hash, this can be used for analytics or other stuff like caching etc

Returns

Promise<string>

string current configuration hash


getCurrentSelection

getCurrentSelection(): string[]

Returns

string[]


getHashOfSerializedConfiguration

getHashOfSerializedConfiguration(serializedConfiguration): string

Returns the hash of the given serialized configuration

Parameters

Name
Type

serializedConfiguration

string

Returns

string


getParameterGroups

getParameterGroups(): KernelParameterGroup[]

Get all parameter groups defined on the component, even if it has no parameters assigned

Returns

KernelParameterGroup[]


getParametersOfComponent

getParametersOfComponent(componentRuntimeId): UiKernelParameter[]

Returns parameters of the component including groups

Parameters

Name
Type

componentRuntimeId

number

Returns

UiKernelParameter[]


getParametersOfPlanObject

getParametersOfPlanObject(): Promise<KernelParameter[]>

Returns all parameters which correspond to the plan object. This is also exposed for embedding

Returns

Promise<KernelParameter[]>


getParametersOfRootComponent

getParametersOfRootComponent(): Promise<KernelParameter[]>

Returns all parameters which correspond to the root component. This is also exposed for embedding

Returns

Promise<KernelParameter[]>


getRuntimeComponentIdOfRootComponent

getRuntimeComponentIdOfRootComponent(): number

Returns the runtime component id of root component of the current plan object

Returns

number

number the number of the runtime id of the root component

Implementation of

KernelUtilityForUi.getRuntimeComponentIdOfRootComponent


getScene

getScene(): Scene

Returns the three.js scene (https://threejs.org/docs/#api/en/scenes/Scene) WARNING: This is the actual scene (reference) and not a copy!

Returns

Scene

Implementation of

GlobalAPI.getScene


getShortUrlOfCurrentConfiguration

getShortUrlOfCurrentConfiguration(): Promise<string>

Returns

Promise<string>

Promise containing the short url for the current configuration


getStorage

getStorage(): default

returns manager class to interface with indexedDB storage

Returns

default

Implementation of

RubensAPI.getStorage


getTagById

getTagById(tagId, options?): Promise<RapiTagForUi>

Get tag for a given tag id

Parameters

Name
Type
Description

tagId

string

options?

Object

{ include: RAPI_PATHS[] }

options.include

-

Returns

Promise<RapiTagForUi>

Promise containing the tag including items and materials for that tag


getTools

getTools(): Promise<default>

Returns

Promise<default>


getUnitFormatter

getUnitFormatter(): default

returns unit formatter for formatting input und output values in scene

Returns

default

Implementation of

GlobalAPI.getUnitFormatter


hideDimensions

hideDimensions(): void

Hides dimensions when they are shown (see showDimensions). Calling hideDimensions does not force dimensions to be always hidden.

See @roomle/web-sdk/configurator-core/src/services/configurator-ui-callback#ConfiguratorUiCallbacks.onDimensionsVisibilityChange to get notified when dimension visibility changes

Returns

void


highlightParts

highlightParts(ids): void

Highlight parts in the scene with the given ids Use empty array to remove highlights

Parameters

Name
Type

ids

number[]

Returns

void


init

init(element, initData?): Promise<void>

This method has to be called before configurator is ready to use

Parameters

Name
Type
Description

element

HTMLElement

which should contain the configurator

initData?

Returns

Promise<void>

Promise which is resolved when configurator is initialized


initSceneManager

initSceneManager(sceneManager?): void

Parameters

Name
Type

sceneManager?

Returns

void


isReady

isReady(): void

Returns

void

Implementation of

ConfiguratorKernelAccessCallbackI.isReady


loadComponentIntoKernel

loadComponentIntoKernel(componentString): Promise<void>

Loads the component (defined as string) into the kernel

Parameters

Name
Type

componentString

string

Returns

Promise<void>

Promise which gets resolved when the component has been loaded


loadConfigurableItemById

loadConfigurableItemById(itemId, initData?): Promise<ConfigurationLoadedResponse>

Loads a configuration based on the item id

Parameters

Name
Type

itemId

string

initData?

Returns

Promise<ConfigurationLoadedResponse>


loadConfiguration

loadConfiguration(configuration, initData?): Promise<ConfigurationLoadedResponse>

Loads an item based on a configuration string

For example: {'componentId":"muuto:Muuto-Stacked'}

Parameters

Name
Type

configuration

string

initData?

Returns

Promise<ConfigurationLoadedResponse>


loadConfigurationById

loadConfigurationById(configurationId, initData?): Promise<ConfigurationLoadedResponse>

Loads an item based on a configuration hash

For example: koinor:FORMIA_LeftGroup:79FBF0D6C79A2598B5FF943111EA29DC0C6884AA97F4383582B47F69C14DDB2C

Parameters

Name
Type

configurationId

string

initData?

Returns

Promise<ConfigurationLoadedResponse>


loadDynamicLightSetting

loadDynamicLightSetting(source): Promise<void>

Loads a dynamic light settings into the scene. The dynamic light setting source can be an object (js), json, or an url (url to json). See @roomle/web-sdk/configurator-core/src/scene-settings-loader#SceneSettings how to define it.

Exampe:

{
 "lights": [
   {
     "type": "rectarea",
     "name": "main",
     "intensity": 240,
     "color": "#ffffff",
     "position": {
       "x": -0.5,
       "y": 6,
       "z": 3
     },
     "target": {
       "x": 0,
       "y": 0,
       "z": 0
     },
     "castShadow": true,
     "width": 0.8,
     "height": 0.8
   },
   {
     "type": "spot",
     "name": "side",
     "intensity": 0.3,
     "color": "#ffffff",
     "position": {
       "x": 2,
       "y": 3,
       "z": 1.5
     },
     "target": {
       "x": 0,
       "y": 0.1,
       "z": 0
     },
     "castShadow": false,
     "angle": 50,
     "penumbra": 0.5
   },
   {
     "type": "ambient",
     "name": "ambient",
     "intensity": 0.3,
     "color": "#ffffff",
     "position": {
       "x": 0,
       "y": 0,
       "z": 0
     }
   }
 ]
}

Parameters

Name
Type

source

Returns

Promise<void>


loadError

loadError(error?): void

Parameters

Name
Type

error?

any

Returns

void

Implementation of

ConfiguratorKernelAccessCallbackI.loadError


loadSceneSetting

loadSceneSetting(sceneSettings): Promise<void>

Loads a SceneSettings object, currently it can can contain a light setting definition (see @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting) and an environment definition (see @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loader#EnvironmentSetting).

Parameters

Name
Type

sceneSettings

Returns

Promise<void>


moveCamera

moveCamera(cameraParameter): Promise<void>

Parameters

Name
Type

cameraParameter

Returns

Promise<void>


notifyUiAboutNewLabel

notifyUiAboutNewLabel(id): void

Parameters

Name
Type

id

string

Returns

void


pauseKernelCallbacks

pauseKernelCallbacks(): void

Returns

void


preLoadConfigurableItemById

preLoadConfigurableItemById(itemId): Promise<RapiItem>

Downloads and caches the selected item id for faster use

Parameters

Name
Type

itemId

string

Returns

Promise<RapiItem>


preLoadConfigurationById

preLoadConfigurationById(configurationId): Promise<RapiConfiguration>

Downloads and caches the selected configuration id for faster use

Parameters

Name
Type

configurationId

string

Returns

Promise<RapiConfiguration>


preparePartImage

preparePartImage(partId, options?): Promise<Base64Image>

Generates an image of one part (slightly from the side) and returns it as base 64 WARNING: It's only possible to render one sub part at a time *

Parameters

Name
Type
Description

partId

number

id of the sub part, received from part list *

options?

size of the rendered image in pixel (default is 256), will render faster when size is smaller

Returns

Promise<Base64Image>


preparePerspectiveImage

preparePerspectiveImage(options?): Promise<Base64Image>

Generates a perspective image (slightly from the side) and returns it as base 64

Parameters

Name
Type

options

Returns

Promise<Base64Image>


prepareTopImage

prepareTopImage(options?): Promise<Base64Image>

Generates a top image (birds perspective) and returns it as base 64

Parameters

Name
Type
Description

options?

should object dimensions be visible

Returns

Promise<Base64Image>


previewDockings

previewDockings(possibleChild, dragEvent?, dragIn?): void

Shows dockings/ghosts for the selected possible child

Parameters

Name
Type

possibleChild

dragEvent?

DragEvent

dragIn?

boolean

Returns

void


redo

redo(): Promise<void>

Redo last action calls configuratorHistory.redo where array of last configuration are stored only possible if undo was called before

Returns

Promise<void>


removeTypeChangeTag

removeTypeChangeTag(rapiId): void

After calling this method the UiCallback removeTypeChangeTag is triggered (see: @roomle/web-sdk/configurator-core/src/services/configurator-ui-callback#ConfiguratorUiCallbacks.onRemoveTypeChangeTag)

Parameters

Name
Type

rapiId

string

Returns

void


renderImage

renderImage(renderOptions): Promise<Base64Image>

Renders the current item in high quality, it also uses the current lightsetting

Parameters

Name
Type

renderOptions

Partial<{ useCurrentPerspective: boolean = false }>

Returns

Promise<Base64Image>


requestAsset

requestAsset(url): string

Returns same url when online or caches url when offline

Parameters

Name
Type

url

string

Returns

string


requestDeleteComponent

requestDeleteComponent(): void

Deletes the currently selected component if possible

Returns

void


resetCameraPosition

resetCameraPosition(): void

Resets the camera back to the start position

Returns

void

Implementation of

RubensAPI.resetCameraPosition


resumeKernelCallbacks

resumeKernelCallbacks(): void

Returns

void


saveCurrentConfiguration

saveCurrentConfiguration(): Promise<RapiConfigurationEnhanced>

Saves the current configuration (parameters etc) and returns a new configuration object including the configuration hash

Returns

Promise<RapiConfigurationEnhanced>


selectComponent

selectComponent(runtimeId): Promise<void>

Select a component by runtime id. You can retrieve this ID from partlist etc If it's already selected it will be deselected to mimic the behavior of click/touch

Parameters

Name
Type
Description

runtimeId

number

number, the runtime id of the component. You can retrieve this ID from partlist etc

Returns

Promise<void>


setActiveGroupInView

setActiveGroupInView(group): void

Set the name of the parameter group which is selected at the moment

Parameters

Name
Type

group

string

Returns

void


setActiveGroupInViewForPlanObject

setActiveGroupInViewForPlanObject(group, runtimeId?): void

Set the name of the parameter group which is selected at the moment

Parameters

Name
Type

group

string

runtimeId?

number

Returns

void


setCameraOffset

setCameraOffset(offset): void

Sets the available screen space for our item Example 1: right 0.9 means 10% padding on the right side Example 2: bottom 0.2 means 20% padding on the bottom side default: 'left: 0, top: 1, right: 1, bottom: 0'

Parameters

Name
Type

offset

Returns

void

Implementation of

GlobalAPI.setCameraOffset


setComponentParameter

setComponentParameter(runtimeId, parameter, value): Promise<void>

Sets the parameter of the component by it's runtime id parameters of the plan object are set

Parameters

Name
Type
Description

runtimeId

number

number, the runtime id of the component. You can retrieve this ID from partlist etc

parameter

an instance of the kernel parameter we want to set, use 'key: "your-key"' if you do not have a kernel instance and do not need validation of the input

value

string

the value we want to set on the parameter as string

Returns

Promise<void>


setEnvironmentMap

setEnvironmentMap(params): void

Parameters

Name
Type

params

Object

params.intensity?

number

params.maxLightSources?

number

params.rotation?

number

params.url?

string

Returns

void

Implementation of

GlobalAPI.setEnvironmentMap


setOverrides

setOverrides(initData): void

Set general configuration parameter

Parameters

Name
Type

initData

Returns

void


setParameter

setParameter(parameter, value, isRaw?): Promise<void>

Sets the parameter of the selected component. If nothing is selected the parameters of the parameters of the plan object are set

Parameters

Name
Type
Default value
Description

parameter

undefined

an instance of the kernel parameter we want to set, use 'key: "your-key"' if you do not have a kernel instance and do not need validation of the input

value

string

undefined

the value we want to set on the parameter as string

isRaw

boolean

false

turn this to true if you dont want the kernel to parse the value string, e.g. convert 100cm to 1000

Returns

Promise<void>


setParameterOfPlanObject

setParameterOfPlanObject(parameter, value): Promise<void>

Method to set a parameter on the plan object. This is used by embedding as well

Parameters

Name
Type
Description

parameter

an instance of the kernel parameter we want to set, use 'key: "your-key"' if you do not have a kernel instance and do not need validation of the input

value

string

the value we want to set on the parameter as string

Returns

Promise<void>


setParameterOfRootComponent

setParameterOfRootComponent(parameter, value): Promise<void>

Method to set a parameter on the root component. This is used by embedding as well

Parameters

Name
Type
Description

parameter

an instance of the kernel parameter we want to set, use 'key: "your-key"' if you do not have a kernel instance and do not need validation of the input

value

string

the value we want to set on the parameter as string

Returns

Promise<void>


showDimensions

showDimensions(): void

Show dimensions (width, height, depth) of object

See @roomle/web-sdk/configurator-core/src/services/configurator-ui-callback#ConfiguratorUiCallbacks.onDimensionsVisibilityChange to get notified when dimension visibility changes

Returns

void


showGUI

showGUI(): void

Returns

void


showStats

showStats(): void

Show overlay with statistic data for: fps memory in MB number of draw calls number of poly/triangle count number of geometries number of textures

Returns

void


syncCatalog

syncCatalog(catalogId): Promise<void>

Start sync of catalog to make it offline available

Parameters

Name
Type

catalogId

string

Returns

Promise<void>


syncFloorTag

syncFloorTag(tagId): Promise<void>

Start sync of floor tag to make it offline available

Parameters

Name
Type

tagId

string

Returns

Promise<void>


syncTypeChangeTag

syncTypeChangeTag(tagId): Promise<void>

Start sync of type change tag to make it offline available

Parameters

Name
Type

tagId

string

Returns

Promise<void>


undo

undo(): Promise<void>

Undo last action calls configuratorHistory.undo where array of last configuration are stored

Returns

Promise<void>


updateParameters

updateParameters(parameters, parameterGroups, elementId, parameterUpdateType): void

Parameters

Name
Type

parameters

parameterGroups

elementId

number | number[]

parameterUpdateType

Returns

void

Implementation of

ConfiguratorKernelAccessCallbackI.updateParameters


updatePossibleChildren

updatePossibleChildren(elementId, children, parameterUpdateType?): Promise<void>

Parameters

Name
Type

elementId

number

children

parameterUpdateType?

Returns

Promise<void>

Implementation of

ConfiguratorKernelAccessCallbackI.updatePossibleChildren


updateScene

updateScene(): void

Updates the scene (recalculating bounds) and restart rendering

Returns

void

Implementation of

GlobalAPI.updateScene


updateSize

updateSize(): void

This function has to be called when the size of the container (the html element which has been used in the init method) changes It is VERY important to call this method because the SDK can not detect if the DOM element which embeds the canvas of the 3D scene changes in size

Returns

void

Implementation of

GlobalAPI.updateSize


zoomIn

zoomIn(value?): void

Moves the camera closer to the object. Default value (when no value given) is 4, higher value moves a bigger distance.

Parameters

Name
Type

value?

number

Returns

void


zoomOut

zoomOut(value?): void

Moves the camera away from the object. Default value (when no value given) is 4, higher value moves a bigger distance.

Parameters

Name
Type

value?

number

Returns

void

Last updated