@woosh/meep-engine 2.60.1 → 2.62.0
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.
- package/build/meep.cjs +20244 -20262
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +20244 -20262
- package/package.json +1 -1
- package/src/core/binary/BitSet.js +1 -1
- package/src/core/bvh2/BinaryNode.js +16 -13
- package/src/core/bvh2/LeafNode.js +6 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.js +81 -0
- package/src/core/geom/3d/aabb/AABB3.js +24 -36
- package/src/core/geom/3d/aabb/aabb3_array_compute_from_sphere.js +22 -0
- package/src/core/geom/3d/aabb/aabb3_array_intersects_sphere.js +22 -0
- package/src/core/geom/3d/aabb/aabb3_array_intersects_sphere_array.js +11 -0
- package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.js +28 -0
- package/src/core/geom/3d/aabb/serializeAABB3Quantized16Uint.js +19 -10
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +30 -182
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.spec.js +27 -1
- package/src/core/geom/3d/tetrahedra/delaunay/Cavity.js +3 -4
- package/src/core/geom/ConicRay.js +16 -21
- package/src/core/geom/ConicRay.spec.js +24 -0
- package/src/core/geom/packing/miniball/Miniball.js +68 -117
- package/src/core/geom/packing/miniball/Miniball.spec.js +3 -3
- package/src/core/geom/packing/miniball/Subspan.js +47 -34
- package/src/core/geom/packing/miniball/miniball_compute_quality.js +64 -0
- package/src/core/math/bessel_3.js +1 -0
- package/src/core/math/random/randomBytes.js +2 -2
- package/src/core/math/sqr.js +8 -0
- package/src/core/model/node-graph/Connection.js +21 -23
- package/src/core/model/node-graph/DataType.js +16 -17
- package/src/core/model/node-graph/NodeGraph.js +49 -50
- package/src/core/model/node-graph/node/NodeDescription.js +42 -44
- package/src/core/model/node-graph/node/NodeInstance.js +59 -60
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +27 -29
- package/src/core/model/node-graph/node/NodeRegistry.js +16 -18
- package/src/core/model/node-graph/node/Port.js +35 -37
- package/src/core/model/node-graph/node/parameter/NodeParameterDescription.js +27 -13
- package/src/core/path/computePathDirectory.spec.js +8 -0
- package/src/core/process/BaseProcess.d.ts +5 -0
- package/src/core/process/WatchDog.js +76 -75
- package/src/core/process/action/AsynchronousAction.js +24 -22
- package/src/core/process/executor/profile/Profile.js +34 -24
- package/src/core/process/executor/profile/TraceEvent.js +75 -75
- package/src/core/process/worker/OnDemandWorkerManager.js +27 -30
- package/src/core/process/worker/WorkerBuilder.js +149 -149
- package/src/core/process/worker/WorkerProxy.js +25 -21
- package/src/core/process/worker/extractTransferables.js +2 -2
- package/src/engine/Engine.js +58 -53
- package/src/engine/EngineConfiguration.d.ts +4 -4
- package/src/engine/ecs/EntityManager.js +517 -614
- package/src/engine/ecs/System.js +2 -2
- package/src/engine/ecs/foliage/ecs/Foliage2System.js +3 -0
- package/src/engine/ecs/foliage/ecs/InstancedMeshComponent.js +4 -1
- package/src/engine/ecs/foliage/ecs/convertInstancedMeshComponents2Entities.js +64 -0
- package/src/engine/ecs/foliage/ecs/{InstancedMeshUtils.js → optimizeIndividualMeshesEntitiesToInstances.js} +11 -70
- package/src/engine/ecs/transform/Transform.d.ts +7 -5
- package/src/engine/ecs/transform/Transform.js +30 -16
- package/src/engine/ecs/validateSystem.js +89 -0
- package/src/engine/graphics/GraphicsEngine.js +433 -483
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +42 -46
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +2 -2
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +49 -52
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +52 -56
- package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +20 -22
- package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.js +43 -25
- package/src/engine/graphics/particles/particular/engine/ParticularEngine.js +160 -180
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +37 -41
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +63 -67
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +46 -50
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +61 -65
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +48 -52
- package/src/engine/graphics/shadows/testShadowMapRendering.js +28 -32
- package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.spec.js +22 -20
- package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_linear.js +10 -13
- package/src/engine/graphics/texture/virtual/VirtualTexture.spec.js +1 -1
- package/src/engine/plugin/EnginePluginManager.d.ts +6 -1
- package/src/engine/sound/dB2Volume.js +8 -0
- package/src/engine/sound/ecs/emitter/SoundEmitter.js +125 -99
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +4 -42
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +31 -121
- package/src/engine/sound/volume2dB.js +8 -0
- package/src/generation/theme/ThemeEngine.js +19 -53
- package/src/engine/ecs/components/ClingToHeightMap.js +0 -19
- package/src/engine/ecs/components/SynchronizePosition.js +0 -15
- package/src/engine/ecs/systems/ClingToHeightMapSystem.js +0 -170
- package/src/engine/ecs/systems/SynchronizePositionSystem.js +0 -43
- package/src/engine/graphics/geometry/bvh/buffered/BVHFromBufferGeometry.js +0 -133
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import {assert} from "../../assert.js";
|
|
2
|
+
import {noop} from "../../function/Functions.js";
|
|
3
|
+
import {objectKeyByValue} from "../object/objectKeyByValue.js";
|
|
4
|
+
import {PortDirection} from "./node/PortDirection.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -10,25 +10,23 @@ import { PortDirection } from "./node/PortDirection.js";
|
|
|
10
10
|
let id_counter = 0;
|
|
11
11
|
|
|
12
12
|
export class Connection {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.target = null;
|
|
31
|
-
}
|
|
13
|
+
/**
|
|
14
|
+
* @readonly
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
id = id_counter++;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {NodeInstancePortReference}
|
|
22
|
+
*/
|
|
23
|
+
source = null;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {NodeInstancePortReference}
|
|
28
|
+
*/
|
|
29
|
+
target = null;
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
32
|
*
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {assert} from "../../assert.js";
|
|
2
2
|
|
|
3
3
|
export class DataType {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Unique integer identifier
|
|
7
|
+
* @type {number}
|
|
8
|
+
*/
|
|
9
|
+
id = 0;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Name is not guaranteed to be unique, it is intended mainly for debug purposes
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
name = "";
|
|
17
16
|
|
|
18
17
|
toString() {
|
|
19
18
|
return `DataType{ id=${this.id}, name='${this.name}' }`;
|
|
@@ -37,10 +36,10 @@ export class DataType {
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
toJSON() {
|
|
40
|
-
return {
|
|
39
|
+
return {...this};
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
fromJSON({
|
|
42
|
+
fromJSON({id, name}) {
|
|
44
43
|
assert.isNonNegativeInteger(id, 'id');
|
|
45
44
|
assert.isString(name, 'name');
|
|
46
45
|
|
|
@@ -53,7 +52,7 @@ export class DataType {
|
|
|
53
52
|
* @param {*} j
|
|
54
53
|
* @returns {DataType}
|
|
55
54
|
*/
|
|
56
|
-
static fromJSON(j){
|
|
55
|
+
static fromJSON(j) {
|
|
57
56
|
const r = new DataType();
|
|
58
57
|
|
|
59
58
|
r.fromJSON(j);
|
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {assert} from "../../assert.js";
|
|
2
|
+
import {array_push_if_unique} from "../../collection/array/array_push_if_unique.js";
|
|
3
|
+
import {array_remove_first} from "../../collection/array/array_remove_first.js";
|
|
2
4
|
import List from "../../collection/list/List.js";
|
|
3
5
|
import IdPool from "../../IdPool.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { array_remove_first } from "../../collection/array/array_remove_first.js";
|
|
8
|
-
import { PortDirection } from "./node/PortDirection.js";
|
|
6
|
+
import {Connection} from "./Connection.js";
|
|
7
|
+
import {NodeInstance} from "./node/NodeInstance.js";
|
|
8
|
+
import {PortDirection} from "./node/PortDirection.js";
|
|
9
9
|
|
|
10
10
|
export class NodeGraph {
|
|
11
|
-
constructor() {
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* @type {List<NodeInstance>}
|
|
15
|
-
*/
|
|
16
|
-
this.nodes = new List();
|
|
17
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @private
|
|
14
|
+
* @type {List<NodeInstance>}
|
|
15
|
+
*/
|
|
16
|
+
nodes = new List();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
* @type {List<Connection>}
|
|
21
|
+
*/
|
|
22
|
+
connections = new List();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {IdPool}
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
__idpNodes = new IdPool();
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {IdPool}
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
__idpConnections = new IdPool();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @readonly
|
|
40
|
+
*/
|
|
41
|
+
on = {
|
|
18
42
|
/**
|
|
19
|
-
* @
|
|
20
|
-
* @type {
|
|
43
|
+
* @readonly
|
|
44
|
+
* @type {Signal<NodeInstance,number>}
|
|
21
45
|
*/
|
|
22
|
-
this.
|
|
46
|
+
nodeAdded: this.nodes.on.added,
|
|
23
47
|
|
|
24
48
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {
|
|
27
|
-
* @private
|
|
49
|
+
* @readonly
|
|
50
|
+
* @type {Signal<NodeInstance,number>}
|
|
28
51
|
*/
|
|
29
|
-
this.
|
|
52
|
+
nodeRemoved: this.nodes.on.removed,
|
|
30
53
|
|
|
31
54
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @type {
|
|
34
|
-
* @private
|
|
55
|
+
* @readonly
|
|
56
|
+
* @type {Signal<Connection,number>}
|
|
35
57
|
*/
|
|
36
|
-
this.
|
|
58
|
+
connectionAdded: this.connections.on.added,
|
|
37
59
|
|
|
38
60
|
/**
|
|
39
61
|
* @readonly
|
|
62
|
+
* @type {Signal<Connection,number>}
|
|
40
63
|
*/
|
|
41
|
-
this.on
|
|
42
|
-
|
|
43
|
-
* @readonly
|
|
44
|
-
* @type {Signal<NodeInstance,number>}
|
|
45
|
-
*/
|
|
46
|
-
nodeAdded: this.nodes.on.added,
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @readonly
|
|
50
|
-
* @type {Signal<NodeInstance,number>}
|
|
51
|
-
*/
|
|
52
|
-
nodeRemoved: this.nodes.on.removed,
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @readonly
|
|
56
|
-
* @type {Signal<Connection,number>}
|
|
57
|
-
*/
|
|
58
|
-
connectionAdded: this.connections.on.added,
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @readonly
|
|
62
|
-
* @type {Signal<Connection,number>}
|
|
63
|
-
*/
|
|
64
|
-
connectionRemoved: this.connections.on.removed
|
|
65
|
-
};
|
|
66
|
-
}
|
|
64
|
+
connectionRemoved: this.connections.on.removed
|
|
65
|
+
};
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* Clear out all data from the graph
|
|
@@ -132,7 +131,7 @@ export class NodeGraph {
|
|
|
132
131
|
* @param {Connection[]} [connections]
|
|
133
132
|
* @returns {{connections:Connection[], nodes:NodeInstance[]}} local created instances
|
|
134
133
|
*/
|
|
135
|
-
mergeFragment({
|
|
134
|
+
mergeFragment({nodes, connections = []}) {
|
|
136
135
|
|
|
137
136
|
const previous_node_count = this.nodes.length;
|
|
138
137
|
const previous_connection_count = this.connections.length;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { NodeParameterDescription } from "./parameter/NodeParameterDescription.js";
|
|
4
|
-
import { Port } from "./Port.js";
|
|
5
|
-
import { PortDirection } from "./PortDirection.js";
|
|
1
|
+
import {assert} from "../../../assert.js";
|
|
2
|
+
import {isArrayEqual} from "../../../collection/array/isArrayEqual.js";
|
|
6
3
|
import Signal from "../../../events/signal/Signal.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import {invokeObjectToJSON} from "../../object/invokeObjectToJSON.js";
|
|
5
|
+
import {NodeParameterDataType} from "./parameter/NodeParameterDataType.js";
|
|
6
|
+
import {NodeParameterDescription} from "./parameter/NodeParameterDescription.js";
|
|
7
|
+
import {Port} from "./Port.js";
|
|
8
|
+
import {PortDirection} from "./PortDirection.js";
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -39,50 +39,48 @@ function pickNewSetId(things) {
|
|
|
39
39
|
let node_id_counter = 0;
|
|
40
40
|
|
|
41
41
|
export class NodeDescription {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.name = "";
|
|
42
|
+
/**
|
|
43
|
+
* Useful human-readable label
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
name = "";
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
/**
|
|
49
|
+
* A unique identifier in the scope of a single registry
|
|
50
|
+
* If two nodes belong to the same registry - they must have different IDs
|
|
51
|
+
* By default an auto-incrementing ID is assigned, as this ID is assigned at the time of object construction - it may be subject to race conditions
|
|
52
|
+
* In case nodes are loaded or constructed in async manner - consider using your own ID assignment scheme
|
|
53
|
+
* @type {number}
|
|
54
|
+
*/
|
|
55
|
+
id = node_id_counter++;
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @protected
|
|
59
|
+
* @type {Port[]}
|
|
60
|
+
*/
|
|
61
|
+
ports = [];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @type {NodeParameterDescription[]}
|
|
66
|
+
*/
|
|
67
|
+
parameters = [];
|
|
63
68
|
|
|
69
|
+
/**
|
|
70
|
+
* @readonly
|
|
71
|
+
*/
|
|
72
|
+
on = {
|
|
64
73
|
/**
|
|
65
|
-
*
|
|
66
|
-
* @type {
|
|
74
|
+
* @readonly
|
|
75
|
+
* @type {Signal<Port>}
|
|
67
76
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
portAdded: new Signal(),
|
|
70
78
|
/**
|
|
71
79
|
* @readonly
|
|
80
|
+
* @type {Signal<Port>}
|
|
72
81
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* @readonly
|
|
76
|
-
* @type {Signal<Port>}
|
|
77
|
-
*/
|
|
78
|
-
portAdded: new Signal(),
|
|
79
|
-
/**
|
|
80
|
-
* @readonly
|
|
81
|
-
* @type {Signal<Port>}
|
|
82
|
-
*/
|
|
83
|
-
portRemoved: new Signal()
|
|
84
|
-
};
|
|
85
|
-
}
|
|
82
|
+
portRemoved: new Signal()
|
|
83
|
+
};
|
|
86
84
|
|
|
87
85
|
/**
|
|
88
86
|
* Perform additional processing on the node instance
|
|
@@ -382,7 +380,7 @@ export class NodeDescription {
|
|
|
382
380
|
* @param name
|
|
383
381
|
* @param {NodeRegistry} registry
|
|
384
382
|
*/
|
|
385
|
-
fromJSON({
|
|
383
|
+
fromJSON({ports, id, name}, registry) {
|
|
386
384
|
this.id = id;
|
|
387
385
|
this.name = name;
|
|
388
386
|
this.ports = ports.map(p => Port.fromJSON(p, registry));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {assert} from "../../../assert.js";
|
|
2
|
+
import {isArrayEqual} from "../../../collection/array/isArrayEqual.js";
|
|
2
3
|
import List from "../../../collection/list/List.js";
|
|
3
|
-
import { NodeInstancePortReference } from "./NodeInstancePortReference.js";
|
|
4
|
-
import { PortDirection } from "./PortDirection.js";
|
|
5
|
-
import { isArrayEqual } from "../../../collection/array/isArrayEqual.js";
|
|
6
|
-
import { objectDeepEquals } from "../../object/objectDeepEquals.js";
|
|
7
4
|
import Signal from "../../../events/signal/Signal.js";
|
|
5
|
+
import {objectDeepEquals} from "../../object/objectDeepEquals.js";
|
|
6
|
+
import {NodeInstancePortReference} from "./NodeInstancePortReference.js";
|
|
7
|
+
import {PortDirection} from "./PortDirection.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
@@ -13,73 +13,72 @@ import Signal from "../../../events/signal/Signal.js";
|
|
|
13
13
|
let id_counter = 0;
|
|
14
14
|
|
|
15
15
|
export class NodeInstance {
|
|
16
|
-
constructor() {
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
this.id = id_counter++;
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @type {number}
|
|
20
|
+
*/
|
|
21
|
+
id = id_counter++;
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {NodeDescription}
|
|
26
|
+
*/
|
|
27
|
+
description = null;
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {NodeInstancePortReference[]}
|
|
32
|
+
*/
|
|
33
|
+
endpoints = [];
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Internal instance data
|
|
37
|
+
* @type {Object}
|
|
38
|
+
*/
|
|
39
|
+
parameters = {};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @transient
|
|
43
|
+
* @type {Array}
|
|
44
|
+
*/
|
|
45
|
+
outputsValues = [];
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {List<Connection>}
|
|
50
|
+
*/
|
|
51
|
+
connections = new List();
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Extra ports that are present just on this instance, these exist in addition to ports from the description
|
|
55
|
+
* IDs of these ports must not collide with IDs of ports on the description
|
|
56
|
+
* TODO implement functionality
|
|
57
|
+
* @protected
|
|
58
|
+
* @type {Port[]}
|
|
59
|
+
*/
|
|
60
|
+
dynamicPorts = [];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @readonly
|
|
64
|
+
*/
|
|
65
|
+
on = {
|
|
47
66
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @type {
|
|
67
|
+
* @readonly
|
|
68
|
+
* @type {Signal<string, *, *>}
|
|
50
69
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
parameterChanged: new Signal(),
|
|
53
71
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* TODO implement functionality
|
|
57
|
-
* @protected
|
|
58
|
-
* @type {Port[]}
|
|
72
|
+
* @readonly
|
|
73
|
+
* @type {Signal<string, *>}
|
|
59
74
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
75
|
+
parameterAdded: new Signal(),
|
|
62
76
|
/**
|
|
63
77
|
* @readonly
|
|
78
|
+
* @type {Signal<string, *>}
|
|
64
79
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* @readonly
|
|
68
|
-
* @type {Signal<string, *, *>}
|
|
69
|
-
*/
|
|
70
|
-
parameterChanged: new Signal(),
|
|
71
|
-
/**
|
|
72
|
-
* @readonly
|
|
73
|
-
* @type {Signal<string, *>}
|
|
74
|
-
*/
|
|
75
|
-
parameterAdded: new Signal(),
|
|
76
|
-
/**
|
|
77
|
-
* @readonly
|
|
78
|
-
* @type {Signal<string, *>}
|
|
79
|
-
*/
|
|
80
|
-
parameterRemoved: new Signal(),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
80
|
+
parameterRemoved: new Signal(),
|
|
81
|
+
};
|
|
83
82
|
|
|
84
83
|
/**
|
|
85
84
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {assert} from "../../../assert.js";
|
|
2
|
+
import {computeHashIntegerArray} from "../../../collection/array/computeHashIntegerArray.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
@@ -12,33 +12,31 @@ let id_counter = 0;
|
|
|
12
12
|
*/
|
|
13
13
|
export class NodeInstancePortReference {
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.connections = [];
|
|
41
|
-
}
|
|
15
|
+
/**
|
|
16
|
+
* @readonly
|
|
17
|
+
* @type {number}
|
|
18
|
+
*/
|
|
19
|
+
id = id_counter++;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @readonly
|
|
23
|
+
* @type {NodeInstance}
|
|
24
|
+
*/
|
|
25
|
+
instance = null;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @readonly
|
|
29
|
+
* @type {Port}
|
|
30
|
+
*/
|
|
31
|
+
port = null;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Attached connections
|
|
35
|
+
* NOTE: Maintained by NodeGraph, do not modify
|
|
36
|
+
* @readonly
|
|
37
|
+
* @type {Connection[]}
|
|
38
|
+
*/
|
|
39
|
+
connections = [];
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
42
|
* Outgoing connections
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import {assert} from "../../../assert.js";
|
|
2
|
+
import {BitSet} from "../../../binary/BitSet.js";
|
|
3
|
+
import {DataType} from "../DataType.js";
|
|
4
|
+
import {NodeDescription} from "./NodeDescription.js";
|
|
5
|
+
import {Port} from "./Port.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -14,19 +14,17 @@ function getPortType(port) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export class NodeRegistry {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.types = new Map();
|
|
29
|
-
}
|
|
17
|
+
/**
|
|
18
|
+
* ID -> Node mapping
|
|
19
|
+
* @type {Map<number, NodeDescription>}
|
|
20
|
+
*/
|
|
21
|
+
nodes = new Map();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* ID -> DataType mapping
|
|
25
|
+
* @type {Map<number, DataType>}
|
|
26
|
+
*/
|
|
27
|
+
types = new Map();
|
|
30
28
|
|
|
31
29
|
/**
|
|
32
30
|
* @returns {NodeDescription[]}
|