UNPKG

@aurigma/ui-framework

Version:

A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.

349 lines (204 loc) 7.18 kB
# Class: AuWidgetMockup3DViewer A widget that is used to render 3D previews based on DAE models. The following example illustrates how you can use proof images obtained from the [`DesignEditor`](../classes/auwidgetdesigneditor.md) to visualize a model in the `3D-Viewer` widget. ``` { "widgets": [ { "name": "previewer", "type": "3d-viewer", "params": { "showAnimationButtons": false, "showCameraButtons": true, "items": [ { "images": "{{ $['editor'].proofImageUrls }}", "model": "64057c8e12287dfc3d0ecebc" } ] } } ] } ``` ## Hierarchy ↳ [Au3dViewerBase](au3dviewerbase.md) ↳ **AuWidgetMockup3DViewer** ## Implements * [IWidget](../interfaces/iwidget.md) ## Index ### Constructors * [constructor](auwidgetmockup3dviewer.md#constructor) ### Properties * [image](auwidgetmockup3dviewer.md#image) * [params](auwidgetmockup3dviewer.md#params) * [paused](auwidgetmockup3dviewer.md#paused) * [speed](auwidgetmockup3dviewer.md#speed) ### Accessors * [backOfficeUrl](auwidgetmockup3dviewer.md#backofficeurl) * [designAtomsApiUrl](auwidgetmockup3dviewer.md#designatomsapiurl) * [ownerId](auwidgetmockup3dviewer.md#ownerid) * [tenantId](auwidgetmockup3dviewer.md#tenantid) * [token](auwidgetmockup3dviewer.md#token) ### Methods * [GetAnimationDuration](auwidgetmockup3dviewer.md#getanimationduration) * [PauseAnimation](auwidgetmockup3dviewer.md#pauseanimation) * [PlayAnimation](auwidgetmockup3dviewer.md#playanimation) * [SetAnimationAt](auwidgetmockup3dviewer.md#setanimationat) * [SetAnimationSpeed](auwidgetmockup3dviewer.md#setanimationspeed) * [checkInitDependenciesWidgets](auwidgetmockup3dviewer.md#checkinitdependencieswidgets) * [closeBox](auwidgetmockup3dviewer.md#closebox) * [openBox](auwidgetmockup3dviewer.md#openbox) * [resetPreloaderState](auwidgetmockup3dviewer.md#resetpreloaderstate) * [showPreloader](auwidgetmockup3dviewer.md#showpreloader) * [showToast](auwidgetmockup3dviewer.md#showtoast) ## Constructors ### constructor \+ **new AuWidgetMockup3DViewer**(): *[AuWidgetMockup3DViewer](auwidgetmockup3dviewer.md)* *Overrides void* **Returns:** *[AuWidgetMockup3DViewer](auwidgetmockup3dviewer.md)* ## Properties ### image**image**: *string* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[image](au3dviewerbase.md#image)* 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 *Inherited from [Au3dViewerBase](au3dviewerbase.md).[paused](au3dviewerbase.md#paused)* If `true`, animation is paused. ___ ### speed • **speed**: *number* = 1 *Inherited from [Au3dViewerBase](au3dviewerbase.md).[speed](au3dviewerbase.md#speed)* The current animation speed. ## Accessors ### backOfficeUrl • **get backOfficeUrl**(): *string* **Returns:** *string* ___ ### designAtomsApiUrl**get designAtomsApiUrl**(): *string* **Returns:** *string* ___ ### ownerId • **get ownerId**(): *string* **Returns:** *string* ___ ### tenantId**get tenantId**(): *number* **Returns:** *number* ___ ### token • **get token**(): *string* **Returns:** *string* ## Methods ### GetAnimationDuration ▸ **GetAnimationDuration**(): *number* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[GetAnimationDuration](au3dviewerbase.md#getanimationduration)* Gets the longest animation time in the model. **`constructor`** **Returns:** *number* ___ ### PauseAnimation**PauseAnimation**(): *void* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[PauseAnimation](au3dviewerbase.md#pauseanimation)* Pauses animation. **Returns:** *void* ___ ### PlayAnimation ▸ **PlayAnimation**(): *void* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[PlayAnimation](au3dviewerbase.md#playanimation)* Plays animation. **Returns:** *void* ___ ### SetAnimationAt**SetAnimationAt**(`value`: number): *void* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[SetAnimationAt](au3dviewerbase.md#setanimationat)* Navigates to animation time. **Parameters:** Name | Type | Description | ------ | ------ | ------ | `value` | number | The animation time. | **Returns:** *void* ___ ### SetAnimationSpeed ▸ **SetAnimationSpeed**(`value`: number): *void* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[SetAnimationSpeed](au3dviewerbase.md#setanimationspeed)* 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* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[closeBox](au3dviewerbase.md#closebox)* Closes the dynamic model. **Returns:** *void* ___ ### openBox**openBox**(): *void* *Inherited from [Au3dViewerBase](au3dviewerbase.md).[openBox](au3dviewerbase.md#openbox)* 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 &#124; 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*