x_ite 8.3.2 → 8.3.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.
- package/.github/workflows/pages-deploy.yml +1 -1
- package/.vscode/settings.json +2 -1
- package/dist/LICENSE.md +4 -4
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +61 -74
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +19 -19
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +17 -17
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/{ProjectiveTextureMapping.js → TextureProjector.js} +39 -39
- package/dist/assets/components/TextureProjector.min.js +1 -0
- package/dist/assets/components/Texturing3D.js +27 -27
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +1492 -1291
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/Gemfile +1 -4
- package/docs/_config.yml +3 -3
- package/docs/_posts/getting-started.md +147 -441
- package/docs/_posts/reference/scene-services.md +13 -2
- package/docs/_posts/what's-new.md +21 -3
- package/docs/_tabs/playground.html +36 -40
- package/docs/assets/css/style.scss +18 -0
- package/package.json +1 -1
- package/src/assets/components/{ProjectiveTextureMapping.js → TextureProjector.js} +5 -5
- package/src/examples.js +1 -1
- package/src/tests.js +5 -5
- package/src/x_ite/Base/X3DInfoArray.js +21 -21
- package/src/x_ite/Base/X3DObject.js +29 -20
- package/src/x_ite/Base/X3DObjectArrayField.js +27 -26
- package/src/x_ite/Base/X3DTypedArrayField.js +34 -32
- package/src/x_ite/Browser/DOMIntegration.js +4 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +43 -28
- package/src/x_ite/Components/Core/X3DNode.js +196 -187
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +113 -90
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +18 -43
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +24 -25
- package/src/x_ite/Components/HAnim/HAnimJoint.js +19 -31
- package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +14 -1
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +0 -1
- package/src/x_ite/Components/{ProjectiveTextureMapping → TextureProjector}/TextureProjector.js +1 -1
- package/src/x_ite/Components/{ProjectiveTextureMapping → TextureProjector}/TextureProjectorParallel.js +1 -1
- package/src/x_ite/Components/{ProjectiveTextureMapping → TextureProjector}/X3DTextureProjectorNode.js +0 -0
- package/src/x_ite/Components/Time/TimeSensor.js +5 -0
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +1 -0
- package/src/x_ite/Configuration/ComponentInfo.js +20 -23
- package/src/x_ite/Configuration/ProfileInfo.js +6 -6
- package/src/x_ite/Configuration/SupportedComponents.js +22 -20
- package/src/x_ite/Configuration/SupportedProfiles.js +1 -1
- package/src/x_ite/Configuration/UnitInfo.js +24 -27
- package/src/x_ite/Execution/X3DExecutionContext.js +28 -59
- package/src/x_ite/Execution/X3DExportedNode.js +23 -28
- package/src/x_ite/Execution/X3DImportedNode.js +63 -67
- package/src/x_ite/Execution/X3DScene.js +98 -117
- package/src/x_ite/Fields/ArrayFields.js +57 -55
- package/src/x_ite/Fields/SFBool.js +6 -6
- package/src/x_ite/Fields/SFColor.js +10 -12
- package/src/x_ite/Fields/SFDouble.js +7 -10
- package/src/x_ite/Fields/SFFloat.js +7 -10
- package/src/x_ite/Fields/SFImage.js +33 -8
- package/src/x_ite/Fields/SFInt32.js +6 -6
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +13 -13
- package/src/x_ite/Fields/SFNode.js +42 -19
- package/src/x_ite/Fields/SFRotation.js +13 -13
- package/src/x_ite/Fields/SFString.js +6 -7
- package/src/x_ite/Fields/SFTime.js +6 -6
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +10 -10
- package/src/x_ite/InputOutput/FileLoader.js +1 -1
- package/src/x_ite/InputOutput/Generator.js +117 -17
- package/src/x_ite/Parser/VRMLParser.js +24 -27
- package/src/x_ite/Parser/X3DParser.js +0 -4
- package/src/x_ite/Parser/XMLParser.js +2 -2
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +59 -64
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +86 -93
- package/src/x_ite/Rendering/X3DRenderObject.js +6 -1
- package/src/x_ite/Routing/X3DRoute.js +37 -40
- package/src/x_ite.html +1 -1
- package/x_ite.min.html +1 -1
- package/dist/assets/components/ProjectiveTextureMapping.min.js +0 -1
- package/docs/Gemfile.lock +0 -116
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import Fields from "../../Fields.js";
|
|
49
48
|
import X3DChildNode from "../Core/X3DChildNode.js";
|
|
50
49
|
import X3DTimeDependentNode from "../Time/X3DTimeDependentNode.js";
|
|
51
50
|
import X3DConstants from "../../Base/X3DConstants.js";
|
|
File without changes
|
|
@@ -197,6 +197,11 @@ TimeSensor .prototype = Object .assign (Object .create (X3DSensorNode .prototype
|
|
|
197
197
|
|
|
198
198
|
this ._time = time;
|
|
199
199
|
},
|
|
200
|
+
dispose: function ()
|
|
201
|
+
{
|
|
202
|
+
X3DTimeDependentNode .prototype .dispose .call (this);
|
|
203
|
+
X3DSensorNode .prototype .dispose .call (this);
|
|
204
|
+
},
|
|
200
205
|
});
|
|
201
206
|
|
|
202
207
|
export default TimeSensor;
|
|
@@ -342,6 +342,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
|
|
|
342
342
|
set_resume: function () { },
|
|
343
343
|
set_stop: function () { },
|
|
344
344
|
set_time: function () { },
|
|
345
|
+
dispose: function () { }
|
|
345
346
|
});
|
|
346
347
|
|
|
347
348
|
export default X3DTimeDependentNode;
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
|
|
48
48
|
import X3DObject from "../Base/X3DObject.js";
|
|
49
49
|
import URLs from "../Browser/Networking/URLs.js";
|
|
50
|
-
import Generator from "../InputOutput/Generator.js";
|
|
51
50
|
|
|
52
51
|
function ComponentInfo ({ name, level, title, providerUrl, external = false, dependencies = [ ] })
|
|
53
52
|
{
|
|
@@ -67,31 +66,29 @@ ComponentInfo .prototype = Object .assign (Object .create (X3DObject .prototype)
|
|
|
67
66
|
{
|
|
68
67
|
return "ComponentInfo";
|
|
69
68
|
},
|
|
70
|
-
toVRMLStream: function (
|
|
69
|
+
toVRMLStream: function (generator)
|
|
71
70
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
generator .string += "COMPONENT";
|
|
72
|
+
generator .string += generator .Space ();
|
|
73
|
+
generator .string += this .name;
|
|
74
|
+
generator .string += generator .TidySpace ();
|
|
75
|
+
generator .string += ":";
|
|
76
|
+
generator .string += generator .TidySpace ();
|
|
77
|
+
generator .string += this .level;
|
|
79
78
|
},
|
|
80
|
-
toXMLStream: function (
|
|
79
|
+
toXMLStream: function (generator)
|
|
81
80
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
stream .string += "'";
|
|
94
|
-
stream .string += "/>";
|
|
81
|
+
generator .string += generator .Indent ();
|
|
82
|
+
generator .string += "<component";
|
|
83
|
+
generator .string += generator .Space ();
|
|
84
|
+
generator .string += "name='";
|
|
85
|
+
generator .string += this .name;
|
|
86
|
+
generator .string += "'";
|
|
87
|
+
generator .string += generator .Space ();
|
|
88
|
+
generator .string += "level='";
|
|
89
|
+
generator .string += this .level;
|
|
90
|
+
generator .string += "'";
|
|
91
|
+
generator .string += "/>";
|
|
95
92
|
},
|
|
96
93
|
});
|
|
97
94
|
|
|
@@ -62,15 +62,15 @@ ProfileInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
62
62
|
{
|
|
63
63
|
return "ProfileInfo";
|
|
64
64
|
},
|
|
65
|
-
toVRMLStream: function (
|
|
65
|
+
toVRMLStream: function (generator)
|
|
66
66
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
generator .string += "PROFILE";
|
|
68
|
+
generator .string += generator .Space ();
|
|
69
|
+
generator .string += this .name;
|
|
70
70
|
},
|
|
71
|
-
toXMLStream: function (
|
|
71
|
+
toXMLStream: function (generator)
|
|
72
72
|
{
|
|
73
|
-
|
|
73
|
+
generator .string += this .name;
|
|
74
74
|
},
|
|
75
75
|
});
|
|
76
76
|
|
|
@@ -59,7 +59,7 @@ SupportedComponents .addComponent (
|
|
|
59
59
|
|
|
60
60
|
SupportedComponents .addComponent (
|
|
61
61
|
{
|
|
62
|
-
title: "
|
|
62
|
+
title: "CAD geometry",
|
|
63
63
|
name: "CADGeometry",
|
|
64
64
|
level: 2,
|
|
65
65
|
external: true,
|
|
@@ -82,7 +82,7 @@ SupportedComponents .addComponent (
|
|
|
82
82
|
|
|
83
83
|
SupportedComponents .addComponent (
|
|
84
84
|
{
|
|
85
|
-
title: "Distributed interactive simulation
|
|
85
|
+
title: "Distributed interactive simulation",
|
|
86
86
|
name: "DIS",
|
|
87
87
|
level: 2,
|
|
88
88
|
external: true,
|
|
@@ -99,14 +99,14 @@ SupportedComponents .addComponent (
|
|
|
99
99
|
{
|
|
100
100
|
title: "Environmental sensor",
|
|
101
101
|
name: "EnvironmentalSensor",
|
|
102
|
-
level:
|
|
102
|
+
level: 3,
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
SupportedComponents .addComponent (
|
|
106
106
|
{
|
|
107
107
|
title: "Event utilities",
|
|
108
108
|
name: "EventUtilities",
|
|
109
|
-
level:
|
|
109
|
+
level: 1,
|
|
110
110
|
external: true,
|
|
111
111
|
});
|
|
112
112
|
|
|
@@ -114,7 +114,7 @@ SupportedComponents .addComponent (
|
|
|
114
114
|
{
|
|
115
115
|
title: "Followers",
|
|
116
116
|
name: "Followers",
|
|
117
|
-
level:
|
|
117
|
+
level: 1,
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
SupportedComponents .addComponent (
|
|
@@ -211,7 +211,7 @@ SupportedComponents .addComponent (
|
|
|
211
211
|
|
|
212
212
|
SupportedComponents .addComponent (
|
|
213
213
|
{
|
|
214
|
-
title: "
|
|
214
|
+
title: "NURBS",
|
|
215
215
|
name: "NURBS",
|
|
216
216
|
level: 4,
|
|
217
217
|
external: true,
|
|
@@ -227,7 +227,7 @@ SupportedComponents .addComponent (
|
|
|
227
227
|
|
|
228
228
|
SupportedComponents .addComponent (
|
|
229
229
|
{
|
|
230
|
-
title: "Picking
|
|
230
|
+
title: "Picking",
|
|
231
231
|
name: "Picking",
|
|
232
232
|
level: 3,
|
|
233
233
|
external: true,
|
|
@@ -243,19 +243,21 @@ SupportedComponents .addComponent (
|
|
|
243
243
|
|
|
244
244
|
SupportedComponents .addComponent (
|
|
245
245
|
{
|
|
246
|
-
title: "
|
|
247
|
-
name: "
|
|
248
|
-
level:
|
|
249
|
-
external: true,
|
|
246
|
+
title: "Programmable shaders",
|
|
247
|
+
name: "Shaders",
|
|
248
|
+
level: 1,
|
|
250
249
|
});
|
|
251
250
|
|
|
252
251
|
SupportedComponents .addComponent (
|
|
253
252
|
{
|
|
254
|
-
title: "
|
|
255
|
-
name: "
|
|
256
|
-
level:
|
|
253
|
+
title: "Texture Projector",
|
|
254
|
+
name: "TextureProjector",
|
|
255
|
+
level: 2,
|
|
256
|
+
external: true,
|
|
257
257
|
});
|
|
258
258
|
|
|
259
|
+
SupportedComponents .addAlias ("ProjectiveTextureMapping", "TextureProjector");
|
|
260
|
+
|
|
259
261
|
SupportedComponents .addComponent (
|
|
260
262
|
{
|
|
261
263
|
title: "Rendering",
|
|
@@ -267,7 +269,7 @@ SupportedComponents .addComponent (
|
|
|
267
269
|
{
|
|
268
270
|
title: "Rigid body physics",
|
|
269
271
|
name: "RigidBodyPhysics",
|
|
270
|
-
level:
|
|
272
|
+
level: 2,
|
|
271
273
|
external: true,
|
|
272
274
|
});
|
|
273
275
|
|
|
@@ -283,14 +285,14 @@ SupportedComponents .addComponent (
|
|
|
283
285
|
{
|
|
284
286
|
title: "Shape",
|
|
285
287
|
name: "Shape",
|
|
286
|
-
level:
|
|
288
|
+
level: 4,
|
|
287
289
|
});
|
|
288
290
|
|
|
289
291
|
SupportedComponents .addComponent (
|
|
290
292
|
{
|
|
291
293
|
title: "Sound",
|
|
292
294
|
name: "Sound",
|
|
293
|
-
level:
|
|
295
|
+
level: 3,
|
|
294
296
|
});
|
|
295
297
|
|
|
296
298
|
SupportedComponents .addComponent (
|
|
@@ -305,14 +307,14 @@ SupportedComponents .addComponent (
|
|
|
305
307
|
{
|
|
306
308
|
title: "Texturing",
|
|
307
309
|
name: "Texturing",
|
|
308
|
-
level:
|
|
310
|
+
level: 4,
|
|
309
311
|
});
|
|
310
312
|
|
|
311
313
|
SupportedComponents .addComponent (
|
|
312
314
|
{
|
|
313
315
|
title: "Texturing3D",
|
|
314
316
|
name: "Texturing3D",
|
|
315
|
-
level:
|
|
317
|
+
level: 2,
|
|
316
318
|
external: true,
|
|
317
319
|
});
|
|
318
320
|
|
|
@@ -327,7 +329,7 @@ SupportedComponents .addComponent (
|
|
|
327
329
|
{
|
|
328
330
|
title: "Volume rendering",
|
|
329
331
|
name: "VolumeRendering",
|
|
330
|
-
level:
|
|
332
|
+
level: 4,
|
|
331
333
|
external: true,
|
|
332
334
|
dependencies: ["CADGeometry", "Texturing3D"],
|
|
333
335
|
});
|
|
@@ -108,7 +108,7 @@ SupportedProfiles .addProfile ({
|
|
|
108
108
|
SupportedComponents .get ("ParticleSystems"),
|
|
109
109
|
SupportedComponents .get ("Picking"),
|
|
110
110
|
SupportedComponents .get ("PointingDeviceSensor"),
|
|
111
|
-
SupportedComponents .get ("
|
|
111
|
+
SupportedComponents .get ("TextureProjector"),
|
|
112
112
|
SupportedComponents .get ("Rendering"),
|
|
113
113
|
SupportedComponents .get ("RigidBodyPhysics"),
|
|
114
114
|
SupportedComponents .get ("Scripting"),
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
48
|
import X3DObject from "../Base/X3DObject.js";
|
|
49
|
-
import Generator from "../InputOutput/Generator.js";
|
|
50
49
|
|
|
51
50
|
function UnitInfo (category, name, conversionFactor)
|
|
52
51
|
{
|
|
@@ -66,35 +65,33 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
66
65
|
{
|
|
67
66
|
return "UnitInfo";
|
|
68
67
|
},
|
|
69
|
-
toVRMLStream: function (
|
|
68
|
+
toVRMLStream: function (generator)
|
|
70
69
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
generator .string += "UNIT";
|
|
71
|
+
generator .string += generator .Space ();
|
|
72
|
+
generator .string += this .category;
|
|
73
|
+
generator .string += generator .Space ();
|
|
74
|
+
generator .string += this .name;
|
|
75
|
+
generator .string += generator .Space ();
|
|
76
|
+
generator .string += this .conversionFactor;
|
|
78
77
|
},
|
|
79
|
-
toXMLStream: function (
|
|
78
|
+
toXMLStream: function (generator)
|
|
80
79
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
stream .string += "'";
|
|
97
|
-
stream .string += "/>";
|
|
80
|
+
generator .string += generator .Indent ();
|
|
81
|
+
generator .string += "<unit";
|
|
82
|
+
generator .string += generator .Space ();
|
|
83
|
+
generator .string += "category='";
|
|
84
|
+
generator .string += this .category;
|
|
85
|
+
generator .string += "'";
|
|
86
|
+
generator .string += generator .Space ();
|
|
87
|
+
generator .string += "name='";
|
|
88
|
+
generator .string += generator .XMLEncode (this .name);
|
|
89
|
+
generator .string += "'";
|
|
90
|
+
generator .string += generator .Space ();
|
|
91
|
+
generator .string += "conversionFactor='";
|
|
92
|
+
generator .string += this .conversionFactor;
|
|
93
|
+
generator .string += "'";
|
|
94
|
+
generator .string += "/>";
|
|
98
95
|
},
|
|
99
96
|
});
|
|
100
97
|
|
|
@@ -59,7 +59,6 @@ import RouteArray from "../Routing/RouteArray.js";
|
|
|
59
59
|
import X3DRoute from "../Routing/X3DRoute.js";
|
|
60
60
|
import X3DCast from "../Base/X3DCast.js";
|
|
61
61
|
import X3DConstants from "../Base/X3DConstants.js";
|
|
62
|
-
import Generator from "../InputOutput/Generator.js";
|
|
63
62
|
import SFNodeCache from "../Fields/SFNodeCache.js";
|
|
64
63
|
import Algorithm from "../../standard/Math/Algorithm.js";
|
|
65
64
|
|
|
@@ -79,9 +78,14 @@ function X3DExecutionContext (executionContext)
|
|
|
79
78
|
|
|
80
79
|
this .addType (X3DConstants .X3DExecutionContext)
|
|
81
80
|
|
|
82
|
-
this .addChildObjects ("rootNodes",
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
this .addChildObjects ("rootNodes", new Fields .MFNode (),
|
|
82
|
+
"worldInfos", new Fields .MFNode (),
|
|
83
|
+
"sceneGraph_changed", new Fields .SFTime (),
|
|
84
|
+
"namedNodes_changed", new Fields .SFTime (),
|
|
85
|
+
"importedNodes_changed", new Fields .SFTime (),
|
|
86
|
+
"protos_changed", new Fields .SFTime (),
|
|
87
|
+
"externprotos_changed", new Fields .SFTime (),
|
|
88
|
+
"routes_changed", new Fields .SFTime ())
|
|
85
89
|
|
|
86
90
|
this ._rootNodes .setAccessType (X3DConstants .initializeOnly);
|
|
87
91
|
this ._rootNodes .addCloneCount (1);
|
|
@@ -91,13 +95,6 @@ function X3DExecutionContext (executionContext)
|
|
|
91
95
|
this [_protos] = new ProtoDeclarationArray ();
|
|
92
96
|
this [_externprotos] = new ExternProtoDeclarationArray ();
|
|
93
97
|
this [_routes] = new RouteArray ();
|
|
94
|
-
|
|
95
|
-
this .addChildObjects ("namedNodes_changed", new Fields .SFTime (),
|
|
96
|
-
"importedNodes_changed", new Fields .SFTime (),
|
|
97
|
-
"protos_changed", new Fields .SFTime (),
|
|
98
|
-
"externprotos_changed", new Fields .SFTime (),
|
|
99
|
-
"routes_changed", new Fields .SFTime ())
|
|
100
|
-
|
|
101
98
|
}
|
|
102
99
|
|
|
103
100
|
X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
@@ -327,8 +324,6 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
|
|
|
327
324
|
|
|
328
325
|
this [_importedNodes] .add (importedName, importedNode);
|
|
329
326
|
|
|
330
|
-
importedNode .setup ();
|
|
331
|
-
|
|
332
327
|
this ._importedNodes_changed = this .getBrowser () .getCurrentTime ();
|
|
333
328
|
},
|
|
334
329
|
removeImportedNode: function (importedName)
|
|
@@ -761,21 +756,19 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
|
|
|
761
756
|
this ._worldInfos .splice (i, 1);
|
|
762
757
|
}
|
|
763
758
|
},
|
|
764
|
-
toVRMLStream: function (
|
|
759
|
+
toVRMLStream: function (generator)
|
|
765
760
|
{
|
|
766
|
-
const generator = Generator .Get (stream);
|
|
767
|
-
|
|
768
761
|
generator .PushExecutionContext (this);
|
|
769
762
|
generator .EnterScope ();
|
|
770
763
|
generator .ImportedNodes (this .getImportedNodes ());
|
|
771
764
|
|
|
772
765
|
// Output extern protos
|
|
773
766
|
|
|
774
|
-
this .getExternProtoDeclarations () .toVRMLStream (
|
|
767
|
+
this .getExternProtoDeclarations () .toVRMLStream (generator);
|
|
775
768
|
|
|
776
769
|
// Output protos
|
|
777
770
|
|
|
778
|
-
this .getProtoDeclarations () .toVRMLStream (
|
|
771
|
+
this .getProtoDeclarations () .toVRMLStream (generator);
|
|
779
772
|
|
|
780
773
|
// Output root nodes
|
|
781
774
|
|
|
@@ -785,38 +778,28 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
|
|
|
785
778
|
{
|
|
786
779
|
const rootNode = rootNodes [i];
|
|
787
780
|
|
|
788
|
-
|
|
781
|
+
generator .string += generator .Indent ();
|
|
789
782
|
|
|
790
783
|
if (rootNode)
|
|
791
|
-
rootNode .toVRMLStream (
|
|
784
|
+
rootNode .toVRMLStream (generator);
|
|
792
785
|
else
|
|
793
|
-
|
|
786
|
+
generator .string += "NULL";
|
|
794
787
|
|
|
795
|
-
|
|
788
|
+
generator .string += generator .TidyBreak ();
|
|
796
789
|
|
|
797
790
|
if (i !== length - 1)
|
|
798
|
-
|
|
791
|
+
generator .string += generator .TidyBreak ();
|
|
799
792
|
}
|
|
800
793
|
|
|
801
794
|
// Output imported nodes
|
|
802
795
|
|
|
803
796
|
const importedNodes = this .getImportedNodes ();
|
|
804
797
|
|
|
805
|
-
if (importedNodes .
|
|
798
|
+
if (importedNodes .length)
|
|
806
799
|
{
|
|
807
|
-
|
|
800
|
+
generator .string += generator .TidyBreak ();
|
|
808
801
|
|
|
809
|
-
importedNodes .
|
|
810
|
-
{
|
|
811
|
-
try
|
|
812
|
-
{
|
|
813
|
-
importedNode .toVRMLStream (stream);
|
|
814
|
-
|
|
815
|
-
stream .string += "\n";
|
|
816
|
-
}
|
|
817
|
-
catch (error)
|
|
818
|
-
{ }
|
|
819
|
-
});
|
|
802
|
+
importedNodes .toVRMLStream (generator);
|
|
820
803
|
}
|
|
821
804
|
|
|
822
805
|
// Output routes
|
|
@@ -825,29 +808,27 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
|
|
|
825
808
|
|
|
826
809
|
if (routes .length)
|
|
827
810
|
{
|
|
828
|
-
|
|
811
|
+
generator .string += generator .TidyBreak ();
|
|
829
812
|
|
|
830
|
-
routes .toVRMLStream (
|
|
813
|
+
routes .toVRMLStream (generator);
|
|
831
814
|
}
|
|
832
815
|
|
|
833
816
|
generator .LeaveScope ();
|
|
834
817
|
generator .PopExecutionContext ();
|
|
835
818
|
},
|
|
836
|
-
toXMLStream: function (
|
|
819
|
+
toXMLStream: function (generator)
|
|
837
820
|
{
|
|
838
|
-
const generator = Generator .Get (stream);
|
|
839
|
-
|
|
840
821
|
generator .PushExecutionContext (this);
|
|
841
822
|
generator .EnterScope ();
|
|
842
823
|
generator .ImportedNodes (this .getImportedNodes ());
|
|
843
824
|
|
|
844
825
|
// Output extern protos
|
|
845
826
|
|
|
846
|
-
this .getExternProtoDeclarations () .toXMLStream (
|
|
827
|
+
this .getExternProtoDeclarations () .toXMLStream (generator);
|
|
847
828
|
|
|
848
829
|
// Output protos
|
|
849
830
|
|
|
850
|
-
this .getProtoDeclarations () .toXMLStream (
|
|
831
|
+
this .getProtoDeclarations () .toXMLStream (generator);
|
|
851
832
|
|
|
852
833
|
// Output root nodes
|
|
853
834
|
|
|
@@ -855,30 +836,18 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
|
|
|
855
836
|
|
|
856
837
|
if (rootNodes .length)
|
|
857
838
|
{
|
|
858
|
-
rootNodes .toXMLStream (
|
|
839
|
+
rootNodes .toXMLStream (generator);
|
|
859
840
|
|
|
860
|
-
|
|
841
|
+
generator .string += generator .TidyBreak ();
|
|
861
842
|
}
|
|
862
843
|
|
|
863
844
|
// Output imported nodes
|
|
864
845
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
importedNodes .forEach (function (importedNode)
|
|
868
|
-
{
|
|
869
|
-
try
|
|
870
|
-
{
|
|
871
|
-
importedNode .toXMLStream (stream);
|
|
872
|
-
|
|
873
|
-
stream .string += "\n";
|
|
874
|
-
}
|
|
875
|
-
catch (error)
|
|
876
|
-
{ }
|
|
877
|
-
});
|
|
846
|
+
this .getImportedNodes () .toXMLStream (generator);
|
|
878
847
|
|
|
879
848
|
// Output routes
|
|
880
849
|
|
|
881
|
-
this .getRoutes () .toXMLStream (
|
|
850
|
+
this .getRoutes () .toXMLStream (generator);
|
|
882
851
|
|
|
883
852
|
generator .LeaveScope ();
|
|
884
853
|
generator .PopExecutionContext ();
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
|
|
48
48
|
import X3DObject from "../Base/X3DObject.js";
|
|
49
49
|
import SFNodeCache from "../Fields/SFNodeCache.js";
|
|
50
|
-
import Generator from "../InputOutput/Generator.js";
|
|
51
50
|
|
|
52
51
|
const
|
|
53
52
|
_exportedName = Symbol (),
|
|
@@ -72,47 +71,43 @@ X3DExportedNode .prototype = Object .assign (Object .create (X3DObject .prototyp
|
|
|
72
71
|
{
|
|
73
72
|
return this [_localNode];
|
|
74
73
|
},
|
|
75
|
-
toVRMLStream: function (
|
|
74
|
+
toVRMLStream: function (generator)
|
|
76
75
|
{
|
|
77
|
-
const
|
|
78
|
-
generator = Generator .Get (stream),
|
|
79
|
-
localName = generator .LocalName (this [_localNode]);
|
|
76
|
+
const localName = generator .LocalName (this [_localNode]);
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
generator .string += generator .Indent ();
|
|
79
|
+
generator .string += "EXPORT";
|
|
80
|
+
generator .string += generator .Space ();
|
|
81
|
+
generator .string += localName;
|
|
85
82
|
|
|
86
83
|
if (this [_exportedName] !== localName)
|
|
87
84
|
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
generator .string += generator .Space ();
|
|
86
|
+
generator .string += "AS";
|
|
87
|
+
generator .string += generator .Space ();
|
|
88
|
+
generator .string += this [_exportedName];
|
|
92
89
|
}
|
|
93
90
|
},
|
|
94
|
-
toXMLStream: function (
|
|
91
|
+
toXMLStream: function (generator)
|
|
95
92
|
{
|
|
96
|
-
const
|
|
97
|
-
generator = Generator .Get (stream),
|
|
98
|
-
localName = generator .LocalName (this [_localNode]);
|
|
93
|
+
const localName = generator .LocalName (this [_localNode]);
|
|
99
94
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
generator .string += generator .Indent ();
|
|
96
|
+
generator .string += "<EXPORT";
|
|
97
|
+
generator .string += generator .Space ();
|
|
98
|
+
generator .string += "localDEF='";
|
|
99
|
+
generator .string += generator .XMLEncode (localName);
|
|
100
|
+
generator .string += "'";
|
|
106
101
|
|
|
107
102
|
if (this [_exportedName] !== localName)
|
|
108
103
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
generator .string += generator .Space ();
|
|
105
|
+
generator .string += "AS='";
|
|
106
|
+
generator .string += generator .XMLEncode (this [_exportedName]);
|
|
107
|
+
generator .string += "'";
|
|
113
108
|
}
|
|
114
109
|
|
|
115
|
-
|
|
110
|
+
generator .string += "/>";
|
|
116
111
|
},
|
|
117
112
|
});
|
|
118
113
|
|