Class: VariationConfiguratorPlugin
Plugins.VariationConfiguratorPlugin
Hierarchy
AViewerPlugin<"">↳
VariationConfiguratorPlugin
Properties
PluginType
▪ Static Readonly PluginType: "VariationConfiguratorPlugin"
dependencies
• dependencies: typeof AssetManagerPlugin[]
enabled
• enabled: boolean = true
Overrides
serializeWithViewer
• serializeWithViewer: boolean = false
baseUrl
• baseUrl: string = ''
variations
• variations: Object
Type declaration
| Name | Type |
|---|---|
objects | IConfiguratorVariation[] |
materials | IConfiguratorVariation[] |
autoDispose
• autoDispose: boolean = true
Default = true. When set to false the items will not be disposed when removed.
utils
• Readonly utils: Object
Type declaration
| Name | Type |
|---|---|
getName | (item: IConfiguratorVariation | { name?: string ; prefix: string }) => string |
getTitle | (item: IConfiguratorVariation) => string |
getIcon | (variation: IConfiguratorVariation, type: "objects" | "materials") => string |
getItemIcon | (variation: IConfiguratorVariation, i: number, type: "objects" | "materials") => string |
getItemTitle | (variation: IConfiguratorVariation, i: number) => string |
getItemPath | (variation: IConfiguratorVariation, i: number, type: "objects" | "materials") => string |
pathToTitle | (item: string) => string |
pathToIcon | (item: string) => string |
toJSON
• toJSON: any = undefined
Overrides
_dirty
• Protected _dirty: boolean = false
Inherited from
_viewer
• Protected Optional _viewer: ViewerApp
Inherited from
_ty
• Protected _ty: readonly ["objects", "materials"]
_extForType
• Protected _extForType: Object
Type declaration
| Name | Type |
|---|---|
objects | string[] |
materials | string[] |
images | string[] |
Constructors
constructor
• new VariationConfiguratorPlugin()
Inherited from
Accessors
dirty
• get dirty(): boolean
Returns
boolean
Inherited from
AViewerPlugin.dirty
• set dirty(value): void
Parameters
| Name | Type |
|---|---|
value | boolean |
Returns
void
Inherited from
AViewerPlugin.dirty
viewer
• get viewer(): undefined | ViewerApp
Returns
undefined | ViewerApp
Inherited from
AViewerPlugin.viewer
Methods
onAdded
▸ onAdded(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Inherited from
onDispose
▸ onDispose(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Inherited from
exportState
▸ exportState(): any
Returns
any
Inherited from
importState
▸ importState(state): Promise<void>
Parameters
| Name | Type |
|---|---|
state | any |
Returns
Promise<void>
Inherited from
storeState
▸ storeState(prefix?, storage?, data?): void
Parameters
| Name | Type |
|---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
loadState
▸ loadState(prefix?, storage?): Promise<void>
Parameters
| Name | Type |
|---|---|
prefix? | string |
storage? | Storage |
Returns
Promise<void>
Inherited from
applyVariation
▸ applyVariation(variation, item, type, force?): Promise<void>
Parameters
| Name | Type | Default value |
|---|---|---|
variation | IConfiguratorVariation | undefined |
item | string | number | undefined |
type | "objects" | "materials" | undefined |
force | boolean | false |
Returns
Promise<void>
clearVariations
▸ clearVariations(): void
Returns
void
importConfig
▸ importConfig(config, folder?): void
Parameters
| Name | Type |
|---|---|
config | any |
folder? | Unzipped |
Returns
void
importPath
▸ importPath(configPath): Promise<void>
Parameters
| Name | Type |
|---|---|
configPath | string |
Returns
Promise<void>
getMaterials
▸ getMaterials(name): string[]
Parameters
| Name | Type |
|---|---|
name | string |
Returns
string[]
getObjects
▸ getObjects(name): string[]
Parameters
| Name | Type |
|---|---|
name | string |
Returns
string[]
getMaterialVariations
▸ getMaterialVariations(): string[]
Returns
string[]
getObjectVariations
▸ getObjectVariations(): string[]
Returns
string[]
onRemove
▸ onRemove(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Overrides
fromJSON
▸ fromJSON(json): null | VariationConfiguratorPlugin
Parameters
| Name | Type |
|---|---|
json | any |
Returns
null | VariationConfiguratorPlugin
Overrides
_storeKey
▸ Protected _storeKey(prefix?): string
Parameters
| Name | Type |
|---|---|
prefix? | string |
Returns
string
Inherited from
_loadMaterial
▸ Protected _loadMaterial(path, blob?): Promise<undefined | IMaterial<any, IMaterialEventMap>>
Parameters
| Name | Type |
|---|---|
path | string |
blob? | IFile |
Returns
Promise<undefined | IMaterial<any, IMaterialEventMap>>
_loadObject
▸ Protected _loadObject(path, blob?): Promise<IModel<Object3D<Object3DEventMap>, IObject3DEventMap>[]>
Parameters
| Name | Type |
|---|---|
path | string |
blob? | IFile |
Returns
Promise<IModel<Object3D<Object3DEventMap>, IObject3DEventMap>[]>
_exportConfiguratorState
▸ Protected _exportConfiguratorState(): Promise<{ folder: undefined | Zippable ; config: any }>
Returns
Promise<{ folder: undefined | Zippable ; config: any }>