@lionweb/delta-protocol-test-cli 0.0.1-alpha.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.
@@ -0,0 +1,1086 @@
1
+ // Copyright 2025 TRUMPF Laser SE and other contributors
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License")
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ // SPDX-FileCopyrightText: 2025 TRUMPF Laser SE and other contributors
16
+ // SPDX-License-Identifier: Apache-2.0
17
+
18
+ // Warning: this file is generated!
19
+ // Modifying it by hand is useless at best, and sabotage at worst.
20
+
21
+ /*
22
+ * language's metadata:
23
+ * name: Shapes
24
+ * version: 1
25
+ * key: key-Shapes
26
+ * id: id-Shapes
27
+ */
28
+
29
+
30
+ import {
31
+ Annotation,
32
+ Classifier,
33
+ Concept,
34
+ Containment,
35
+ Enumeration,
36
+ EnumerationLiteral,
37
+ Interface,
38
+ Language,
39
+ PrimitiveType,
40
+ Property,
41
+ Reference,
42
+ SingleRef
43
+ } from "@lionweb/core";
44
+
45
+ import {
46
+ LionWebId
47
+ } from "@lionweb/json";
48
+
49
+ import {
50
+ ContainmentValueManager,
51
+ DeltaHandler,
52
+ ILanguageBase,
53
+ INamed,
54
+ INodeBase,
55
+ LionCore_builtinsBase,
56
+ NodeBase,
57
+ NodeBaseFactory,
58
+ OptionalMultiContainmentValueManager,
59
+ OptionalMultiReferenceValueManager,
60
+ OptionalPropertyValueManager,
61
+ OptionalSingleContainmentValueManager,
62
+ OptionalSingleReferenceValueManager,
63
+ Parentage,
64
+ PropertyValueManager,
65
+ ReferenceValueManager,
66
+ RequiredMultiContainmentValueManager,
67
+ RequiredMultiReferenceValueManager,
68
+ RequiredPropertyValueManager,
69
+ RequiredSingleContainmentValueManager,
70
+ RequiredSingleReferenceValueManager
71
+ } from "@lionweb/class-core";
72
+
73
+
74
+ export class ShapesBase implements ILanguageBase {
75
+
76
+ private readonly _language: Language = new Language("Shapes", "1", "id-Shapes", "key-Shapes");
77
+ get language(): Language {
78
+ this.ensureWiredUp();
79
+ return this._language;
80
+ }
81
+
82
+ public readonly _Circle = new Concept(this._language, "Circle", "key-Circle", "id-Circle", false);
83
+ get Circle(): Concept {
84
+ this.ensureWiredUp();
85
+ return this._Circle;
86
+ }
87
+ private readonly _Circle_r = new Property(this._Circle, "r", "key-r", "id-r");
88
+ get Circle_r(): Property {
89
+ this.ensureWiredUp();
90
+ return this._Circle_r;
91
+ }
92
+ private readonly _Circle_center = new Containment(this._Circle, "center", "key-center", "id-center");
93
+ get Circle_center(): Containment {
94
+ this.ensureWiredUp();
95
+ return this._Circle_center;
96
+ }
97
+
98
+ public readonly _Coord = new Concept(this._language, "Coord", "key-Coord", "id-Coord", false);
99
+ get Coord(): Concept {
100
+ this.ensureWiredUp();
101
+ return this._Coord;
102
+ }
103
+ private readonly _Coord_x = new Property(this._Coord, "x", "key-x", "id-x");
104
+ get Coord_x(): Property {
105
+ this.ensureWiredUp();
106
+ return this._Coord_x;
107
+ }
108
+ private readonly _Coord_y = new Property(this._Coord, "y", "key-y", "id-y");
109
+ get Coord_y(): Property {
110
+ this.ensureWiredUp();
111
+ return this._Coord_y;
112
+ }
113
+ private readonly _Coord_z = new Property(this._Coord, "z", "key-z", "id-z");
114
+ get Coord_z(): Property {
115
+ this.ensureWiredUp();
116
+ return this._Coord_z;
117
+ }
118
+
119
+ public readonly _Geometry = new Concept(this._language, "Geometry", "key-Geometry", "id-Geometry", false).isPartition();
120
+ get Geometry(): Concept {
121
+ this.ensureWiredUp();
122
+ return this._Geometry;
123
+ }
124
+ private readonly _Geometry_shapes = new Containment(this._Geometry, "shapes", "key-shapes", "id-shapes").isOptional().isMultiple();
125
+ get Geometry_shapes(): Containment {
126
+ this.ensureWiredUp();
127
+ return this._Geometry_shapes;
128
+ }
129
+ private readonly _Geometry_documentation = new Containment(this._Geometry, "documentation", "key-documentation", "id-documentation").isOptional();
130
+ get Geometry_documentation(): Containment {
131
+ this.ensureWiredUp();
132
+ return this._Geometry_documentation;
133
+ }
134
+
135
+ public readonly _IShape = new Interface(this._language, "IShape", "key-IShape", "id-IShape");
136
+ get IShape(): Interface {
137
+ this.ensureWiredUp();
138
+ return this._IShape;
139
+ }
140
+ private readonly _IShape_uuid = new Property(this._IShape, "uuid", "key-uuid", "id-uuid");
141
+ get IShape_uuid(): Property {
142
+ this.ensureWiredUp();
143
+ return this._IShape_uuid;
144
+ }
145
+ private readonly _IShape_fixpoints = new Containment(this._IShape, "fixpoints", "key-fixpoints", "id-fixpoints").isOptional().isMultiple();
146
+ get IShape_fixpoints(): Containment {
147
+ this.ensureWiredUp();
148
+ return this._IShape_fixpoints;
149
+ }
150
+
151
+ public readonly _Line = new Concept(this._language, "Line", "key-Line", "id-Line", false);
152
+ get Line(): Concept {
153
+ this.ensureWiredUp();
154
+ return this._Line;
155
+ }
156
+ private readonly _Line_start = new Containment(this._Line, "start", "key-start", "id-start");
157
+ get Line_start(): Containment {
158
+ this.ensureWiredUp();
159
+ return this._Line_start;
160
+ }
161
+ private readonly _Line_end = new Containment(this._Line, "end", "key-end", "id-end");
162
+ get Line_end(): Containment {
163
+ this.ensureWiredUp();
164
+ return this._Line_end;
165
+ }
166
+
167
+ public readonly _OffsetDuplicate = new Concept(this._language, "OffsetDuplicate", "key-OffsetDuplicate", "id-OffsetDuplicate", false);
168
+ get OffsetDuplicate(): Concept {
169
+ this.ensureWiredUp();
170
+ return this._OffsetDuplicate;
171
+ }
172
+ private readonly _OffsetDuplicate_offset = new Containment(this._OffsetDuplicate, "offset", "key-offset", "id-offset");
173
+ get OffsetDuplicate_offset(): Containment {
174
+ this.ensureWiredUp();
175
+ return this._OffsetDuplicate_offset;
176
+ }
177
+ private readonly _OffsetDuplicate_source = new Reference(this._OffsetDuplicate, "source", "key-source", "id-source");
178
+ get OffsetDuplicate_source(): Reference {
179
+ this.ensureWiredUp();
180
+ return this._OffsetDuplicate_source;
181
+ }
182
+ private readonly _OffsetDuplicate_altSource = new Reference(this._OffsetDuplicate, "altSource", "key-alt-source", "id-alt-source").isOptional();
183
+ get OffsetDuplicate_altSource(): Reference {
184
+ this.ensureWiredUp();
185
+ return this._OffsetDuplicate_altSource;
186
+ }
187
+ private readonly _OffsetDuplicate_docs = new Containment(this._OffsetDuplicate, "docs", "key-docs", "id-docs").isOptional();
188
+ get OffsetDuplicate_docs(): Containment {
189
+ this.ensureWiredUp();
190
+ return this._OffsetDuplicate_docs;
191
+ }
192
+ private readonly _OffsetDuplicate_secretDocs = new Containment(this._OffsetDuplicate, "secretDocs", "key-secret-docs", "id-secret-docs").isOptional();
193
+ get OffsetDuplicate_secretDocs(): Containment {
194
+ this.ensureWiredUp();
195
+ return this._OffsetDuplicate_secretDocs;
196
+ }
197
+
198
+ public readonly _Shape = new Concept(this._language, "Shape", "key-Shape", "id-Shape", true);
199
+ get Shape(): Concept {
200
+ this.ensureWiredUp();
201
+ return this._Shape;
202
+ }
203
+ private readonly _Shape_shapeDocs = new Containment(this._Shape, "shapeDocs", "key-shape-docs", "id-shape-docs").isOptional();
204
+ get Shape_shapeDocs(): Containment {
205
+ this.ensureWiredUp();
206
+ return this._Shape_shapeDocs;
207
+ }
208
+
209
+ public readonly _CompositeShape = new Concept(this._language, "CompositeShape", "key-CompositeShape", "id-CompositeShape", false);
210
+ get CompositeShape(): Concept {
211
+ this.ensureWiredUp();
212
+ return this._CompositeShape;
213
+ }
214
+ private readonly _CompositeShape_parts = new Containment(this._CompositeShape, "parts", "key-parts", "id-parts").isMultiple();
215
+ get CompositeShape_parts(): Containment {
216
+ this.ensureWiredUp();
217
+ return this._CompositeShape_parts;
218
+ }
219
+ private readonly _CompositeShape_disabledParts = new Containment(this._CompositeShape, "disabledParts", "key-disabled-parts", "id-disabled-parts").isMultiple();
220
+ get CompositeShape_disabledParts(): Containment {
221
+ this.ensureWiredUp();
222
+ return this._CompositeShape_disabledParts;
223
+ }
224
+ private readonly _CompositeShape_evilPart = new Containment(this._CompositeShape, "evilPart", "key-evil-part", "id-evil-part");
225
+ get CompositeShape_evilPart(): Containment {
226
+ this.ensureWiredUp();
227
+ return this._CompositeShape_evilPart;
228
+ }
229
+
230
+ public readonly _ReferenceGeometry = new Concept(this._language, "ReferenceGeometry", "key-ReferenceGeometry", "id-ReferenceGeometry", false).isPartition();
231
+ get ReferenceGeometry(): Concept {
232
+ this.ensureWiredUp();
233
+ return this._ReferenceGeometry;
234
+ }
235
+ private readonly _ReferenceGeometry_shapes = new Reference(this._ReferenceGeometry, "shapes", "key-shapes-references", "id-shape-references").isOptional().isMultiple();
236
+ get ReferenceGeometry_shapes(): Reference {
237
+ this.ensureWiredUp();
238
+ return this._ReferenceGeometry_shapes;
239
+ }
240
+
241
+ public readonly _Documentation = new Annotation(this._language, "Documentation", "key-Documentation", "id-Documentation");
242
+ get Documentation(): Annotation {
243
+ this.ensureWiredUp();
244
+ return this._Documentation;
245
+ }
246
+ private readonly _Documentation_text = new Property(this._Documentation, "text", "key-text", "id-text").isOptional();
247
+ get Documentation_text(): Property {
248
+ this.ensureWiredUp();
249
+ return this._Documentation_text;
250
+ }
251
+ private readonly _Documentation_technical = new Property(this._Documentation, "technical", "key-technical", "id-technical").isOptional();
252
+ get Documentation_technical(): Property {
253
+ this.ensureWiredUp();
254
+ return this._Documentation_technical;
255
+ }
256
+
257
+ public readonly _BillOfMaterials = new Annotation(this._language, "BillOfMaterials", "key-BillOfMaterials", "id-BillOfMaterials");
258
+ get BillOfMaterials(): Annotation {
259
+ this.ensureWiredUp();
260
+ return this._BillOfMaterials;
261
+ }
262
+ private readonly _BillOfMaterials_materials = new Reference(this._BillOfMaterials, "materials", "key-materials", "id-materials").isOptional().isMultiple();
263
+ get BillOfMaterials_materials(): Reference {
264
+ this.ensureWiredUp();
265
+ return this._BillOfMaterials_materials;
266
+ }
267
+ private readonly _BillOfMaterials_groups = new Containment(this._BillOfMaterials, "groups", "key-groups", "id-groups").isOptional().isMultiple();
268
+ get BillOfMaterials_groups(): Containment {
269
+ this.ensureWiredUp();
270
+ return this._BillOfMaterials_groups;
271
+ }
272
+ private readonly _BillOfMaterials_altGroups = new Containment(this._BillOfMaterials, "altGroups", "key-alt-groups", "id-alt-groups").isOptional().isMultiple();
273
+ get BillOfMaterials_altGroups(): Containment {
274
+ this.ensureWiredUp();
275
+ return this._BillOfMaterials_altGroups;
276
+ }
277
+ private readonly _BillOfMaterials_defaultGroup = new Containment(this._BillOfMaterials, "defaultGroup", "key-default-group", "id-default-group").isOptional();
278
+ get BillOfMaterials_defaultGroup(): Containment {
279
+ this.ensureWiredUp();
280
+ return this._BillOfMaterials_defaultGroup;
281
+ }
282
+
283
+ public readonly _MaterialGroup = new Concept(this._language, "MaterialGroup", "key-MaterialGroup", "id-MaterialGroup", false);
284
+ get MaterialGroup(): Concept {
285
+ this.ensureWiredUp();
286
+ return this._MaterialGroup;
287
+ }
288
+ private readonly _MaterialGroup_matterState = new Property(this._MaterialGroup, "matterState", "key-matter-state", "id-matter-state").isOptional();
289
+ get MaterialGroup_matterState(): Property {
290
+ this.ensureWiredUp();
291
+ return this._MaterialGroup_matterState;
292
+ }
293
+ private readonly _MaterialGroup_materials = new Reference(this._MaterialGroup, "materials", "key-group-materials", "id-group-materials").isMultiple();
294
+ get MaterialGroup_materials(): Reference {
295
+ this.ensureWiredUp();
296
+ return this._MaterialGroup_materials;
297
+ }
298
+ private readonly _MaterialGroup_defaultShape = new Containment(this._MaterialGroup, "defaultShape", "key-default-shape", "id-default-shape").isOptional();
299
+ get MaterialGroup_defaultShape(): Containment {
300
+ this.ensureWiredUp();
301
+ return this._MaterialGroup_defaultShape;
302
+ }
303
+
304
+ public readonly _MatterState = new Enumeration(this._language, "MatterState", "key-MatterState", "id-MatterState");
305
+ get MatterState(): Enumeration {
306
+ this.ensureWiredUp();
307
+ return this._MatterState;
308
+ }
309
+ private readonly _MatterState_solid = new EnumerationLiteral(this._MatterState, "solid", "key-solid", "id-solid");
310
+ get MatterState_solid(): EnumerationLiteral {
311
+ this.ensureWiredUp();
312
+ return this._MatterState_solid;
313
+ }
314
+ private readonly _MatterState_liquid = new EnumerationLiteral(this._MatterState, "liquid", "key-liquid", "id-liquid");
315
+ get MatterState_liquid(): EnumerationLiteral {
316
+ this.ensureWiredUp();
317
+ return this._MatterState_liquid;
318
+ }
319
+ private readonly _MatterState_gas = new EnumerationLiteral(this._MatterState, "gas", "key-gas", "id-gas");
320
+ get MatterState_gas(): EnumerationLiteral {
321
+ this.ensureWiredUp();
322
+ return this._MatterState_gas;
323
+ }
324
+
325
+ public readonly _Time = new PrimitiveType(this._language, "Time", "key-Time", "id-Time");
326
+ get Time(): PrimitiveType {
327
+ this.ensureWiredUp();
328
+ return this._Time;
329
+ }
330
+
331
+ private _wiredUp: boolean = false;
332
+ private ensureWiredUp() {
333
+ if (this._wiredUp) {
334
+ return;
335
+ }
336
+ this._language.havingEntities(this._Circle, this._Coord, this._Geometry, this._IShape, this._Line, this._OffsetDuplicate, this._Shape, this._CompositeShape, this._ReferenceGeometry, this._Documentation, this._BillOfMaterials, this._MaterialGroup, this._MatterState, this._Time);
337
+ this._Circle.extends = this._Shape;
338
+ this._Circle.havingFeatures(this._Circle_r, this._Circle_center);
339
+ this._Circle_r.ofType(LionCore_builtinsBase.INSTANCE._Integer);
340
+ this._Circle_center.ofType(this._Coord);
341
+ this._Coord.havingFeatures(this._Coord_x, this._Coord_y, this._Coord_z);
342
+ this._Coord_x.ofType(LionCore_builtinsBase.INSTANCE._Integer);
343
+ this._Coord_y.ofType(LionCore_builtinsBase.INSTANCE._Integer);
344
+ this._Coord_z.ofType(LionCore_builtinsBase.INSTANCE._Integer);
345
+ this._Geometry.havingFeatures(this._Geometry_shapes, this._Geometry_documentation);
346
+ this._Geometry_shapes.ofType(this._IShape);
347
+ this._Geometry_documentation.ofType(this._Documentation);
348
+ this._IShape.havingFeatures(this._IShape_uuid, this._IShape_fixpoints);
349
+ this._IShape_uuid.ofType(LionCore_builtinsBase.INSTANCE._String);
350
+ this._IShape_fixpoints.ofType(this._Coord);
351
+ this._Line.extends = this._Shape;
352
+ this._Line.implementing(LionCore_builtinsBase.INSTANCE._INamed);
353
+ this._Line.havingFeatures(this._Line_start, this._Line_end);
354
+ this._Line_start.ofType(this._Coord);
355
+ this._Line_end.ofType(this._Coord);
356
+ this._OffsetDuplicate.extends = this._Shape;
357
+ this._OffsetDuplicate.havingFeatures(this._OffsetDuplicate_offset, this._OffsetDuplicate_source, this._OffsetDuplicate_altSource, this._OffsetDuplicate_docs, this._OffsetDuplicate_secretDocs);
358
+ this._OffsetDuplicate_offset.ofType(this._Coord);
359
+ this._OffsetDuplicate_source.ofType(this._Shape);
360
+ this._OffsetDuplicate_altSource.ofType(this._Shape);
361
+ this._OffsetDuplicate_docs.ofType(this._Documentation);
362
+ this._OffsetDuplicate_secretDocs.ofType(this._Documentation);
363
+ this._Shape.implementing(LionCore_builtinsBase.INSTANCE._INamed, this._IShape);
364
+ this._Shape.havingFeatures(this._Shape_shapeDocs);
365
+ this._Shape_shapeDocs.ofType(this._Documentation);
366
+ this._CompositeShape.extends = this._Shape;
367
+ this._CompositeShape.havingFeatures(this._CompositeShape_parts, this._CompositeShape_disabledParts, this._CompositeShape_evilPart);
368
+ this._CompositeShape_parts.ofType(this._IShape);
369
+ this._CompositeShape_disabledParts.ofType(this._IShape);
370
+ this._CompositeShape_evilPart.ofType(this._IShape);
371
+ this._ReferenceGeometry.havingFeatures(this._ReferenceGeometry_shapes);
372
+ this._ReferenceGeometry_shapes.ofType(this._IShape);
373
+ this._Documentation.havingFeatures(this._Documentation_text, this._Documentation_technical);
374
+ this._Documentation_text.ofType(LionCore_builtinsBase.INSTANCE._String).isOptional();
375
+ this._Documentation_technical.ofType(LionCore_builtinsBase.INSTANCE._Boolean).isOptional();
376
+ this._BillOfMaterials.havingFeatures(this._BillOfMaterials_materials, this._BillOfMaterials_groups, this._BillOfMaterials_altGroups, this._BillOfMaterials_defaultGroup);
377
+ this._BillOfMaterials_materials.ofType(this._IShape);
378
+ this._BillOfMaterials_groups.ofType(this._MaterialGroup);
379
+ this._BillOfMaterials_altGroups.ofType(this._MaterialGroup);
380
+ this._BillOfMaterials_defaultGroup.ofType(this._MaterialGroup);
381
+ this._MaterialGroup.havingFeatures(this._MaterialGroup_matterState, this._MaterialGroup_materials, this._MaterialGroup_defaultShape);
382
+ this._MaterialGroup_matterState.ofType(this._MatterState).isOptional();
383
+ this._MaterialGroup_materials.ofType(this._IShape);
384
+ this._MaterialGroup_defaultShape.ofType(this._IShape);
385
+ this._MatterState.havingLiterals(this._MatterState_solid, this._MatterState_liquid, this._MatterState_gas);
386
+ this._wiredUp = true;
387
+ }
388
+
389
+ factory(handleDelta?: DeltaHandler): NodeBaseFactory {
390
+ return (classifier: Classifier, id: LionWebId) => {
391
+ switch (classifier.key) {
392
+ case this._Circle.key: return Circle.create(id, handleDelta);
393
+ case this._Coord.key: return Coord.create(id, handleDelta);
394
+ case this._Geometry.key: return Geometry.create(id, handleDelta);
395
+ case this._Line.key: return Line.create(id, handleDelta);
396
+ case this._OffsetDuplicate.key: return OffsetDuplicate.create(id, handleDelta);
397
+ case this._CompositeShape.key: return CompositeShape.create(id, handleDelta);
398
+ case this._ReferenceGeometry.key: return ReferenceGeometry.create(id, handleDelta);
399
+ case this._Documentation.key: return Documentation.create(id, handleDelta);
400
+ case this._BillOfMaterials.key: return BillOfMaterials.create(id, handleDelta);
401
+ case this._MaterialGroup.key: return MaterialGroup.create(id, handleDelta);
402
+ default: {
403
+ const {language} = classifier;
404
+ throw new Error(`can't instantiate ${classifier.name} (key=${classifier.key}): classifier is not known in language ${language.name} (key=${language.key}, version=${language.version})`);
405
+ }
406
+ }
407
+ }
408
+ }
409
+
410
+ enumLiteralFrom<EnumType>(enumerationLiteral: EnumerationLiteral): EnumType {
411
+ const {enumeration} = enumerationLiteral;
412
+ if (enumeration.key === this._MatterState.key) {
413
+ return enumerationLiteral.key as EnumType;
414
+ }
415
+ const {language} = enumeration;
416
+ throw new Error(`enumeration with key ${enumeration.key} is not known in language ${language.name} (key=${language.key}, version=${language.version})`);
417
+ }
418
+
419
+ public static readonly INSTANCE = new ShapesBase();
420
+ }
421
+
422
+
423
+ export abstract class Shape extends NodeBase implements INamed, IShape {
424
+
425
+ private readonly _shapeDocs: OptionalSingleContainmentValueManager<Documentation>;
426
+ get shapeDocs(): Documentation | undefined {
427
+ return this._shapeDocs.get();
428
+ }
429
+ set shapeDocs(newValue: Documentation | undefined) {
430
+ this._shapeDocs.set(newValue);
431
+ }
432
+ replaceShapeDocsWith(newValue: Documentation) {
433
+ this._shapeDocs.replaceWith(newValue);
434
+ }
435
+
436
+ private readonly _name: RequiredPropertyValueManager<string>;
437
+ get name(): string {
438
+ return this._name.get();
439
+ }
440
+ set name(newValue: string) {
441
+ this._name.set(newValue);
442
+ }
443
+
444
+ private readonly _uuid: RequiredPropertyValueManager<string>;
445
+ get uuid(): string {
446
+ return this._uuid.get();
447
+ }
448
+ set uuid(newValue: string) {
449
+ this._uuid.set(newValue);
450
+ }
451
+
452
+ private readonly _fixpoints: OptionalMultiContainmentValueManager<Coord>;
453
+ get fixpoints(): Coord[] {
454
+ return this._fixpoints.get();
455
+ }
456
+ addFixpoints(newValue: Coord) {
457
+ this._fixpoints.add(newValue);
458
+ }
459
+ removeFixpoints(valueToRemove: Coord) {
460
+ this._fixpoints.remove(valueToRemove);
461
+ }
462
+ addFixpointsAtIndex(newValue: Coord, index: number) {
463
+ this._fixpoints.insertAtIndex(newValue, index);
464
+ }
465
+ moveFixpoints(oldIndex: number, newIndex: number) {
466
+ this._fixpoints.move(oldIndex, newIndex);
467
+ }
468
+ replaceFixpointsAtIndex(movedChild: Coord, newIndex: number) {
469
+ this._fixpoints.replaceAtIndex(movedChild, newIndex);
470
+ }
471
+
472
+ protected constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
473
+ super(classifier, id, handleDelta, parentInfo);
474
+ this._shapeDocs = new OptionalSingleContainmentValueManager<Documentation>(ShapesBase.INSTANCE.Shape_shapeDocs, this);
475
+ this._name = new RequiredPropertyValueManager<string>(LionCore_builtinsBase.INSTANCE.INamed_name, this);
476
+ this._uuid = new RequiredPropertyValueManager<string>(ShapesBase.INSTANCE.IShape_uuid, this);
477
+ this._fixpoints = new OptionalMultiContainmentValueManager<Coord>(ShapesBase.INSTANCE.IShape_fixpoints, this);
478
+ }
479
+
480
+ getPropertyValueManager(property: Property): PropertyValueManager<unknown> {
481
+ switch (property.key) {
482
+ case LionCore_builtinsBase.INSTANCE.INamed_name.key: return this._name;
483
+ case ShapesBase.INSTANCE.IShape_uuid.key: return this._uuid;
484
+ default: return super.getPropertyValueManager(property);
485
+ }
486
+ }
487
+
488
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
489
+ switch (containment.key) {
490
+ case ShapesBase.INSTANCE.Shape_shapeDocs.key: return this._shapeDocs;
491
+ case ShapesBase.INSTANCE.IShape_fixpoints.key: return this._fixpoints;
492
+ default: return super.getContainmentValueManager(containment);
493
+ }
494
+ }
495
+ }
496
+
497
+ export class Circle extends Shape {
498
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): Circle {
499
+ return new Circle(ShapesBase.INSTANCE.Circle, id, handleDelta, parentInfo);
500
+ }
501
+
502
+ private readonly _r: RequiredPropertyValueManager<number>;
503
+ get r(): number {
504
+ return this._r.get();
505
+ }
506
+ set r(newValue: number) {
507
+ this._r.set(newValue);
508
+ }
509
+
510
+ private readonly _center: RequiredSingleContainmentValueManager<Coord>;
511
+ get center(): Coord {
512
+ return this._center.get();
513
+ }
514
+ set center(newValue: Coord) {
515
+ this._center.set(newValue);
516
+ }
517
+ replaceCenterWith(newValue: Coord) {
518
+ this._center.replaceWith(newValue);
519
+ }
520
+
521
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
522
+ super(classifier, id, handleDelta, parentInfo);
523
+ this._r = new RequiredPropertyValueManager<number>(ShapesBase.INSTANCE.Circle_r, this);
524
+ this._center = new RequiredSingleContainmentValueManager<Coord>(ShapesBase.INSTANCE.Circle_center, this);
525
+ }
526
+
527
+ getPropertyValueManager(property: Property): PropertyValueManager<unknown> {
528
+ if (property.key === ShapesBase.INSTANCE.Circle_r.key) {
529
+ return this._r;
530
+ }
531
+ return super.getPropertyValueManager(property);
532
+ }
533
+
534
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
535
+ if (containment.key === ShapesBase.INSTANCE.Circle_center.key) {
536
+ return this._center;
537
+ }
538
+ return super.getContainmentValueManager(containment);
539
+ }
540
+ }
541
+
542
+ export class Coord extends NodeBase {
543
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): Coord {
544
+ return new Coord(ShapesBase.INSTANCE.Coord, id, handleDelta, parentInfo);
545
+ }
546
+
547
+ private readonly _x: RequiredPropertyValueManager<number>;
548
+ get x(): number {
549
+ return this._x.get();
550
+ }
551
+ set x(newValue: number) {
552
+ this._x.set(newValue);
553
+ }
554
+
555
+ private readonly _y: RequiredPropertyValueManager<number>;
556
+ get y(): number {
557
+ return this._y.get();
558
+ }
559
+ set y(newValue: number) {
560
+ this._y.set(newValue);
561
+ }
562
+
563
+ private readonly _z: RequiredPropertyValueManager<number>;
564
+ get z(): number {
565
+ return this._z.get();
566
+ }
567
+ set z(newValue: number) {
568
+ this._z.set(newValue);
569
+ }
570
+
571
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
572
+ super(classifier, id, handleDelta, parentInfo);
573
+ this._x = new RequiredPropertyValueManager<number>(ShapesBase.INSTANCE.Coord_x, this);
574
+ this._y = new RequiredPropertyValueManager<number>(ShapesBase.INSTANCE.Coord_y, this);
575
+ this._z = new RequiredPropertyValueManager<number>(ShapesBase.INSTANCE.Coord_z, this);
576
+ }
577
+
578
+ getPropertyValueManager(property: Property): PropertyValueManager<unknown> {
579
+ switch (property.key) {
580
+ case ShapesBase.INSTANCE.Coord_x.key: return this._x;
581
+ case ShapesBase.INSTANCE.Coord_y.key: return this._y;
582
+ case ShapesBase.INSTANCE.Coord_z.key: return this._z;
583
+ default: return super.getPropertyValueManager(property);
584
+ }
585
+ }
586
+ }
587
+
588
+ export class Geometry extends NodeBase {
589
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): Geometry {
590
+ return new Geometry(ShapesBase.INSTANCE.Geometry, id, handleDelta, parentInfo);
591
+ }
592
+
593
+ private readonly _shapes: OptionalMultiContainmentValueManager<IShape>;
594
+ get shapes(): IShape[] {
595
+ return this._shapes.get();
596
+ }
597
+ addShapes(newValue: IShape) {
598
+ this._shapes.add(newValue);
599
+ }
600
+ removeShapes(valueToRemove: IShape) {
601
+ this._shapes.remove(valueToRemove);
602
+ }
603
+ addShapesAtIndex(newValue: IShape, index: number) {
604
+ this._shapes.insertAtIndex(newValue, index);
605
+ }
606
+ moveShapes(oldIndex: number, newIndex: number) {
607
+ this._shapes.move(oldIndex, newIndex);
608
+ }
609
+ replaceShapesAtIndex(movedChild: IShape, newIndex: number) {
610
+ this._shapes.replaceAtIndex(movedChild, newIndex);
611
+ }
612
+
613
+ private readonly _documentation: OptionalSingleContainmentValueManager<Documentation>;
614
+ get documentation(): Documentation | undefined {
615
+ return this._documentation.get();
616
+ }
617
+ set documentation(newValue: Documentation | undefined) {
618
+ this._documentation.set(newValue);
619
+ }
620
+ replaceDocumentationWith(newValue: Documentation) {
621
+ this._documentation.replaceWith(newValue);
622
+ }
623
+
624
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
625
+ super(classifier, id, handleDelta, parentInfo);
626
+ this._shapes = new OptionalMultiContainmentValueManager<IShape>(ShapesBase.INSTANCE.Geometry_shapes, this);
627
+ this._documentation = new OptionalSingleContainmentValueManager<Documentation>(ShapesBase.INSTANCE.Geometry_documentation, this);
628
+ }
629
+
630
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
631
+ switch (containment.key) {
632
+ case ShapesBase.INSTANCE.Geometry_shapes.key: return this._shapes;
633
+ case ShapesBase.INSTANCE.Geometry_documentation.key: return this._documentation;
634
+ default: return super.getContainmentValueManager(containment);
635
+ }
636
+ }
637
+ }
638
+
639
+ export interface IShape extends INodeBase {
640
+ uuid: string;
641
+ fixpoints: Coord[];
642
+ }
643
+
644
+ export class Line extends Shape implements INamed {
645
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): Line {
646
+ return new Line(ShapesBase.INSTANCE.Line, id, handleDelta, parentInfo);
647
+ }
648
+
649
+ private readonly _start: RequiredSingleContainmentValueManager<Coord>;
650
+ get start(): Coord {
651
+ return this._start.get();
652
+ }
653
+ set start(newValue: Coord) {
654
+ this._start.set(newValue);
655
+ }
656
+ replaceStartWith(newValue: Coord) {
657
+ this._start.replaceWith(newValue);
658
+ }
659
+
660
+ private readonly _end: RequiredSingleContainmentValueManager<Coord>;
661
+ get end(): Coord {
662
+ return this._end.get();
663
+ }
664
+ set end(newValue: Coord) {
665
+ this._end.set(newValue);
666
+ }
667
+ replaceEndWith(newValue: Coord) {
668
+ this._end.replaceWith(newValue);
669
+ }
670
+
671
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
672
+ super(classifier, id, handleDelta, parentInfo);
673
+ this._start = new RequiredSingleContainmentValueManager<Coord>(ShapesBase.INSTANCE.Line_start, this);
674
+ this._end = new RequiredSingleContainmentValueManager<Coord>(ShapesBase.INSTANCE.Line_end, this);
675
+ }
676
+
677
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
678
+ switch (containment.key) {
679
+ case ShapesBase.INSTANCE.Line_start.key: return this._start;
680
+ case ShapesBase.INSTANCE.Line_end.key: return this._end;
681
+ default: return super.getContainmentValueManager(containment);
682
+ }
683
+ }
684
+ }
685
+
686
+ export class OffsetDuplicate extends Shape {
687
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): OffsetDuplicate {
688
+ return new OffsetDuplicate(ShapesBase.INSTANCE.OffsetDuplicate, id, handleDelta, parentInfo);
689
+ }
690
+
691
+ private readonly _offset: RequiredSingleContainmentValueManager<Coord>;
692
+ get offset(): Coord {
693
+ return this._offset.get();
694
+ }
695
+ set offset(newValue: Coord) {
696
+ this._offset.set(newValue);
697
+ }
698
+ replaceOffsetWith(newValue: Coord) {
699
+ this._offset.replaceWith(newValue);
700
+ }
701
+
702
+ private readonly _source: RequiredSingleReferenceValueManager<Shape>;
703
+ get source(): SingleRef<Shape> {
704
+ return this._source.get();
705
+ }
706
+ set source(newValue: SingleRef<Shape>) {
707
+ this._source.set(newValue);
708
+ }
709
+
710
+ private readonly _altSource: OptionalSingleReferenceValueManager<Shape>;
711
+ get altSource(): SingleRef<Shape> | undefined {
712
+ return this._altSource.get();
713
+ }
714
+ set altSource(newValue: SingleRef<Shape> | undefined) {
715
+ this._altSource.set(newValue);
716
+ }
717
+
718
+ private readonly _docs: OptionalSingleContainmentValueManager<Documentation>;
719
+ get docs(): Documentation | undefined {
720
+ return this._docs.get();
721
+ }
722
+ set docs(newValue: Documentation | undefined) {
723
+ this._docs.set(newValue);
724
+ }
725
+ replaceDocsWith(newValue: Documentation) {
726
+ this._docs.replaceWith(newValue);
727
+ }
728
+
729
+ private readonly _secretDocs: OptionalSingleContainmentValueManager<Documentation>;
730
+ get secretDocs(): Documentation | undefined {
731
+ return this._secretDocs.get();
732
+ }
733
+ set secretDocs(newValue: Documentation | undefined) {
734
+ this._secretDocs.set(newValue);
735
+ }
736
+ replaceSecretDocsWith(newValue: Documentation) {
737
+ this._secretDocs.replaceWith(newValue);
738
+ }
739
+
740
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
741
+ super(classifier, id, handleDelta, parentInfo);
742
+ this._offset = new RequiredSingleContainmentValueManager<Coord>(ShapesBase.INSTANCE.OffsetDuplicate_offset, this);
743
+ this._source = new RequiredSingleReferenceValueManager<Shape>(ShapesBase.INSTANCE.OffsetDuplicate_source, this);
744
+ this._altSource = new OptionalSingleReferenceValueManager<Shape>(ShapesBase.INSTANCE.OffsetDuplicate_altSource, this);
745
+ this._docs = new OptionalSingleContainmentValueManager<Documentation>(ShapesBase.INSTANCE.OffsetDuplicate_docs, this);
746
+ this._secretDocs = new OptionalSingleContainmentValueManager<Documentation>(ShapesBase.INSTANCE.OffsetDuplicate_secretDocs, this);
747
+ }
748
+
749
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
750
+ switch (containment.key) {
751
+ case ShapesBase.INSTANCE.OffsetDuplicate_offset.key: return this._offset;
752
+ case ShapesBase.INSTANCE.OffsetDuplicate_docs.key: return this._docs;
753
+ case ShapesBase.INSTANCE.OffsetDuplicate_secretDocs.key: return this._secretDocs;
754
+ default: return super.getContainmentValueManager(containment);
755
+ }
756
+ }
757
+
758
+ getReferenceValueManager(reference: Reference): ReferenceValueManager<INodeBase> {
759
+ switch (reference.key) {
760
+ case ShapesBase.INSTANCE.OffsetDuplicate_source.key: return this._source;
761
+ case ShapesBase.INSTANCE.OffsetDuplicate_altSource.key: return this._altSource;
762
+ default: return super.getReferenceValueManager(reference);
763
+ }
764
+ }
765
+ }
766
+
767
+ export class CompositeShape extends Shape {
768
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): CompositeShape {
769
+ return new CompositeShape(ShapesBase.INSTANCE.CompositeShape, id, handleDelta, parentInfo);
770
+ }
771
+
772
+ private readonly _parts: RequiredMultiContainmentValueManager<IShape>;
773
+ get parts(): IShape[] {
774
+ return this._parts.get();
775
+ }
776
+ addParts(newValue: IShape) {
777
+ this._parts.add(newValue);
778
+ }
779
+ removeParts(valueToRemove: IShape) {
780
+ this._parts.remove(valueToRemove);
781
+ }
782
+ addPartsAtIndex(newValue: IShape, index: number) {
783
+ this._parts.insertAtIndex(newValue, index);
784
+ }
785
+ moveParts(oldIndex: number, newIndex: number) {
786
+ this._parts.move(oldIndex, newIndex);
787
+ }
788
+ replacePartsAtIndex(movedChild: IShape, newIndex: number) {
789
+ this._parts.replaceAtIndex(movedChild, newIndex);
790
+ }
791
+
792
+ private readonly _disabledParts: RequiredMultiContainmentValueManager<IShape>;
793
+ get disabledParts(): IShape[] {
794
+ return this._disabledParts.get();
795
+ }
796
+ addDisabledParts(newValue: IShape) {
797
+ this._disabledParts.add(newValue);
798
+ }
799
+ removeDisabledParts(valueToRemove: IShape) {
800
+ this._disabledParts.remove(valueToRemove);
801
+ }
802
+ addDisabledPartsAtIndex(newValue: IShape, index: number) {
803
+ this._disabledParts.insertAtIndex(newValue, index);
804
+ }
805
+ moveDisabledParts(oldIndex: number, newIndex: number) {
806
+ this._disabledParts.move(oldIndex, newIndex);
807
+ }
808
+ replaceDisabledPartsAtIndex(movedChild: IShape, newIndex: number) {
809
+ this._disabledParts.replaceAtIndex(movedChild, newIndex);
810
+ }
811
+
812
+ private readonly _evilPart: RequiredSingleContainmentValueManager<IShape>;
813
+ get evilPart(): IShape {
814
+ return this._evilPart.get();
815
+ }
816
+ set evilPart(newValue: IShape) {
817
+ this._evilPart.set(newValue);
818
+ }
819
+ replaceEvilPartWith(newValue: IShape) {
820
+ this._evilPart.replaceWith(newValue);
821
+ }
822
+
823
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
824
+ super(classifier, id, handleDelta, parentInfo);
825
+ this._parts = new RequiredMultiContainmentValueManager<IShape>(ShapesBase.INSTANCE.CompositeShape_parts, this);
826
+ this._disabledParts = new RequiredMultiContainmentValueManager<IShape>(ShapesBase.INSTANCE.CompositeShape_disabledParts, this);
827
+ this._evilPart = new RequiredSingleContainmentValueManager<IShape>(ShapesBase.INSTANCE.CompositeShape_evilPart, this);
828
+ }
829
+
830
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
831
+ switch (containment.key) {
832
+ case ShapesBase.INSTANCE.CompositeShape_parts.key: return this._parts;
833
+ case ShapesBase.INSTANCE.CompositeShape_disabledParts.key: return this._disabledParts;
834
+ case ShapesBase.INSTANCE.CompositeShape_evilPart.key: return this._evilPart;
835
+ default: return super.getContainmentValueManager(containment);
836
+ }
837
+ }
838
+ }
839
+
840
+ export class ReferenceGeometry extends NodeBase {
841
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): ReferenceGeometry {
842
+ return new ReferenceGeometry(ShapesBase.INSTANCE.ReferenceGeometry, id, handleDelta, parentInfo);
843
+ }
844
+
845
+ private readonly _shapes: OptionalMultiReferenceValueManager<IShape>;
846
+ get shapes(): SingleRef<IShape>[] {
847
+ return this._shapes.get();
848
+ }
849
+ addShapes(newValue: IShape) {
850
+ this._shapes.add(newValue);
851
+ }
852
+ removeShapes(valueToRemove: IShape) {
853
+ this._shapes.remove(valueToRemove);
854
+ }
855
+ addShapesAtIndex(newValue: IShape, index: number) {
856
+ this._shapes.insertAtIndex(newValue, index);
857
+ }
858
+ moveShapes(oldIndex: number, newIndex: number) {
859
+ this._shapes.move(oldIndex, newIndex);
860
+ }
861
+
862
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
863
+ super(classifier, id, handleDelta, parentInfo);
864
+ this._shapes = new OptionalMultiReferenceValueManager<IShape>(ShapesBase.INSTANCE.ReferenceGeometry_shapes, this);
865
+ }
866
+
867
+ getReferenceValueManager(reference: Reference): ReferenceValueManager<INodeBase> {
868
+ if (reference.key === ShapesBase.INSTANCE.ReferenceGeometry_shapes.key) {
869
+ return this._shapes;
870
+ }
871
+ return super.getReferenceValueManager(reference);
872
+ }
873
+ }
874
+
875
+ export class Documentation extends NodeBase {
876
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): Documentation {
877
+ return new Documentation(ShapesBase.INSTANCE.Documentation, id, handleDelta, parentInfo);
878
+ }
879
+
880
+ private readonly _text: OptionalPropertyValueManager<string>;
881
+ get text(): string | undefined {
882
+ return this._text.get();
883
+ }
884
+ set text(newValue: string | undefined) {
885
+ this._text.set(newValue);
886
+ }
887
+
888
+ private readonly _technical: OptionalPropertyValueManager<boolean>;
889
+ get technical(): boolean | undefined {
890
+ return this._technical.get();
891
+ }
892
+ set technical(newValue: boolean | undefined) {
893
+ this._technical.set(newValue);
894
+ }
895
+
896
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
897
+ super(classifier, id, handleDelta, parentInfo);
898
+ this._text = new OptionalPropertyValueManager<string>(ShapesBase.INSTANCE.Documentation_text, this);
899
+ this._technical = new OptionalPropertyValueManager<boolean>(ShapesBase.INSTANCE.Documentation_technical, this);
900
+ }
901
+
902
+ getPropertyValueManager(property: Property): PropertyValueManager<unknown> {
903
+ switch (property.key) {
904
+ case ShapesBase.INSTANCE.Documentation_text.key: return this._text;
905
+ case ShapesBase.INSTANCE.Documentation_technical.key: return this._technical;
906
+ default: return super.getPropertyValueManager(property);
907
+ }
908
+ }
909
+ }
910
+
911
+ export class BillOfMaterials extends NodeBase {
912
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): BillOfMaterials {
913
+ return new BillOfMaterials(ShapesBase.INSTANCE.BillOfMaterials, id, handleDelta, parentInfo);
914
+ }
915
+
916
+ private readonly _materials: OptionalMultiReferenceValueManager<IShape>;
917
+ get materials(): SingleRef<IShape>[] {
918
+ return this._materials.get();
919
+ }
920
+ addMaterials(newValue: IShape) {
921
+ this._materials.add(newValue);
922
+ }
923
+ removeMaterials(valueToRemove: IShape) {
924
+ this._materials.remove(valueToRemove);
925
+ }
926
+ addMaterialsAtIndex(newValue: IShape, index: number) {
927
+ this._materials.insertAtIndex(newValue, index);
928
+ }
929
+ moveMaterials(oldIndex: number, newIndex: number) {
930
+ this._materials.move(oldIndex, newIndex);
931
+ }
932
+
933
+ private readonly _groups: OptionalMultiContainmentValueManager<MaterialGroup>;
934
+ get groups(): MaterialGroup[] {
935
+ return this._groups.get();
936
+ }
937
+ addGroups(newValue: MaterialGroup) {
938
+ this._groups.add(newValue);
939
+ }
940
+ removeGroups(valueToRemove: MaterialGroup) {
941
+ this._groups.remove(valueToRemove);
942
+ }
943
+ addGroupsAtIndex(newValue: MaterialGroup, index: number) {
944
+ this._groups.insertAtIndex(newValue, index);
945
+ }
946
+ moveGroups(oldIndex: number, newIndex: number) {
947
+ this._groups.move(oldIndex, newIndex);
948
+ }
949
+ replaceGroupsAtIndex(movedChild: MaterialGroup, newIndex: number) {
950
+ this._groups.replaceAtIndex(movedChild, newIndex);
951
+ }
952
+
953
+ private readonly _altGroups: OptionalMultiContainmentValueManager<MaterialGroup>;
954
+ get altGroups(): MaterialGroup[] {
955
+ return this._altGroups.get();
956
+ }
957
+ addAltGroups(newValue: MaterialGroup) {
958
+ this._altGroups.add(newValue);
959
+ }
960
+ removeAltGroups(valueToRemove: MaterialGroup) {
961
+ this._altGroups.remove(valueToRemove);
962
+ }
963
+ addAltGroupsAtIndex(newValue: MaterialGroup, index: number) {
964
+ this._altGroups.insertAtIndex(newValue, index);
965
+ }
966
+ moveAltGroups(oldIndex: number, newIndex: number) {
967
+ this._altGroups.move(oldIndex, newIndex);
968
+ }
969
+ replaceAltGroupsAtIndex(movedChild: MaterialGroup, newIndex: number) {
970
+ this._altGroups.replaceAtIndex(movedChild, newIndex);
971
+ }
972
+
973
+ private readonly _defaultGroup: OptionalSingleContainmentValueManager<MaterialGroup>;
974
+ get defaultGroup(): MaterialGroup | undefined {
975
+ return this._defaultGroup.get();
976
+ }
977
+ set defaultGroup(newValue: MaterialGroup | undefined) {
978
+ this._defaultGroup.set(newValue);
979
+ }
980
+ replaceDefaultGroupWith(newValue: MaterialGroup) {
981
+ this._defaultGroup.replaceWith(newValue);
982
+ }
983
+
984
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
985
+ super(classifier, id, handleDelta, parentInfo);
986
+ this._materials = new OptionalMultiReferenceValueManager<IShape>(ShapesBase.INSTANCE.BillOfMaterials_materials, this);
987
+ this._groups = new OptionalMultiContainmentValueManager<MaterialGroup>(ShapesBase.INSTANCE.BillOfMaterials_groups, this);
988
+ this._altGroups = new OptionalMultiContainmentValueManager<MaterialGroup>(ShapesBase.INSTANCE.BillOfMaterials_altGroups, this);
989
+ this._defaultGroup = new OptionalSingleContainmentValueManager<MaterialGroup>(ShapesBase.INSTANCE.BillOfMaterials_defaultGroup, this);
990
+ }
991
+
992
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
993
+ switch (containment.key) {
994
+ case ShapesBase.INSTANCE.BillOfMaterials_groups.key: return this._groups;
995
+ case ShapesBase.INSTANCE.BillOfMaterials_altGroups.key: return this._altGroups;
996
+ case ShapesBase.INSTANCE.BillOfMaterials_defaultGroup.key: return this._defaultGroup;
997
+ default: return super.getContainmentValueManager(containment);
998
+ }
999
+ }
1000
+
1001
+ getReferenceValueManager(reference: Reference): ReferenceValueManager<INodeBase> {
1002
+ if (reference.key === ShapesBase.INSTANCE.BillOfMaterials_materials.key) {
1003
+ return this._materials;
1004
+ }
1005
+ return super.getReferenceValueManager(reference);
1006
+ }
1007
+ }
1008
+
1009
+ export class MaterialGroup extends NodeBase {
1010
+ static create(id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage): MaterialGroup {
1011
+ return new MaterialGroup(ShapesBase.INSTANCE.MaterialGroup, id, handleDelta, parentInfo);
1012
+ }
1013
+
1014
+ private readonly _matterState: OptionalPropertyValueManager<MatterState>;
1015
+ get matterState(): MatterState | undefined {
1016
+ return this._matterState.get();
1017
+ }
1018
+ set matterState(newValue: MatterState | undefined) {
1019
+ this._matterState.set(newValue);
1020
+ }
1021
+
1022
+ private readonly _materials: RequiredMultiReferenceValueManager<IShape>;
1023
+ get materials(): SingleRef<IShape>[] {
1024
+ return this._materials.get();
1025
+ }
1026
+ addMaterials(newValue: IShape) {
1027
+ this._materials.add(newValue);
1028
+ }
1029
+ removeMaterials(valueToRemove: IShape) {
1030
+ this._materials.remove(valueToRemove);
1031
+ }
1032
+ addMaterialsAtIndex(newValue: IShape, index: number) {
1033
+ this._materials.insertAtIndex(newValue, index);
1034
+ }
1035
+ moveMaterials(oldIndex: number, newIndex: number) {
1036
+ this._materials.move(oldIndex, newIndex);
1037
+ }
1038
+
1039
+ private readonly _defaultShape: OptionalSingleContainmentValueManager<IShape>;
1040
+ get defaultShape(): IShape | undefined {
1041
+ return this._defaultShape.get();
1042
+ }
1043
+ set defaultShape(newValue: IShape | undefined) {
1044
+ this._defaultShape.set(newValue);
1045
+ }
1046
+ replaceDefaultShapeWith(newValue: IShape) {
1047
+ this._defaultShape.replaceWith(newValue);
1048
+ }
1049
+
1050
+ public constructor(classifier: Classifier, id: LionWebId, handleDelta?: DeltaHandler, parentInfo?: Parentage) {
1051
+ super(classifier, id, handleDelta, parentInfo);
1052
+ this._matterState = new OptionalPropertyValueManager<MatterState>(ShapesBase.INSTANCE.MaterialGroup_matterState, this);
1053
+ this._materials = new RequiredMultiReferenceValueManager<IShape>(ShapesBase.INSTANCE.MaterialGroup_materials, this);
1054
+ this._defaultShape = new OptionalSingleContainmentValueManager<IShape>(ShapesBase.INSTANCE.MaterialGroup_defaultShape, this);
1055
+ }
1056
+
1057
+ getPropertyValueManager(property: Property): PropertyValueManager<unknown> {
1058
+ if (property.key === ShapesBase.INSTANCE.MaterialGroup_matterState.key) {
1059
+ return this._matterState;
1060
+ }
1061
+ return super.getPropertyValueManager(property);
1062
+ }
1063
+
1064
+ getContainmentValueManager(containment: Containment): ContainmentValueManager<INodeBase> {
1065
+ if (containment.key === ShapesBase.INSTANCE.MaterialGroup_defaultShape.key) {
1066
+ return this._defaultShape;
1067
+ }
1068
+ return super.getContainmentValueManager(containment);
1069
+ }
1070
+
1071
+ getReferenceValueManager(reference: Reference): ReferenceValueManager<INodeBase> {
1072
+ if (reference.key === ShapesBase.INSTANCE.MaterialGroup_materials.key) {
1073
+ return this._materials;
1074
+ }
1075
+ return super.getReferenceValueManager(reference);
1076
+ }
1077
+ }
1078
+
1079
+ export enum MatterState {
1080
+ solid = "key-solid",
1081
+ liquid = "key-liquid",
1082
+ gas = "key-gas"
1083
+ }
1084
+
1085
+ export type Time = string;
1086
+