ExplodeService

class wvc.ExplodeService()

IExplodeService

Constructors

wvc.ExplodeService.constructor()
ExplodeService(): ExplodeService

Returns: ExplodeService

Properties

wvc.ExplodeService.serviceName

readonly

serviceName: “ExplodeService”

Accessors

wvc.ExplodeService.webViewer()
get webViewer(): (undefined | IWebViewer)

Returns: (undefined | IWebViewer)

set webViewer(value: (undefined | IWebViewer)): void

Parameters

value: (undefined | IWebViewer)

Returns: void

Methods

wvc.ExplodeService.addEventListener()

inherited

addEventListener(type: string, callback: (None | EventListenerOrEventListenerObject), options: (boolean | AddEventListenerOptions)): void

Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options’s capture.

When set to true, options’s capture prevents callback from being invoked when the event’s eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event’s eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event’s eventPhase attribute value is AT_TARGET.

When set to true, options’s passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

When set to true, options’s once indicates that the callback will only be invoked once after which the event listener will be removed.

If an AbortSignal is passed for options’s signal, then the event listener will be removed when signal is aborted.

The event listener is appended to target’s event listener list and is not appended if it has the same type, callback, and capture.

MDN Reference

Parameters

type: string

callback: (None | EventListenerOrEventListenerObject)

options: (boolean | AddEventListenerOptions)

Returns: void

wvc.ExplodeService.dispatchEvent()

inherited

dispatchEvent(event: Event): boolean

Dispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

MDN Reference

Parameters

event: Event

Returns: boolean

wvc.ExplodeService.getActive()
getActive(): boolean

Indicates whether there is a currently active explode operation.

Returns: boolean

boolean value indicating if there is an active explode operation.
wvc.ExplodeService.getMagnitude()
getMagnitude(): number

Gets the current explode magnitude. This will always return 0 when there is no active explode operation.

Returns: number

the current explode magnitude.
wvc.ExplodeService.removeEventListener()

inherited

removeEventListener(type: string, callback: (None | EventListenerOrEventListenerObject), options: (boolean | EventListenerOptions)): void

Removes the event listener in target’s event listener list with the same type, callback, and options.

MDN Reference

Parameters

type: string

callback: (None | EventListenerOrEventListenerObject)

options: (boolean | EventListenerOptions)

Returns: void

wvc.ExplodeService.reset()
reset(): void

Resets the explode service, clearing any active operations.

Returns: void

wvc.ExplodeService.setMagnitude()
setMagnitude(magnitude: number): Promise

Sets the explosion magnitude if there is an active explosion operation. A value of 1.0 indicates that the distance between a part’s exploded center, and exploded center will be double.

Parameters

magnitude: number

the magnitude for the explosion.

Returns: Promise

a promise that resolves when this operation is complete.
wvc.ExplodeService.start()
start(nodeIds: number[], explosionVector: IPoint3): Promise

Starts an explode operation. This will cancel any currently active explode operation.

Parameters

nodeIds: number[]

an array of node Ids for the parts that should be exploded. If this parameter is omitted or is an empty array, the entire model will be considered for explosion.

explosionVector: IPoint3

the vector to use for the center of the explosion.

Returns: Promise

a promise that resolves when this operation is complete.
wvc.ExplodeService.stop()
stop(): Promise

Terminates any active explode operation.

Returns: Promise

a promise that resolves when this operation is complete.