Drawing
The Drawing manages all necessary data that belong to a model.
On the one hand these are the structure and graphic data by which the CAD model is defined, on the other hand it administers additional data for the support with the client-sided development.

DrawingID#
DrawingAPI#
structure#
selection#
interaction#
plugin#
geometry#
graphic#
cad#
reset#
Declaration
Returns void
DrawingState#
Members
| Name | Type | Description |
|---|---|---|
| api | DrawingAPI |
createDrawingState#
StructureData#
Members
| Name | Type | Description |
|---|---|---|
| products | ObjectID[] | |
| visibleContainers | GraphicID[] |
StructureApi#
get#
Declaration
Returns StructureData
set#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| structure | IStructureProtocol |
Returns void
applyPatches#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| patches | IStructurePatch[] |
Returns void
filterTree#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| tree | IStructureTree | ||
| filter | (obj: IStructureObject) => boolean |
Returns IStructureObject[]
findTree#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| tree | IStructureTree | ||
| filter | (obj: IStructureObject) => boolean |
Returns IStructureObject | undefined
collectUsedSolidIds#
Declaration
Returns ObjectID[]
collectProducts#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| root | ObjectID |
Returns IStructureObject[]
getProductSolidIds#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| productId | ObjectID |
Returns any[]
postProcessStructureUpdate#
Declaration
Returns void
calculateGlobalTransformation#
Calculates the global transformation matrix for the given objectId.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| objectId | ObjectID | The object to calculate the global transformation for. | |
| matrix? | THREE.Matrix4 | new THREE.Matrix4().identity() | The initial matrix (mainly used for recursion). It is an out parameter and in the end, it will contain the same matrix as the return value of this function. |
Returns THREE.Matrix4
The global transformation matrix for the given objectId.
calculateProductBounds#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| productId | ObjectID | ||
| base.min | THREE.Vector3 | ||
| base.max | THREE.Vector3 |
Returns { center: THREE.Vector3; radius: number; max: THREE.Vector3; min: THREE.Vector3; }
getDrawingId#
This is a workaround to get the corresponding drawing id via API.
!!! Should not be used in user code !!!
Declaration
Returns DrawingID
The drawing id.
structureData#
structureApi#
GraphicData#
Members
| Name | Type | Description |
|---|---|---|
| containers | Record<number, IGraphicContainer> |
GraphicApi#
addPackages#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| packages | IGraphicPackage[] |
Returns void
cleanupGraphicRecords#
Declaration
Returns void
filter#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| cb | (elem: IGraphicElement) => boolean | ||
| options.onlyOne? | boolean | ||
| options.containerId? | ObjectID |
Returns { elem: IGraphicElement; containerId: ObjectID; solidId: ObjectID; }[]
graphicData#
containers#
graphicApi#
GeometryBounds#
Members
| Name | Type | Description |
|---|---|---|
| center | THREE.Vector3 | |
| radius | number | |
| max | THREE.Vector3 | |
| min | THREE.Vector3 |
GeometryConfig#
disabled#
meshes#
Members
| Name | Type | Description |
|---|---|---|
| meshes.wireframe | boolean | |
| meshes.depthWrite | boolean |
edges#
points#
GeometryData#
cache#
Members
| Name | Type | Description |
|---|---|---|
| cache.dirtyStamp | number | The dirty stamp will be updated, as soon as a client side modification of the geometry will happen! Examples: 'setColor' or 'setOpacity' Can for example be used to trigger the render process for this container. |
stamp#
bounds#
config#
Members
| Name | Type | Description |
|---|---|---|
| config.product | Record<ObjectID, GeometryConfig> |
GeometryApi#
updateBounds#
Updates the @see geometry.bounds depending on all products of the model. The update will only happen, if at least one solid of one product is available.
Declaration
Returns void
createGeometryIfNotCached#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| containerId | ObjectID | ||
| color? | number[] |
Returns ContainerGeometryT | undefined
setGraphicColor#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| containerId | ObjectID | ||
| graphicId | GraphicID | ||
| r | number | ||
| g | number | ||
| b | number |
Returns void
setContainerColor#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| containerId | ObjectID | ||
| r | number | ||
| g | number | ||
| b | number |
Returns void
setOpacity#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| containerId | ObjectID | ||
| opacity | number |
Returns void
setConfig#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| objId | ObjectID | ||
| config | Partial<GeometryConfig> l null |
Returns void
findDecorated#
Declaration
Returns GeometryElement[]
filter#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| cb | (elem: GeometryElement) => boolean | ||
| options.onlyOne? | boolean | ||
| options.containerId? | ObjectID |
Returns GeometryElement[]
geometryData#
cache#
stamp#
bounds#
center#
radius#
min#
max#
config#
product#
geometryApi#
BuerliScope#
SelectorID#
SeletedItemData#
SelectionScope#
SelectedItem#
id#
scope#
data#
label#
removeCondition#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| d | DrawingState |
Returns boolean
SelectionFilter#
Members
| Name | Type | Description |
|---|
CustomSelect#
Members
| Name | Type | Description |
|---|
Selector#
Type for selector.
Members
| Name | Type | Description |
|---|---|---|
| isSelectable | SelectionFilter | |
| items | Array<SelectedItem<T>> | |
| hoveredItem | SelectedItem<T> l null | |
| maxLen | number | |
| customSelect | CustomSelect | |
| customUnSelect | CustomSelect |
SelectionData#
Members
| Name | Type | Description |
|---|---|---|
| refs | Record<SelectorID, Selector> | |
| active | SelectorID l null |
SelectionApi#
unselectAll#
unselect#
select#
setHovered#
activateSelector#
createSelector#
areItemsSelected#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| items | SelectedItem[] | ||
| selectorId? | SelectorID |
Returns boolean
isItemSelected#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| item | SelectedItem | ||
| selectorId? | SelectorID |
Returns boolean
setItems#
selectGraphic#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| selectorId | SelectorID | ||
| items | { productId: ObjectID; containerId: GraphicID; graphicId?: GraphicID }[] | ||
| options.unselectExisting? | boolean |
Returns void
getGraphicItem#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| productId | ObjectID | ||
| containerId | GraphicID | ||
| graphicId? | GraphicID |
Returns SelectedItem<ProductElement> | null
selectionData#
refs#
active#
selectionApi#
createGraphicItem#
PluginDescription#
name#
version#
author#
persistent#
global#
initialState#
Members
| Name | Type | Description |
|---|
Plugin#
Root#
Members
| Name | Type | Description |
|---|
View#
Members
| Name | Type | Description |
|---|
description#
PluginDef#
PluginImpl#
Members
| Name | Type | Description |
|---|
PluginID#
PluginState#
PluginData#
feature#
Contains ids of feature-plugins
global#
Contains ids of global-plugins
refs#
active#
Members
| Name | Type | Description |
|---|---|---|
| active.feature | PluginID l null | |
| active.global | PluginID[] |
visible#
PluginApi#
setActiveFeature#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| id | ObjectID l null |
Returns void
setVisiblePlugin#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| id | PluginID | ||
| visible | boolean |
Returns void
setActiveGlobal#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| id | PluginID | ||
| active | boolean |
Returns void
createPlugin#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| def | PluginDef | ||
| defaultId? | ObjectID l string | ||
| drawingId? | DrawingID | ||
| objectId? | ObjectID |
Returns (deactivate?: boolean) => void
pluginData#
feature#
global#
refs#
active#
feature#
global#
visible#
pluginApi#
isPromisePlugin#
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| def | PluginDef |
Returns def is Promise<Plugin>
InteractionData#
Members
| Name | Type | Description |
|---|---|---|
| hovered | InteractionInfo l null | |
| selected | InteractionInfo[] |
InteractionApi#
setHovered#
Sets the hovered item in the store to the given item.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| item | InteractionInfo l null | The item. |
Returns void
setSelected#
Reset the 'selected' array to the given items.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| items | InteractionInfo[] | The items. |
Returns void
select#
Adds the given item to the 'selected' array if it is not yet selected. If the item is already selected, it will be removed from the 'selected' array.
With 'multi' enabled, the already selected items will remain selected.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| item | InteractionInfo | The item to select. | |
| multi? | boolean | Do multi select. |
Returns void