@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.
64 lines (60 loc) • 2.4 kB
JavaScript
import { F as FlowGraphInteger, j as RichTypeFlowGraphInteger } from './declarationMapper-CqO08-WM.esm.js';
import { c as FlowGraphExecutionBlockWithOutSignal } from './KHR_interactivity-CEwUaqxQ.esm.js';
import { u as RegisterClass } from './index-MZPybX0H.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 a branch a set number of times.
*/
class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {
constructor(
/**
* [Object] the configuration of the block
*/
config = {}) {
super(config);
this.config = config;
this.config.startIndex = config.startIndex ?? new FlowGraphInteger(0);
this.reset = this._registerSignalInput("reset");
this.maxExecutions = this.registerDataInput("maxExecutions", RichTypeFlowGraphInteger);
this.executionCount = this.registerDataOutput("executionCount", RichTypeFlowGraphInteger, new FlowGraphInteger(0));
}
_execute(context, callingSignal) {
if (callingSignal === this.reset) {
this.executionCount.setValue(this.config.startIndex, context);
}
else {
const currentCountValue = this.executionCount.getValue(context);
if (currentCountValue.value < this.maxExecutions.getValue(context).value) {
this.executionCount.setValue(new FlowGraphInteger(currentCountValue.value + 1), context);
this.out._activateSignal(context);
}
}
}
/**
* @returns class name of the block.
*/
getClassName() {
return "FlowGraphDoNBlock" /* FlowGraphBlockNames.DoN */;
}
}
let _Registered = false;
/**
* Register side effects for flowGraphDoNBlock.
* Safe to call multiple times; only the first call has an effect.
*/
function RegisterFlowGraphDoNBlock() {
if (_Registered) {
return;
}
_Registered = true;
RegisterClass("FlowGraphDoNBlock" /* FlowGraphBlockNames.DoN */, FlowGraphDoNBlock);
}
/**
* Re-exports pure implementation and applies runtime side effects.
* Import flowGraphDoNBlock.pure for tree-shakeable, side-effect-free usage.
*/
RegisterFlowGraphDoNBlock();
export { FlowGraphDoNBlock, RegisterFlowGraphDoNBlock };
//# sourceMappingURL=flowGraphDoNBlock-BEr8UbG1.esm.js.map