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

Class: OrbitControllerExtension

Около 2 мин

Class: OrbitControllerExtension

Orbit controller extension for camera. Provides basic rotation and movement actions.

Hierarchy

Constructors

constructor

new OrbitControllerExtension(viewerName, options): OrbitControllerExtension

Parameters

NameTypeDescription
viewerNamestringOwner viewer name for extension.
optionsOrbitExtensionOptionsextension options.

Returns

OrbitControllerExtension

Overrides

ControllerExtensionBase.constructor

Properties

controllerDesc

Readonly controllerDesc: string

Controller description or name.

Inherited from

ControllerExtensionBase.controllerDesc


controllerIcon

Readonly controllerIcon: string

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

Inherited from

ControllerExtensionBase.controllerIcon


getName

getName: () => string

Get unique extension name.

Type declaration

▸ (): string

Get unique extension name.

Returns

string

Inherited from

ControllerExtensionBase.getName


helpDesc

Readonly helpDesc: string

Optional description for placing on HelpToolbar.

Inherited from

ControllerExtensionBase.helpDesc


helpIcon

Readonly helpIcon: string

Optional icon for placing on HelpToolbar.

Inherited from

ControllerExtensionBase.helpIcon


hideToolbar

hideToolbar: boolean

Is extension need to hide toolbar or not.

Inherited from

ControllerExtensionBase.hideToolbar


isUpdated

isUpdated: boolean

Is controller updated or not.

Inherited from

ControllerExtensionBase.isUpdated


state

state: any

Any extension data which can be stored in browser local storage and restored after (any extension settings, buttons state and so one). State will be saved in local storage with 'tangl-ext-extensionName' key.

Inherited from

ControllerExtensionBase.state


type

Readonly type: string

Extension type (ext, mode, control)

Inherited from

ControllerExtensionBase.type


viewerName

Readonly viewerName: string

Owner viewer name.

Inherited from

ControllerExtensionBase.viewerName

Methods

getAzimuthalAngle

getAzimuthalAngle(): number

Gets azimuth camera angle (Theta).

Returns

number


getPolarAngle

getPolarAngle(): number

Gets polar camera angle (Phi).

Returns

number


getRenderManager

getRenderManager(): RenderManager

Get current RenderManager instance.

Returns

RenderManager

Inherited from

ControllerExtensionBase.getRenderManager


getZoomRelationToSceneBounds

getZoomRelationToSceneBounds(): number

Gets current zoom factor relative minZoom, maxZoom and scene bounds.

Returns

number


restoreState

restoreState(): void

Restore extension state from the local storage.

Returns

void

Inherited from

ControllerExtensionBase.restoreState


saveState

saveState(): void

Save extension state in the local storage.

Returns

void

Inherited from

ControllerExtensionBase.saveState


setDollyLimitsFromSceneBounds

setDollyLimitsFromSceneBounds(minSceneSizeCoef?, maxSceneSizeCoef?): void

Sets dolly limits relative scene bounds. Coefficient == 1 equals scene boundary sphere diameter.

Parameters

NameTypeDescription
minSceneSizeCoef?numberMinimum dolly coefficient.
maxSceneSizeCoef?numberMaximum dolly coefficient.

Returns

void


setMouseButtonsActions

setMouseButtonsActions(left, right, middle, middleAlt): void

Sets mouse button bindings for controller actions.

Parameters

NameTypeDescription
leftMOUSELeft button binding.
rightMOUSERight button binding.
middleMOUSEMiddle button binding.
middleAltMOUSEMiddle + Alt button binding.

Returns

void


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

ControllerExtensionBase.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

ControllerExtensionBase.setSaveStateHandler


setTouchActions

setTouchActions(one?, two?): void

Sets touch button bindings for controller actions.

Parameters

NameTypeDescription
one?TOUCHSingle finger tap binding.
two?TOUCHTwo fingers tap binding.

Returns

void

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

ControllerExtensionBase.commandChanged


dedicatedToolbarRender

dedicatedToolbarRender(container): void

Render function for rendering dedicated toolbar content.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ControllerExtensionBase.dedicatedToolbarRender


sharedToolbarRender

sharedToolbarRender(container): void

Render function for rendering shared toolbar content.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ControllerExtensionBase.sharedToolbarRender


uiRender

uiRender(container): void

Render function for rendering additional UI above viewer canvas.

Parameters

NameTypeDescription
containerHTMLElementParent DOM container.

Returns

void

Inherited from

ControllerExtensionBase.uiRender