Class: CropExtension
Class: CropExtension
Crop box extension. Extension can show crop box and creates gizmos for modifying box size.
Hierarchy
↳
CropExtension
Implements
ViewpointState
Constructors
constructor
• new CropExtension(viewerName
, options
): CropExtension
Parameters
Name | Type | Description |
---|---|---|
viewerName | string | Owner viewer name. |
options | CropExtensionOptions | options for extension. |
Returns
Overrides
Properties
boxColor
• boxColor: Color
Color of crop box.
getName
• getName: () => string
Get unique extension name.
Type declaration
▸ (): string
Get unique extension name.
Returns
string
Inherited from
gizmoColor
• gizmoColor: Color
Color of handles for resizing.
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
isCropOn
• isCropOn: boolean
Whether the measurement command is active or not.
planes
• planes: Map
<GizmoDir
, Plane
>
Map with box clipping planes.
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).
Inherited from
viewerName
• Readonly
viewerName: string
Owner viewer name.
Inherited from
Methods
getRenderManager
▸ getRenderManager(): RenderManager
Get current RenderManager instance.
Returns
Inherited from
ExtensionBase.getRenderManager
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
setCrop
▸ setCrop(on
): void
Switch on or off crop box mode.
Parameters
Name | Type | Description |
---|---|---|
on | boolean | Is crop box on. |
Returns
void
setCropToSelected
▸ setCropToSelected(forceZoom?
): void
Sets crop box size to selected elements boundaries.
Parameters
Name | Type |
---|---|
forceZoom? | boolean |
Returns
void
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
setRotation
▸ setRotation(): void
Sets vertical axis rotation via picking face.
Returns
void
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
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
uiRender
▸ uiRender(container
): void
Render function for rendering additional UI above viewer canvas.
Parameters
Name | Type | Description |
---|---|---|
container | HTMLElement | Parent DOM container. |
Returns
void