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
creator
string
Properties
_creator_
• _creator_: string
Implementation of
Accessors
callbacks
• get
callbacks(): default
Use this callbacks to hook in your functionality
Returns
Implementation of
Methods
calcPartsPriceSum
▸ calcPartsPriceSum(partList
): Promise
<KernelPartListPrice
>
Parameters
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
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
materialId
string
Returns
Promise
<void
>
promise that resolves when material has been changed
changeOffset
▸ changeOffset(offset
): void
Change the camera offset
Parameters
offset
Returns
void
cleanup
▸ cleanup(options?
): void
Clears the scene and all components/meshes. Also unregisters configurator callbacks in kernel.
Parameters
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
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
exportCanvasScreenshot
▸ exportCanvasScreenshot(quality?
): Promise
<string
>
Parameters
quality?
number
Returns
Promise
<string
>
Implementation of
RubensAPI.exportCanvasScreenshot
exportImageFromCamera
▸ exportImageFromCamera(filename?
, shouldWaitForAssets?
): Promise
<void
>
Parameters
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
value
number
parameter
Returns
string
| number
generateExport
▸ generateExport(exportType
, defaultExportDefinition?
): Promise
<any
>
Parameters
exportType
undefined
defaultExportDefinition
string
''
Returns
Promise
<any
>
generateIMOSiXExport
▸ generateIMOSiXExport(defaultExportDefinition?
): Promise
<any
>
Parameters
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
defaultExportDefinition
string
''
Returns
Promise
<any
>
generateTCExport
▸ generateTCExport(defaultExportDefinition?
): Promise
<any
>
Parameters
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
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
Implementation of
getChildrenOfPlanComponent
▸ getChildrenOfPlanComponent(componentRuntimeId
, onlyPossible?
, onlyVisible?
): Promise
<{ defaultChild
: UiPossibleChild
; tags
: UiPossibleChildTag
[] }>
Returns all possible children and the default child for a given component
Parameters
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
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
componentRuntimeId
number
Returns
getConfiguratorContext
▸ getConfiguratorContext(): default
returns class containing configurator specific data properties
Returns
getConfiguratorSettings
▸ getConfiguratorSettings(id
): Promise
<RapiConfiguratorSettings
>
Get the data which is assigned to the configurator object, especially things like allowed hosts
Parameters
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
serializedConfiguration
string
Returns
string
getParameterGroups
▸ getParameterGroups(): KernelParameterGroup
[]
Get all parameter groups defined on the component, even if it has no parameters assigned
Returns
getParametersOfComponent
▸ getParametersOfComponent(componentRuntimeId
): UiKernelParameter
[]
Returns parameters of the component including groups
Parameters
componentRuntimeId
number
Returns
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
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
Implementation of
getTagById
▸ getTagById(tagId
, options?
): Promise
<RapiTagForUi
>
Get tag for a given tag id
Parameters
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
Implementation of
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
ids
number
[]
Returns
void
init
▸ init(element
, initData?
): Promise
<void
>
This method has to be called before configurator is ready to use
Parameters
element
HTMLElement
which should contain the configurator
initData?
Returns
Promise
<void
>
Promise which is resolved when configurator is initialized
initSceneManager
▸ initSceneManager(sceneManager?
): void
Parameters
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
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
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
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
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:
Parameters
source
Returns
Promise
<void
>
loadError
▸ loadError(error?
): void
Parameters
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
sceneSettings
Returns
Promise
<void
>
moveCamera
▸ moveCamera(cameraParameter
): Promise
<void
>
Parameters
cameraParameter
Returns
Promise
<void
>
notifyUiAboutNewLabel
▸ notifyUiAboutNewLabel(id
): void
Parameters
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
itemId
string
Returns
Promise
<RapiItem
>
preLoadConfigurationById
▸ preLoadConfigurationById(configurationId
): Promise
<RapiConfiguration
>
Downloads and caches the selected configuration id for faster use
Parameters
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
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
options
Returns
Promise
<Base64Image
>
prepareTopImage
▸ prepareTopImage(options?
): Promise
<Base64Image
>
Generates a top image (birds perspective) and returns it as base 64
Parameters
options?
should object dimensions be visible
Returns
Promise
<Base64Image
>
previewDockings
▸ previewDockings(possibleChild
, dragEvent?
, dragIn?
): void
Shows dockings/ghosts for the selected possible child
Parameters
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
rapiId
string
Returns
void
renderImage
▸ renderImage(renderOptions
): Promise
<Base64Image
>
Renders the current item in high quality, it also uses the current lightsetting
Parameters
renderOptions
Partial
<{ useCurrentPerspective
: boolean
= false }>
Returns
Promise
<Base64Image
>
requestAsset
▸ requestAsset(url
): string
Returns same url when online or caches url when offline
Parameters
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
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
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
group
string
Returns
void
setActiveGroupInViewForPlanObject
▸ setActiveGroupInViewForPlanObject(group
, runtimeId?
): void
Set the name of the parameter group which is selected at the moment
Parameters
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
offset
Returns
void
Implementation of
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
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
params
Object
params.intensity?
number
params.maxLightSources?
number
params.rotation?
number
params.url?
string
Returns
void
Implementation of
setOverrides
▸ setOverrides(initData
): void
Set general configuration parameter
Parameters
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
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
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
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
catalogId
string
Returns
Promise
<void
>
syncFloorTag
▸ syncFloorTag(tagId
): Promise
<void
>
Start sync of floor tag to make it offline available
Parameters
tagId
string
Returns
Promise
<void
>
syncTypeChangeTag
▸ syncTypeChangeTag(tagId
): Promise
<void
>
Start sync of type change tag to make it offline available
Parameters
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
parameters
parameterGroups
elementId
number
| number
[]
parameterUpdateType
Returns
void
Implementation of
ConfiguratorKernelAccessCallbackI.updateParameters
updatePossibleChildren
▸ updatePossibleChildren(elementId
, children
, parameterUpdateType?
): Promise
<void
>
Parameters
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
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
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
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
value?
number
Returns
void
Last updated