Skip to main content

Class: ToolComponent

components.ToolComponent

An object to easily handle all the tools used (e.g. updating them, retrieving them, performing batch operations, etc). A tool is a feature that achieves something through user interaction (e.g. clipping planes, dimensions, etc).

Hierarchy

Implements

Properties

enabled

enabled: boolean = true

enabled

Overrides

Component.enabled

Defined in

temp/components/core/ToolsComponent/index.ts:20


name

name: string = "ToolComponent"

name

Overrides

Component.name

Defined in

temp/components/core/ToolsComponent/index.ts:17

Methods

add

add(...tool): void

Registers a new tool component.

Parameters

NameTypeDescription
...toolComponent<any>[]The tool to register in the application.

Returns

void

Defined in

temp/components/core/ToolsComponent/index.ts:31


dispose

dispose(): void

Disposes all the memory used by all the tools.

Returns

void

Implementation of

Disposable.dispose

Defined in

temp/components/core/ToolsComponent/index.ts:91


get

get(name): undefined | Component<any>

Retrieves a tool component by its name.

Parameters

NameTypeDescription
namestringThe name of the component..

Returns

undefined | Component<any>

Overrides

Component.get

Defined in

temp/components/core/ToolsComponent/index.ts:56


hasUI

hasUI(): this is UI

Whether is component implements any kind of UI.

Returns

this is UI

Inherited from

Component.hasUI

Defined in

temp/components/base-types/component.ts:48


isDisposeable

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

Component.isDisposeable

Defined in

temp/components/base-types/component.ts:28


isHideable

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

Component.isHideable

Defined in

temp/components/base-types/component.ts:43


isResizeable

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

Component.isResizeable

Defined in

temp/components/base-types/component.ts:33


isUpdateable

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

Component.isUpdateable

Defined in

temp/components/base-types/component.ts:38


remove

remove(tool): boolean

Deletes a previously registered tool component.

Parameters

NameTypeDescription
toolComponent<any>The tool to delete.

Returns

boolean

Defined in

temp/components/core/ToolsComponent/index.ts:42


update

update(delta): void

Updates all the registered tool components. Only the components where the property enabled is true will be updated.

Parameters

NameTypeDescription
deltanumberThe delta time of the loop.

Returns

void

Defined in

temp/components/core/ToolsComponent/index.ts:80


use

use<T>(token, id): Promise<>

Gets one of your tools of That Open Platform. You can pass the type of component as the generic parameter T to get the types and intellisense for the component.

Type parameters

Name
T

Parameters

NameTypeDescription
tokenstringThe authentication token to authorise this request.
idstringThe ID of the tool you want to get

Returns

Promise<>

Defined in

temp/components/core/ToolsComponent/index.ts:67