Skip to main content

Class: SimplifyModifierPlugin

Plugins.SimplifyModifierPlugin

Boilerplate for implementing a plugin for simplifying geometries. This is a base class and cannot be used directly. See MeshOptSimplifyModifierPlugin the simplify-modifier-plugin example for a sample implementation.

Hierarchy

Properties

PluginType

Static Readonly PluginType: string = 'SimplifyModifierPlugin'

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:38


enabled

enabled: boolean = true

Overrides

AViewerPlugin.enabled

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:39


toJSON

toJSON: any = undefined

Overrides

AViewerPlugin.toJSON

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:40


simplifyFactor

simplifyFactor: number = 0.5

Factor of vertices to remove. eg 0.5 will remove half of the vertices. Default is 0.5 This is used when no factor or count is provided in the options to simplifyGeometry or simplifyGeometries.

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:61


_dirty

Protected _dirty: boolean = false

Inherited from

AViewerPlugin._dirty

Defined in

webgi/src/core/AViewerPlugin.ts:23


_viewer

Protected Optional _viewer: ViewerApp

Inherited from

AViewerPlugin._viewer

Defined in

webgi/src/core/AViewerPlugin.ts:27

Accessors

dirty

get dirty(): boolean

Returns

boolean

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:16

set dirty(value): void

Parameters

NameType
valueboolean

Returns

void

Inherited from

AViewerPlugin.dirty

Defined in

webgi/src/core/AViewerPlugin.ts:20


viewer

get viewer(): undefined | TViewer

Returns

undefined | TViewer

Inherited from

AViewerPlugin.viewer

Defined in

webgi/src/core/AViewerPlugin.ts:29


initialized

get initialized(): boolean

Returns

boolean

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:46

Methods

onDispose

onDispose(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Inherited from

AViewerPlugin.onDispose

Defined in

webgi/src/core/AViewerPlugin.ts:40


onRemove

onRemove(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Inherited from

AViewerPlugin.onRemove

Defined in

webgi/src/core/AViewerPlugin.ts:44


fromJSON

fromJSON(data, meta?): null | SimplifyModifierPlugin | Promise<null | SimplifyModifierPlugin>

Parameters

NameType
dataany
meta?any

Returns

null | SimplifyModifierPlugin | Promise<null | SimplifyModifierPlugin>

Inherited from

AViewerPlugin.fromJSON

Defined in

webgi/src/core/AViewerPlugin.ts:56


exportState

exportState(): any

Returns

any

Inherited from

AViewerPlugin.exportState

Defined in

webgi/src/core/AViewerPlugin.ts:68


importState

importState(state): Promise<void>

Parameters

NameType
stateany

Returns

Promise<void>

Inherited from

AViewerPlugin.importState

Defined in

webgi/src/core/AViewerPlugin.ts:71


storeState

storeState(prefix?, storage?, data?): void

Parameters

NameType
prefix?string
storage?Storage
data?any

Returns

void

Inherited from

AViewerPlugin.storeState

Defined in

webgi/src/core/AViewerPlugin.ts:78


loadState

loadState(prefix?, storage?): Promise<void>

Parameters

NameType
prefix?string
storage?Storage

Returns

Promise<void>

Inherited from

AViewerPlugin.loadState

Defined in

webgi/src/core/AViewerPlugin.ts:88


initialize

initialize(): Promise<void>

Returns

Promise<void>

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:47


onAdded

onAdded(viewer): Promise<void>

Parameters

NameType
viewerViewerApp

Returns

Promise<void>

Overrides

AViewerPlugin.onAdded

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:50


simplifyGeometries

simplifyGeometries(geometry?, options?): undefined | any[]

Parameters

NameType
geometry?any
options?SimplifyOptions

Returns

undefined | any[]

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:63


simplifyGeometry

simplifyGeometry(geometry?, __namedParameters?): any

Parameters

NameType
geometry?any
__namedParametersSimplifyOptions

Returns

any

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:81


simplifyAll

simplifyAll(root?, options?): Promise<undefined | any[]>

Parameters

NameType
root?IModel<any>
options?SimplifyOptions

Returns

Promise<undefined | any[]>

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:155


simplifySelected

simplifySelected(): Promise<void>

Returns

Promise<void>

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:180


_storeKey

Protected _storeKey(prefix?): string

Parameters

NameType
prefix?string

Returns

string

Inherited from

AViewerPlugin._storeKey

Defined in

webgi/src/core/AViewerPlugin.ts:64


_simplify

Protected Abstract _simplify(geometry, count): any

Sample for three.js addons SimplifyModifier: import {SimplifyModifier} from 'three/examples/jsm/modifiers/SimplifyModifier' protected _simplify(geometry: IGeometry, count: number): IGeometry { const modifier = new SimplifyModifier() return modifier.modify(geometry, count) as IGeometry }

Parameters

NameType
geometryany
countnumber

Returns

any

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:152

Constructors

constructor

new SimplifyModifierPlugin()

Overrides

AViewerPlugin.constructor

Defined in

webgi/src/plugins/SimplifyModifierPlugin.ts:42