@babylonjs/core 6.21.2 → 6.21.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/Animations/animatable.d.ts +4 -0
  2. package/Animations/animatable.js +6 -0
  3. package/Animations/animatable.js.map +1 -1
  4. package/Animations/animationGroup.d.ts +9 -0
  5. package/Animations/animationGroup.js +14 -0
  6. package/Animations/animationGroup.js.map +1 -1
  7. package/Buffers/buffer.d.ts +31 -2
  8. package/Buffers/buffer.js +100 -65
  9. package/Buffers/buffer.js.map +1 -1
  10. package/Engines/engine.d.ts +5 -0
  11. package/Engines/thinEngine.js +2 -2
  12. package/Engines/thinEngine.js.map +1 -1
  13. package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +59 -0
  14. package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +86 -0
  15. package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +1 -0
  16. package/FlowGraph/Blocks/Data/Logic/index.d.ts +2 -0
  17. package/FlowGraph/Blocks/Data/Logic/index.js +3 -0
  18. package/FlowGraph/Blocks/Data/Logic/index.js.map +1 -0
  19. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +2 -1
  20. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +6 -2
  21. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
  22. package/FlowGraph/Blocks/Data/Math/index.d.ts +4 -0
  23. package/FlowGraph/Blocks/Data/Math/index.js +5 -0
  24. package/FlowGraph/Blocks/Data/Math/index.js.map +1 -0
  25. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +1 -1
  26. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  27. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +1 -1
  28. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  29. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +2 -1
  30. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +2 -2
  31. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
  32. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +1 -8
  33. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +2 -5
  34. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  35. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
  36. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  37. package/FlowGraph/Blocks/Data/index.d.ts +2 -4
  38. package/FlowGraph/Blocks/Data/index.js +4 -4
  39. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  40. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +1 -1
  41. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  42. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +1 -3
  43. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  44. package/FlowGraph/Blocks/Execution/{flowGraphConditionalBlock.d.ts → ControlFlow/flowGraphConditionalBlock.d.ts} +5 -5
  45. package/FlowGraph/Blocks/Execution/{flowGraphConditionalBlock.js → ControlFlow/flowGraphConditionalBlock.js} +3 -3
  46. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphConditionalBlock.js.map +1 -0
  47. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +20 -0
  48. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +26 -0
  49. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -0
  50. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +24 -0
  51. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +30 -0
  52. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -0
  53. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +24 -0
  54. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +27 -0
  55. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -0
  56. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +24 -0
  57. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +27 -0
  58. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -0
  59. package/FlowGraph/Blocks/Execution/{flowGraphForLoopBlock.d.ts → ControlFlow/flowGraphForLoopBlock.d.ts} +4 -4
  60. package/FlowGraph/Blocks/Execution/{flowGraphForLoopBlock.js → ControlFlow/flowGraphForLoopBlock.js} +4 -5
  61. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -0
  62. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +51 -0
  63. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +77 -0
  64. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -0
  65. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +31 -0
  66. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +32 -0
  67. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -0
  68. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +24 -0
  69. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +31 -0
  70. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -0
  71. package/FlowGraph/Blocks/Execution/{flowGraphTimerBlock.d.ts → ControlFlow/flowGraphTimerBlock.d.ts} +5 -9
  72. package/FlowGraph/Blocks/Execution/{flowGraphTimerBlock.js → ControlFlow/flowGraphTimerBlock.js} +5 -9
  73. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -0
  74. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +32 -0
  75. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +62 -0
  76. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -0
  77. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +31 -0
  78. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +27 -0
  79. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -0
  80. package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +12 -0
  81. package/FlowGraph/Blocks/Execution/ControlFlow/index.js +13 -0
  82. package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -0
  83. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +0 -1
  84. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
  85. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +1 -5
  86. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +3 -8
  87. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  88. package/FlowGraph/Blocks/Execution/index.d.ts +1 -3
  89. package/FlowGraph/Blocks/Execution/index.js +2 -3
  90. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  91. package/FlowGraph/flowGraphConnection.d.ts +4 -0
  92. package/FlowGraph/flowGraphConnection.js +5 -0
  93. package/FlowGraph/flowGraphConnection.js.map +1 -1
  94. package/FlowGraph/flowGraphContext.d.ts +42 -2
  95. package/FlowGraph/flowGraphContext.js +58 -6
  96. package/FlowGraph/flowGraphContext.js.map +1 -1
  97. package/FlowGraph/flowGraphDataConnection.d.ts +19 -2
  98. package/FlowGraph/flowGraphDataConnection.js +29 -5
  99. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  100. package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -1
  101. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  102. package/FlowGraph/flowGraphSignalConnection.js +1 -1
  103. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  104. package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
  105. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  106. package/Materials/Textures/equiRectangularCubeTexture.js +1 -0
  107. package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
  108. package/Meshes/Compression/dracoCompression.js +28 -13
  109. package/Meshes/Compression/dracoCompression.js.map +1 -1
  110. package/Misc/fileTools.js +2 -2
  111. package/Misc/fileTools.js.map +1 -1
  112. package/Misc/webRequest.d.ts +5 -0
  113. package/Misc/webRequest.js +7 -0
  114. package/Misc/webRequest.js.map +1 -1
  115. package/XR/features/WebXRPlaneDetector.d.ts +8 -0
  116. package/XR/features/WebXRPlaneDetector.js +13 -0
  117. package/XR/features/WebXRPlaneDetector.js.map +1 -1
  118. package/package.json +1 -1
  119. package/FlowGraph/Blocks/Execution/flowGraphConditionalBlock.js.map +0 -1
  120. package/FlowGraph/Blocks/Execution/flowGraphForLoopBlock.js.map +0 -1
  121. package/FlowGraph/Blocks/Execution/flowGraphTimerBlock.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ import type { FlowGraphContext } from "../../../flowGraphContext";
2
+ import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
3
+ import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
4
+ import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock";
5
+ /**
6
+ * @experimental
7
+ * A block that throttles the execution of its output flow.
8
+ */
9
+ export declare class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {
10
+ /**
11
+ * Input connection: The duration of the throttle, in ms.
12
+ */
13
+ readonly duration: FlowGraphDataConnection<number>;
14
+ /**
15
+ * Input connection: Resets the throttle.
16
+ */
17
+ readonly reset: FlowGraphSignalConnection;
18
+ /**
19
+ * Output connection: The time remaining before the throttle is done, in ms.
20
+ */
21
+ readonly timeRemaining: FlowGraphDataConnection<number>;
22
+ constructor();
23
+ _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
24
+ }
@@ -0,0 +1,31 @@
1
+ import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
2
+ import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock.js";
3
+ /**
4
+ * @experimental
5
+ * A block that throttles the execution of its output flow.
6
+ */
7
+ export class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {
8
+ constructor() {
9
+ super();
10
+ this.reset = this._registerSignalInput("reset");
11
+ this.duration = this._registerDataInput("duration", RichTypeNumber);
12
+ this.timeRemaining = this._registerDataOutput("timeRemaining", RichTypeNumber);
13
+ }
14
+ _execute(context, callingSignal) {
15
+ const lastExecutedTime = context._getExecutionVariable(this, "lastExecutedTime");
16
+ const durationValue = this.duration.getValue(context);
17
+ const currentTime = Date.now();
18
+ if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {
19
+ //activate the output flow
20
+ this.timeRemaining.setValue(0, context);
21
+ this.onDone._activateSignal(context);
22
+ context._setExecutionVariable(this, "lastExecutedTime", currentTime);
23
+ }
24
+ else {
25
+ //activate the output flow after the remaining time
26
+ const remaining = durationValue - (currentTime - lastExecutedTime);
27
+ this.timeRemaining.setValue(remaining, context);
28
+ }
29
+ }
30
+ }
31
+ //# sourceMappingURL=flowGraphThrottleBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iCAAiC;IAczE;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACnF,CAAC;IACM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,MAAM,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACjF,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,IAAI,gBAAgB,KAAK,SAAS,IAAI,WAAW,GAAG,gBAAgB,GAAG,aAAa,EAAE;YAClH,0BAA0B;YAC1B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACrC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;SACxE;aAAM;YACH,mDAAmD;YACnD,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,WAAW,GAAG,gBAAgB,CAAC,CAAC;YACnE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;SACnD;IACL,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\n\r\n/**\r\n * @experimental\r\n * A block that throttles the execution of its output flow.\r\n */\r\nexport class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The duration of the throttle, in ms.\r\n */\r\n public readonly duration: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the throttle.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The time remaining before the throttle is done, in ms.\r\n */\r\n public readonly timeRemaining: FlowGraphDataConnection<number>;\r\n\r\n constructor() {\r\n super();\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.duration = this._registerDataInput(\"duration\", RichTypeNumber);\r\n this.timeRemaining = this._registerDataOutput(\"timeRemaining\", RichTypeNumber);\r\n }\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const lastExecutedTime = context._getExecutionVariable(this, \"lastExecutedTime\");\r\n const durationValue = this.duration.getValue(context);\r\n const currentTime = Date.now();\r\n if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {\r\n //activate the output flow\r\n this.timeRemaining.setValue(0, context);\r\n this.onDone._activateSignal(context);\r\n context._setExecutionVariable(this, \"lastExecutedTime\", currentTime);\r\n } else {\r\n //activate the output flow after the remaining time\r\n const remaining = durationValue - (currentTime - lastExecutedTime);\r\n this.timeRemaining.setValue(remaining, context);\r\n }\r\n }\r\n}\r\n"]}
@@ -1,13 +1,9 @@
1
- import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
2
- import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection";
3
- import type { FlowGraphContext } from "../../flowGraphContext";
4
- import { FlowGraphAsyncExecutionBlock } from "../../flowGraphAsyncExecutionBlock";
5
- export interface IFlowGraphTimerBlockParameters {
6
- timeout?: number;
7
- }
1
+ import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
2
+ import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
3
+ import type { FlowGraphContext } from "../../../flowGraphContext";
4
+ import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
8
5
  /**
9
6
  * @experimental
10
- * question: is this doc understandable enough? accepting suggestions
11
7
  * Block that provides two different output flows. One is started immediately once the block is executed,
12
8
  * and the other is executed after a set time. The timer for this block runs based on the scene's render loop.
13
9
  */
@@ -21,7 +17,7 @@ export declare class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
21
17
  * This signal is activated asynchronically.
22
18
  */
23
19
  readonly onTimerDone: FlowGraphSignalConnection;
24
- constructor(parameters?: IFlowGraphTimerBlockParameters);
20
+ constructor();
25
21
  _preparePendingTasks(context: FlowGraphContext): void;
26
22
  /**
27
23
  * @internal
@@ -1,20 +1,16 @@
1
- import { AdvancedTimer } from "../../../Misc/timer.js";
2
- import { FlowGraphAsyncExecutionBlock } from "../../flowGraphAsyncExecutionBlock.js";
3
- import { RichTypeNumber } from "../../flowGraphRichTypes.js";
4
- import { Tools } from "../../../Misc/tools.js";
1
+ import { AdvancedTimer } from "../../../../Misc/timer.js";
2
+ import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock.js";
3
+ import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
4
+ import { Tools } from "../../../../Misc/tools.js";
5
5
  /**
6
6
  * @experimental
7
- * question: is this doc understandable enough? accepting suggestions
8
7
  * Block that provides two different output flows. One is started immediately once the block is executed,
9
8
  * and the other is executed after a set time. The timer for this block runs based on the scene's render loop.
10
9
  */
11
10
  export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
12
- constructor(parameters) {
11
+ constructor() {
13
12
  super();
14
13
  this.timeout = this._registerDataInput("timeout", RichTypeNumber);
15
- if ((parameters === null || parameters === void 0 ? void 0 : parameters.timeout) !== undefined) {
16
- this.timeout.value = parameters.timeout;
17
- }
18
14
  this.onTimerDone = this._registerSignalOutput("onTimerDone");
19
15
  }
20
16
  _preparePendingTasks(context) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphTimerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,4BAA4B;IAWjE;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;IAEM,oBAAoB,CAAC,OAAyB;QACjD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEtD,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,IAAI,CAAC,EAAE;YACrD,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;YAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;YAC3C,MAAM,KAAK,GAAkB,IAAI,aAAa,CAAC;gBAC3C,OAAO,EAAE,cAAc;gBACvB,iBAAiB,EAAE,KAAK,CAAC,wBAAwB;gBACjD,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;aAC/C,CAAC,CAAC;YACH,KAAK,CAAC,KAAK,EAAE,CAAC;YAEd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;SAChE;IACL,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEO,QAAQ,CAAC,KAAoB,EAAE,OAAyB;QAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;QAC1E,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC3B;aAAM;YACH,KAAK,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;SAC/F;QACD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEM,mBAAmB,CAAC,OAAyB;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;QAC1E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,KAAK,CAAC,OAAO,EAAE,CAAC;SACnB;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC5D,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { AdvancedTimer } from \"../../../../Misc/timer\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { Tools } from \"../../../../Misc/tools\";\r\n\r\n/**\r\n * @experimental\r\n * Block that provides two different output flows. One is started immediately once the block is executed,\r\n * and the other is executed after a set time. The timer for this block runs based on the scene's render loop.\r\n */\r\nexport class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The timeout of the timer.\r\n */\r\n public readonly timeout: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The signal that is activated when the timer is done.\r\n * This signal is activated asynchronically.\r\n */\r\n public readonly onTimerDone: FlowGraphSignalConnection;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.timeout = this._registerDataInput(\"timeout\", RichTypeNumber);\r\n this.onTimerDone = this._registerSignalOutput(\"onTimerDone\");\r\n }\r\n\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const currentTimeout = this.timeout.getValue(context);\r\n\r\n if (currentTimeout !== undefined && currentTimeout >= 0) {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n const scene = context.graphVariables.scene;\r\n const timer: AdvancedTimer = new AdvancedTimer({\r\n timeout: currentTimeout,\r\n contextObservable: scene.onBeforeRenderObservable,\r\n onEnded: () => this._onEnded(timer, context),\r\n });\r\n timer.start();\r\n\r\n timers.push(timer);\r\n context._setExecutionVariable(this, \"runningTimers\", timers);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext) {\r\n this._startPendingTasks(context);\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n private _onEnded(timer: AdvancedTimer, context: FlowGraphContext) {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n const index = timers.indexOf(timer);\r\n if (index !== -1) {\r\n timers.splice(index, 1);\r\n } else {\r\n Tools.Warn(\"FlowGraphTimerBlock: Timer ended but was not found in the running timers list\");\r\n }\r\n context._removePendingBlock(this);\r\n this.onTimerDone._activateSignal(context);\r\n }\r\n\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n for (const timer of timers) {\r\n timer.dispose();\r\n }\r\n context._deleteExecutionVariable(this, \"runningTimers\");\r\n }\r\n}\r\n"]}
@@ -0,0 +1,32 @@
1
+ import type { FlowGraphContext } from "../../../flowGraphContext";
2
+ import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
3
+ import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock";
4
+ /**
5
+ * @experimental
6
+ * Configuration for the wait all block.
7
+ */
8
+ export interface IFlowGraphWaitAllBlockConfiguration {
9
+ /**
10
+ * The number of input flows.
11
+ */
12
+ numberInputFlows: number;
13
+ }
14
+ /**
15
+ * @experimental
16
+ * A block that waits for all input flows to be activated before activating its output flow.
17
+ */
18
+ export declare class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
19
+ private _config;
20
+ /**
21
+ * Input connection: Resets the block.
22
+ */
23
+ reset: FlowGraphSignalConnection;
24
+ /**
25
+ * Input connection: The 2nd to nth input flows (the first is named onStart)
26
+ */
27
+ readonly inFlows: FlowGraphSignalConnection[];
28
+ private _cachedActivationState;
29
+ constructor(_config: IFlowGraphWaitAllBlockConfiguration);
30
+ private _getCurrentActivationState;
31
+ _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
32
+ }
@@ -0,0 +1,62 @@
1
+ import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock.js";
2
+ /**
3
+ * @experimental
4
+ * A block that waits for all input flows to be activated before activating its output flow.
5
+ */
6
+ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
7
+ constructor(_config) {
8
+ super();
9
+ this._config = _config;
10
+ /**
11
+ * Input connection: The 2nd to nth input flows (the first is named onStart)
12
+ */
13
+ this.inFlows = [];
14
+ this._cachedActivationState = [];
15
+ this.reset = this._registerSignalInput("reset");
16
+ // The first inFlow is the default input signal all execution blocks have
17
+ for (let i = 1; i < this._config.numberInputFlows; i++) {
18
+ this.inFlows.push(this._registerSignalInput(`in${i}`));
19
+ }
20
+ }
21
+ _getCurrentActivationState(context) {
22
+ const activationState = this._cachedActivationState;
23
+ activationState.length = 0;
24
+ if (!context._hasExecutionVariable(this, "activationState")) {
25
+ for (let i = 0; i < this._config.numberInputFlows; i++) {
26
+ activationState.push(false);
27
+ }
28
+ }
29
+ else {
30
+ const contextActivationState = context._getExecutionVariable(this, "activationState");
31
+ for (let i = 0; i < contextActivationState.length; i++) {
32
+ activationState.push(contextActivationState[i]);
33
+ }
34
+ }
35
+ return activationState;
36
+ }
37
+ _execute(context, callingSignal) {
38
+ const activationState = this._getCurrentActivationState(context);
39
+ if (callingSignal === this.reset) {
40
+ for (let i = 0; i < this._config.numberInputFlows; i++) {
41
+ activationState[i] = false;
42
+ }
43
+ }
44
+ else if (callingSignal === this.onStart) {
45
+ activationState[0] = true;
46
+ }
47
+ else {
48
+ const index = this.inFlows.indexOf(callingSignal);
49
+ if (index >= 0) {
50
+ activationState[index + 1] = true;
51
+ }
52
+ }
53
+ context._setExecutionVariable(this, "activationState", activationState.slice());
54
+ if (activationState.every((value) => value)) {
55
+ this.onDone._activateSignal(context);
56
+ for (let i = 0; i < this._config.numberInputFlows; i++) {
57
+ activationState[i] = false;
58
+ }
59
+ }
60
+ }
61
+ }
62
+ //# sourceMappingURL=flowGraphWaitAllBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAa/F;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iCAAiC;IAWxE,YAAoB,OAA4C;QAC5D,KAAK,EAAE,CAAC;QADQ,YAAO,GAAP,OAAO,CAAqC;QANhE;;WAEG;QACa,YAAO,GAAgC,EAAE,CAAC;QAClD,2BAAsB,GAAc,EAAE,CAAC;QAK3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEhD,yEAAyE;QACzE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;YACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1D;IACL,CAAC;IAEO,0BAA0B,CAAC,OAAyB;QACxD,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACpD,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE;YACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACpD,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC/B;SACJ;aAAM;YACH,MAAM,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YACtF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAsB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpD,eAAe,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;aACnD;SACJ;QACD,OAAO,eAAe,CAAC;IAC3B,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACpD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;aAAM,IAAI,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;YACvC,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;SAC7B;aAAM;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAClD,IAAI,KAAK,IAAI,CAAC,EAAE;gBACZ,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;aACrC;SACJ;QAED,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;QAEhF,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE;YAClD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACpD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;IACL,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\n\r\n/**\r\n * @experimental\r\n * Configuration for the wait all block.\r\n */\r\nexport interface IFlowGraphWaitAllBlockConfiguration {\r\n /**\r\n * The number of input flows.\r\n */\r\n numberInputFlows: number;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that waits for all input flows to be activated before activating its output flow.\r\n */\r\nexport class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: Resets the block.\r\n */\r\n public reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The 2nd to nth input flows (the first is named onStart)\r\n */\r\n public readonly inFlows: FlowGraphSignalConnection[] = [];\r\n private _cachedActivationState: boolean[] = [];\r\n\r\n constructor(private _config: IFlowGraphWaitAllBlockConfiguration) {\r\n super();\r\n\r\n this.reset = this._registerSignalInput(\"reset\");\r\n\r\n // The first inFlow is the default input signal all execution blocks have\r\n for (let i = 1; i < this._config.numberInputFlows; i++) {\r\n this.inFlows.push(this._registerSignalInput(`in${i}`));\r\n }\r\n }\r\n\r\n private _getCurrentActivationState(context: FlowGraphContext) {\r\n const activationState = this._cachedActivationState;\r\n activationState.length = 0;\r\n if (!context._hasExecutionVariable(this, \"activationState\")) {\r\n for (let i = 0; i < this._config.numberInputFlows; i++) {\r\n activationState.push(false);\r\n }\r\n } else {\r\n const contextActivationState = context._getExecutionVariable(this, \"activationState\");\r\n for (let i = 0; i < contextActivationState.length; i++) {\r\n activationState.push(contextActivationState[i]);\r\n }\r\n }\r\n return activationState;\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const activationState = this._getCurrentActivationState(context);\r\n if (callingSignal === this.reset) {\r\n for (let i = 0; i < this._config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n } else if (callingSignal === this.onStart) {\r\n activationState[0] = true;\r\n } else {\r\n const index = this.inFlows.indexOf(callingSignal);\r\n if (index >= 0) {\r\n activationState[index + 1] = true;\r\n }\r\n }\r\n\r\n context._setExecutionVariable(this, \"activationState\", activationState.slice());\r\n\r\n if (activationState.every((value: boolean) => value)) {\r\n this.onDone._activateSignal(context);\r\n for (let i = 0; i < this._config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -0,0 +1,31 @@
1
+ import type { FlowGraphContext } from "../../../flowGraphContext";
2
+ import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
3
+ import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
4
+ import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock";
5
+ /**
6
+ * @experimental
7
+ * Configuration for the while loop block.
8
+ */
9
+ export interface IFlowGraphWhileLoopBlockConfiguration {
10
+ /**
11
+ * If true, the loop body will be executed at least once.
12
+ */
13
+ isDo?: boolean;
14
+ }
15
+ /**
16
+ * @experimental
17
+ * A block that executes a branch while a condition is true.
18
+ */
19
+ export declare class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
20
+ private _config?;
21
+ /**
22
+ * Input connection: The condition to evaluate.
23
+ */
24
+ readonly condition: FlowGraphDataConnection<boolean>;
25
+ /**
26
+ * Output connection: The loop body.
27
+ */
28
+ readonly loopBody: FlowGraphSignalConnection;
29
+ constructor(_config?: IFlowGraphWhileLoopBlockConfiguration | undefined);
30
+ _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
31
+ }
@@ -0,0 +1,27 @@
1
+ import { RichTypeBoolean } from "../../../flowGraphRichTypes.js";
2
+ import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock.js";
3
+ /**
4
+ * @experimental
5
+ * A block that executes a branch while a condition is true.
6
+ */
7
+ export class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
8
+ constructor(_config) {
9
+ super();
10
+ this._config = _config;
11
+ this.condition = this._registerDataInput("condition", RichTypeBoolean);
12
+ this.loopBody = this._registerSignalOutput("loopBody");
13
+ }
14
+ _execute(context, _callingSignal) {
15
+ var _a;
16
+ let conditionValue = this.condition.getValue(context);
17
+ if (((_a = this._config) === null || _a === void 0 ? void 0 : _a.isDo) && !conditionValue) {
18
+ this.loopBody._activateSignal(context);
19
+ }
20
+ while (conditionValue) {
21
+ this.loopBody._activateSignal(context);
22
+ conditionValue = this.condition.getValue(context);
23
+ }
24
+ this.onDone._activateSignal(context);
25
+ }
26
+ }
27
+ //# sourceMappingURL=flowGraphWhileLoopBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAa/F;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iCAAiC;IAU1E,YAAoB,OAA+C;QAC/D,KAAK,EAAE,CAAC;QADQ,YAAO,GAAP,OAAO,CAAwC;QAG/D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;;QAChF,IAAI,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,IAAI,KAAI,CAAC,cAAc,EAAE;YACvC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SAC1C;QACD,OAAO,cAAc,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACvC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrD;QACD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\n\r\n/**\r\n * @experimental\r\n * Configuration for the while loop block.\r\n */\r\nexport interface IFlowGraphWhileLoopBlockConfiguration {\r\n /**\r\n * If true, the loop body will be executed at least once.\r\n */\r\n isDo?: boolean;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that executes a branch while a condition is true.\r\n */\r\nexport class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The condition to evaluate.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Output connection: The loop body.\r\n */\r\n public readonly loopBody: FlowGraphSignalConnection;\r\n\r\n constructor(private _config?: IFlowGraphWhileLoopBlockConfiguration) {\r\n super();\r\n\r\n this.condition = this._registerDataInput(\"condition\", RichTypeBoolean);\r\n this.loopBody = this._registerSignalOutput(\"loopBody\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n let conditionValue = this.condition.getValue(context);\r\n if (this._config?.isDo && !conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n }\r\n while (conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n conditionValue = this.condition.getValue(context);\r\n }\r\n this.onDone._activateSignal(context);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,12 @@
1
+ export * from "./flowGraphConditionalBlock";
2
+ export * from "./flowGraphDoNBlock";
3
+ export * from "./flowGraphForLoopBlock";
4
+ export * from "./flowGraphThrottleBlock";
5
+ export * from "./flowGraphTimerBlock";
6
+ export * from "./flowGraphMultiGateBlock";
7
+ export * from "./flowGraphSwitchBlock";
8
+ export * from "./flowGraphWaitAllBlock";
9
+ export * from "./flowGraphCounterBlock";
10
+ export * from "./flowGraphWhileLoopBlock";
11
+ export * from "./flowGraphDebounceBlock";
12
+ export * from "./flowGraphFlipFlopBlock";
@@ -0,0 +1,13 @@
1
+ export * from "./flowGraphConditionalBlock.js";
2
+ export * from "./flowGraphDoNBlock.js";
3
+ export * from "./flowGraphForLoopBlock.js";
4
+ export * from "./flowGraphThrottleBlock.js";
5
+ export * from "./flowGraphTimerBlock.js";
6
+ export * from "./flowGraphMultiGateBlock.js";
7
+ export * from "./flowGraphSwitchBlock.js";
8
+ export * from "./flowGraphWaitAllBlock.js";
9
+ export * from "./flowGraphCounterBlock.js";
10
+ export * from "./flowGraphWhileLoopBlock.js";
11
+ export * from "./flowGraphDebounceBlock.js";
12
+ export * from "./flowGraphFlipFlopBlock.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./flowGraphConditionalBlock\";\r\nexport * from \"./flowGraphDoNBlock\";\r\nexport * from \"./flowGraphForLoopBlock\";\r\nexport * from \"./flowGraphThrottleBlock\";\r\nexport * from \"./flowGraphTimerBlock\";\r\nexport * from \"./flowGraphMultiGateBlock\";\r\nexport * from \"./flowGraphSwitchBlock\";\r\nexport * from \"./flowGraphWaitAllBlock\";\r\nexport * from \"./flowGraphCounterBlock\";\r\nexport * from \"./flowGraphWhileLoopBlock\";\r\nexport * from \"./flowGraphDebounceBlock\";\r\nexport * from \"./flowGraphFlipFlopBlock\";\r\n"]}
@@ -8,7 +8,6 @@ export class FlowGraphLogBlock extends FlowGraphWithOnDoneExecutionBlock {
8
8
  constructor() {
9
9
  super();
10
10
  this.message = this._registerDataInput("message", RichTypeAny);
11
- this.message.value = "Hello World!";
12
11
  }
13
12
  /**
14
13
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iCAAiC;IAMpE;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,iCAAiC;QACjC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphLogBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n public constructor() {\r\n super();\r\n this.message = this._registerDataInput(\"message\", RichTypeAny);\r\n this.message.value = \"Hello World!\";\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const messageValue = this.message.getValue(context);\r\n console.log(messageValue);\r\n // activate the output flow block\r\n this.onDone._activateSignal(context);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphLogBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iCAAiC;IAMpE;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,iCAAiC;QACjC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\n\r\n/**\r\n * @experimental\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphLogBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The message to log.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n public constructor() {\r\n super();\r\n this.message = this._registerDataInput(\"message\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const messageValue = this.message.getValue(context);\r\n console.log(messageValue);\r\n // activate the output flow block\r\n this.onDone._activateSignal(context);\r\n }\r\n}\r\n"]}
@@ -1,10 +1,6 @@
1
1
  import type { FlowGraphContext } from "../../flowGraphContext";
2
2
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
3
  import { FlowGraphWithOnDoneExecutionBlock } from "../../flowGraphWithOnDoneExecutionBlock";
4
- export interface IFlowGraphSetVariableBlockParameter<T> {
5
- variableName?: string;
6
- input?: T;
7
- }
8
4
  /**
9
5
  * Block to set a variable.
10
6
  * @experimental
@@ -18,6 +14,6 @@ export declare class FlowGraphSetVariableBlock<T> extends FlowGraphWithOnDoneExe
18
14
  * Input connection: The value to set on the variable.
19
15
  */
20
16
  readonly input: FlowGraphDataConnection<T>;
21
- constructor(params?: IFlowGraphSetVariableBlockParameter<T>);
17
+ constructor();
22
18
  _execute(context: FlowGraphContext): void;
23
19
  }
@@ -5,20 +5,15 @@ import { FlowGraphWithOnDoneExecutionBlock } from "../../flowGraphWithOnDoneExec
5
5
  * @experimental
6
6
  */
7
7
  export class FlowGraphSetVariableBlock extends FlowGraphWithOnDoneExecutionBlock {
8
- constructor(params) {
8
+ constructor() {
9
9
  super();
10
10
  this.variableName = this._registerDataInput("variableName", RichTypeString);
11
- if ((params === null || params === void 0 ? void 0 : params.variableName) !== undefined) {
12
- this.variableName.value = params.variableName;
13
- }
14
11
  this.input = this._registerDataInput("input", RichTypeAny);
15
- if ((params === null || params === void 0 ? void 0 : params.input) !== undefined) {
16
- this.input.value = params.input;
17
- }
18
12
  }
19
13
  _execute(context) {
20
14
  const variableNameValue = this.variableName.getValue(context);
21
- context.setVariable(variableNameValue, this.input.getValue(context));
15
+ const inputValue = this.input.getValue(context);
16
+ context.setVariable(variableNameValue, inputValue);
22
17
  this.onDone._activateSignal(context);
23
18
  }
24
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAM5F;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,iCAAiC;IAU/E,YAAY,MAA+C;QACvD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC5E,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,MAAK,SAAS,EAAE;YACpC,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;SACjD;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC3D,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,MAAK,SAAS,EAAE;YAC7B,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;SACnC;IACL,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\n\r\nexport interface IFlowGraphSetVariableBlockParameter<T> {\r\n variableName?: string;\r\n input?: T;\r\n}\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The name of the variable to set.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Input connection: The value to set on the variable.\r\n */\r\n public readonly input: FlowGraphDataConnection<T>;\r\n\r\n constructor(params?: IFlowGraphSetVariableBlockParameter<T>) {\r\n super();\r\n\r\n this.variableName = this._registerDataInput(\"variableName\", RichTypeString);\r\n if (params?.variableName !== undefined) {\r\n this.variableName.value = params.variableName;\r\n }\r\n this.input = this._registerDataInput(\"input\", RichTypeAny);\r\n if (params?.input !== undefined) {\r\n this.input.value = params.input;\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n context.setVariable(variableNameValue, this.input.getValue(context));\r\n this.onDone._activateSignal(context);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphSetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAE5F;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,iCAAiC;IAU/E;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/D,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../flowGraphWithOnDoneExecutionBlock\";\r\n\r\n/**\r\n * Block to set a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphSetVariableBlock<T> extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The name of the variable to set.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Input connection: The value to set on the variable.\r\n */\r\n public readonly input: FlowGraphDataConnection<T>;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.variableName = this._registerDataInput(\"variableName\", RichTypeString);\r\n this.input = this._registerDataInput(\"input\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n const inputValue = this.input.getValue(context);\r\n context.setVariable(variableNameValue, inputValue);\r\n this.onDone._activateSignal(context);\r\n }\r\n}\r\n"]}
@@ -1,8 +1,6 @@
1
- export * from "./flowGraphForLoopBlock";
2
1
  export * from "./flowGraphLogBlock";
3
- export * from "./flowGraphConditionalBlock";
4
2
  export * from "./flowGraphSetVariableBlock";
5
3
  export * from "./flowGraphSetPropertyBlock";
6
- export * from "./flowGraphTimerBlock";
7
4
  export * from "./flowGraphSendCustomEventBlock";
5
+ export * from "./ControlFlow/index";
8
6
  export * from "./Animation/index";
@@ -1,10 +1,9 @@
1
- export * from "./flowGraphForLoopBlock.js";
2
1
  export * from "./flowGraphLogBlock.js";
3
- export * from "./flowGraphConditionalBlock.js";
4
2
  export * from "./flowGraphSetVariableBlock.js";
5
3
  export * from "./flowGraphSetPropertyBlock.js";
6
- export * from "./flowGraphTimerBlock.js";
7
4
  export * from "./flowGraphSendCustomEventBlock.js";
8
5
  // eslint-disable-next-line import/no-internal-modules
6
+ export * from "./ControlFlow/index.js";
7
+ // eslint-disable-next-line import/no-internal-modules
9
8
  export * from "./Animation/index.js";
10
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,sDAAsD;AACtD,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./flowGraphForLoopBlock\";\r\nexport * from \"./flowGraphLogBlock\";\r\nexport * from \"./flowGraphConditionalBlock\";\r\nexport * from \"./flowGraphSetVariableBlock\";\r\nexport * from \"./flowGraphSetPropertyBlock\";\r\nexport * from \"./flowGraphTimerBlock\";\r\nexport * from \"./flowGraphSendCustomEventBlock\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Animation/index\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,sDAAsD;AACtD,cAAc,qBAAqB,CAAC;AACpC,sDAAsD;AACtD,cAAc,mBAAmB,CAAC","sourcesContent":["export * from \"./flowGraphLogBlock\";\r\nexport * from \"./flowGraphSetVariableBlock\";\r\nexport * from \"./flowGraphSetPropertyBlock\";\r\nexport * from \"./flowGraphSendCustomEventBlock\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./ControlFlow/index\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Animation/index\";\r\n"]}
@@ -25,6 +25,10 @@ export declare class FlowGraphConnection<BlockT, ConnectedToT extends IConnectab
25
25
  protected _ownerBlock: BlockT;
26
26
  /** @internal */
27
27
  _connectedPoint: Array<ConnectedToT>;
28
+ /**
29
+ * A uniquely identifying string for the connection.
30
+ */
31
+ uniqueId: string;
28
32
  constructor(name: string, /** @internal */ _connectionType: FlowGraphConnectionType, _ownerBlock: BlockT);
29
33
  /**
30
34
  * The type of the connection
@@ -1,3 +1,4 @@
1
+ import { RandomGUID } from "../Misc/guid.js";
1
2
  /**
2
3
  * @experimental
3
4
  * The type of a connection point - inpput or output.
@@ -18,6 +19,10 @@ export class FlowGraphConnection {
18
19
  this._ownerBlock = _ownerBlock;
19
20
  /** @internal */
20
21
  this._connectedPoint = [];
22
+ /**
23
+ * A uniquely identifying string for the connection.
24
+ */
25
+ this.uniqueId = RandomGUID();
21
26
  }
22
27
  /**
23
28
  * The type of the connection
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConnection.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IAC/B,uEAAK,CAAA;IACL,yEAAM,CAAA;AACV,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAYD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAI5B,YAA0B,IAAY,EAAE,gBAAgB,CAAQ,eAAwC,EAAY,WAAmB;QAA7G,SAAI,GAAJ,IAAI,CAAQ;QAA0B,oBAAe,GAAf,eAAe,CAAyB;QAAY,gBAAW,GAAX,WAAW,CAAQ;QAHvI,gBAAgB;QACT,oBAAe,GAAwB,EAAE,CAAC;IAEyF,CAAC;IAE3I;;OAEG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,KAAmB;QAChC,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;SAC/E;QACD,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;YAC1I,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;SAClE;QACD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACJ","sourcesContent":["/**\r\n * @experimental\r\n * The type of a connection point - inpput or output.\r\n */\r\nexport enum FlowGraphConnectionType {\r\n Input,\r\n Output,\r\n}\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IConnectable {\r\n _connectedPoint: Array<IConnectable>;\r\n _isSingularConnection(): boolean;\r\n _connectionType: FlowGraphConnectionType;\r\n connectTo(point: IConnectable): void;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * The base connection class.\r\n */\r\nexport class FlowGraphConnection<BlockT, ConnectedToT extends IConnectable> implements IConnectable {\r\n /** @internal */\r\n public _connectedPoint: Array<ConnectedToT> = [];\r\n\r\n public constructor(public name: string, /** @internal */ public _connectionType: FlowGraphConnectionType, protected _ownerBlock: BlockT) {}\r\n\r\n /**\r\n * The type of the connection\r\n */\r\n public get connectionType() {\r\n return this._connectionType;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Override this to indicate if a point can connect to more than one point.\r\n */\r\n public _isSingularConnection(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns if a point is connected to any other point.\r\n * @returns boolean indicating if the point is connected.\r\n */\r\n public isConnected(): boolean {\r\n return this._connectedPoint.length > 0;\r\n }\r\n\r\n /**\r\n * Connects two points together.\r\n * @param point\r\n */\r\n public connectTo(point: ConnectedToT): void {\r\n if (this._connectionType === point._connectionType) {\r\n throw new Error(`Cannot connect two points of type ${this.connectionType}`);\r\n }\r\n if ((this._isSingularConnection() && this._connectedPoint.length > 0) || (point._isSingularConnection() && point._connectedPoint.length > 0)) {\r\n throw new Error(\"Max number of connections for point reached\");\r\n }\r\n this._connectedPoint.push(point);\r\n point._connectedPoint.push(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphConnection.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IAC/B,uEAAK,CAAA;IACL,yEAAM,CAAA;AACV,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAYD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAQ5B,YAA0B,IAAY,EAAE,gBAAgB,CAAQ,eAAwC,EAAY,WAAmB;QAA7G,SAAI,GAAJ,IAAI,CAAQ;QAA0B,oBAAe,GAAf,eAAe,CAAyB;QAAY,gBAAW,GAAX,WAAW,CAAQ;QAPvI,gBAAgB;QACT,oBAAe,GAAwB,EAAE,CAAC;QACjD;;WAEG;QACI,aAAQ,GAAG,UAAU,EAAE,CAAC;IAE2G,CAAC;IAE3I;;OAEG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,KAAmB;QAChC,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;SAC/E;QACD,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;YAC1I,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;SAClE;QACD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACJ","sourcesContent":["import { RandomGUID } from \"../Misc/guid\";\r\n\r\n/**\r\n * @experimental\r\n * The type of a connection point - inpput or output.\r\n */\r\nexport enum FlowGraphConnectionType {\r\n Input,\r\n Output,\r\n}\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IConnectable {\r\n _connectedPoint: Array<IConnectable>;\r\n _isSingularConnection(): boolean;\r\n _connectionType: FlowGraphConnectionType;\r\n connectTo(point: IConnectable): void;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * The base connection class.\r\n */\r\nexport class FlowGraphConnection<BlockT, ConnectedToT extends IConnectable> implements IConnectable {\r\n /** @internal */\r\n public _connectedPoint: Array<ConnectedToT> = [];\r\n /**\r\n * A uniquely identifying string for the connection.\r\n */\r\n public uniqueId = RandomGUID();\r\n\r\n public constructor(public name: string, /** @internal */ public _connectionType: FlowGraphConnectionType, protected _ownerBlock: BlockT) {}\r\n\r\n /**\r\n * The type of the connection\r\n */\r\n public get connectionType() {\r\n return this._connectionType;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Override this to indicate if a point can connect to more than one point.\r\n */\r\n public _isSingularConnection(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns if a point is connected to any other point.\r\n * @returns boolean indicating if the point is connected.\r\n */\r\n public isConnected(): boolean {\r\n return this._connectedPoint.length > 0;\r\n }\r\n\r\n /**\r\n * Connects two points together.\r\n * @param point\r\n */\r\n public connectTo(point: ConnectedToT): void {\r\n if (this._connectionType === point._connectionType) {\r\n throw new Error(`Cannot connect two points of type ${this.connectionType}`);\r\n }\r\n if ((this._isSingularConnection() && this._connectedPoint.length > 0) || (point._isSingularConnection() && point._connectedPoint.length > 0)) {\r\n throw new Error(\"Max number of connections for point reached\");\r\n }\r\n this._connectedPoint.push(point);\r\n point._connectedPoint.push(this);\r\n }\r\n}\r\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { Scene } from "../scene";
2
2
  import type { FlowGraphAsyncExecutionBlock } from "./flowGraphAsyncExecutionBlock";
3
3
  import type { FlowGraphBlock } from "./flowGraphBlock";
4
+ import type { FlowGraphDataConnection } from "./flowGraphDataConnection";
4
5
  import type { FlowGraphEventCoordinator } from "./flowGraphEventCoordinator";
5
6
  /**
6
7
  * Construction parameters for the context.
@@ -32,6 +33,10 @@ export declare class FlowGraphContext {
32
33
  * These are the variables set by the blocks.
33
34
  */
34
35
  private _executionVariables;
36
+ /**
37
+ * These are the values for the data connection points
38
+ */
39
+ private _connectionValues;
35
40
  /**
36
41
  * These are the variables set by the graph.
37
42
  */
@@ -59,7 +64,7 @@ export declare class FlowGraphContext {
59
64
  * @returns
60
65
  */
61
66
  getVariable(name: string): any;
62
- private _getBlockPrefixedName;
67
+ private _getUniqueIdPrefixedName;
63
68
  /**
64
69
  * Set an internal execution variable
65
70
  * @internal
@@ -73,8 +78,43 @@ export declare class FlowGraphContext {
73
78
  * @param name
74
79
  * @returns
75
80
  */
76
- _getExecutionVariable(block: FlowGraphBlock, name: string): any;
81
+ _getExecutionVariable(block: FlowGraphBlock, name: string, defaultValue?: any): any;
82
+ /**
83
+ * Delete an internal execution variable
84
+ * @internal
85
+ * @param block
86
+ * @param name
87
+ */
77
88
  _deleteExecutionVariable(block: FlowGraphBlock, name: string): void;
89
+ /**
90
+ * Check if an internal execution variable is defined
91
+ * @internal
92
+ * @param block
93
+ * @param name
94
+ * @returns
95
+ */
96
+ _hasExecutionVariable(block: FlowGraphBlock, name: string): boolean;
97
+ /**
98
+ * Check if a connection value is defined
99
+ * @internal
100
+ * @param connectionPoint
101
+ * @returns
102
+ */
103
+ _hasConnectionValue(connectionPoint: FlowGraphDataConnection<any>): boolean;
104
+ /**
105
+ * Set a connection value
106
+ * @internal
107
+ * @param connectionPoint
108
+ * @param value
109
+ */
110
+ _setConnectionValue<T>(connectionPoint: FlowGraphDataConnection<T>, value: T): void;
111
+ /**
112
+ * Get a connection value
113
+ * @internal
114
+ * @param connectionPoint
115
+ * @returns
116
+ */
117
+ _getConnectionValue<T>(connectionPoint: FlowGraphDataConnection<T>): T;
78
118
  /**
79
119
  * Get the graph set variables
80
120
  * @internal