UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

75 lines (71 loc) 2.59 kB
import { f as FlowGraphExecutionBlock } from './KHR_interactivity-CEwUaqxQ.esm.js'; import { u as RegisterClass } from './index-MZPybX0H.esm.js'; import './declarationMapper-CqO08-WM.esm.js'; import './objectModelMapping-De5EKNEZ.esm.js'; import './spotLight.pure-CRdZC6Ci.esm.js'; /** This file must only contain pure code and pure imports */ /** * A block that executes its output flows in sequence. */ class FlowGraphSequenceBlock extends FlowGraphExecutionBlock { constructor( /** * the configuration of the block */ config) { super(config); this.config = config; /** * The output flows. */ this.executionSignals = []; this.setNumberOfOutputSignals(this.config.outputSignalCount); } _execute(context) { for (let i = 0; i < this.executionSignals.length; i++) { this.executionSignals[i]._activateSignal(context); } } /** * Sets the block's output flows. Would usually be passed from the constructor but can be changed afterwards. * @param outputSignalCount the number of output flows */ setNumberOfOutputSignals(outputSignalCount = 1) { // check the size of the outFlow Array, see if it is not larger than needed while (this.executionSignals.length > outputSignalCount) { const flow = this.executionSignals.pop(); if (flow) { flow.disconnectFromAll(); this._unregisterSignalOutput(flow.name); } } while (this.executionSignals.length < outputSignalCount) { this.executionSignals.push(this._registerSignalOutput(`out_${this.executionSignals.length}`)); } } /** * @returns class name of the block. */ getClassName() { return "FlowGraphSequenceBlock" /* FlowGraphBlockNames.Sequence */; } } let _Registered = false; /** * Register side effects for flowGraphSequenceBlock. * Safe to call multiple times; only the first call has an effect. */ function RegisterFlowGraphSequenceBlock() { if (_Registered) { return; } _Registered = true; RegisterClass("FlowGraphSequenceBlock" /* FlowGraphBlockNames.Sequence */, FlowGraphSequenceBlock); } /** * Re-exports pure implementation and applies runtime side effects. * Import flowGraphSequenceBlock.pure for tree-shakeable, side-effect-free usage. */ RegisterFlowGraphSequenceBlock(); export { FlowGraphSequenceBlock, RegisterFlowGraphSequenceBlock }; //# sourceMappingURL=flowGraphSequenceBlock-CM16L04G.esm.js.map