API ReferenceGlobalsRoomleConfigurator

# Class: RoomleConfigurator

# Hierarchy

  • RoomleConfigurator

# Implements

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new RoomleConfigurator(creator: string): RoomleConfigurator

Defined in packages/configurator-core/src/roomle-configurator.ts:168

Parameters:

Name Type
creator string

Returns: RoomleConfigurator

# Properties

# creator

creator: string

Implementation of Context.creator

Defined in packages/configurator-core/src/roomle-configurator.ts:86

# Accessors

# callbacks

get callbacks(): ConfiguratorUiCallbacks

Defined in packages/configurator-core/src/roomle-configurator.ts:1408

Return ConfiguratorUiCallbacks to override

Returns: ConfiguratorUiCallbacks


# globalCallbacks

get globalCallbacks(): GlobalCallback

Defined in packages/configurator-core/src/roomle-configurator.ts:1416

internal Return GlobalCallback to override

Returns: GlobalCallback

# Methods

# cancelDockings

cancelDockings(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:604

Remove/cancel all dockings/ghosts

Returns: void


# cancelSelection

cancelSelection(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:564

Cancels the selection of all currently selected components

Returns: void


# changeFloorMaterial

changeFloorMaterial(material: RapiMaterial): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1078

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 RapiMaterial

Returns: Promise‹void›

promise that resolves when material has been changed


# changeFloorMaterialById

changeFloorMaterialById(materialId: string): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1102

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: CanvasOffset): void

Defined in packages/configurator-core/src/roomle-configurator.ts:586

Change the camera offset, see CanvasOffset for more details

Parameters:

Name Type Description
offset CanvasOffset

Returns: void


# cleanup

cleanup(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1364

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

Returns: void


# disableHDGeometry

disableHDGeometry(): Promise‹void | ConfigurationLoadedResponse

Defined in packages/configurator-core/src/roomle-configurator.ts:578

Disable the use of HD Geometry

Returns: Promise‹void | ConfigurationLoadedResponse


# disableMultiselect

disableMultiselect(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:955

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

Returns: void


# enableHDGeometry

enableHDGeometry(): Promise‹void | ConfigurationLoadedResponse

Defined in packages/configurator-core/src/roomle-configurator.ts:571

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

Returns: Promise‹void | ConfigurationLoadedResponse


# enableMeshSelection

enableMeshSelection(enabled: boolean): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1327

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 Description
enabled boolean

Returns: void


# enableMultiselect

enableMultiselect(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:947

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

Returns: void


# formatValueToUnitString

formatValueToUnitString(value: number, parameter: KernelParameter): string | number

Defined in packages/configurator-core/src/roomle-configurator.ts:1023

Returns the formatted value based on the parameter.unitType

Parameters:

Name Type Description
value number -
parameter KernelParameter

Returns: string | number


# generateImagesOfCurrentConfiguration

generateImagesOfCurrentConfiguration(): Promise‹object›

Defined in packages/configurator-core/src/roomle-configurator.ts:717

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


# getAdditionalContentsOf

getAdditionalContentsOf(rapiItems: RapiItem[]): Promise‹RapiAdditionalContent[]›

Defined in packages/configurator-core/src/roomle-configurator.ts:1130

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 Description
rapiItems RapiItem[]

Returns: Promise‹RapiAdditionalContent[]›


# getCameraOffset

getCameraOffset(): CanvasOffset

Implementation of GlobalAPI

Defined in packages/configurator-core/src/roomle-configurator.ts:1346

Returns: CanvasOffset


# getConfiguratorSettings

getConfiguratorSettings(id: RapiId): Promise‹RapiConfiguratorSettings

Defined in packages/configurator-core/src/roomle-configurator.ts:1678

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

Parameters:

Name Type
id RapiId

Returns: Promise‹RapiConfiguratorSettings


# getCurrentConfiguration

getCurrentConfiguration(): Promise‹ConfigurationString

Defined in packages/configurator-core/src/roomle-configurator.ts:963

Returns: Promise‹ConfigurationString

Promise with the current configuration string/hash


# getCurrentConfigurationHash

getCurrentConfigurationHash(): Promise‹ConfigurationHash

Defined in packages/configurator-core/src/roomle-configurator.ts:1441

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

Returns: Promise‹ConfigurationHash

string current configuration hash


# getCurrentSelection

getCurrentSelection(): string[]

Defined in packages/configurator-core/src/roomle-configurator.ts:1445

Returns: string[]


# getParameterGroups

getParameterGroups(): KernelParameterGroup[]

Defined in packages/configurator-core/src/roomle-configurator.ts:1671

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

Returns: KernelParameterGroup[]


# getParametersOfPlanObject

getParametersOfPlanObject(): Promise‹KernelParameter[]›

Defined in packages/configurator-core/src/roomle-configurator.ts:917

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

Returns: Promise‹KernelParameter[]›


# getParametersOfRootComponent

getParametersOfRootComponent(): Promise‹KernelParameter[]›

Defined in packages/configurator-core/src/roomle-configurator.ts:938

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

Returns: Promise‹KernelParameter[]›


# getRuntimeComponentIdOfRootComponent

getRuntimeComponentIdOfRootComponent(): number

Defined in packages/configurator-core/src/roomle-configurator.ts:1424

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


# getScene

getScene(): THREE.Scene

Implementation of GlobalAPI

Defined in packages/configurator-core/src/roomle-configurator.ts:184

Returns: THREE.Scene


# getShortUrlOfCurrentConfiguration

getShortUrlOfCurrentConfiguration(): Promise‹string›

Defined in packages/configurator-core/src/roomle-configurator.ts:1000

Returns: Promise‹string›

Promise containing the short url for the current configuration


# getTagById

getTagById(tagId: RapiId, options?: object): Promise‹RapiTagForUi

Defined in packages/configurator-core/src/roomle-configurator.ts:1034

Get tag for a given tag id

Parameters:

tagId: RapiId

Optional options: object

{ include: RAPI_PATHS[] }

Name Type
include RAPI_PATHS[]

Returns: Promise‹RapiTagForUi

Promise containing the tag including items and materials for that tag


# hideDimensions

hideDimensions(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1189

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

See onDimensionsVisibilityChange to get notified when dimension visibility changes

Returns: void


# highlightParts

highlightParts(ids: number[]): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1691

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

Parameters:

Name Type Description
ids number[]

Returns: void


# init

init(element: HTMLElement, initData?: InitDataDefinition): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:544

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

Parameters:

Name Type Description
element HTMLElement which should contain the configurator
initData? InitDataDefinition -

Returns: Promise‹void›

Promise which is resolved when configurator is initialized


# isReady

isReady(): void

Implementation of ConfiguratorKernelAccessCallbackI

Defined in packages/configurator-core/src/roomle-configurator.ts:1464

Returns: void


# loadComponentIntoKernel

loadComponentIntoKernel(componentString: string): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:974

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: RapiId, initData?: InitDataDefinition): Promise‹ConfigurationLoadedResponse

Defined in packages/configurator-core/src/roomle-configurator.ts:819

Loads a configuration based on the item id

Parameters:

Name Type Description
itemId RapiId -
initData? InitDataDefinition

Returns: Promise‹ConfigurationLoadedResponse


# loadConfiguration

loadConfiguration(configuration: ConfigurationString, initData?: InitDataDefinition): Promise‹ConfigurationLoadedResponse

Defined in packages/configurator-core/src/roomle-configurator.ts:779

Loads an item based on a configuration string

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

Parameters:

Name Type Description
configuration ConfigurationString -
initData? InitDataDefinition

Returns: Promise‹ConfigurationLoadedResponse


# loadConfigurationById

loadConfigurationById(configurationId: RapiId, initData?: InitDataDefinition): Promise‹ConfigurationLoadedResponse

Defined in packages/configurator-core/src/roomle-configurator.ts:797

Loads an item based on a configuration hash

For example: koinor:FORMIA_LeftGroup:79FBF0D6C79A2598B5FF943111EA29DC0C6884AA97F4383582B47F69C14DDB2C

Parameters:

Name Type Description
configurationId RapiId -
initData? InitDataDefinition

Returns: Promise‹ConfigurationLoadedResponse


# loadDynamicLightSetting

loadDynamicLightSetting(source: DynamicLightSettingSource): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1279

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 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 Description
source DynamicLightSettingSource

Returns: Promise‹void›


# loadError

loadError(error?: any): void

Implementation of ConfiguratorKernelAccessCallbackI

Defined in packages/configurator-core/src/roomle-configurator.ts:1643

Parameters:

Name Type
error? any

Returns: void


# loadSceneSetting

loadSceneSetting(sceneSettings: SceneSettings): Promise‹object›

Defined in packages/configurator-core/src/roomle-configurator.ts:1316

Loads a SceneSettings object, currently it can can contain a light setting definition (see loadDynamicLightSetting) and an environment definition (see EnvironmentSetting).

Parameters:

Name Type Description
sceneSettings SceneSettings

Returns: Promise‹object›


# moveCamera

moveCamera(cameraParameter: CameraParameter): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1682

Parameters:

Name Type
cameraParameter CameraParameter

Returns: Promise‹void›


# pauseKernelCallbacks

pauseKernelCallbacks(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1655

Returns: void


# preLoadConfigurableItemById

preLoadConfigurableItemById(itemId: RapiId): Promise‹RapiItem

Defined in packages/configurator-core/src/roomle-configurator.ts:838

Downloads and caches the selected item id for faster use

Parameters:

Name Type Description
itemId RapiId

Returns: Promise‹RapiItem


# preLoadConfigurationById

preLoadConfigurationById(configurationId: RapiId): Promise‹RapiConfiguration

Defined in packages/configurator-core/src/roomle-configurator.ts:830

Downloads and caches the selected configuration id for faster use

Parameters:

Name Type Description
configurationId RapiId

Returns: Promise‹RapiConfiguration


# preparePartImage

preparePartImage(partId: number, options?: PrepareImageOptions | number): Promise‹Base64Image

Defined in packages/configurator-core/src/roomle-configurator.ts:636

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

  • @param partId id of the sub part, received from part list
  • @param size size of the rendered image in pixel (default is 256), will render faster when size is smaller

Parameters:

Name Type
partId number
options? PrepareImageOptions | number

Returns: Promise‹Base64Image


# preparePerspectiveImage

preparePerspectiveImage(options: PrepareImageOptions): Promise‹Base64Image

Defined in packages/configurator-core/src/roomle-configurator.ts:626

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

Parameters:

Name Type Default
options PrepareImageOptions {}

Returns: Promise‹Base64Image


# prepareTopImage

prepareTopImage(options?: PrepareTopImageOptions | boolean): Promise‹Base64Image

Defined in packages/configurator-core/src/roomle-configurator.ts:729

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

Parameters:

Name Type
options? PrepareTopImageOptions | boolean

Returns: Promise‹Base64Image


# previewDockings

previewDockings(possibleChild: UiPossibleChild, dragEvent?: DragEvent, dragIn?: boolean): void

Defined in packages/configurator-core/src/roomle-configurator.ts:597

Shows dockings/ghosts for the selected possible child

Parameters:

Name Type Description
possibleChild UiPossibleChild -
dragEvent? DragEvent -
dragIn? boolean

Returns: void


# removeTypeChangeTag

removeTypeChangeTag(rapiId: RapiId): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1150

Just calls onRemoveTypeChangeTag on ConfiguratorUiCallbacks

Parameters:

Name Type Description
rapiId RapiId

Returns: void


# renderImage

renderImage(renderOptions: RenderOptions): Promise‹Base64Image

Defined in packages/configurator-core/src/roomle-configurator.ts:619

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

Parameters:

Name Type Description
renderOptions RenderOptions

Returns: Promise‹Base64Image


# requestAsset

requestAsset(url: string): AssetUrl

Defined in packages/configurator-core/src/roomle-configurator.ts:1067

Returns same url when online or caches url when offline

Parameters:

Name Type Description
url string

Returns: AssetUrl


# requestDeleteComponent

requestDeleteComponent(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:611

Deletes the currently selected component if possible

Returns: void


# resetCameraPosition

resetCameraPosition(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:750

Resets the camera back to the start position

Returns: void


# resumeKernelCallbacks

resumeKernelCallbacks(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1650

Returns: void


# saveCurrentConfiguration

saveCurrentConfiguration(): Promise‹RapiConfigurationEnhanced

Defined in packages/configurator-core/src/roomle-configurator.ts:659

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

Returns: Promise‹RapiConfigurationEnhanced


# setActiveGroupInView

setActiveGroupInView(group: string): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1664

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

Parameters:

Name Type Description
group string

Returns: void


# setCameraOffset

setCameraOffset(offset: CanvasOffset): void

Implementation of GlobalAPI

Defined in packages/configurator-core/src/roomle-configurator.ts:1342

Parameters:

Name Type
offset CanvasOffset

Returns: void


# setOverrides

setOverrides(initData: InitDataDefinition & GlobalInitDataDefinition): void

Defined in packages/configurator-core/src/roomle-configurator.ts:528

Set general configuration parameter

Parameters:

Name Type Description
initData InitDataDefinition & GlobalInitDataDefinition

Returns: void


# setParameter

setParameter(parameter: KernelParameter, value: string, isRaw: boolean): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:873

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 Description
parameter KernelParameter - a instance of the kernel parameter we want to set
value string - the value we want to set on the parameter
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: KernelParameter, value: string): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:902

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

Parameters:

Name Type Description
parameter KernelParameter a instance of the kernel parameter we want to set
value string the value we want to set on the parameter

Returns: Promise‹void›


# setParameterOfRootComponent

setParameterOfRootComponent(parameter: KernelParameter, value: string): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:927

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

Parameters:

Name Type Description
parameter KernelParameter a instance of the kernel parameter we want to set
value string the value we want to set on the parameter

Returns: Promise‹void›


# showDimensions

showDimensions(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1179

Show dimensions (width, height, depth) of object

See onDimensionsVisibilityChange to get notified when dimension visibility changes

Returns: void


# showGUI

showGUI(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1154

Returns: void


# showStats

showStats(): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1170

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: RapiId): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1197

Start sync of catalog to make it offline available

Parameters:

Name Type Description
catalogId RapiId

Returns: Promise‹void›


# syncFloorTag

syncFloorTag(tagId: RapiId): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1205

Start sync of floor tag to make it offline available

Parameters:

Name Type Description
tagId RapiId

Returns: Promise‹void›


# syncPlanObjectToView

syncPlanObjectToView(conversationId: number, objectId: number): void

Defined in packages/configurator-core/src/roomle-configurator.ts:804

Parameters:

Name Type
conversationId number
objectId number

Returns: void


# syncTypeChangeTag

syncTypeChangeTag(tagId: RapiId): Promise‹void›

Defined in packages/configurator-core/src/roomle-configurator.ts:1213

Start sync of type change tag to make it offline available

Parameters:

Name Type Description
tagId RapiId

Returns: Promise‹void›


# updateParameters

updateParameters(parameters: KernelParameter[], parameterGroups: KernelParameterGroup[], elementId: number | number[], parameterUpdateType: PARAMETER_UPDATE_TYPE): void

Implementation of ConfiguratorKernelAccessCallbackI

Defined in packages/configurator-core/src/roomle-configurator.ts:1603

Parameters:

Name Type
parameters KernelParameter[]
parameterGroups KernelParameterGroup[]
elementId number | number[]
parameterUpdateType PARAMETER_UPDATE_TYPE

Returns: void


# updatePossibleChildren

updatePossibleChildren(elementId: number, children: KernelPossibleChild[], parameterUpdateType?: PARAMETER_UPDATE_TYPE): void

Implementation of ConfiguratorKernelAccessCallbackI

Defined in packages/configurator-core/src/roomle-configurator.ts:1479

Parameters:

Name Type
elementId number
children KernelPossibleChild[]
parameterUpdateType? PARAMETER_UPDATE_TYPE

Returns: void


# updateScene

updateScene(): void

Implementation of GlobalAPI

Defined in packages/configurator-core/src/roomle-configurator.ts:188

Returns: void


# updateSize

updateSize(): void

Implementation of GlobalAPI

Defined in packages/configurator-core/src/roomle-configurator.ts:1338

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


# zoomIn

zoomIn(value?: number): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1393

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

Parameters:

Name Type Description
value? number

Returns: void


# zoomOut

zoomOut(value?: number): void

Defined in packages/configurator-core/src/roomle-configurator.ts:1401

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

Parameters:

Name Type Description
value? number

Returns: void