Class: ControllerExtensionBase
Class: ControllerExtensionBase
Base class for any controller extension for render manager. Controller extensions can manage renderer camera and provide way for user actions. For example, rotating, zoom, walkthrough, panoramic moving and so on.
Hierarchy
↳
ControllerExtensionBase
Constructors
constructor
• new ControllerExtensionBase(viewerName
, controllerDesc
, controllerIcon
): ControllerExtensionBase
Parameters
Name | Type | Description |
---|---|---|
viewerName | string | Owner viewer name. |
controllerDesc | string | Mode description or name. Also you can use locale key. |
controllerIcon | string | Controller icon name. Icon name will be used by viewer Toolbar UI component for displaying controllers dropdown menu. |
Returns
Overrides
Properties
controllerDesc
• Readonly
controllerDesc: string
Controller description or name.
controllerIcon
• Readonly
controllerIcon: string
Controller icon name. Icon name will be used by viewer Toolbar UI component for displaying mode buttons.
getName
• getName: () => string
Get unique extension name.
Type declaration
▸ (): string
Get unique extension name.
Returns
string
Inherited from
helpDesc
• Readonly
helpDesc: string
Optional description for placing on HelpToolbar.
Inherited from
helpIcon
• Readonly
helpIcon: string
Optional icon for placing on HelpToolbar.
Inherited from
hideToolbar
• hideToolbar: boolean
Is extension need to hide toolbar or not.
Inherited from
isUpdated
• isUpdated: boolean
Is controller updated or not.
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
type
• Readonly
type: string
Extension type (ext, mode, control)
Overrides
viewerName
• Readonly
viewerName: string
Owner viewer name.
Inherited from
getName
▪ Static
getName: () => string
Get unique extension name.
Type declaration
▸ (): string
Get unique extension name.
Returns
string
Inherited from
Methods
getRenderManager
▸ getRenderManager(): RenderManager
Get current RenderManager instance.
Returns
Inherited from
ExtensionBase.getRenderManager
getTargetClone
▸ getTargetClone(): Vector3
Get camera target point clone.
Returns
Vector3
restoreState
▸ restoreState(): void
Restore extension state from the local storage.
Returns
void
Inherited from
saveState
▸ saveState(): void
Save extension state in the local storage.
Returns
void
Inherited from
setRestoreStateHandler
▸ setRestoreStateHandler(handler
): this
Sets external hook handler for restoring extension state in the local storage.
Parameters
Name | Type | Description |
---|---|---|
handler | Function | handler hook function. |
Returns
this
Inherited from
ExtensionBase.setRestoreStateHandler
setSaveStateHandler
▸ setSaveStateHandler(handler
): this
Sets external hook handler for storing extension state in the local storage.
Parameters
Name | Type | Description |
---|---|---|
handler | Function | handler hook function. |
Returns
this
Inherited from
ExtensionBase.setSaveStateHandler
Hooks
added
▸ added(): void
Hook when extension is added to ExtensionManager. Called by ExtensionManager.addExtension().
Returns
void
Inherited from
cameraModeChanged
▸ cameraModeChanged(perspective
): boolean
Hook when RenderManager wants change camera mode. Called by ThreeManager.animate().
Parameters
Name | Type | Description |
---|---|---|
perspective | boolean | camera mode state for applying (perspective or orthogonal). |
Returns
boolean
Allow RenderManager change camera mode or not.
commandChanged
▸ commandChanged(newCommand
): void
Hook when current extension command is changed or finished. Called by ExtensionManager.setCurrentCommandExtension().
Parameters
Name | Type |
---|---|
newCommand | ExtensionBase |
Returns
void
Inherited from
dedicatedToolbarRender
▸ dedicatedToolbarRender(container
): void
Render function for rendering dedicated toolbar content.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void
Inherited from
ExtensionBase.dedicatedToolbarRender
deleted
▸ deleted(): void
Hook when extension is deleted from ExtensionManager. Called by ExtensionManager.clear().
Returns
void
Inherited from
selected
▸ selected(): void
Hook when extension is activated (selected as current controller). Called by ExtensionManager.selectControllerExtension().
Returns
void
sharedToolbarRender
▸ sharedToolbarRender(container
): void
Render function for rendering shared toolbar content.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void
Inherited from
ExtensionBase.sharedToolbarRender
uiRender
▸ uiRender(container
): void
Render function for rendering additional UI above viewer canvas.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void
Inherited from
unselected
▸ unselected(): void
Hook when extension is deactivated. Called by ExtensionManager.selectControllerExtension()
Returns
void
updated
▸ updated(delta
): void
Hook when controller extension needs updating and transforming camera for next renderer frame. Called by ThreeManager.animate().
Parameters
Name | Type | Description |
---|---|---|
delta | number | Time delta between last frame and new frame. |
Returns
void