planner-core/src/roomle-planner.default
Shared API between configurator and planner
# Implements
KernelAccessCallbackIRoomlePlannerCallbackGlobalAPIContextKernelUtilityForUiExternalEmbeddable<default>RubensAPI
# Table of contents
# Constructors
# Properties
# Accessors
# Methods
- back
- backTo
- backToPlanner
- calcPartsPriceSum
- cancelSelection
- changeExteriorWallsMaterial
- changeFloorsMaterial
- changeInteriorWallsMaterial
- createNewSerializedConfiguration
- deleteSelection
- disableAdvancedDocking
- disableMeasurementLineDrawing
- disableMultiselect
- disableRotation
- disableShowChildrenOfPlanObject
- disableSnapping
- disableWallDrawing
- dragInObject
- drawWalls
- duplicateItems
- enableAdvancedDocking
- enableMeasurementLineDrawing
- enableMultiselect
- enableRotation
- enableShowChildrenOfPlanObject
- enableSnapping
- enableWallDrawing
- escapeDrawing
- exportGLB
- exportImageFromCamera
- formatValueToUnitString
- generateTCExport
- getCameraOffset
- getConfigurator
- getConfiguratorApi
- getConfiguratorContext
- getCurrentSkin
- getObjects
- getPartlistOf
- getPlanInteractionHandler
- getPlanModelViewHelper
- getPlanOverview
- getPlanXmlFrom
- getRuntimeComponentIdOfRootComponent
- getScene
- getStorage
- getUnitFormatter
- getWallAngleDegrees
- hasWalls
- importGLB
- init
- insertItemList
- insertItems
- insertObject
- isCurrentlyDrawing
- isReady
- loadError
- loadPlan
- loadPlanXml
- moveCamera
- moveElementPosition
- moveElementsPosition
- onCloseHSC
- preparePerspectiveImage
- preparePerspectiveImageOf
- prepareTopImage
- removeElements
- resetCameraPosition
- resolveShortUrl
- rotateSelection
- saveCurrentPlanSnapshot
- selectPlanObjectById
- setCameraOffset
- setEnvironmentMap
- setMeasurementLineLength
- setObjectToWallMeasurementLength
- setOverrides
- setSceneEvents
- setWallMeasurementLength
- showBenchmarks
- showGUI
- showStats
- showsChildrenOfPlanObject
- startConfiguring
- startViewing
- swapObject
- switch2D
- switch3D
- switchToConfigurator
- switchToFirstPerson
- switchToPlanner
- switchToViewer
- syncCatalog
- toggleConfigureInRoom
- update
- updateScene
- updateSize
# Constructors
# constructor
• new default(creator)
# Parameters
| Name | Type |
|---|---|
creator | string |
# Properties
# _creator_
• _creator_: string
# Implementation of
# Accessors
# PlannerCoreTypes
• get PlannerCoreTypes(): PlannerKernelContainer
# Returns
an object which has all type constants from Roomle Core (C/C++)
# callbacks
• get callbacks(): default
# Returns
# Implementation of
• set callbacks(callback): void
# Parameters
| Name | Type |
|---|---|
callback | default |
# Returns
void
# Implementation of
# Methods
# back
▸ back(): void
# Returns
void
# backTo
▸ backTo(_cssClass): void
# Parameters
| Name | Type |
|---|---|
_cssClass | string |
# Returns
void
# backToPlanner
▸ backToPlanner(): void
# Returns
void
# calcPartsPriceSum
▸ calcPartsPriceSum(partList): Promise<KernelPartListPrice>
# Parameters
| Name | Type |
|---|---|
partList | KernelPartList |
# Returns
Promise<KernelPartListPrice>
# cancelSelection
▸ cancelSelection(reason?): void
# Parameters
| Name | Type | Default value |
|---|---|---|
reason | CancelSelectionReasons | 'unknown' |
# Returns
void
# Implementation of
RoomlePlannerCallback.cancelSelection
# changeExteriorWallsMaterial
▸ changeExteriorWallsMaterial(material): void
# Parameters
| Name | Type |
|---|---|
material | BatchPaintMaterial |
# Returns
void
# changeFloorsMaterial
▸ changeFloorsMaterial(material): void
# Parameters
| Name | Type |
|---|---|
material | BatchPaintMaterial |
# Returns
void
# changeInteriorWallsMaterial
▸ changeInteriorWallsMaterial(material): void
# Parameters
| Name | Type |
|---|---|
material | BatchPaintMaterial |
# Returns
void
# createNewSerializedConfiguration
▸ createNewSerializedConfiguration(configurationRuntimeId): Promise<string>
# Parameters
| Name | Type |
|---|---|
configurationRuntimeId | number |
# Returns
Promise<string>
# deleteSelection
▸ deleteSelection(): void
# Returns
void
# Implementation of
RoomlePlannerCallback.deleteSelection
# disableAdvancedDocking
▸ disableAdvancedDocking(): void
disable docking of objects that fit together when objects are snapped in the plan
# Returns
void
# disableMeasurementLineDrawing
▸ disableMeasurementLineDrawing(): void
# Returns
void
# disableMultiselect
▸ disableMultiselect(): void
Disable the selection of multiple elements.
# Returns
void
# disableRotation
▸ disableRotation(): void
Disable rotation of selected elements
# Returns
void
# disableShowChildrenOfPlanObject
▸ disableShowChildrenOfPlanObject(planElementViewModel): void
disable interaction with child components of configurable objects in the plan
# Parameters
| Name | Type |
|---|---|
planElementViewModel | default |
# Returns
void
# disableSnapping
▸ disableSnapping(): void
disable all types of snapping
# Returns
void
# disableWallDrawing
▸ disableWallDrawing(): void
# Returns
void
# dragInObject
▸ dragInObject(id, dragEvent): Promise<number>
# Parameters
| Name | Type |
|---|---|
id | string |
dragEvent | DragEvent |
# Returns
Promise<number>
# drawWalls
▸ drawWalls(wallDefinitions, interactionOptions?): KernelWall[]
Draws walls according to the wall definitions this can be used to create a room on the fly
# Parameters
| Name | Type |
|---|---|
wallDefinitions | WallDefinition[] |
interactionOptions | InteractionOptions |
# Returns
# duplicateItems
▸ duplicateItems(itemList): PlanObject[]
Duplicates all planObjects in the array and inserts them into the current plan
# Parameters
| Name | Type | Description |
|---|---|---|
itemList | PlanObject[] | Array of PlanObjects |
# Returns
# enableAdvancedDocking
▸ enableAdvancedDocking(): void
enable docking of objects that fit together when objects are snapped in the plan
# Returns
void
# enableMeasurementLineDrawing
▸ enableMeasurementLineDrawing(): void
# Returns
void
# enableMultiselect
▸ enableMultiselect(): void
Enable the selection of multiple elements. Common parameters shared between those elements can then be changed at once
# Returns
void
# Implementation of
# enableRotation
▸ enableRotation(): void
Enables rotation of selected elements
# Returns
void
# enableShowChildrenOfPlanObject
▸ enableShowChildrenOfPlanObject(planElementViewModel): void
enable interaction with child components of configurable objects in the plan
# Parameters
| Name | Type |
|---|---|
planElementViewModel | default |
# Returns
void
# enableSnapping
▸ enableSnapping(): void
enable snapping of object to object and object to wall
# Returns
void
# enableWallDrawing
▸ enableWallDrawing(): void
# Returns
void
# escapeDrawing
▸ escapeDrawing(cancelDrawing): void
# Parameters
| Name | Type |
|---|---|
cancelDrawing | boolean |
# Returns
void
# exportGLB
▸ exportGLB(): void
# Returns
void
# 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 | KernelParameter |
# Returns
string | number
# generateTCExport
▸ generateTCExport(planObjectIds?): Promise<any>
# Parameters
| Name | Type | Default value |
|---|---|---|
planObjectIds | string[] | [] |
# Returns
Promise<any>
# getCameraOffset
▸ getCameraOffset(): CanvasOffset
Gets the available screen space for our item default: 'left: 0, top: 1, right: 1, bottom: 0'
# Returns
# Implementation of
# getConfigurator
▸ getConfigurator(): Configurator
# Returns
# getConfiguratorApi
▸ getConfiguratorApi(): default
# Returns
# getConfiguratorContext
▸ getConfiguratorContext(): default
returns class containing configurator specific data properties
# Returns
# getCurrentSkin
▸ getCurrentSkin(): Promise<RapiSkin>
# Returns
Promise<RapiSkin>
# getObjects
▸ getObjects(): Promise<UiPlanObject[]>
returns all objects found in the current plan this includes info about size, rotation, id and parts
# Returns
Promise<UiPlanObject[]>
# getPartlistOf
▸ getPartlistOf(id): Promise<KernelPartList>
get the Partlist of certain runtimeID can be used if partlist of a selected Item is needed
# Parameters
| Name | Type | Description |
|---|---|---|
id | number | runtimeID of a configurable item |
# Returns
Promise<KernelPartList>
kernelPartlist with processed price, currency and RAL colors
# getPlanInteractionHandler
▸ getPlanInteractionHandler(): Promise<PlanInteractionHandler>
# Returns
Promise<PlanInteractionHandler>
# getPlanModelViewHelper
▸ getPlanModelViewHelper(): Promise<PlanModelViewHelper>
# Returns
Promise<PlanModelViewHelper>
# getPlanOverview
▸ getPlanOverview(): Promise<PlanOverview>
get all info available for the current plan, including objects, rooms and walls
# Returns
Promise<PlanOverview>
# getPlanXmlFrom
▸ getPlanXmlFrom(plan): any
# Parameters
| Name | Type |
|---|---|
plan | RapiPlan | RapiPlanSnapshotGetData |
# Returns
any
# getRuntimeComponentIdOfRootComponent
▸ getRuntimeComponentIdOfRootComponent(planObjectId): number
Returns the runtime component id of the plan object with the given id
# Parameters
| Name | Type | Description |
|---|---|---|
planObjectId | number | id of the plan object you want to get the runtime component id of the root component from |
# 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
# getStorage
▸ getStorage(): default
returns manager class to interface with indexedDB storage
# Returns
# Implementation of
# getUnitFormatter
▸ getUnitFormatter(): default
returns unit formatter for formatting input und output values in scene
# Returns
# Implementation of
# getWallAngleDegrees
▸ getWallAngleDegrees(wall): number
Returns the wall angle in degrees relative to the camera
# Parameters
| Name | Type | Description |
|---|---|---|
wall | default | a WallPlanElementViewModel instance |
# Returns
number
# hasWalls
▸ hasWalls(): boolean
# Returns
boolean
# importGLB
▸ importGLB(url): void
# Parameters
| Name | Type |
|---|---|
url | string |
# Returns
void
# init
▸ init(element, preloadPlanId?, options?): Promise<void>
# Parameters
| Name | Type |
|---|---|
element | HTMLElement |
preloadPlanId? | string |
options? | InitDataDefinition & GlobalInitDataDefinition |
# Returns
Promise<void>
# insertItemList
▸ insertItemList(ids): Promise<number[]>
# Parameters
| Name | Type |
|---|---|
ids | string[] |
# Returns
Promise<number[]>
# insertItems
▸ insertItems(itemList): Promise<number[]>
Inserts all of the items in the array into current plan
# Parameters
| Name | Type | Description |
|---|---|---|
itemList | RapiItem[] | Array of items received from the Roomle API |
# Returns
Promise<number[]>
# insertObject
▸ insertObject(id, position?, rotation?): Promise<number>
Inserts the object into the scene (at a given position and rotation)
# Parameters
| Name | Type | Description |
|---|---|---|
id | string | |
position? | Position3 | x (left/right),y (up, down) and z(front, back) in meters |
rotation? | number | in radians |
# Returns
Promise<number>
# isCurrentlyDrawing
▸ isCurrentlyDrawing(): boolean
# Returns
boolean
# isReady
▸ isReady(): void
# Returns
void
# Implementation of
# loadError
▸ loadError(error?): void
# Parameters
| Name | Type |
|---|---|
error? | any |
# Returns
void
# Implementation of
KernelAccessCallbackI.loadError
# loadPlan
▸ loadPlan(id, options?): Promise<RapiPlan | RapiPlanSnapshotGetData>
# Parameters
| Name | Type |
|---|---|
id | string |
options? | InitDataDefinition & GlobalInitDataDefinition |
# Returns
Promise<RapiPlan | RapiPlanSnapshotGetData>
# loadPlanXml
▸ loadPlanXml(xml, options?): Promise<void>
# Parameters
| Name | Type |
|---|---|
xml | string |
options? | InitDataDefinition & GlobalInitDataDefinition |
# Returns
Promise<void>
# moveCamera
▸ moveCamera(cameraParameter): Promise<void>
# Parameters
| Name | Type |
|---|---|
cameraParameter | CameraParameter |
# Returns
Promise<void>
# moveElementPosition
▸ moveElementPosition(selectedElement, position): void
Move the current selected element in the 3D space
# Parameters
| Name | Type | Description |
|---|---|---|
selectedElement | default | this is the current selected plan object |
position | KernelVector3 | new KernelVector3 position of the current selected element returns runtime ID of the new object |
# Returns
void
# moveElementsPosition
▸ moveElementsPosition(selectedElements, position): void
Moves the current multi-selected elements in the 3D space
# Parameters
| Name | Type | Description |
|---|---|---|
selectedElements | default[] | this is the current selected plan object |
position | KernelVector3 | new KernelVector3 position of the current selected element returns runtime ID of the new object |
# Returns
void
# onCloseHSC
▸ onCloseHSC(): void
# Returns
void
# preparePerspectiveImage
▸ preparePerspectiveImage(options?): Promise<Base64Image>
Generates a perspective image (slightly from the side) and returns it as base64
# Parameters
| Name | Type |
|---|---|
options | PrepareImageOptions |
# Returns
Promise<Base64Image>
# preparePerspectiveImageOf
▸ preparePerspectiveImageOf(runtimeId, options?): Promise<Base64Image>
Generates a perspective image (slightly from the side) of a plan element by a given runtime-id and returns it as base64
# Parameters
| Name | Type | Description |
|---|---|---|
runtimeId | number | runtime-id of the plan element, e.g.: a selected element |
options | PrepareImageOptions | PrepareImageOptions |
# Returns
Promise<Base64Image>
# prepareTopImage
▸ prepareTopImage(options?): Promise<Base64Image>
Generates a top image (birds eye view) and returns it as base64
# Parameters
| Name | Type |
|---|---|
options | PrepareImageOptions |
# Returns
Promise<Base64Image>
# removeElements
▸ removeElements(kernelPlanElements, interactionOptions?): Promise<void>
# Parameters
| Name | Type |
|---|---|
kernelPlanElements | KernelObject[] |
interactionOptions | InteractionOptions |
# Returns
Promise<void>
# resetCameraPosition
▸ resetCameraPosition(): void
# Returns
void
# Implementation of
# resolveShortUrl
▸ resolveShortUrl(shortUrl): Promise<string>
Resolves a shortened URL.
# Parameters
| Name | Type | Description |
|---|---|---|
shortUrl | string | The shortened URL to resolve. |
# Returns
Promise<string>
- A promise that resolves to the URL.
# rotateSelection
▸ rotateSelection(rotateBy): void
rotates the selected item(s)
# Parameters
| Name | Type | Description |
|---|---|---|
rotateBy | number | angle in rad |
# Returns
void
# Implementation of
RoomlePlannerCallback.rotateSelection
# saveCurrentPlanSnapshot
▸ saveCurrentPlanSnapshot(parentPlanId?): Promise<RapiPlanSnapshotGetData>
# Parameters
| Name | Type |
|---|---|
parentPlanId? | string |
# Returns
Promise<RapiPlanSnapshotGetData>
# selectPlanObjectById
▸ selectPlanObjectById(runtimeId): Promise<void>
select an object in the scene based on its runtime id
# Parameters
| Name | Type |
|---|---|
runtimeId | number |
# Returns
Promise<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 | CanvasOffset |
# Returns
void
# Implementation of
# 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
# setMeasurementLineLength
▸ setMeasurementLineLength(measurementId, length, wallDirection): void
# Parameters
| Name | Type |
|---|---|
measurementId | number |
length | number |
wallDirection | string |
# Returns
void
# setObjectToWallMeasurementLength
▸ setObjectToWallMeasurementLength(planElementId, measurementId, length): void
# Parameters
| Name | Type |
|---|---|
planElementId | number |
measurementId | number |
length | number |
# Returns
void
# setOverrides
▸ setOverrides(initData): void
Set general configuration parameter
# Parameters
| Name | Type |
|---|---|
initData | InitDataDefinition & GlobalInitDataDefinition |
# Returns
void
# setSceneEvents
▸ setSceneEvents(sceneEvents): void
set which events are enabled in the scene, for example disable selection of walls and wall nodes
# Parameters
| Name | Type |
|---|---|
sceneEvents | SceneEvents |
# Returns
void
# setWallMeasurementLength
▸ setWallMeasurementLength(measurementId, length, wallDirection): void
# Parameters
| Name | Type |
|---|---|
measurementId | number |
length | number |
wallDirection | EMSConstant |
# Returns
void
# showBenchmarks
▸ showBenchmarks(): void
# Returns
void
# showGUI
▸ showGUI(): void
# Returns
void
# showStats
▸ showStats(): void
# Returns
void
# showsChildrenOfPlanObject
▸ showsChildrenOfPlanObject(planElementViewModel): boolean
returns true if interaction with the child components of a configuration object is enabled, and flashes otherwise
# Parameters
| Name | Type |
|---|---|
planElementViewModel | default |
# Returns
boolean
# startConfiguring
▸ startConfiguring(): void
# Returns
void
# startViewing
▸ startViewing(): void
# Returns
void
# swapObject
▸ swapObject(old, idOfNew): Promise<number>
Swap two plan objects in the scene in the same position for example swap two object variants
# Parameters
| Name | Type | Description |
|---|---|---|
old | default | this is the current selected plan object |
idOfNew | string | the RAPI id of the new plan object returns runtime ID of the new object |
# Returns
Promise<number>
# switch2D
▸ switch2D(): void
# Returns
void
# switch3D
▸ switch3D(): void
# Returns
void
# switchToConfigurator
▸ switchToConfigurator(): Promise<Configurator>
# Returns
Promise<Configurator>
# Implementation of
RoomlePlannerCallback.switchToConfigurator
# switchToFirstPerson
▸ switchToFirstPerson(): void
# Returns
void
# switchToPlanner
▸ switchToPlanner(id?): void
# Parameters
| Name | Type |
|---|---|
id? | string |
# Returns
void
# switchToViewer
▸ switchToViewer(): Promise<GlbViewer>
# Returns
Promise<GlbViewer>
# Implementation of
RoomlePlannerCallback.switchToViewer
# syncCatalog
▸ syncCatalog(catalogId): Promise<void>
# Parameters
| Name | Type |
|---|---|
catalogId | string |
# Returns
Promise<void>
# toggleConfigureInRoom
▸ toggleConfigureInRoom(): void
# Returns
void
# update
▸ update(): void
# Returns
void
# updateScene
▸ updateScene(): void
Updates the scene (recalculating bounds) and restart rendering
# Returns
void
# Implementation of
# updateSize
▸ updateSize(): void
# Returns
void