RoomlePlanner.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
an object which has all type constants from Roomle Core (C/C++)
• set
callbacks(callback
): void
callback
void
• get
hasSingleRoom(): boolean
Check if the 3D scene contains only one room
boolean
True if there is only one room, false otherwise
â–¸ _selectExternalObjectGroup(groupId
, switchToPlanner
): Promise
<void
>
groupId
string
switchToPlanner
boolean
Promise
<void
>
â–¸ _selectExternalObjectModule(rootModuleId
, subModuleId
, selectPlanObject
, switchToConfigurator
, selectComponent
, highlightSelection
): Promise
<void
>
rootModuleId
string
subModuleId
string
selectPlanObject
boolean
switchToConfigurator
boolean
selectComponent
boolean
highlightSelection
boolean
Promise
<void
>
Creates a sloping roof attic on a given wall.
wall
The wall to add an attic to.
kneeHeight
number
Height of the attic knee wall.
width
number
Width of the sloping roof.
preferredSide?
The side where the attic should be added.
The newly created attic.
â–¸ back(): void
void
â–¸ backTo(_cssClass
): void
_cssClass
string
void
â–¸ backToPlanner(): void
void
partList
â–¸ cancelSelection(reason?
): void
reason
'unknown'
void
RoomlePlannerCallback.cancelSelection
â–¸ changeExteriorWallsMaterial(material
): void
material
void
â–¸ changeFloorsMaterial(material
): void
material
void
â–¸ changeInteriorWallsMaterial(material
): void
material
void
â–¸ configureExternalObjectApi(configurationJson
): Promise
<void
>
With "configureExternalObjectApi" the default representation of the objects and UI and the default behavior when interacting with external objects can be completely or partially overwritten. This configuration should be set prior to loading plans or objects.
configurationJson
The configuration JSON as string or object.
Promise
<void
>
â–¸ createNewSerializedConfiguration(configurationRuntimeId
): Promise
<string
>
configurationRuntimeId
number
Promise
<string
>
â–¸ createPlanFromObject(id
, position?
, rotation?
): Promise
<number
>
creates and loads a plan from a given object
id
string
position?
rotation?
number
return the object runtime id
Promise
<number
>
â–¸ deleteSelection(): void
void
RoomlePlannerCallback.deleteSelection
â–¸ disableAdvancedDocking(): void
disable docking of objects that fit together when objects are snapped in the plan
void
â–¸ disableEvents(): void
void
â–¸ disableMeasurementLineDrawing(): void
void
â–¸ disableMultiselect(): void
Disable the selection of multiple elements.
void
â–¸ disableRotation(): void
Disable rotation of selected elements
void
â–¸ disableShowChildrenOfPlanObject(planElementViewModel
): void
disable interaction with child components of configurable objects in the plan
planElementViewModel
void
â–¸ disableSnapping(): void
disable all types of snapping
void
â–¸ disableWallDrawing(): void
void
â–¸ downloadHomagIxExportPoC(): Promise
<any
>
Promise
<any
>
â–¸ dragInObject(idOrSerializedConfigString
, dragEvent
, type?
): Promise
<number
>
idOrSerializedConfigString
string
undefined
dragEvent
DragEvent
undefined
type
'rml_id'
Promise
<number
>
Draws walls according to the wall definitions this can be used to create a room on the fly
wallDefinitions
interactionOptions
Duplicates all planObjects in the array and inserts them into the current plan
itemList
Array of PlanObjects
â–¸ enableAdvancedDocking(): void
enable docking of objects that fit together when objects are snapped in the plan
void
â–¸ enableEvents(): void
void
â–¸ enableMeasurementLineDrawing(): void
void
â–¸ enableMultiselect(): void
Enable the selection of multiple elements. Common parameters shared between those elements can then be changed at once
void
â–¸ enableRotation(): void
Enables rotation of selected elements
void
â–¸ enableShowChildrenOfPlanObject(planElementViewModel
): void
enable interaction with child components of configurable objects in the plan
planElementViewModel
void
â–¸ enableSnapping(): void
enable snapping of object to object and object to wall
void
â–¸ enableWallDrawing(): void
void
â–¸ escapeDrawing(cancelDrawing
): void
cancelDrawing
boolean
void
â–¸ exportCanvasScreenshot(quality?
): Promise
<string
>
quality?
number
Promise
<string
>
â–¸ exportGLB(): void
void
â–¸ 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
â–¸ generateTCExport(planObjectIds?
): Promise
<any
>
planObjectIds
string
[]
[]
Promise
<any
>
Gets the attached attic from a wall.
wall
The wall to retrieve the attic from.
The first attached attic or null.
Gets the available screen space for our item default: 'left: 0, top: 1, right: 1, bottom: 0'
returns class containing configurator specific data properties
â–¸ getExternalObjectGroups(): Promise
<object
[]>
"getExternalObjectGroups" returns all groups of external objects modules (PosData) that are currently loaded in the plan.
Promise
<object
[]>
returns all objects found in the current plan this includes info about size, rotation, id and parts
get the Partlist of certain runtimeID can be used if partlist of a selected Item is needed
id
number
runtimeID of a configurable item
kernelPartlist with processed price, currency and RAL colors
get all info available for the current plan, including objects, rooms and walls
â–¸ getPlanXmlFrom(plan
): any
plan
any
â–¸ getRuntimeComponentIdOfRootComponent(planObjectId
): number
Returns the runtime component id of the plan object with the given id
planObjectId
number
id of the plan object you want to get the runtime component id of the root component from
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
returns manager class to interface with indexedDB storage
returns unit formatter for formatting input und output values in scene
â–¸ getWallAngleDegrees(wall
): number
Returns the wall angle in degrees relative to the camera
wall
a WallPlanElementViewModel instance
number
â–¸ hasWalls(): boolean
boolean
â–¸ highlightPlanElements(runtimeIds
): void
Highlights one or more objects in the scene based on their runtime IDs.
If runtimeIds
is null
, all highlighted objects will be unhighlighted.
runtimeIds
number
| number
[]
A single runtime ID, an array of runtime IDs, or null.
void
â–¸ importGLB(url
): void
url
string
void
â–¸ init(element
, preloadPlanId?
, options?
): Promise
<void
>
element
HTMLElement
preloadPlanId?
string
options?
Promise
<void
>
â–¸ insertItemList(ids
): Promise
<number
[]>
ids
string
[]
Promise
<number
[]>
â–¸ insertItems(itemList
): Promise
<number
[]>
Inserts all of the items in the array into current plan
itemList
Array of items received from the Roomle API
Promise
<number
[]>
â–¸ insertObject(id
, position?
, rotation?
): Promise
<number
>
Inserts the object into the scene (at a given position and rotation)
id
string
position?
x (left/right),y (up, down) and z(front, back) in meters
rotation?
number
in radians
Promise
<number
>
â–¸ isCurrentlyDrawing(): boolean
boolean
â–¸ isReady(): void
void
â–¸ loadError(error?
): void
error?
any
void
â–¸ loadExternalObjectGroup(groupData
, findFreeSpaceInPlan
, verifyArrangement?
, mergedGroups?
): Promise
<void
>
"loadExternalObjectGroup" loads a group of modules and places them in the plan. If the group has already been loaded, it is completely replaced by the new group. This function therefore has 2 use cases:
Load a new group of modules
Update or modify an existing group of modules The initial location of the group and the IDs of the modules are defined in the group JSON.
groupData
undefined
The group JSON as string or object.
findFreeSpaceInPlan
boolean
undefined
A free space is automatically searched for in the plane.
verifyArrangement
boolean
false
Verify whether the root modules of the group need to be rearranged as they have changed in size.
mergedGroups
string
[]
[]
Groups that were merged into another group and have to be delete (this is required to generate correct undo/redo steps).
Promise
<void
>
â–¸ loadExternalObjectLibrary(libraryJson
): void
"loadExternalObjectLibrary" loads the master data of a library. If master data has already been loaded for the library, it is completely replaced by the new master data.
libraryJson
string
| object
The library JSON as string or object.
void
id
string
options?
â–¸ loadPlanXml(xml
, options?
): Promise
<void
>
xml
string
options?
Promise
<void
>
â–¸ moveCamera(cameraParameter
): Promise
<void
>
cameraParameter
Promise
<void
>
â–¸ moveElementPosition(selectedElement
, position
): void
Move the current selected element in the 3D space
selectedElement
this is the current selected plan object
position
new KernelVector3 position of the current selected element returns runtime ID of the new object
void
â–¸ moveElementsPosition(selectedElements
, position
): void
Moves the current multi-selected elements in the 3D space
selectedElements
this is the current selected plan object
position
new KernelVector3 position of the current selected element returns runtime ID of the new object
void
â–¸ onCloseHSC(): void
void
â–¸ openOrCloseGeometryOfExternalObject(groupIdOrRootModuleId
, subModuleId
, open
, animate
): Promise
<void
>
"openOrCloseGeometryOfExternalObject" switches the geometry of the modules between closed and open representation. The function can switch the geometry of the group or the singe root module with the ID "groupIdOrRootModuleId". If "groupIdOrRootModuleId" is the ID of a root module and the "subModuleId" is also specified, only this one sub-module is opened or closed.
groupIdOrRootModuleId
string
The ID of the group of modules or the ID of the root module.
subModuleId
string
The ID of the sub module.
open
boolean
If true, the modules are opened, if false, they are closed, if the geometry is already in the desired state, nothing happens.
animate
boolean
If true the opening or closing is animated else the geometry is switched instantly.
Promise
<void
>
Generates a perspective image (slightly from the side) and returns it as base64
options
{}
isolationMode
boolean
false
defaults to false. Determines whether to generate a perspective image for the current configuration.
Generates a perspective image (slightly from the side) of a plan element by a given runtime-id and returns it as base64
runtimeId
number
runtime-id of the plan element, e.g.: a selected element
options
PrepareImageOptions
Generates a top image (birds eye view) and returns it as base64
options
â–¸ removeAttic(attic
): void
Removes an attic from a wall.
attic
The attic to be removed.
void
â–¸ removeElements(kernelPlanElements
, interactionOptions?
): Promise
<void
>
kernelPlanElements
interactionOptions
Promise
<void
>
â–¸ removeExternalObjectGroup(groupId
, wasMerged?
): Promise
<void
>
"removeExternalObjectGroup" removes a group and all its modules from the plan.
groupId
string
undefined
The ID of the group of modules.
wasMerged
boolean
false
Should be set to true if the group has been merged with another group (this is required to generate correct undo/redo steps).
Promise
<void
>
â–¸ removeExternalObjectRootModule(rootModuleId
): void
"removeExternalObjectRootModule" removes a root module from a group and splits the remaining group if the removed root module is located between other root modules. If the group consists of only one root module, the group is removed.
rootModuleId
string
void
â–¸ renderImagesOfExternalObjectGroup(groups
): Promise
<{ [key: string]
: string
; }>
"renderImagesOfExternalObjectGroups" renders images of groups of modules.
groups
object
Promise
<{ [key: string]
: string
; }>
â–¸ resetCameraPosition(): void
void
â–¸ resolveShortUrl(shortUrl
): Promise
<string
>
Resolves a shortened URL.
shortUrl
string
The shortened URL to resolve.
Promise
<string
>
A promise that resolves to the URL.
â–¸ rotateSelection(rotateBy
): void
rotates the selected item(s)
rotateBy
number
angle in rad
void
RoomlePlannerCallback.rotateSelection
parentPlanId?
string
configurationHashOrGroupId?
string
| string
[]
Saves a snapshot of the external objects in the plan without walls and other objects Also contains the urls to the glb and usdz files
parentPlanId?
string
id of the current plan, optional
â–¸ selectExternalObjectGroup(groupId
): Promise
<void
>
"selectExternalObjectGroup" changes the selected object in the scene. The function selects a complete group of root modules and always switches to planning mode. If the group consists of only one root module, this is equivalent to selecting a single root module.
groupId
string
The ID of the group of modules.
Promise
<void
>
â–¸ selectExternalObjectRootModule(rootModuleId
): Promise
<void
>
"selectExternalObjectRootModule" changes the selected object in the scene. The function selects a root module within a group and always switches to planning mode.
rootModuleId
string
The ID of the root module.
Promise
<void
>
â–¸ selectExternalObjectSubModule(rootModuleId
, subModuleId
): Promise
<void
>
"selectExternalObjectSubModule" changes the selected object in the scene. The function selects a sub module a root module and always switches to configuration mode.
rootModuleId
string
The ID of the root module.
subModuleId
string
The ID of the sub module.
Promise
<void
>
â–¸ selectPlanObjectById(runtimeId
): Promise
<void
>
select an object in the scene based on its runtime id
runtimeId
number
Promise
<void
>
â–¸ setAtticSide(attic
, side
): void
Set the attic direction from a wall.
attic
The attic to be removed.
side
-
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
â–¸ setEnvironmentMap(params
): void
params
Object
params.intensity?
number
params.maxLightSources?
number
params.rotation?
number
params.url?
string
void
â–¸ setMeasurementLineLength(measurementId
, length
, wallDirection
): void
measurementId
number
length
number
wallDirection
string
void
â–¸ setObjectToWallMeasurementLength(planElementId
, measurementId
, length
): void
planElementId
number
measurementId
number
length
number
void
â–¸ setOverrides(initData
): void
Set general configuration parameter
initData
void
â–¸ setSceneEvents(sceneEvents
): void
set which events are enabled in the scene, for example disable selection of walls and wall nodes
sceneEvents
void
â–¸ setWallMeasurementLength(measurementId
, length
, wallDirection
): void
measurementId
number
length
number
wallDirection
void
â–¸ showBenchmarks(): void
void
â–¸ showGUI(): void
void
â–¸ showStats(): void
void
â–¸ showsChildrenOfPlanObject(planElementViewModel
): boolean
returns true if interaction with the child components of a configuration object is enabled, and flashes otherwise
planElementViewModel
boolean
â–¸ startConfiguring(): void
void
â–¸ startViewing(): void
void
â–¸ swapObject(old
, idOfNew
): Promise
<number
>
Swap two plan objects in the scene in the same position for example swap two object variants
old
this is the current selected plan object
idOfNew
string
the RAPI id of the new plan object returns runtime ID of the new object
Promise
<number
>
â–¸ switch2D(): void
void
â–¸ switch3D(): void
void
RoomlePlannerCallback.switchToConfigurator
â–¸ switchToFirstPerson(): void
void
â–¸ switchToPlanner(id?
): void
id?
string
void
RoomlePlannerCallback.switchToViewer
â–¸ syncCatalog(catalogId
): Promise
<void
>
catalogId
string
Promise
<void
>
â–¸ toggleConfigureInRoom(): void
void
â–¸ update(): void
void
â–¸ updateAtticKneeHeight(attic
, kneeHeight
): void
Updates the knee height of an attic.
attic
The attic to update.
kneeHeight
number
The new knee height value.
void
â–¸ updateAtticWidth(attic
, width
): void
Updates the width of an attic.
attic
The attic to update.
width
number
The new width value.
void
â–¸ updateScene(): void
Updates the scene (recalculating bounds) and restart rendering
void
â–¸ updateSize(): void
void
extends readonly [] = readonly []
.
• get
PlannerCoreTypes():
• get
callbacks():
.
.
â–¸ addAtticToWall(wall
, kneeHeight
, width
, preferredSide?
):
â–¸ calcPartsPriceSum(partList
): Promise
<>
Promise
<>
string
|
.
â–¸ drawWalls(wallDefinitions
, interactionOptions?
): []
[]
[]
â–¸ duplicateItems(itemList
): []
[]
[]
.
.
.
â–¸ getAttachedAttic(wall
):
â–¸ getCameraOffset():
.
â–¸ getConfigurator():
â–¸ getConfiguratorApi(): <P
>
<P
>
â–¸ getConfiguratorContext():
â–¸ getCurrentSkin(): Promise
<>
Promise
<>
.
â–¸ getObjects(): Promise
<[]>
Promise
<[]>
â–¸ getPartlistOf(id
): Promise
<>
Promise
<>
â–¸ getPlanInteractionHandler(): Promise
<>
Promise
<>
â–¸ getPlanModelViewHelper(): Promise
<>
Promise
<>
â–¸ getPlanOverview(): Promise
<>
Promise
<>
|
.
.
â–¸ getStorage():
.
â–¸ getUnitFormatter():
.
&
( | | `__ext__obj__#${string}` | )[]
.
.
.
.
â–¸ loadPlan(id
, options?
): Promise
< | >
&
Promise
< | >
&
[]
.
â–¸ preparePerspectiveImage(options?
, isolationMode?
): Promise
<>
Promise
<>
â–¸ preparePerspectiveImageOf(runtimeId
, options?
): Promise
<>
Promise
<>
â–¸ prepareTopImage(options?
): Promise
<>
Promise
<>
[]
.
.
.
.
â–¸ saveCurrentPlanSnapshot(parentPlanId?
, configurationHashOrGroupId?
): Promise
<>
Promise
<>
â–¸ saveExternalObjectSnapshot(parentPlanId?
): Promise
<>
Promise
<>
.
.
.
.
.
&
â–¸ switchToConfigurator(): Promise
<>
Promise
<>
â–¸ switchToViewer(): Promise
<>
Promise
<>
.
.