x_ite 8.6.20 → 8.6.22
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/Makefile +1 -4
- package/build/bin/components.js +45 -0
- 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 +18 -18
- 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 +22 -22
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- 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/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +30 -30
- 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 +746 -613
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +2 -2
- package/docs/_posts/dom-integration.md +14 -12
- package/docs/_posts/getting-started.md +13 -11
- package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +1 -1
- package/docs/_posts/reference/scene-services.md +6 -3
- package/docs/_posts/report-a-bug.md +5 -3
- package/docs/_posts/setup-a-localhost-server.md +7 -7
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
- package/docs/_tabs/playground.html +8 -12
- package/package.json +1 -1
- package/src/locale/de.po.js +9 -0
- package/src/locale/fr.po.js +31 -25
- package/src/tests.js +1 -0
- package/src/x_ite/Base/X3DBaseNode.js +2 -12
- package/src/x_ite/Base/X3DInfoArray.js +0 -2
- package/src/x_ite/Base/X3DObjectArrayField.js +0 -2
- package/src/x_ite/Base/X3DTypedArrayField.js +0 -2
- package/src/x_ite/Browser/Core/BrowserTimings.js +147 -67
- package/src/x_ite/Browser/Core/ContextMenu.js +2 -2
- package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -2
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +7 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +0 -10
- package/src/x_ite/Browser/X3DBrowserContext.js +0 -1
- package/src/x_ite/Components/Core/X3DNode.js +40 -9
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +5 -5
- package/src/x_ite/Configuration/ComponentInfo.js +2 -1
- package/src/x_ite/Configuration/ProfileInfo.js +1 -0
- package/src/x_ite/Configuration/UnitInfo.js +3 -5
- package/src/x_ite/Execution/BindableList.js +34 -27
- package/src/x_ite/Execution/BindableStack.js +15 -17
- package/src/x_ite/Execution/X3DExecutionContext.js +7 -17
- package/src/x_ite/Execution/X3DExportedNode.js +1 -3
- package/src/x_ite/Execution/X3DImportedNode.js +2 -6
- package/src/x_ite/Execution/X3DScene.js +30 -28
- package/src/x_ite/Fields/ArrayFields.js +4 -4
- package/src/x_ite/Fields/SFColor.js +0 -3
- package/src/x_ite/Fields/SFColorRGBA.js +0 -4
- package/src/x_ite/Fields/SFImage.js +0 -4
- package/src/x_ite/Fields/SFMatrix3.js +0 -1
- package/src/x_ite/Fields/SFMatrix4.js +0 -1
- package/src/x_ite/Fields/SFRotation.js +0 -4
- package/src/x_ite/Fields/SFString.js +7 -4
- package/src/x_ite/Fields/SFVec2.js +0 -2
- package/src/x_ite/Fields/SFVec3.js +0 -3
- package/src/x_ite/Fields/SFVec4.js +0 -4
- package/src/x_ite/InputOutput/Generator.js +86 -16
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -8
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +2 -6
- package/src/x_ite/Routing/X3DRoute.js +1 -5
- package/src/x_ite/X3DCanvasElement.js +2 -0
- package/src/x_ite.css +5 -1
- package/src/x_ite.html +4 -36
- package/x_ite.min.html +4 -36
|
@@ -51,7 +51,6 @@ function UnitInfo (category, name, conversionFactor)
|
|
|
51
51
|
{
|
|
52
52
|
Object .defineProperty (this, "category", {
|
|
53
53
|
value: category,
|
|
54
|
-
writable: false,
|
|
55
54
|
});
|
|
56
55
|
|
|
57
56
|
this .name = name;
|
|
@@ -67,6 +66,7 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
67
66
|
},
|
|
68
67
|
toVRMLStream: function (generator)
|
|
69
68
|
{
|
|
69
|
+
generator .string += generator .Indent ();
|
|
70
70
|
generator .string += "UNIT";
|
|
71
71
|
generator .string += generator .Space ();
|
|
72
72
|
generator .string += this .category;
|
|
@@ -91,7 +91,7 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
91
91
|
generator .string += "conversionFactor='";
|
|
92
92
|
generator .string += this .conversionFactor;
|
|
93
93
|
generator .string += "'";
|
|
94
|
-
generator .string += "/>";
|
|
94
|
+
generator .string += generator .closingTags ? "></unit>" : "/>";
|
|
95
95
|
},
|
|
96
96
|
toJSONStream: function (generator, _throw)
|
|
97
97
|
{
|
|
@@ -134,7 +134,7 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
134
134
|
generator .string += '"';
|
|
135
135
|
generator .string += ':';
|
|
136
136
|
generator .string += generator .TidySpace ();
|
|
137
|
-
generator .string +=
|
|
137
|
+
generator .string += this .conversionFactor;
|
|
138
138
|
generator .string += generator .TidyBreak ();
|
|
139
139
|
|
|
140
140
|
generator .string += generator .DecIndent ();
|
|
@@ -149,8 +149,6 @@ for (const key of Reflect .ownKeys (UnitInfo .prototype))
|
|
|
149
149
|
Object .defineProperty (UnitInfo .prototype, "conversion_factor",
|
|
150
150
|
{
|
|
151
151
|
get: function () { return this .conversionFactor; },
|
|
152
|
-
enumerable: false,
|
|
153
|
-
configurable: false
|
|
154
152
|
});
|
|
155
153
|
|
|
156
154
|
export default UnitInfo;
|
|
@@ -52,10 +52,11 @@ function BindableList (executionContext, defaultNode)
|
|
|
52
52
|
{
|
|
53
53
|
X3DBaseNode .call (this, executionContext);
|
|
54
54
|
|
|
55
|
-
this .
|
|
56
|
-
this .
|
|
57
|
-
this .
|
|
58
|
-
this .
|
|
55
|
+
this .updateTime = 0;
|
|
56
|
+
this .nodes = [ defaultNode ];
|
|
57
|
+
this .collectedNodes = [ defaultNode ];
|
|
58
|
+
this .changedNodes = [ ];
|
|
59
|
+
this .removedNodes = [ ];
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
@@ -67,14 +68,14 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
67
68
|
},
|
|
68
69
|
get: function ()
|
|
69
70
|
{
|
|
70
|
-
return this .
|
|
71
|
+
return this .nodes;
|
|
71
72
|
},
|
|
72
73
|
getBound: function (name)
|
|
73
74
|
{
|
|
74
|
-
const length = this .
|
|
75
|
+
const length = this .nodes .length;
|
|
75
76
|
|
|
76
77
|
if (length === 1)
|
|
77
|
-
return this .
|
|
78
|
+
return this .nodes [0]; // Return default viewpoint.
|
|
78
79
|
|
|
79
80
|
const enableInlineBindables = false;
|
|
80
81
|
|
|
@@ -85,7 +86,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
85
86
|
for (let i = 1; i < length; ++ i)
|
|
86
87
|
{
|
|
87
88
|
const
|
|
88
|
-
node = this .
|
|
89
|
+
node = this .nodes [i],
|
|
89
90
|
scene = node .getExecutionContext () .getOuterNode () ?.getScene () ?? node .getScene ();
|
|
90
91
|
|
|
91
92
|
if (!enableInlineBindables && !scene .isMainScene ())
|
|
@@ -101,7 +102,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
101
102
|
for (let i = 1; i < length; ++ i)
|
|
102
103
|
{
|
|
103
104
|
const
|
|
104
|
-
node = this .
|
|
105
|
+
node = this .nodes [i],
|
|
105
106
|
scene = node .getExecutionContext () .getOuterNode () ?.getScene () ?? node .getScene ();
|
|
106
107
|
|
|
107
108
|
if (!enableInlineBindables && !scene .isMainScene ())
|
|
@@ -116,7 +117,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
116
117
|
for (let i = 1; i < length; ++ i)
|
|
117
118
|
{
|
|
118
119
|
const
|
|
119
|
-
node = this .
|
|
120
|
+
node = this .nodes [i],
|
|
120
121
|
scene = node .getExecutionContext () .getOuterNode () ?.getScene () ?? node .getScene ();
|
|
121
122
|
|
|
122
123
|
if (!enableInlineBindables && !scene .isMainScene ())
|
|
@@ -125,46 +126,52 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
125
126
|
return node;
|
|
126
127
|
}
|
|
127
128
|
|
|
128
|
-
return this .
|
|
129
|
+
return this .nodes [0]; // Return default viewpoint.
|
|
129
130
|
},
|
|
130
131
|
push: function (node)
|
|
131
132
|
{
|
|
132
|
-
return this .
|
|
133
|
+
return this .collectedNodes .push (node);
|
|
133
134
|
},
|
|
134
135
|
update: function (layerNode, stack)
|
|
135
136
|
{
|
|
136
137
|
const
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
collectedNodes = this .collectedNodes,
|
|
139
|
+
changedNodes = this .changedNodes,
|
|
140
|
+
removedNodes = this .removedNodes;
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
for (const node of collectedNodes)
|
|
141
143
|
{
|
|
142
|
-
|
|
144
|
+
if (node ._set_bind .getModificationTime () > this .updateTime)
|
|
145
|
+
changedNodes .push (node);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (!equals (collectedNodes, this .nodes))
|
|
149
|
+
{
|
|
150
|
+
// Unbind nodes not in current list (collectedNodes);
|
|
143
151
|
|
|
144
|
-
for (const node of this .
|
|
152
|
+
for (const node of this .nodes)
|
|
145
153
|
{
|
|
146
|
-
if (
|
|
147
|
-
{
|
|
154
|
+
if (collectedNodes .indexOf (node) === -1)
|
|
148
155
|
removedNodes .push (node);
|
|
149
|
-
}
|
|
150
156
|
}
|
|
151
157
|
|
|
152
|
-
// Swap
|
|
158
|
+
// Swap nodes.
|
|
153
159
|
|
|
154
|
-
const tmp = this .
|
|
160
|
+
const tmp = this .nodes;
|
|
155
161
|
|
|
156
|
-
this .
|
|
157
|
-
this .
|
|
162
|
+
this .nodes = collectedNodes;
|
|
163
|
+
this .collectedNodes = tmp;
|
|
158
164
|
}
|
|
159
165
|
|
|
160
|
-
// Clear collected
|
|
166
|
+
// Clear collected nodes.
|
|
161
167
|
|
|
162
|
-
this .
|
|
168
|
+
this .collectedNodes .length = 1;
|
|
163
169
|
|
|
164
170
|
// Update stack.
|
|
165
171
|
|
|
166
172
|
stack .update (layerNode, removedNodes, changedNodes)
|
|
167
173
|
|
|
174
|
+
changedNodes .length = 0;
|
|
168
175
|
removedNodes .length = 0;
|
|
169
176
|
|
|
170
177
|
// Advance updateTime time.
|
|
@@ -176,7 +183,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
176
183
|
for (const key of Reflect .ownKeys (BindableList .prototype))
|
|
177
184
|
Object .defineProperty (BindableList .prototype, key, { enumerable: false });
|
|
178
185
|
|
|
179
|
-
// Compares two
|
|
186
|
+
// Compares two nodess.
|
|
180
187
|
|
|
181
188
|
function equals (lhs, rhs)
|
|
182
189
|
{
|
|
@@ -51,7 +51,7 @@ function BindableStack (executionContext, defaultNode)
|
|
|
51
51
|
{
|
|
52
52
|
X3DBaseNode .call (this, executionContext);
|
|
53
53
|
|
|
54
|
-
this .
|
|
54
|
+
this .nodes = [ defaultNode ];
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
@@ -63,18 +63,18 @@ BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototyp
|
|
|
63
63
|
},
|
|
64
64
|
get: function ()
|
|
65
65
|
{
|
|
66
|
-
return this .
|
|
66
|
+
return this .nodes;
|
|
67
67
|
},
|
|
68
68
|
top: function ()
|
|
69
69
|
{
|
|
70
|
-
return this .
|
|
70
|
+
return this .nodes .at (-1);
|
|
71
71
|
},
|
|
72
72
|
pushOnTop: function (node)
|
|
73
73
|
{
|
|
74
|
-
if (node !== this .
|
|
74
|
+
if (node !== this .nodes [0])
|
|
75
75
|
{
|
|
76
|
-
this .
|
|
77
|
-
this .
|
|
76
|
+
this .nodes .at (-1) ._isBound = false;
|
|
77
|
+
this .nodes .push (node);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Don't do set_bind.
|
|
@@ -92,25 +92,25 @@ BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototyp
|
|
|
92
92
|
|
|
93
93
|
const
|
|
94
94
|
fromNode = this .top (),
|
|
95
|
-
boundNode = this .
|
|
95
|
+
boundNode = this .nodes .at (-1);
|
|
96
96
|
|
|
97
97
|
// Remove invisible nodes and unbind them if needed.
|
|
98
98
|
|
|
99
99
|
for (const removedNode of removedNodes)
|
|
100
100
|
{
|
|
101
|
-
const index = this .
|
|
101
|
+
const index = this .nodes .indexOf (removedNode);
|
|
102
102
|
|
|
103
103
|
if (index > 0)
|
|
104
|
-
this .
|
|
104
|
+
this .nodes .splice (index, 1);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Unbind nodes with set_bind false and pop top node.
|
|
108
108
|
|
|
109
|
-
if (boundNode !== this .
|
|
109
|
+
if (boundNode !== this .nodes [0])
|
|
110
110
|
{
|
|
111
111
|
if (changedNodes .some (node => ! node ._set_bind .getValue () && node === boundNode))
|
|
112
112
|
{
|
|
113
|
-
this .
|
|
113
|
+
this .nodes .pop ();
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -120,20 +120,18 @@ BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototyp
|
|
|
120
120
|
{
|
|
121
121
|
if (bindNode ._set_bind .getValue ())
|
|
122
122
|
{
|
|
123
|
-
const index = this .
|
|
123
|
+
const index = this .nodes .indexOf (bindNode);
|
|
124
124
|
|
|
125
125
|
if (index > -1)
|
|
126
|
-
|
|
127
|
-
this .array .splice (index, 1);
|
|
128
|
-
}
|
|
126
|
+
this .nodes .splice (index, 1);
|
|
129
127
|
|
|
130
|
-
this .
|
|
128
|
+
this .nodes .push (bindNode);
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
// Bind top node if not bound.
|
|
135
133
|
|
|
136
|
-
const top = this .
|
|
134
|
+
const top = this .nodes .at (-1);
|
|
137
135
|
|
|
138
136
|
if (top !== boundNode)
|
|
139
137
|
{
|
|
@@ -942,73 +942,63 @@ for (const key of Reflect .ownKeys (X3DExecutionContext .prototype))
|
|
|
942
942
|
|
|
943
943
|
Object .defineProperty (X3DExecutionContext .prototype, "specificationVersion",
|
|
944
944
|
{
|
|
945
|
-
get:
|
|
945
|
+
get: function () { return this .getSpecificationVersion () },
|
|
946
946
|
enumerable: true,
|
|
947
|
-
configurable: false
|
|
948
947
|
});
|
|
949
948
|
|
|
950
949
|
Object .defineProperty (X3DExecutionContext .prototype, "encoding",
|
|
951
950
|
{
|
|
952
|
-
get:
|
|
951
|
+
get: function () { return this .getEncoding () },
|
|
953
952
|
enumerable: true,
|
|
954
|
-
configurable: false
|
|
955
953
|
});
|
|
956
954
|
|
|
957
955
|
Object .defineProperty (X3DExecutionContext .prototype, "profile",
|
|
958
956
|
{
|
|
959
|
-
get:
|
|
957
|
+
get: function () { return this .getProfile () },
|
|
960
958
|
enumerable: true,
|
|
961
|
-
configurable: false
|
|
962
959
|
});
|
|
963
960
|
|
|
964
961
|
Object .defineProperty (X3DExecutionContext .prototype, "components",
|
|
965
962
|
{
|
|
966
|
-
get:
|
|
963
|
+
get: function () { return this .getComponents () },
|
|
967
964
|
enumerable: true,
|
|
968
|
-
configurable: false
|
|
969
965
|
});
|
|
970
966
|
|
|
971
967
|
Object .defineProperty (X3DExecutionContext .prototype, "worldURL",
|
|
972
968
|
{
|
|
973
|
-
get:
|
|
969
|
+
get: function () { return this .getWorldURL () },
|
|
974
970
|
enumerable: true,
|
|
975
|
-
configurable: false
|
|
976
971
|
});
|
|
977
972
|
|
|
978
973
|
Object .defineProperty (X3DExecutionContext .prototype, "units",
|
|
979
974
|
{
|
|
980
|
-
get:
|
|
975
|
+
get: function () { return this .getUnits () },
|
|
981
976
|
enumerable: true,
|
|
982
|
-
configurable: false
|
|
983
977
|
});
|
|
984
978
|
|
|
985
979
|
Object .defineProperty (X3DExecutionContext .prototype, "rootNodes",
|
|
986
980
|
{
|
|
987
981
|
get: X3DExecutionContext .prototype .getRootNodes,
|
|
988
|
-
set:
|
|
982
|
+
set: function (value) { this .setRootNodes (value) },
|
|
989
983
|
enumerable: true,
|
|
990
|
-
configurable: false
|
|
991
984
|
});
|
|
992
985
|
|
|
993
986
|
Object .defineProperty (X3DExecutionContext .prototype, "protos",
|
|
994
987
|
{
|
|
995
988
|
get: X3DExecutionContext .prototype .getProtoDeclarations,
|
|
996
989
|
enumerable: true,
|
|
997
|
-
configurable: false
|
|
998
990
|
});
|
|
999
991
|
|
|
1000
992
|
Object .defineProperty (X3DExecutionContext .prototype, "externprotos",
|
|
1001
993
|
{
|
|
1002
994
|
get: X3DExecutionContext .prototype .getExternProtoDeclarations,
|
|
1003
995
|
enumerable: true,
|
|
1004
|
-
configurable: false
|
|
1005
996
|
});
|
|
1006
997
|
|
|
1007
998
|
Object .defineProperty (X3DExecutionContext .prototype, "routes",
|
|
1008
999
|
{
|
|
1009
1000
|
get: X3DExecutionContext .prototype .getRoutes,
|
|
1010
1001
|
enumerable: true,
|
|
1011
|
-
configurable: false
|
|
1012
1002
|
});
|
|
1013
1003
|
|
|
1014
1004
|
export default X3DExecutionContext;
|
|
@@ -107,7 +107,7 @@ X3DExportedNode .prototype = Object .assign (Object .create (X3DObject .prototyp
|
|
|
107
107
|
generator .string += "'";
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
generator .string += "/>";
|
|
110
|
+
generator .string += generator .closingTags ? "></EXPORT>" : "/>";
|
|
111
111
|
},
|
|
112
112
|
toJSONStream: function (generator)
|
|
113
113
|
{
|
|
@@ -177,7 +177,6 @@ Object .defineProperty (X3DExportedNode .prototype, "exportedName",
|
|
|
177
177
|
return SFNodeCache .get (this [_exportedName]);
|
|
178
178
|
},
|
|
179
179
|
enumerable: true,
|
|
180
|
-
configurable: false
|
|
181
180
|
});
|
|
182
181
|
|
|
183
182
|
Object .defineProperty (X3DExportedNode .prototype, "localNode",
|
|
@@ -187,7 +186,6 @@ Object .defineProperty (X3DExportedNode .prototype, "localNode",
|
|
|
187
186
|
return SFNodeCache .get (this [_localNode]);
|
|
188
187
|
},
|
|
189
188
|
enumerable: true,
|
|
190
|
-
configurable: false
|
|
191
189
|
});
|
|
192
190
|
|
|
193
191
|
export default X3DExportedNode;
|
|
@@ -267,7 +267,7 @@ X3DImportedNode .prototype = Object .assign (Object .create (X3DNode .prototype)
|
|
|
267
267
|
generator .string += "'";
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
generator .string += "/>";
|
|
270
|
+
generator .string += generator .closingTags ? "></IMPORT>" : "/>";
|
|
271
271
|
|
|
272
272
|
try
|
|
273
273
|
{
|
|
@@ -316,7 +316,7 @@ X3DImportedNode .prototype = Object .assign (Object .create (X3DNode .prototype)
|
|
|
316
316
|
generator .string += "toField='";
|
|
317
317
|
generator .string += generator .XMLEncode (destinationField);
|
|
318
318
|
generator .string += "'";
|
|
319
|
-
generator .string += "/>";
|
|
319
|
+
generator .string += generator .closingTags ? "></ROUTE>" : "/>";
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -520,7 +520,6 @@ Object .defineProperty (X3DImportedNode .prototype, "inlineNode",
|
|
|
520
520
|
return SFNodeCache .get (this [_inlineNode]);
|
|
521
521
|
},
|
|
522
522
|
enumerable: true,
|
|
523
|
-
configurable: false
|
|
524
523
|
});
|
|
525
524
|
|
|
526
525
|
Object .defineProperty (X3DImportedNode .prototype, "exportedName",
|
|
@@ -530,7 +529,6 @@ Object .defineProperty (X3DImportedNode .prototype, "exportedName",
|
|
|
530
529
|
return this [_exportedName];
|
|
531
530
|
},
|
|
532
531
|
enumerable: true,
|
|
533
|
-
configurable: false
|
|
534
532
|
});
|
|
535
533
|
|
|
536
534
|
Object .defineProperty (X3DImportedNode .prototype, "exportedNode",
|
|
@@ -540,7 +538,6 @@ Object .defineProperty (X3DImportedNode .prototype, "exportedNode",
|
|
|
540
538
|
return this [_inlineNode] .getInternalScene () .getExportedNode (this [_exportedName]);
|
|
541
539
|
},
|
|
542
540
|
enumerable: true,
|
|
543
|
-
configurable: false
|
|
544
541
|
});
|
|
545
542
|
|
|
546
543
|
Object .defineProperty (X3DImportedNode .prototype, "importedName",
|
|
@@ -550,7 +547,6 @@ Object .defineProperty (X3DImportedNode .prototype, "importedName",
|
|
|
550
547
|
return this [_importedName];
|
|
551
548
|
},
|
|
552
549
|
enumerable: true,
|
|
553
|
-
configurable: false
|
|
554
550
|
});
|
|
555
551
|
|
|
556
552
|
export default X3DImportedNode;
|
|
@@ -399,6 +399,7 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
399
399
|
},
|
|
400
400
|
toVRMLStream: function (generator)
|
|
401
401
|
{
|
|
402
|
+
generator .string += generator .Indent ();
|
|
402
403
|
generator .string += "#X3D V";
|
|
403
404
|
generator .string += LATEST_VERSION;
|
|
404
405
|
generator .string += generator .Space ();
|
|
@@ -430,34 +431,29 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
430
431
|
generator .string += generator .TidyBreak ();
|
|
431
432
|
}
|
|
432
433
|
|
|
433
|
-
|
|
434
|
-
{
|
|
435
|
-
let empty = true;
|
|
434
|
+
const units = this .getUnits () .filter (unit => unit .conversionFactor !== 1);
|
|
436
435
|
|
|
437
|
-
|
|
436
|
+
if (units .length)
|
|
437
|
+
{
|
|
438
|
+
for (const unit of units)
|
|
438
439
|
{
|
|
439
|
-
|
|
440
|
-
{
|
|
441
|
-
empty = false;
|
|
442
|
-
|
|
443
|
-
unit .toVRMLStream (generator);
|
|
440
|
+
unit .toVRMLStream (generator);
|
|
444
441
|
|
|
445
|
-
|
|
446
|
-
}
|
|
442
|
+
generator .string += generator .Break ();
|
|
447
443
|
}
|
|
448
444
|
|
|
449
|
-
|
|
450
|
-
generator .string += generator .TidyBreak ();
|
|
445
|
+
generator .string += generator .TidyBreak ();
|
|
451
446
|
}
|
|
452
447
|
|
|
453
448
|
const metadata = this .getMetaDatas ();
|
|
454
449
|
|
|
455
450
|
if (metadata .size)
|
|
456
451
|
{
|
|
457
|
-
for (const [key, values] of metadata
|
|
452
|
+
for (const [key, values] of metadata)
|
|
458
453
|
{
|
|
459
454
|
for (const value of values)
|
|
460
455
|
{
|
|
456
|
+
generator .string += generator .Indent ();
|
|
461
457
|
generator .string += "META";
|
|
462
458
|
generator .string += generator .Space ();
|
|
463
459
|
generator .string += new Fields .SFString (key) .toString ();
|
|
@@ -490,15 +486,21 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
490
486
|
},
|
|
491
487
|
toXMLStream: function (generator)
|
|
492
488
|
{
|
|
493
|
-
generator .
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
489
|
+
if (!generator .html)
|
|
490
|
+
{
|
|
491
|
+
generator .string += generator .Indent ();
|
|
492
|
+
generator .string += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
493
|
+
generator .string += generator .TidyBreak ();
|
|
494
|
+
generator .string += generator .Indent ();
|
|
495
|
+
generator .string += "<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D ";
|
|
496
|
+
generator .string += LATEST_VERSION;
|
|
497
|
+
generator .string += "//EN\" \"http://www.web3d.org/specifications/x3d-";
|
|
498
|
+
generator .string += LATEST_VERSION;
|
|
499
|
+
generator .string += ".dtd\">";
|
|
500
|
+
generator .string += generator .TidyBreak ();
|
|
501
|
+
}
|
|
501
502
|
|
|
503
|
+
generator .string += generator .Indent ();
|
|
502
504
|
generator .string += "<X3D";
|
|
503
505
|
generator .string += generator .Space ();
|
|
504
506
|
generator .string += "profile='";
|
|
@@ -542,7 +544,7 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
542
544
|
}
|
|
543
545
|
}
|
|
544
546
|
|
|
545
|
-
for (const [key, values] of this .getMetaDatas ()
|
|
547
|
+
for (const [key, values] of this .getMetaDatas ())
|
|
546
548
|
{
|
|
547
549
|
for (const value of values)
|
|
548
550
|
{
|
|
@@ -556,7 +558,7 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
556
558
|
generator .string += "content='";
|
|
557
559
|
generator .string += generator .XMLEncode (value);
|
|
558
560
|
generator .string += "'";
|
|
559
|
-
generator .string += "/>";
|
|
561
|
+
generator .string += generator .closingTags ? "></meta>" : "/>";
|
|
560
562
|
generator .string += generator .TidyBreak ();
|
|
561
563
|
}
|
|
562
564
|
}
|
|
@@ -612,13 +614,14 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
612
614
|
|
|
613
615
|
generator .DecIndent ();
|
|
614
616
|
|
|
617
|
+
generator .string += generator .Indent ();
|
|
615
618
|
generator .string += "</X3D>";
|
|
616
|
-
generator .string += generator .TidyBreak ();
|
|
617
619
|
},
|
|
618
620
|
toJSONStream: function (generator)
|
|
619
621
|
{
|
|
620
622
|
// X3D
|
|
621
623
|
|
|
624
|
+
generator .string += generator .Indent ();
|
|
622
625
|
generator .string += '{';
|
|
623
626
|
generator .string += generator .TidySpace ();
|
|
624
627
|
generator .string += '"';
|
|
@@ -756,9 +759,9 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
756
759
|
|
|
757
760
|
// Meta data
|
|
758
761
|
|
|
759
|
-
for (const [i, [key, values]] of [... this .getMetaDatas ()]
|
|
762
|
+
for (const [i, [key, values]] of [... this .getMetaDatas ()])
|
|
760
763
|
{
|
|
761
|
-
for (const [j, value] of values
|
|
764
|
+
for (const [j, value] of values)
|
|
762
765
|
{
|
|
763
766
|
generator .string += generator .Indent ();
|
|
764
767
|
generator .string += '{';
|
|
@@ -957,7 +960,6 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
|
|
|
957
960
|
generator .string += generator .DecIndent ();
|
|
958
961
|
generator .string += generator .Indent ();
|
|
959
962
|
generator .string += '}';
|
|
960
|
-
generator .string += generator .TidyBreak ();
|
|
961
963
|
},
|
|
962
964
|
});
|
|
963
965
|
|
|
@@ -325,7 +325,7 @@ MFNode .prototype = Object .assign (Object .create (X3DObjectArrayField .prototy
|
|
|
325
325
|
generator .string += "'";
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
generator .string += "/>";
|
|
328
|
+
generator .string += generator .closingTags ? "></NULL>" : "/>";
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
@@ -451,7 +451,7 @@ MFString .prototype = Object .assign (Object .create (X3DObjectArrayField .proto
|
|
|
451
451
|
{
|
|
452
452
|
return X3DConstants .MFString;
|
|
453
453
|
},
|
|
454
|
-
toXMLStream: function (generator)
|
|
454
|
+
toXMLStream: function (generator, sourceText)
|
|
455
455
|
{
|
|
456
456
|
const
|
|
457
457
|
target = this .getTarget (),
|
|
@@ -464,14 +464,14 @@ MFString .prototype = Object .assign (Object .create (X3DObjectArrayField .proto
|
|
|
464
464
|
for (let i = 0, n = length - 1; i < n; ++ i)
|
|
465
465
|
{
|
|
466
466
|
generator .string += "\"";
|
|
467
|
-
value [i] .toXMLStream (generator);
|
|
467
|
+
value [i] .toXMLStream (generator, sourceText);
|
|
468
468
|
generator .string += "\"";
|
|
469
469
|
generator .string += generator .Comma ();
|
|
470
470
|
generator .string += generator .TidySpace ();
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
generator .string += "\"";
|
|
474
|
-
value .at (-1) .toXMLStream (generator);
|
|
474
|
+
value .at (-1) .toXMLStream (generator, sourceText);
|
|
475
475
|
generator .string += "\"";
|
|
476
476
|
}
|
|
477
477
|
},
|
|
@@ -189,7 +189,6 @@ const r = {
|
|
|
189
189
|
this .addEvent ();
|
|
190
190
|
},
|
|
191
191
|
enumerable: true,
|
|
192
|
-
configurable: false
|
|
193
192
|
};
|
|
194
193
|
|
|
195
194
|
const g = {
|
|
@@ -203,7 +202,6 @@ const g = {
|
|
|
203
202
|
this .addEvent ();
|
|
204
203
|
},
|
|
205
204
|
enumerable: true,
|
|
206
|
-
configurable: false
|
|
207
205
|
};
|
|
208
206
|
|
|
209
207
|
const b = {
|
|
@@ -217,7 +215,6 @@ const b = {
|
|
|
217
215
|
this .addEvent ();
|
|
218
216
|
},
|
|
219
217
|
enumerable: true,
|
|
220
|
-
configurable: false
|
|
221
218
|
};
|
|
222
219
|
|
|
223
220
|
Object .defineProperty (SFColor .prototype, "r", r);
|
|
@@ -142,7 +142,6 @@ const r = {
|
|
|
142
142
|
this .addEvent ();
|
|
143
143
|
},
|
|
144
144
|
enumerable: true,
|
|
145
|
-
configurable: false
|
|
146
145
|
};
|
|
147
146
|
|
|
148
147
|
const g = {
|
|
@@ -156,7 +155,6 @@ const g = {
|
|
|
156
155
|
this .addEvent ();
|
|
157
156
|
},
|
|
158
157
|
enumerable: true,
|
|
159
|
-
configurable: false
|
|
160
158
|
};
|
|
161
159
|
|
|
162
160
|
const b = {
|
|
@@ -170,7 +168,6 @@ const b = {
|
|
|
170
168
|
this .addEvent ();
|
|
171
169
|
},
|
|
172
170
|
enumerable: true,
|
|
173
|
-
configurable: false
|
|
174
171
|
};
|
|
175
172
|
|
|
176
173
|
const a = {
|
|
@@ -184,7 +181,6 @@ const a = {
|
|
|
184
181
|
this .addEvent ();
|
|
185
182
|
},
|
|
186
183
|
enumerable: true,
|
|
187
|
-
configurable: false
|
|
188
184
|
};
|
|
189
185
|
|
|
190
186
|
Object .defineProperty (SFColorRGBA .prototype, "r", r);
|
|
@@ -299,7 +299,6 @@ const width = {
|
|
|
299
299
|
this .addEvent ();
|
|
300
300
|
},
|
|
301
301
|
enumerable: true,
|
|
302
|
-
configurable: false
|
|
303
302
|
};
|
|
304
303
|
|
|
305
304
|
const height = {
|
|
@@ -313,7 +312,6 @@ const height = {
|
|
|
313
312
|
this .addEvent ();
|
|
314
313
|
},
|
|
315
314
|
enumerable: true,
|
|
316
|
-
configurable: false
|
|
317
315
|
};
|
|
318
316
|
|
|
319
317
|
const comp = {
|
|
@@ -327,7 +325,6 @@ const comp = {
|
|
|
327
325
|
this .addEvent ();
|
|
328
326
|
},
|
|
329
327
|
enumerable: true,
|
|
330
|
-
configurable: false
|
|
331
328
|
};
|
|
332
329
|
|
|
333
330
|
const array = {
|
|
@@ -341,7 +338,6 @@ const array = {
|
|
|
341
338
|
this .addEvent ();
|
|
342
339
|
},
|
|
343
340
|
enumerable: true,
|
|
344
|
-
configurable: false
|
|
345
341
|
};
|
|
346
342
|
|
|
347
343
|
Object .defineProperty (SFImage .prototype, "width", width);
|