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
AViewerPlugin
<""
>↳
SimplifyModifierPlugin
Properties
PluginType
▪ Static
Readonly
PluginType: string
= 'SimplifyModifierPlugin'
Defined in
webgi/src/plugins/SimplifyModifierPlugin.ts:38
enabled
• enabled: boolean
= true
Overrides
Defined in
webgi/src/plugins/SimplifyModifierPlugin.ts:39
toJSON
• toJSON: any
= undefined
Overrides
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
Defined in
webgi/src/core/AViewerPlugin.ts:23
_viewer
• Protected
Optional
_viewer: ViewerApp
Inherited from
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
Name | Type |
---|---|
value | boolean |
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
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:40
onRemove
▸ onRemove(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:44
fromJSON
▸ fromJSON(data
, meta?
): null
| SimplifyModifierPlugin
| Promise
<null
| SimplifyModifierPlugin
>
Parameters
Name | Type |
---|---|
data | any |
meta? | any |
Returns
null
| SimplifyModifierPlugin
| Promise
<null
| SimplifyModifierPlugin
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:56
exportState
▸ exportState(): any
Returns
any
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:68
importState
▸ importState(state
): Promise
<void
>
Parameters
Name | Type |
---|---|
state | any |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:71
storeState
▸ storeState(prefix?
, storage?
, data?
): void
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:78
loadState
▸ loadState(prefix?
, storage?
): Promise
<void
>
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
Returns
Promise
<void
>
Inherited from
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
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Overrides
Defined in
webgi/src/plugins/SimplifyModifierPlugin.ts:50
simplifyGeometries
▸ simplifyGeometries(geometry?
, options?
): undefined
| any
[]
Parameters
Name | Type |
---|---|
geometry? | any |
options? | SimplifyOptions |
Returns
undefined
| any
[]
Defined in
webgi/src/plugins/SimplifyModifierPlugin.ts:63
simplifyGeometry
▸ simplifyGeometry(geometry?
, __namedParameters?
): any
Parameters
Name | Type |
---|---|
geometry? | any |
__namedParameters | SimplifyOptions |
Returns
any
Defined in
webgi/src/plugins/SimplifyModifierPlugin.ts:81
simplifyAll
▸ simplifyAll(root?
, options?
): Promise
<undefined
| any
[]>
Parameters
Name | Type |
---|---|
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
Name | Type |
---|---|
prefix? | string |
Returns
string
Inherited from
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
Name | Type |
---|---|
geometry | any |
count | number |
Returns
any
Defined in
webgi/src/plugins/SimplifyModifierPlugin.ts:152
Constructors
constructor
• new SimplifyModifierPlugin()