configurator-core/src/roomle-configurator.default
Shared API between configurator and planner
Type parameters
Table of contents
• new default<P>(creator, activePlugins?)
Type parameters
extends readonly "external-objects"[] = readonly []
• _creator_: string
Implementation of
Context.creator
• get callbacks(): default
Use this callbacks to hook in your functionality
default
Implementation of
ExternalEmbeddable.callbacks
calcPartsPriceSum
â–¸ calcPartsPriceSum(partList): Promise<KernelPartListPrice>
Promise<KernelPartListPrice>
â–¸ cancelDockings(): void
Remove/cancel all dockings/ghosts
void
cancelSelection
▸ cancelSelection(«destructured»?): void
Cancels the selection of all currently selected components
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
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
Promise<void>
promise that resolves when material has been changed
â–¸ changeOffset(offset): void
Change the camera offset
void
â–¸ cleanup(options?): void
Clears the scene and all components/meshes.
Also unregisters configurator callbacks in kernel.
void
â–¸ clearHistory(): void
clears current configurator history
void
â–¸ disableEvents(): void
void
disableHDGeometry
â–¸ disableHDGeometry(): Promise<void | ConfigurationLoadedResponse>
Disable the use of HD Geometry
Promise<void | ConfigurationLoadedResponse>
disableMultiselect
â–¸ disableMultiselect(): void
Disable selection of multiple components. By default only one component can be selected at a time
void
downloadHomagIxExportPoC
â–¸ downloadHomagIxExportPoC(): Promise<any>
Promise<any>
enableDebugging
â–¸ enableDebugging(): void
void
Implementation of
ConfiguratorDebugAPI.enableDebugging
â–¸ enableEvents(): void
void
enableHDGeometry
â–¸ enableHDGeometry(): Promise<void | ConfigurationLoadedResponse>
Enable the use of HD geometry. Also reloads the object with HD geometry enabled
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.
void
enableMultiselect
â–¸ enableMultiselect(): void
Enable the selection of multiple components.
Common parameters shared between those components can then be changed at once
void
Implementation of
RubensAPI.enableMultiselect
exportCanvasScreenshot
â–¸ exportCanvasScreenshot(quality?): Promise<string>
Promise<string>
Implementation of
RubensAPI.exportCanvasScreenshot
exportImageFromCamera
â–¸ exportImageFromCamera(filename?, shouldWaitForAssets?): Promise<void>
Promise<void>
Implementation of
RubensAPI.exportImageFromCamera
â–¸ formatValueToUnitString(value, parameter): string | number
Returns the formatted value based on the parameter.unitType
string | number
generateHOMAGiXExport
â–¸ generateHOMAGiXExport(defaultExportDefinition?, homagIxOrderData?, homagIxHeaderParams?, homagIxArticleParams?): Promise<string>
Promise<string>
generateHomagIxExport
â–¸ generateHomagIxExport(exportType, defaultExportDefinition?): Promise<any>
Promise<any>
generateIMOSiXExport
â–¸ generateIMOSiXExport(defaultExportDefinition?): Promise<any>
Promise<any>
generateImagesOfCurrentConfiguration
â–¸ generateImagesOfCurrentConfiguration(): Promise<object>
Generates images of the current configuration
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>
Promise<any>
generateTCExport
â–¸ generateTCExport(defaultExportDefinition?): Promise<any>
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
Promise<RapiAdditionalContent[]>
getCameraOffset
â–¸ getCameraOffset(): CanvasOffset
Gets the available screen space for our item
default: 'left: 0, top: 1, right: 1, bottom: 0'
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
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
Promise<{ defaultChild: UiPossibleChild ; tags: UiPossibleChildTag[] }>
â–¸ getComponent(componentRuntimeId): KernelComponent
Returns the KernelComponent object for the given componentRuntimeId
KernelComponent
getConfiguratorContext
â–¸ getConfiguratorContext(): default
returns class containing configurator specific data properties
default
getConfiguratorSettings
â–¸ getConfiguratorSettings(): Promise<RapiConfiguratorSettings>
Get the data which is assigned to the configurator object, especially things like allowed hosts
Promise<RapiConfiguratorSettings>
getCurrentConfiguration
â–¸ getCurrentConfiguration(): Promise<string>
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
Promise<string>
string current configuration hash
getCurrentSelection
â–¸ getCurrentSelection(): string[]
string[]
getHashOfSerializedConfiguration
â–¸ getHashOfSerializedConfiguration(serializedConfiguration): string
Returns the hash of the given serialized configuration
string
getParameterGroups
â–¸ getParameterGroups(): KernelParameterGroup[]
Get all parameter groups defined on the component, even if it has no parameters assigned
KernelParameterGroup[]
getParametersOfComponent
â–¸ getParametersOfComponent(componentRuntimeId): UiKernelParameter[]
Returns parameters of the component including groups
UiKernelParameter[]
getParametersOfPlanObject
â–¸ getParametersOfPlanObject(): Promise<KernelParameter[]>
Returns all parameters which correspond to the plan object. This is also exposed for embedding
Promise<KernelParameter[]>
getParametersOfRootComponent
â–¸ getParametersOfRootComponent(): Promise<KernelParameter[]>
Returns all parameters which correspond to the root component. This is also exposed for embedding
Promise<KernelParameter[]>
getRuntimeComponentIdOfRootComponent
â–¸ getRuntimeComponentIdOfRootComponent(): number
Returns the runtime component id of root component of the current plan object
number
number the number of the runtime id of the root component
Implementation of
KernelUtilityForUi.getRuntimeComponentIdOfRootComponent
â–¸ 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!
Scene
Implementation of
GlobalAPI.getScene
getShortUrlOfCurrentConfiguration
â–¸ getShortUrlOfCurrentConfiguration(): Promise<string>
Promise<string>
Promise containing the short url for the current configuration
â–¸ getStorage(): default
returns manager class to interface with indexedDB storage
default
Implementation of
RubensAPI.getStorage
â–¸ getTagById(tagId, options?): Promise<RapiTagForUi>
Get tag for a given tag id
{ include: RAPI_PATHS[] }
Promise<RapiTagForUi>
Promise containing the tag including items and materials for that tag
â–¸ getTools(): Promise<default>
Promise<default>
â–¸ getUnitFormatter(): default
returns unit formatter for formatting input und output values in scene
default
Implementation of
GlobalAPI.getUnitFormatter
â–¸ 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
void
â–¸ highlightParts(ids): void
Highlight parts in the scene with the given ids
Use empty array to remove highlights
void
â–¸ init(element, initData?): Promise<void>
This method has to be called before configurator is ready to use
which should contain the configurator
Promise<void>
Promise which is resolved when configurator is initialized
initSceneManager
â–¸ initSceneManager(sceneManager?): void
void
â–¸ isReady(): void
void
Implementation of
ConfiguratorKernelAccessCallbackI.isReady
loadComponentIntoKernel
â–¸ loadComponentIntoKernel(componentString): Promise<void>
Loads the component (defined as string) into the kernel
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
Promise<ConfigurationLoadedResponse>
loadConfiguration
â–¸ loadConfiguration(configuration, initData?): Promise<ConfigurationLoadedResponse>
Loads an item based on a configuration string
For example: {'componentId":"muuto:Muuto-Stacked'}
Promise<ConfigurationLoadedResponse>
loadConfigurationById
â–¸ loadConfigurationById(configurationId, initData?): Promise<ConfigurationLoadedResponse>
Loads an item based on a configuration hash
For example: koinor:FORMIA_LeftGroup:79FBF0D6C79A2598B5FF943111EA29DC0C6884AA97F4383582B47F69C14DDB2C
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:
Promise<void>
â–¸ loadError(error?): void
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).
Promise<void>
â–¸ moveCamera(cameraParameter): Promise<void>
Promise<void>
notifyUiAboutNewLabel
â–¸ notifyUiAboutNewLabel(id): void
void
pauseKernelCallbacks
â–¸ pauseKernelCallbacks(): void
void
preLoadConfigurableItemById
â–¸ preLoadConfigurableItemById(itemId): Promise<RapiItem>
Downloads and caches the selected item id for faster use
Promise<RapiItem>
preLoadConfigurationById
â–¸ preLoadConfigurationById(configurationId): Promise<RapiConfiguration>
Downloads and caches the selected configuration id for faster use
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
*
id of the sub part, received from part list *
size of the rendered image in pixel (default is 256), will render faster when size is smaller
Promise<Base64Image>
preparePerspectiveImage
â–¸ preparePerspectiveImage(options?): Promise<Base64Image>
Generates a perspective image (slightly from the side) and returns it as base 64
Promise<Base64Image>
prepareTopImage
â–¸ prepareTopImage(options?): Promise<Base64Image>
Generates a top image (birds perspective) and returns it as base 64
should object dimensions be visible
Promise<Base64Image>
previewDockings
â–¸ previewDockings(possibleChild, dragEvent?, dragIn?): void
Shows dockings/ghosts for the selected possible child
void
â–¸ redo(): Promise<void>
Redo last action
calls configuratorHistory.redo where array of last configuration are stored
only possible if undo was called before
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)
void
â–¸ renderImage(renderOptions): Promise<Base64Image>
Renders the current item in high quality, it also uses the current lightsetting
Partial<{ useCurrentPerspective: boolean = false }>
Promise<Base64Image>
â–¸ requestAsset(url): string
Returns same url when online or caches url when offline
string
requestDeleteComponent
â–¸ requestDeleteComponent(): void
Deletes the currently selected component if possible
void
resetCameraPosition
â–¸ resetCameraPosition(): void
Resets the camera back to the start position
void
Implementation of
RubensAPI.resetCameraPosition
resumeKernelCallbacks
â–¸ resumeKernelCallbacks(): void
void
saveCurrentConfiguration
â–¸ saveCurrentConfiguration(): Promise<SaveCurrentConfigurationReturnType<P>>
Saves the current configuration (parameters etc)
and returns a new configuration object including the configuration hash
Promise<SaveCurrentConfigurationReturnType<P>>
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
number, the runtime id of the component. You can retrieve this ID from partlist etc
Promise<void>
setActiveGroupInView
â–¸ setActiveGroupInView(group): void
Set the name of the parameter group which is selected at the moment
void
setActiveGroupInViewForPlanObject
â–¸ setActiveGroupInViewForPlanObject(group, runtimeId?): void
Set the name of the parameter group which is selected at the moment
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'
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
number, the runtime id of the component. You can retrieve this ID from partlist etc
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
the value we want to set on the parameter as string
Promise<void>
setEnvironmentMap
â–¸ setEnvironmentMap(params): void
void
Implementation of
GlobalAPI.setEnvironmentMap
â–¸ setOverrides(initData): void
Set general configuration parameter
void
â–¸ 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
Name
Type
Default value
Description
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
the value we want to set on the parameter as string
turn this to true if you dont want the kernel to parse the value string, e.g. convert 100cm to 1000
Promise<void>
setParameterOfPlanObject
â–¸ setParameterOfPlanObject(parameter, value): Promise<void>
Method to set a parameter on the plan object. This is used by embedding as well
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
the value we want to set on the parameter as string
Promise<void>
setParameterOfRootComponent
â–¸ setParameterOfRootComponent(parameter, value): Promise<void>
Method to set a parameter on the root component. This is used by embedding as well
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
the value we want to set on the parameter as string
Promise<void>
â–¸ 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
void
â–¸ showGUI(): void
void
â–¸ 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
void
â–¸ syncCatalog(catalogId): Promise<void>
Start sync of catalog to make it offline available
Promise<void>
â–¸ syncFloorTag(tagId): Promise<void>
Start sync of floor tag to make it offline available
Promise<void>
syncTypeChangeTag
â–¸ syncTypeChangeTag(tagId): Promise<void>
Start sync of type change tag to make it offline available
Promise<void>
â–¸ undo(): Promise<void>
Undo last action
calls configuratorHistory.undo where array of last configuration are stored
Promise<void>
updateParameters
â–¸ updateParameters(parameters, parameterGroups, elementId, parameterUpdateType): void
void
Implementation of
ConfiguratorKernelAccessCallbackI.updateParameters
updatePossibleChildren
â–¸ updatePossibleChildren(elementId, children, parameterUpdateType?): Promise<void>
Promise<void>
Implementation of
ConfiguratorKernelAccessCallbackI.updatePossibleChildren
â–¸ updateScene(): void
Updates the scene (recalculating bounds) and restart rendering
void
Implementation of
GlobalAPI.updateScene
â–¸ 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
void
Implementation of
GlobalAPI.updateSize
â–¸ zoomIn(value?): void
Moves the camera closer to the object. Default value (when no value given) is 4, higher value moves a bigger distance.
void
â–¸ zoomOut(value?): void
Moves the camera away from the object. Default value (when no value given) is 4, higher value moves a bigger distance.
void