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
|
@@ -144,14 +144,25 @@ Creates or updates the exported node *exportedName.*
|
|
|
144
144
|
|
|
145
145
|
Removes the exported node *exportedName.*
|
|
146
146
|
|
|
147
|
-
#### String **toVRMLString** ()
|
|
147
|
+
#### String **toVRMLString** (\[options\])
|
|
148
148
|
|
|
149
149
|
Returns the X3D VRML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this scene.
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
##### Options
|
|
152
|
+
|
|
153
|
+
An object with one or more of these properties:
|
|
154
|
+
|
|
155
|
+
* **scene:** scene to use for units (default: current scene)
|
|
156
|
+
* **style:** string, output style (one of: **"TIDY"**, "COMPACT", "SMALL", "CLEAN")
|
|
157
|
+
* **precision:** integer, float precision (default: 6)
|
|
158
|
+
* **doublePrecision:** integer, double precision (default: 14)
|
|
159
|
+
|
|
160
|
+
#### String **toXMLString** (\[options\])
|
|
152
161
|
|
|
153
162
|
Returns the X3D XML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this scene.
|
|
154
163
|
|
|
164
|
+
For options see toVRMLString.
|
|
165
|
+
|
|
155
166
|
## ProfileInfo
|
|
156
167
|
|
|
157
168
|
This object stores information about a particular X3D profile.
|
|
@@ -5,6 +5,24 @@ nav: main
|
|
|
5
5
|
categories: []
|
|
6
6
|
tags: [new, releases]
|
|
7
7
|
---
|
|
8
|
+
## X_ITE v8.3.3 Released
|
|
9
|
+
|
|
10
|
+
### New Features
|
|
11
|
+
|
|
12
|
+
- Added to*String options (scene, style, precision, doublePrecision).
|
|
13
|
+
- Added output styles (CLEAN, SMALL, COMPACT, TIDY).
|
|
14
|
+
- Prefer PROTO's during parse.
|
|
15
|
+
- Collect joint nodes if no provided (HAnim).
|
|
16
|
+
- Relaxed VRML parser (parse top level statements in MFNode).
|
|
17
|
+
- XML short syntax of prototype instances.
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
- Fixed bug when floating point numbers are printed.
|
|
22
|
+
- Fixed bug when MFImage is printed.
|
|
23
|
+
- Fixed component's highest levels.
|
|
24
|
+
- Fixed double count of headlight.
|
|
25
|
+
|
|
8
26
|
## X_ITE v8.3.0 Released
|
|
9
27
|
|
|
10
28
|
*Leipzig, 14st December 2022:* We right now released a new version.
|
|
@@ -512,7 +530,7 @@ This release also increased pure rendering speed (without routing and scripting)
|
|
|
512
530
|
- Fixed picking and Layout node.
|
|
513
531
|
- Fixed bug with composite glyphs in Text node.
|
|
514
532
|
- Fixed bug with data URLs.
|
|
515
|
-
- Fixed bug in toXMLString and toVRMLString when
|
|
533
|
+
- Fixed bug in toXMLString and toVRMLString when outputting protos.
|
|
516
534
|
|
|
517
535
|
## X_ITE v4.4.7 Released
|
|
518
536
|
|
|
@@ -552,7 +570,7 @@ This release also increased pure rendering speed (without routing and scripting)
|
|
|
552
570
|
- Fixed bug when parsing SFMatrix3d/f values.
|
|
553
571
|
- Fixed bug when parsing data URLs.
|
|
554
572
|
- Fixed shadow handling.
|
|
555
|
-
- Fixed bug in MF
|
|
573
|
+
- Fixed bug in MF* fields pop and shift.
|
|
556
574
|
|
|
557
575
|
## X_ITE v4.4.3 Released
|
|
558
576
|
|
|
@@ -879,7 +897,7 @@ You can tune the *shadowIntensity*. It is the intensity of the shadow. 0 means n
|
|
|
879
897
|
- Optimizations in IndexedQuadSet and QuadSet
|
|
880
898
|
- Optimized CoordinateInterpolator, NormalInterpolator, and CoordinateInterpolator2D
|
|
881
899
|
- Support for more textures for custom shaders
|
|
882
|
-
- New »
|
|
900
|
+
- New »StraightenHorizon« browser option
|
|
883
901
|
- Better rendering of Text in some cases
|
|
884
902
|
|
|
885
903
|
### Bug Fixes
|
|
@@ -5,7 +5,7 @@ order: 3
|
|
|
5
5
|
icon: fas fa-rocket
|
|
6
6
|
---
|
|
7
7
|
<style>
|
|
8
|
-
.
|
|
8
|
+
.post, .post-content {
|
|
9
9
|
height: 100%;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -15,15 +15,15 @@ icon: fas fa-rocket
|
|
|
15
15
|
|
|
16
16
|
/* Table */
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
height:
|
|
21
|
-
table-layout: fixed;
|
|
18
|
+
.row {
|
|
19
|
+
display: flex;
|
|
20
|
+
height: calc(100vh - 180px);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
.column {
|
|
24
|
+
flex: 50%;
|
|
25
|
+
width: 50%;
|
|
26
|
+
height: 100%;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/* Editor */
|
|
@@ -86,6 +86,17 @@ html[data-mode=light] {
|
|
|
86
86
|
white-space: pre;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
.console {
|
|
90
|
+
height: 50%;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.post x3d-canvas {
|
|
94
|
+
display: block;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 50%;
|
|
97
|
+
aspect-ratio: unset;
|
|
98
|
+
}
|
|
99
|
+
|
|
89
100
|
.ace_gutter {
|
|
90
101
|
background: var(--editor-gutter) !important;
|
|
91
102
|
}
|
|
@@ -164,21 +175,13 @@ span.info {
|
|
|
164
175
|
color: var(--system-blue);
|
|
165
176
|
}
|
|
166
177
|
|
|
167
|
-
span.
|
|
178
|
+
span.warn {
|
|
168
179
|
color: var(--system-yellow);
|
|
169
180
|
}
|
|
170
181
|
|
|
171
182
|
span.error {
|
|
172
183
|
color: var(--system-red);
|
|
173
184
|
}
|
|
174
|
-
|
|
175
|
-
/* Canvas */
|
|
176
|
-
|
|
177
|
-
.post x3d-canvas {
|
|
178
|
-
width: 100%;
|
|
179
|
-
height: 100%;
|
|
180
|
-
aspect-ratio: unset;
|
|
181
|
-
}
|
|
182
185
|
</style>
|
|
183
186
|
|
|
184
187
|
<pre style="display:none">
|
|
@@ -239,7 +242,7 @@ $(function ()
|
|
|
239
242
|
<Shape>
|
|
240
243
|
<Appearance>
|
|
241
244
|
<Material
|
|
242
|
-
|
|
245
|
+
diffuseColor='0 0.5 1'></Material>
|
|
243
246
|
</Appearance>
|
|
244
247
|
<Box></Box>
|
|
245
248
|
</Shape>
|
|
@@ -268,6 +271,9 @@ $(function ()
|
|
|
268
271
|
text = Array .prototype .slice .call (args) .join ("") + "\n",
|
|
269
272
|
element = $("<span></span>") .addClass (classes) .text (text);
|
|
270
273
|
|
|
274
|
+
if (text .includes ("No suitable"))
|
|
275
|
+
return;
|
|
276
|
+
|
|
271
277
|
log .apply (this, args);
|
|
272
278
|
|
|
273
279
|
$(".console") .append (element);
|
|
@@ -276,28 +282,18 @@ $(function ()
|
|
|
276
282
|
}
|
|
277
283
|
}
|
|
278
284
|
|
|
279
|
-
console .log
|
|
280
|
-
console .info
|
|
281
|
-
console .
|
|
282
|
-
console .error
|
|
283
|
-
console .debug
|
|
285
|
+
console .log = output (console .log, "log");
|
|
286
|
+
console .info = output (console .info, "info");
|
|
287
|
+
console .warn = output (console .warn, "warn");
|
|
288
|
+
console .error = output (console .error, "error");
|
|
289
|
+
console .debug = output (console .debug, "debug");
|
|
284
290
|
})();
|
|
285
291
|
</script>
|
|
286
292
|
|
|
287
|
-
<
|
|
288
|
-
<
|
|
289
|
-
<
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<tr>
|
|
295
|
-
<td><div class="console"></div></td>
|
|
296
|
-
</tr>
|
|
297
|
-
</table>
|
|
298
|
-
</td>
|
|
299
|
-
<td>
|
|
300
|
-
<div id="editor"></div>
|
|
301
|
-
</td>
|
|
302
|
-
</tr>
|
|
303
|
-
</table>
|
|
293
|
+
<div class="row">
|
|
294
|
+
<div class="column">
|
|
295
|
+
<x3d-canvas splashScreen="false"></x3d-canvas>
|
|
296
|
+
<div class="console"></div>
|
|
297
|
+
</div>
|
|
298
|
+
<div class="column"><div id="editor"></div></div>
|
|
299
|
+
</div>
|
|
@@ -106,6 +106,24 @@ a {
|
|
|
106
106
|
font-size: 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
.table-wrapper > table.examples a.popup {
|
|
110
|
+
margin: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.table-wrapper > table.examples a:hover::before {
|
|
114
|
+
content: "";
|
|
115
|
+
position: absolute;
|
|
116
|
+
background: var(--shimmer-bg);
|
|
117
|
+
height: 100%;
|
|
118
|
+
width: 100%;
|
|
119
|
+
-webkit-animation: shimmer 1s infinite;
|
|
120
|
+
animation: shimmer 1s infinite;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.table-wrapper > table.examples .shimmer::before {
|
|
124
|
+
all: unset;
|
|
125
|
+
}
|
|
126
|
+
|
|
109
127
|
@media all and (max-width: 849px) {
|
|
110
128
|
.table-wrapper > table.examples tbody tr td {
|
|
111
129
|
border-width: 2px;
|
package/package.json
CHANGED
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
48
|
import Components from "../../x_ite/Components.js";
|
|
49
|
-
import TextureProjector from "../../x_ite/Components/
|
|
50
|
-
import TextureProjectorParallel from "../../x_ite/Components/
|
|
51
|
-
import X3DTextureProjectorNode from "../../x_ite/Components/
|
|
49
|
+
import TextureProjector from "../../x_ite/Components/TextureProjector/TextureProjector.js";
|
|
50
|
+
import TextureProjectorParallel from "../../x_ite/Components/TextureProjector/TextureProjectorParallel.js";
|
|
51
|
+
import X3DTextureProjectorNode from "../../x_ite/Components/TextureProjector/X3DTextureProjectorNode.js";
|
|
52
52
|
|
|
53
53
|
Components .addComponent ({
|
|
54
|
-
name: "
|
|
54
|
+
name: "TextureProjector",
|
|
55
55
|
types:
|
|
56
56
|
{
|
|
57
|
-
TextureProjector:
|
|
57
|
+
TextureProjector: TextureProjector,
|
|
58
58
|
TextureProjectorParallel: TextureProjectorParallel,
|
|
59
59
|
},
|
|
60
60
|
abstractTypes:
|
package/src/examples.js
CHANGED
|
@@ -78,7 +78,6 @@ const X_ITE_EXAMPLES = [
|
|
|
78
78
|
{ component: "Picking", test: "PrimitivePickSensor" },
|
|
79
79
|
{ component: "PointingDeviceSensor", test: "CylinderSensor" },
|
|
80
80
|
{ component: "PointingDeviceSensor", test: "PlaneSensor" },
|
|
81
|
-
{ component: "ProjectiveTextureMapping", test: "TextureProjector" },
|
|
82
81
|
{ component: "Rendering", test: "ClipPlane" },
|
|
83
82
|
{ component: "Rendering", test: "Color" },
|
|
84
83
|
{ component: "Rendering", test: "ColorRGBA" },
|
|
@@ -106,6 +105,7 @@ const X_ITE_EXAMPLES = [
|
|
|
106
105
|
{ component: "Sound", test: "AudioClip" },
|
|
107
106
|
{ component: "Text", test: "FontStyle" },
|
|
108
107
|
{ component: "Text", test: "Text" },
|
|
108
|
+
{ component: "TextureProjector", test: "TextureProjector" },
|
|
109
109
|
{ component: "Texturing", test: "ImageTexture" },
|
|
110
110
|
{ component: "Texturing", test: "MovieTexture" },
|
|
111
111
|
{ component: "Texturing", test: "MultiTexture" },
|
package/src/tests.js
CHANGED
|
@@ -215,11 +215,6 @@ const X_ITE_TESTS = [
|
|
|
215
215
|
{ path: "PointingDeviceSensor/TouchBeethoven.x3dz" },
|
|
216
216
|
{ path: "PointingDeviceSensor/TouchLines.x3dv" },
|
|
217
217
|
{ path: "PointingDeviceSensor/TouchPoints.x3dv" },
|
|
218
|
-
{ component: "ProjectiveTextureMapping" },
|
|
219
|
-
{ path: "ProjectiveTextureMapping/apple.x3d" },
|
|
220
|
-
{ path: "ProjectiveTextureMapping/Local.x3d" },
|
|
221
|
-
{ path: "ProjectiveTextureMapping/Parallel.x3d" },
|
|
222
|
-
{ path: "ProjectiveTextureMapping/Perspective.x3d" },
|
|
223
218
|
{ component: "PROTO" },
|
|
224
219
|
{ path: "PROTO/27cubes.x3d" },
|
|
225
220
|
{ path: "PROTO/cbx.wrl" },
|
|
@@ -326,6 +321,11 @@ const X_ITE_TESTS = [
|
|
|
326
321
|
{ path: "Text/scrolling-text.x3d" },
|
|
327
322
|
{ path: "Text/test.x3d" },
|
|
328
323
|
{ path: "Text/vertical.x3d" },
|
|
324
|
+
{ component: "TextureProjector" },
|
|
325
|
+
{ path: "TextureProjector/apple.x3d" },
|
|
326
|
+
{ path: "TextureProjector/Local.x3d" },
|
|
327
|
+
{ path: "TextureProjector/Parallel.x3d" },
|
|
328
|
+
{ path: "TextureProjector/Perspective.x3d" },
|
|
329
329
|
{ component: "Texturing" },
|
|
330
330
|
{ path: "Texturing/ColorManagement.x3d" },
|
|
331
331
|
{ path: "Texturing/ColorMaterial.x3d" },
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import
|
|
48
|
+
import Generator from "../InputOutput/Generator.js";
|
|
49
49
|
|
|
50
50
|
const
|
|
51
51
|
_array = Symbol (),
|
|
@@ -223,56 +223,56 @@ X3DInfoArray .prototype = {
|
|
|
223
223
|
slice: Array .prototype .slice,
|
|
224
224
|
some: Array .prototype .some,
|
|
225
225
|
values: Array .prototype .values,
|
|
226
|
-
toString: function (
|
|
226
|
+
toString: function (options = Object .prototype)
|
|
227
227
|
{
|
|
228
|
-
const
|
|
228
|
+
const generator = new Generator (options);
|
|
229
229
|
|
|
230
|
-
if (scene)
|
|
231
|
-
|
|
230
|
+
if (options .scene)
|
|
231
|
+
generator .PushExecutionContext (options .scene);
|
|
232
232
|
|
|
233
|
-
this .toStream (
|
|
233
|
+
this .toStream (generator);
|
|
234
234
|
|
|
235
|
-
return
|
|
235
|
+
return generator .string;
|
|
236
236
|
},
|
|
237
|
-
|
|
237
|
+
toStream: function (generator)
|
|
238
|
+
{
|
|
239
|
+
generator .string = "[object " + this .getTypeName () + "]";
|
|
240
|
+
},
|
|
241
|
+
toVRMLStream: function (generator)
|
|
238
242
|
{
|
|
239
243
|
for (const value of this [_array])
|
|
240
244
|
{
|
|
241
245
|
try
|
|
242
246
|
{
|
|
243
|
-
value .toVRMLStream (
|
|
247
|
+
value .toVRMLStream (generator);
|
|
244
248
|
|
|
245
|
-
|
|
249
|
+
generator .string += generator .Break ();
|
|
246
250
|
|
|
247
|
-
if (
|
|
248
|
-
|
|
251
|
+
if (this .getTypeName () .match (/Proto/))
|
|
252
|
+
generator .string += generator .TidyBreak ();
|
|
249
253
|
}
|
|
250
254
|
catch (error)
|
|
251
255
|
{
|
|
252
|
-
console .error (error);
|
|
256
|
+
// console .error (error);
|
|
253
257
|
}
|
|
254
258
|
}
|
|
255
259
|
},
|
|
256
|
-
toXMLStream: function (
|
|
260
|
+
toXMLStream: function (generator)
|
|
257
261
|
{
|
|
258
262
|
for (const value of this [_array])
|
|
259
263
|
{
|
|
260
264
|
try
|
|
261
265
|
{
|
|
262
|
-
value .toXMLStream (
|
|
266
|
+
value .toXMLStream (generator);
|
|
263
267
|
|
|
264
|
-
|
|
268
|
+
generator .string += generator .TidyBreak ();
|
|
265
269
|
}
|
|
266
270
|
catch (error)
|
|
267
271
|
{
|
|
268
|
-
console .error (error);
|
|
272
|
+
// console .error (error);
|
|
269
273
|
}
|
|
270
274
|
}
|
|
271
275
|
},
|
|
272
|
-
toStream: function (stream)
|
|
273
|
-
{
|
|
274
|
-
stream .string = "[object " + this .getTypeName () + "]";
|
|
275
|
-
},
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
for (const key of Reflect .ownKeys (X3DInfoArray .prototype))
|
|
@@ -131,44 +131,53 @@ X3DObject .prototype =
|
|
|
131
131
|
interest ();
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
-
toString: function (
|
|
134
|
+
toString: function (options = Object .prototype)
|
|
135
135
|
{
|
|
136
|
-
const
|
|
136
|
+
const generator = new Generator (options);
|
|
137
137
|
|
|
138
|
-
if (scene)
|
|
139
|
-
|
|
138
|
+
if (options .scene)
|
|
139
|
+
generator .PushExecutionContext (options .scene);
|
|
140
140
|
|
|
141
|
-
this .toStream (
|
|
141
|
+
this .toStream (generator);
|
|
142
142
|
|
|
143
|
-
return
|
|
143
|
+
return generator .string;
|
|
144
144
|
},
|
|
145
|
-
toVRMLString: function
|
|
145
|
+
toVRMLString: function (options = Object .prototype)
|
|
146
146
|
{
|
|
147
|
-
const
|
|
147
|
+
const generator = new Generator (options);
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
if (options .scene)
|
|
150
|
+
generator .PushExecutionContext (options .scene);
|
|
150
151
|
|
|
151
|
-
|
|
152
|
+
this .toVRMLStream (generator);
|
|
153
|
+
|
|
154
|
+
return generator .string;
|
|
152
155
|
},
|
|
153
|
-
toXMLString: function
|
|
156
|
+
toXMLString: function (options = Object .prototype)
|
|
154
157
|
{
|
|
155
|
-
const
|
|
158
|
+
const generator = new Generator (options);
|
|
159
|
+
|
|
160
|
+
if (options .scene)
|
|
161
|
+
generator .PushExecutionContext (options .scene);
|
|
156
162
|
|
|
157
|
-
this .toXMLStream (
|
|
163
|
+
this .toXMLStream (generator);
|
|
158
164
|
|
|
159
|
-
return
|
|
165
|
+
return generator .string;
|
|
160
166
|
},
|
|
161
|
-
toJSONString: function ()
|
|
167
|
+
toJSONString: function (options = Object .prototype)
|
|
162
168
|
{
|
|
163
|
-
const
|
|
169
|
+
const generator = new Generator (options);
|
|
170
|
+
|
|
171
|
+
if (options .scene)
|
|
172
|
+
generator .PushExecutionContext (options .scene);
|
|
164
173
|
|
|
165
|
-
this .toVRMLStream (
|
|
174
|
+
this .toVRMLStream (generator); // TODO.
|
|
166
175
|
|
|
167
|
-
return
|
|
176
|
+
return generator .string;
|
|
168
177
|
},
|
|
169
|
-
toStream: function (
|
|
178
|
+
toStream: function (generator)
|
|
170
179
|
{
|
|
171
|
-
|
|
180
|
+
generator .string = "[object " + this .getTypeName () + "]";
|
|
172
181
|
},
|
|
173
182
|
dispose: function () { },
|
|
174
183
|
};
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
|
|
48
48
|
import X3DField from "./X3DField.js";
|
|
49
49
|
import X3DArrayField from "./X3DArrayField.js";
|
|
50
|
-
import Generator from "../InputOutput/Generator.js";
|
|
51
50
|
|
|
52
51
|
const
|
|
53
52
|
_target = Symbol (),
|
|
@@ -453,25 +452,26 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
453
452
|
{
|
|
454
453
|
value .removeParent (this [_proxy]);
|
|
455
454
|
},
|
|
456
|
-
toStream: function (
|
|
455
|
+
toStream: function (generator)
|
|
457
456
|
{
|
|
458
457
|
const
|
|
459
|
-
target
|
|
460
|
-
array
|
|
461
|
-
generator = Generator .Get (stream);
|
|
458
|
+
target = this [_target],
|
|
459
|
+
array = target .getValue ();
|
|
462
460
|
|
|
463
461
|
switch (array .length)
|
|
464
462
|
{
|
|
465
463
|
case 0:
|
|
466
464
|
{
|
|
467
|
-
|
|
465
|
+
generator .string += "[";
|
|
466
|
+
generator .string += generator .TidySpace ();
|
|
467
|
+
generator .string += "]";
|
|
468
468
|
break;
|
|
469
469
|
}
|
|
470
470
|
case 1:
|
|
471
471
|
{
|
|
472
472
|
generator .PushUnitCategory (target .getUnit ());
|
|
473
473
|
|
|
474
|
-
array [0] .toStream (
|
|
474
|
+
array [0] .toStream (generator);
|
|
475
475
|
|
|
476
476
|
generator .PopUnitCategory ();
|
|
477
477
|
break;
|
|
@@ -480,34 +480,36 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
480
480
|
{
|
|
481
481
|
generator .PushUnitCategory (target .getUnit ());
|
|
482
482
|
|
|
483
|
-
|
|
483
|
+
generator .string += "[";
|
|
484
|
+
generator .string += generator .ListStart ();
|
|
484
485
|
generator .IncIndent ();
|
|
485
486
|
|
|
486
487
|
for (let i = 0, length = array .length - 1; i < length; ++ i)
|
|
487
488
|
{
|
|
488
|
-
|
|
489
|
-
array [i] .toStream (
|
|
490
|
-
|
|
489
|
+
generator .string += generator .ListIndent ();
|
|
490
|
+
array [i] .toStream (generator);
|
|
491
|
+
generator .string += generator .Comma ();
|
|
492
|
+
generator .string += generator .ListBreak ();
|
|
491
493
|
}
|
|
492
494
|
|
|
493
|
-
|
|
494
|
-
array .at (-1) .toStream (
|
|
495
|
-
stream .string += "\n";
|
|
495
|
+
generator .string += generator .ListIndent ();
|
|
496
|
+
array .at (-1) .toStream (generator);
|
|
496
497
|
|
|
498
|
+
generator .string += generator .ListEnd ();
|
|
497
499
|
generator .DecIndent ();
|
|
498
|
-
|
|
499
|
-
|
|
500
|
+
generator .string += generator .ListIndent ();
|
|
501
|
+
generator .string += "]";
|
|
500
502
|
|
|
501
503
|
generator .PopUnitCategory ();
|
|
502
504
|
break;
|
|
503
505
|
}
|
|
504
506
|
}
|
|
505
507
|
},
|
|
506
|
-
toVRMLStream: function (
|
|
508
|
+
toVRMLStream: function (generator)
|
|
507
509
|
{
|
|
508
|
-
this .toStream (
|
|
510
|
+
this .toStream (generator);
|
|
509
511
|
},
|
|
510
|
-
toXMLStream: function (
|
|
512
|
+
toXMLStream: function (generator)
|
|
511
513
|
{
|
|
512
514
|
const
|
|
513
515
|
target = this [_target],
|
|
@@ -515,19 +517,18 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
515
517
|
|
|
516
518
|
if (length)
|
|
517
519
|
{
|
|
518
|
-
const
|
|
519
|
-
generator = Generator .Get (stream),
|
|
520
|
-
array = target .getValue ();
|
|
520
|
+
const array = target .getValue ();
|
|
521
521
|
|
|
522
522
|
generator .PushUnitCategory (target .getUnit ());
|
|
523
523
|
|
|
524
|
-
for (
|
|
524
|
+
for (let i = 0, length = array .length - 1; i < length; ++ i)
|
|
525
525
|
{
|
|
526
|
-
|
|
527
|
-
|
|
526
|
+
array [i] .toXMLStream (generator);
|
|
527
|
+
generator .string += generator .Comma ();
|
|
528
|
+
generator .string += generator .TidySpace ();
|
|
528
529
|
}
|
|
529
530
|
|
|
530
|
-
array .at (-1) .toXMLStream (
|
|
531
|
+
array .at (-1) .toXMLStream (generator);
|
|
531
532
|
|
|
532
533
|
generator .PopUnitCategory ();
|
|
533
534
|
}
|