Перейти к основному содержанию

Class: GeneralModeExtension

Около 2 мин

Class: GeneralModeExtension

General mode extension. Used for common model view state. Does not have any specific options.

Hierarchy

Constructors

constructor

new GeneralModeExtension(viewerName, options): GeneralModeExtension

Parameters

NameTypeDescription
viewerNamestringOwner viewer name.
optionsObjectadditional options for extension.
options.restoreStateHandlerFunction-
options.saveStateHandlerFunction-

Returns

GeneralModeExtension

Overrides

ModeExtensionBase.constructor

Properties

enableTooltip

enableTooltip: boolean

Enable or disable viewer tooltip feature for this extension.

Inherited from

ModeExtensionBase.enableTooltip


getName

getName: () => string

Get unique extension name.

Type declaration

▸ (): string

Get unique extension name.

Returns

string

Inherited from

ModeExtensionBase.getName


helpDesc

Readonly helpDesc: string

Optional description for placing on HelpToolbar.

Inherited from

ModeExtensionBase.helpDesc


helpIcon

Readonly helpIcon: string

Optional icon for placing on HelpToolbar.

Inherited from

ModeExtensionBase.helpIcon


hideToolbar

hideToolbar: boolean

Is extension need to hide toolbar or not.

Inherited from

ModeExtensionBase.hideToolbar


modeDesc

Readonly modeDesc: string

Mode description or name.

Inherited from

ModeExtensionBase.modeDesc


modeIcon

Readonly modeIcon: string

Mode icon name. Icon name will be used by viewer Toolbar UI component for displaying mode buttons.

Inherited from

ModeExtensionBase.modeIcon


showTooltip

showTooltip: boolean

Show or hide viewer tooltip feature if enableTooltip == true.

Inherited from

ModeExtensionBase.showTooltip


state

state: RenderSettingsState

General extension data which can be stored in browser local storage and restored after. State will be saved in local storage with 'tangl-ext-extensionName' key.

Overrides

ModeExtensionBase.state


type

Readonly type: string

Extension type (ext, mode, control).

Inherited from

ModeExtensionBase.type


viewerName

Readonly viewerName: string

Owner viewer name.

Inherited from

ModeExtensionBase.viewerName

Methods

clearData

clearData(): void

Clear resource array, details array and elements list.

Returns

void

Inherited from

ModeExtensionBase.clearData


getRenderManager

getRenderManager(): RenderManager

Get current RenderManager instance.

Returns

RenderManager

Inherited from

ModeExtensionBase.getRenderManager


restoreState

restoreState(): void

Restore extension state from the local storage.

Returns

void

Inherited from

ModeExtensionBase.restoreState


restoreTooltipState

restoreTooltipState(): void

Restore enableTooltip state from local storage.

Returns

void

Inherited from

ModeExtensionBase.restoreTooltipState


saveState

saveState(): void

Save extension state in the local storage.

Returns

void

Inherited from

ModeExtensionBase.saveState


saveTooltipState

saveTooltipState(): void

Save enableTooltip state to local storage.

Returns

void

Inherited from

ModeExtensionBase.saveTooltipState


setData

setData(elNums, resourceArray, details, forceClearData?): void

Set data to resource array and details array for elements list.

Parameters

NameTypeDescription
elNumsnumber[]Elements self Ids.
resourceArrayany[]Resource data array.
detailsanyDetails data array.
forceClearData?booleanforce clear data after applying by extension.

Returns

void

Inherited from

ModeExtensionBase.setData


setRestoreStateHandler

setRestoreStateHandler(handler): void

Sets external hook handler for restoring extension state in the local storage.

Parameters

NameTypeDescription
handlerFunctionhandler hook function.

Returns

void

Inherited from

ModeExtensionBase.setRestoreStateHandler


setSaveStateHandler

setSaveStateHandler(handler): void

Sets external hook handler for storing extension state in the local storage.

Parameters

NameTypeDescription
handlerFunctionhandler hook function.

Returns

void

Inherited from

ModeExtensionBase.setSaveStateHandler


tooltipRender

tooltipRender(container): void

Render function for rendering tooltip content when enableTooltip == true.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ModeExtensionBase.tooltipRender

Hooks

commandChanged

commandChanged(newCommand): void

Hook when current extension command is changed or finished. Called by ExtensionManager.setCurrentCommandExtension().

Parameters

NameType
newCommandExtensionBase

Returns

void

Inherited from

ModeExtensionBase.commandChanged


dedicatedToolbarRender

dedicatedToolbarRender(container): void

Render function for rendering dedicated toolbar content.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ModeExtensionBase.dedicatedToolbarRender


sharedToolbarRender

sharedToolbarRender(container): void

Render function for rendering shared toolbar content.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ModeExtensionBase.sharedToolbarRender


uiRender

uiRender(container): void

Render function for rendering additional UI above viewer canvas.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ModeExtensionBase.uiRender