RoomleConfigurator.default
Last updated
Last updated
.default
Shared API between configurator and planner
P
<>
• new default<P
>(creator
, activePlugins?
)
P
extends readonly "external-objects"
[] = readonly []
creator
string
activePlugins?
P
• _creator_: string
Use this callbacks to hook in your functionality
partList
â–¸ cancelDockings(): void
Remove/cancel all dockings/ghosts
void
▸ cancelSelection(«destructured»?
): void
Cancels the selection of all currently selected components
«destructured»
Object
› reason?
› resetCamera?
boolean
void
â–¸ 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
material
Promise
<void
>
promise that resolves when material has been changed
â–¸ 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
materialId
string
Promise
<void
>
promise that resolves when material has been changed
â–¸ changeOffset(offset
): void
Change the camera offset
offset
void
â–¸ cleanup(options?
): void
Clears the scene and all components/meshes. Also unregisters configurator callbacks in kernel.
options
CleanupOptions
void
â–¸ clearHistory(): void
clears current configurator history
void
â–¸ disableEvents(): void
void
Disable the use of HD Geometry
â–¸ disableMultiselect(): void
Disable selection of multiple components. By default only one component can be selected at a time
void
â–¸ downloadHomagIxExportPoC(): Promise
<any
>
Promise
<any
>
â–¸ enableDebugging(): void
void
â–¸ enableEvents(): void
void
Enable the use of HD geometry. Also reloads the object with HD geometry enabled
â–¸ 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.
enabled
boolean
void
â–¸ enableMultiselect(): void
Enable the selection of multiple components. Common parameters shared between those components can then be changed at once
void
â–¸ exportCanvasScreenshot(quality?
): Promise
<string
>
quality?
number
Promise
<string
>
â–¸ exportImageFromCamera(filename?
, shouldWaitForAssets?
): Promise
<void
>
filename
string
'image'
shouldWaitForAssets
boolean
false
Promise
<void
>
â–¸ formatValueToUnitString(value
, parameter
): string
| number
Returns the formatted value based on the parameter.unitType
value
number
parameter
string
| number
â–¸ generateHOMAGiXExport(defaultExportDefinition?
, homagIxOrderData?
, homagIxHeaderParams?
, homagIxArticleParams?
): Promise
<string
>
defaultExportDefinition
string
''
homagIxOrderData
{}
homagIxHeaderParams
{}
homagIxArticleParams
{}
Promise
<string
>
â–¸ generateHomagIxExport(exportType
, defaultExportDefinition?
): Promise
<any
>
exportType
undefined
defaultExportDefinition
string
''
Promise
<any
>
â–¸ generateIMOSiXExport(defaultExportDefinition?
): Promise
<any
>
defaultExportDefinition
string
''
Promise
<any
>
â–¸ 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(defaultExportDefinition?
): Promise
<any
>
defaultExportDefinition
string
''
Promise
<any
>
â–¸ generateTCExport(defaultExportDefinition?
): Promise
<any
>
defaultExportDefinition
string
''
Promise
<any
>
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
rapiItems
Gets the available screen space for our item default: 'left: 0, top: 1, right: 1, bottom: 0'
Returns all possible children and the default child for a given component
componentRuntimeId
number
undefined
onlyPossible
boolean
false
onlyVisible
boolean
false
Returns all possible children and the default child for the plan object
onlyPossible
boolean
false
onlyVisible
boolean
false
Returns the KernelComponent object for the given componentRuntimeId
componentRuntimeId
number
returns class containing configurator specific data properties
Get the data which is assigned to the configurator object, especially things like allowed hosts
â–¸ getCurrentConfiguration(): Promise
<string
>
Promise
<string
>
Promise with the current configuration string/hash
â–¸ 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(): string
[]
string
[]
â–¸ getHashOfSerializedConfiguration(serializedConfiguration
): string
Returns the hash of the given serialized configuration
serializedConfiguration
string
string
Get all parameter groups defined on the component, even if it has no parameters assigned
Returns parameters of the component including groups
componentRuntimeId
number
Returns all parameters which correspond to the plan object. This is also exposed for embedding
Returns all parameters which correspond to the root component. This is also exposed for embedding
â–¸ 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
â–¸ 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
â–¸ getShortUrlOfCurrentConfiguration(): Promise
<string
>
Promise
<string
>
Promise containing the short url for the current configuration
returns manager class to interface with indexedDB storage
Get tag for a given tag id
tagId
string
options?
Object
{ include: RAPI_PATHS[] }
options.include
-
Promise containing the tag including items and materials for that tag
returns unit formatter for formatting input und output values in scene
â–¸ hideDimensions(): void
void
â–¸ highlightParts(ids
): void
Highlight parts in the scene with the given ids Use empty array to remove highlights
ids
number
[]
void
â–¸ init(element
, initData?
): Promise
<void
>
This method has to be called before configurator is ready to use
element
HTMLElement
which should contain the configurator
initData?
Promise
<void
>
Promise which is resolved when configurator is initialized
â–¸ initSceneManager(sceneManager?
): void
sceneManager?
void
â–¸ isReady(): void
void
â–¸ loadComponentIntoKernel(componentString
): Promise
<void
>
Loads the component (defined as string) into the kernel
componentString
string
Promise
<void
>
Promise which gets resolved when the component has been loaded
Loads a configuration based on the item id
itemId
string
initData?
Loads an item based on a configuration string
For example: {'componentId":"muuto:Muuto-Stacked'}
configuration
string
initData?
Loads an item based on a configuration hash
For example: koinor:FORMIA_LeftGroup:79FBF0D6C79A2598B5FF943111EA29DC0C6884AA97F4383582B47F69C14DDB2C
configurationId
string
initData?
â–¸ loadDynamicLightSetting(source
): Promise
<void
>
Exampe:
source
Promise
<void
>
â–¸ loadError(error?
): void
error?
any
void
â–¸ loadSceneSetting(sceneSettings
): Promise
<void
>
sceneSettings
Promise
<void
>
â–¸ moveCamera(cameraParameter
): Promise
<void
>
cameraParameter
Promise
<void
>
â–¸ notifyUiAboutNewLabel(id
): void
id
string
void
â–¸ pauseKernelCallbacks(): void
void
Downloads and caches the selected item id for faster use
itemId
string
Downloads and caches the selected configuration id for faster use
configurationId
string
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 *
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
Generates a perspective image (slightly from the side) and returns it as base 64
options
Generates a top image (birds perspective) and returns it as base 64
options?
should object dimensions be visible
â–¸ previewDockings(possibleChild
, dragEvent?
, dragIn?
): void
Shows dockings/ghosts for the selected possible child
possibleChild
dragEvent?
DragEvent
dragIn?
boolean
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(rapiId
): void
rapiId
string
void
Renders the current item in high quality, it also uses the current lightsetting
renderOptions
Partial
<{ useCurrentPerspective
: boolean
= false }>
â–¸ requestAsset(url
): string
Returns same url when online or caches url when offline
url
string
string
â–¸ requestDeleteComponent(): void
Deletes the currently selected component if possible
void
â–¸ resetCameraPosition(): void
Resets the camera back to the start position
void
â–¸ resumeKernelCallbacks(): void
void
Saves the current configuration (parameters etc) and returns a new configuration object including the configuration hash
â–¸ 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
runtimeId
number
number, the runtime id of the component. You can retrieve this ID from partlist etc
Promise
<void
>
â–¸ setActiveGroupInView(group
): void
Set the name of the parameter group which is selected at the moment
group
string
void
â–¸ setActiveGroupInViewForPlanObject(group
, runtimeId?
): void
Set the name of the parameter group which is selected at the moment
group
string
runtimeId?
number
void
â–¸ 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'
offset
void
â–¸ setComponentParameter(runtimeId
, parameter
, value
): Promise
<void
>
Sets the parameter of the component by it's runtime id parameters of the plan object are set
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
Promise
<void
>
â–¸ setEnvironmentMap(params
): void
params
Object
params.intensity?
number
params.maxLightSources?
number
params.rotation?
number
params.url?
string
void
â–¸ setOverrides(initData
): void
Set general configuration parameter
initData
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
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
Promise
<void
>
â–¸ setParameterOfPlanObject(parameter
, value
): Promise
<void
>
Method to set a parameter on the plan object. This is used by embedding as well
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
Promise
<void
>
â–¸ setParameterOfRootComponent(parameter
, value
): Promise
<void
>
Method to set a parameter on the root component. This is used by embedding as well
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
Promise
<void
>
â–¸ showDimensions(): void
Show dimensions (width, height, depth) of object
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
catalogId
string
Promise
<void
>
â–¸ syncFloorTag(tagId
): Promise
<void
>
Start sync of floor tag to make it offline available
tagId
string
Promise
<void
>
â–¸ syncTypeChangeTag(tagId
): Promise
<void
>
Start sync of type change tag to make it offline available
tagId
string
Promise
<void
>
â–¸ undo(): Promise
<void
>
Undo last action calls configuratorHistory.undo where array of last configuration are stored
Promise
<void
>
â–¸ updateParameters(parameters
, parameterGroups
, elementId
, parameterUpdateType
): void
parameters
parameterGroups
elementId
number
| number
[]
parameterUpdateType
void
â–¸ updatePossibleChildren(elementId
, children
, parameterUpdateType?
): Promise
<void
>
elementId
number
children
parameterUpdateType?
Promise
<void
>
â–¸ updateScene(): void
Updates the scene (recalculating bounds) and restart rendering
void
â–¸ 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
â–¸ zoomIn(value?
): void
Moves the camera closer to the object. Default value (when no value given) is 4, higher value moves a bigger distance.
value?
number
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.
value?
number
void
extends readonly [] = readonly []
.
• get
callbacks():
.
â–¸ calcPartsPriceSum(partList
): Promise
<>
Promise
<>
â–¸ disableHDGeometry(): Promise
<void
| >
Promise
<void
| >
.
â–¸ enableHDGeometry(): Promise
<void
| >
Promise
<void
| >
.
.
.
â–¸ getAdditionalContentsOf(rapiItems
): Promise
<[]>
[]
Promise
<[]>
â–¸ getCameraOffset():
.
â–¸ getChildrenOfPlanComponent(componentRuntimeId
, onlyPossible?
, onlyVisible?
): Promise
<{ defaultChild
: ; tags
: [] }>
Promise
<{ defaultChild
: ; tags
: [] }>
â–¸ getChildrenOfPlanObject(onlyPossible?
, onlyVisible?
): Promise
<{ defaultChild
: ; tags
: [] }>
Promise
<{ defaultChild
: ; tags
: [] }>
â–¸ getComponent(componentRuntimeId
):
â–¸ getConfiguratorContext():
â–¸ getConfiguratorSettings(): Promise
<>
Promise
<>
â–¸ getParameterGroups(): []
[]
â–¸ getParametersOfComponent(componentRuntimeId
): []
[]
â–¸ getParametersOfPlanObject(): Promise
<[]>
Promise
<[]>
â–¸ getParametersOfRootComponent(): Promise
<[]>
Promise
<[]>
.
.
â–¸ getStorage():
.
â–¸ getTagById(tagId
, options?
): Promise
<>
[]
Promise
<>
â–¸ getTools(): Promise
<>
Promise
<>
â–¸ getUnitFormatter():
.
Hides dimensions when they are shown (see ). Calling hideDimensions does not force dimensions to be always hidden.
See to get notified when dimension visibility changes
.
â–¸ loadConfigurableItemById(itemId
, initData?
): Promise
<>
Promise
<>
â–¸ loadConfiguration(configuration
, initData?
): Promise
<>
Promise
<>
â–¸ loadConfigurationById(configurationId
, initData?
): Promise
<>
Promise
<>
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 how to define it.
.
Loads a SceneSettings object, currently it can can contain a light setting definition (see ) and an environment definition (see ).
â–¸ preLoadConfigurableItemById(itemId
): Promise
<>
Promise
<>
â–¸ preLoadConfigurationById(configurationId
): Promise
<>
Promise
<>
â–¸ preparePartImage(partId
, options?
): Promise
<>
number
|
Promise
<>
â–¸ preparePerspectiveImage(options?
): Promise
<>
Promise
<>
â–¸ prepareTopImage(options?
): Promise
<>
boolean
|
Promise
<>
After calling this method the UiCallback removeTypeChangeTag is triggered (see: )
â–¸ renderImage(renderOptions
): Promise
<>
Promise
<>
.
â–¸ saveCurrentConfiguration(): Promise
<<P
>>
Promise
<<P
>>
.
.
| Partial
< & >
See to get notified when dimension visibility changes
[]
[]
.
[]
.
.
.