@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
247 lines (141 loc) • 4.59 kB
Markdown
# Class: Au3dViewerBase
## Hierarchy
↳ [AuBaseWidget](aubasewidget.md)
↳ **Au3dViewerBase**
↳ [AuWidget3DViewer](auwidget3dviewer.md)
↳ [AuWidgetMockup3DViewer](auwidgetmockup3dviewer.md)
## Implements
* [IWidget](../interfaces/iwidget.md)
## Index
### Properties
* [image](au3dviewerbase.md#image)
* [params](au3dviewerbase.md#params)
* [paused](au3dviewerbase.md#paused)
* [speed](au3dviewerbase.md#speed)
### Methods
* [GetAnimationDuration](au3dviewerbase.md#getanimationduration)
* [PauseAnimation](au3dviewerbase.md#pauseanimation)
* [PlayAnimation](au3dviewerbase.md#playanimation)
* [SetAnimationAt](au3dviewerbase.md#setanimationat)
* [SetAnimationSpeed](au3dviewerbase.md#setanimationspeed)
* [checkInitDependenciesWidgets](au3dviewerbase.md#checkinitdependencieswidgets)
* [closeBox](au3dviewerbase.md#closebox)
* [openBox](au3dviewerbase.md#openbox)
* [resetPreloaderState](au3dviewerbase.md#resetpreloaderstate)
* [showPreloader](au3dviewerbase.md#showpreloader)
* [showToast](au3dviewerbase.md#showtoast)
## Properties
### image
• **image**: *string*
A base64 URL that links to the rendered model image in the initial position.
___
### params
• **params**: *any*
*Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md#optional-params)*
*Inherited from [AuBaseWidget](aubasewidget.md).[params](aubasewidget.md#params)*
Compiled widget configuration.
___
### paused
• **paused**: *boolean* = false
If `true`, animation is paused.
___
### speed
• **speed**: *number* = 1
The current animation speed.
## Methods
### GetAnimationDuration
▸ **GetAnimationDuration**(): *number*
Gets the longest animation time in the model.
**`constructor`**
**Returns:** *number*
___
### PauseAnimation
▸ **PauseAnimation**(): *void*
Pauses animation.
**Returns:** *void*
___
### PlayAnimation
▸ **PlayAnimation**(): *void*
Plays animation.
**Returns:** *void*
___
### SetAnimationAt
▸ **SetAnimationAt**(`value`: number): *void*
Navigates to animation time.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`value` | number | The animation time. |
**Returns:** *void*
___
### SetAnimationSpeed
▸ **SetAnimationSpeed**(`value`: number): *void*
Sets the animation speed.
`1` - the default speed.
`<0` - reverse animation.
`-1` - the default speed for reverse animation.
`0` - pause.
`>1` - increments speed.
**Parameters:**
Name | Type |
------ | ------ |
`value` | number |
**Returns:** *void*
___
### checkInitDependenciesWidgets
▸ **checkInitDependenciesWidgets**(): *string[]*
*Inherited from [AuBaseWidget](aubasewidget.md).[checkInitDependenciesWidgets](aubasewidget.md#checkinitdependencieswidgets)*
Returns an array of widget names, due to which the current widget cannot receive parameters.
**Returns:** *string[]*
___
### closeBox
▸ **closeBox**(): *void*
Closes the dynamic model.
**Returns:** *void*
___
### openBox
▸ **openBox**(): *void*
Opens the dynamic model.
**Returns:** *void*
___
### resetPreloaderState
▸ **resetPreloaderState**(): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[resetPreloaderState](aubasewidget.md#resetpreloaderstate)*
**Returns:** *void*
___
### showPreloader
▸ **showPreloader**(`isPreload`: boolean, `message`: string | string[], `timeout`: number): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[showPreloader](aubasewidget.md#showpreloader)*
Shows a preloader.
```
"onClick": [
"{{#function main.showPreloader(true, 'Creating print files...')}}",
"{{#function $['editor'].getHiResImages(800,800)}}",
"{{#function main.showPreloader(false)}}"
]
```
**Parameters:**
Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`isPreload` | boolean | - | If `true`, enables the preloader. |
`message` | string | string[] | [""] | A text message that appears next to the preloader. |
`timeout` | number | 5 | - |
**Returns:** *void*
___
### showToast
▸ **showToast**(`data?`: string, `duration?`: number): *void*
*Inherited from [AuBaseWidget](aubasewidget.md).[showToast](aubasewidget.md#showtoast)*
Shows a toast.
```
return editor.loadUserInfo(data)
.catch(err => {
this.widget.showToast("Error: Invalid data");
console.log(err);
});
```
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`data?` | string | A string message to display in the toast. |
`duration?` | number | Defines how long to show the toast for. |
**Returns:** *void*