x_ite 8.3.2 → 8.4.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.
Files changed (117) hide show
  1. package/.github/workflows/pages-deploy.yml +1 -1
  2. package/.vscode/settings.json +2 -1
  3. package/dist/LICENSE.md +4 -4
  4. package/dist/assets/components/Annotation.js +13 -13
  5. package/dist/assets/components/Annotation.min.js +1 -1
  6. package/dist/assets/components/CADGeometry.js +13 -13
  7. package/dist/assets/components/CADGeometry.min.js +1 -1
  8. package/dist/assets/components/CubeMapTexturing.js +25 -25
  9. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  10. package/dist/assets/components/DIS.js +13 -13
  11. package/dist/assets/components/DIS.min.js +1 -1
  12. package/dist/assets/components/EventUtilities.js +9 -9
  13. package/dist/assets/components/EventUtilities.min.js +1 -1
  14. package/dist/assets/components/Geometry2D.js +19 -19
  15. package/dist/assets/components/Geometry2D.min.js +1 -1
  16. package/dist/assets/components/Geospatial.js +33 -33
  17. package/dist/assets/components/Geospatial.min.js +1 -1
  18. package/dist/assets/components/HAnim.js +64 -75
  19. package/dist/assets/components/HAnim.min.js +1 -1
  20. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  21. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  22. package/dist/assets/components/Layout.js +27 -27
  23. package/dist/assets/components/Layout.min.js +1 -1
  24. package/dist/assets/components/NURBS.js +24 -24
  25. package/dist/assets/components/NURBS.min.js +1 -1
  26. package/dist/assets/components/ParticleSystems.js +23 -23
  27. package/dist/assets/components/ParticleSystems.min.js +1 -1
  28. package/dist/assets/components/Picking.js +19 -19
  29. package/dist/assets/components/Picking.min.js +1 -1
  30. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  31. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  32. package/dist/assets/components/Scripting.js +28 -28
  33. package/dist/assets/components/Scripting.min.js +1 -1
  34. package/dist/assets/components/Text.js +24 -24
  35. package/dist/assets/components/Text.min.js +1 -1
  36. package/dist/assets/components/{ProjectiveTextureMapping.js → TextureProjector.js} +39 -39
  37. package/dist/assets/components/TextureProjector.min.js +1 -0
  38. package/dist/assets/components/Texturing3D.js +27 -27
  39. package/dist/assets/components/Texturing3D.min.js +1 -1
  40. package/dist/assets/components/VolumeRendering.js +19 -19
  41. package/dist/assets/components/VolumeRendering.min.js +1 -1
  42. package/dist/assets/components/X_ITE.js +9 -9
  43. package/dist/assets/components/X_ITE.min.js +1 -1
  44. package/dist/x_ite.css +1 -1
  45. package/dist/x_ite.js +3986 -1366
  46. package/dist/x_ite.min.js +1 -1
  47. package/dist/x_ite.zip +0 -0
  48. package/docs/Gemfile +1 -4
  49. package/docs/_config.yml +3 -3
  50. package/docs/_posts/getting-started.md +147 -441
  51. package/docs/_posts/reference/field-services-and-objects.md +24 -4
  52. package/docs/_posts/reference/prototype-services.md +24 -4
  53. package/docs/_posts/reference/scene-services.md +18 -2
  54. package/docs/_posts/what's-new.md +32 -4
  55. package/docs/_tabs/playground.html +36 -40
  56. package/docs/assets/css/style.scss +18 -0
  57. package/package.json +1 -1
  58. package/src/assets/components/{ProjectiveTextureMapping.js → TextureProjector.js} +5 -5
  59. package/src/examples.js +1 -1
  60. package/src/tests.js +5 -5
  61. package/src/x_ite/Base/X3DInfoArray.js +45 -19
  62. package/src/x_ite/Base/X3DObject.js +29 -20
  63. package/src/x_ite/Base/X3DObjectArrayField.js +71 -26
  64. package/src/x_ite/Base/X3DTypedArrayField.js +108 -32
  65. package/src/x_ite/Browser/DOMIntegration.js +4 -3
  66. package/src/x_ite/Browser/VERSION.js +1 -1
  67. package/src/x_ite/Browser/X3DBrowser.js +43 -28
  68. package/src/x_ite/Components/Core/X3DNode.js +682 -210
  69. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +484 -100
  70. package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +18 -43
  71. package/src/x_ite/Components/HAnim/HAnimHumanoid.js +27 -26
  72. package/src/x_ite/Components/HAnim/HAnimJoint.js +19 -31
  73. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +6 -3
  74. package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +14 -1
  75. package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +0 -1
  76. package/src/x_ite/Components/{ProjectiveTextureMapping → TextureProjector}/TextureProjector.js +1 -1
  77. package/src/x_ite/Components/{ProjectiveTextureMapping → TextureProjector}/TextureProjectorParallel.js +1 -1
  78. package/src/x_ite/Components/{ProjectiveTextureMapping → TextureProjector}/X3DTextureProjectorNode.js +0 -0
  79. package/src/x_ite/Components/Time/TimeSensor.js +5 -0
  80. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +1 -0
  81. package/src/x_ite/Configuration/ComponentInfo.js +51 -22
  82. package/src/x_ite/Configuration/ProfileInfo.js +10 -6
  83. package/src/x_ite/Configuration/SupportedComponents.js +22 -20
  84. package/src/x_ite/Configuration/SupportedProfiles.js +1 -1
  85. package/src/x_ite/Configuration/UnitInfo.js +69 -26
  86. package/src/x_ite/Execution/X3DExecutionContext.js +78 -55
  87. package/src/x_ite/Execution/X3DExportedNode.js +75 -28
  88. package/src/x_ite/Execution/X3DImportedNode.js +227 -67
  89. package/src/x_ite/Execution/X3DScene.js +437 -117
  90. package/src/x_ite/Fields/ArrayFields.js +105 -55
  91. package/src/x_ite/Fields/SFBool.js +14 -6
  92. package/src/x_ite/Fields/SFColor.js +35 -12
  93. package/src/x_ite/Fields/SFColorRGBA.js +2 -0
  94. package/src/x_ite/Fields/SFDouble.js +17 -10
  95. package/src/x_ite/Fields/SFFloat.js +17 -10
  96. package/src/x_ite/Fields/SFImage.js +93 -8
  97. package/src/x_ite/Fields/SFInt32.js +14 -6
  98. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +38 -13
  99. package/src/x_ite/Fields/SFNode.js +59 -21
  100. package/src/x_ite/Fields/SFRotation.js +38 -13
  101. package/src/x_ite/Fields/SFString.js +14 -7
  102. package/src/x_ite/Fields/SFTime.js +14 -6
  103. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +39 -13
  104. package/src/x_ite/InputOutput/FileLoader.js +1 -1
  105. package/src/x_ite/InputOutput/Generator.js +178 -17
  106. package/src/x_ite/Parser/JSONParser.js +1 -1
  107. package/src/x_ite/Parser/VRMLParser.js +24 -27
  108. package/src/x_ite/Parser/X3DParser.js +0 -4
  109. package/src/x_ite/Parser/XMLParser.js +2 -2
  110. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +182 -64
  111. package/src/x_ite/Prototype/X3DProtoDeclaration.js +314 -93
  112. package/src/x_ite/Rendering/X3DRenderObject.js +6 -1
  113. package/src/x_ite/Routing/X3DRoute.js +104 -40
  114. package/src/x_ite.html +1 -1
  115. package/x_ite.min.html +1 -1
  116. package/dist/assets/components/ProjectiveTextureMapping.min.js +0 -1
  117. package/docs/Gemfile.lock +0 -116
@@ -407,14 +407,24 @@ Returns the node type name.
407
407
 
408
408
  Removes a field callback function associated with the parameters *name* and *key*.
409
409
 
410
- #### String **toVRMLString** ()
410
+ #### String **toVRMLString** (\[options\])
411
411
 
412
412
  Returns the X3D VRML-encoded string that, if parsed as the value of an SFNode field, produce this node.
413
413
 
414
- #### String **toXMLString** ()
414
+ For options see X3DScene.toVRMLString.
415
+
416
+ #### String **toXMLString** (\[options\])
415
417
 
416
418
  Returns the X3D XML-encoded string that, if parsed as the value of an SFNode field, produce this node.
417
419
 
420
+ For options see X3DScene.toVRMLString.
421
+
422
+ #### String **toJSONString** (\[options\])
423
+
424
+ Returns the X3D JSON-encoded string that, if parsed as the value of an SFNode field, produce this node.
425
+
426
+ For options see X3DScene.toVRMLString.
427
+
418
428
  ## SFRotation Object
419
429
 
420
430
  The SFRotation object corresponds to a X3D SFRotation field.
@@ -966,14 +976,24 @@ An integer containing the number of elements in the array. Assigning an integer
966
976
 
967
977
  ### Methods
968
978
 
969
- #### String **toVRMLString** ()
979
+ #### String **toVRMLString** (\[options\])
970
980
 
971
981
  Returns the X3D VRML-encoded string that, if parsed as the value of an MFNode field, produce this node.
972
982
 
973
- #### String **toXMLString** ()
983
+ For options see X3DScene.toVRMLString.
984
+
985
+ #### String **toXMLString** (\[options\])
974
986
 
975
987
  Returns the X3D XML-encoded string that, if parsed as the value of an MFNode field, produce this node.
976
988
 
989
+ For options see X3DScene.toVRMLString.
990
+
991
+ #### String **toJSONString** (\[options\])
992
+
993
+ Returns the X3D JSON-encoded string that, if parsed as the value of an MFNode field, produce this node.
994
+
995
+ For options see X3DScene.toVRMLString.
996
+
977
997
  ## MFRotation Object
978
998
 
979
999
  The MFRotation object corresponds to a X3D MFRotation field. It is used to store a one-dimensional array of SFRotation objects. Individual elements of the array can be referenced using the standard C-style dereferencing operator (e.g. *mfRotationObjectName*[*index*], where *index* is an integer-valued expression with 0<=*index*<length and length is the number of elements in the array). Assigning to an element with *index* > length results in the array being dynamically expanded to contain length elements. All elements not explicitly initialized are set to SFRotation (0, 0, 1, 0).
@@ -33,14 +33,24 @@ Always has the value of false. This property is read only.
33
33
 
34
34
  Creates a new default instance of the prototype.
35
35
 
36
- #### String **toVRMLString** ()
36
+ #### String **toVRMLString** (\[options\])
37
37
 
38
38
  Returns the X3D VRML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this prototype.
39
39
 
40
- #### String **toXMLString** ()
40
+ For options see X3DScene.toVRMLString.
41
+
42
+ #### String **toXMLString** (\[options\])
41
43
 
42
44
  Returns the X3D XML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this prototype.
43
45
 
46
+ For options see X3DScene.toVRMLString.
47
+
48
+ #### String **toJSONString** (\[options\])
49
+
50
+ Returns the X3D JSON-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this prototype.
51
+
52
+ For options see X3DScene.toVRMLString.
53
+
44
54
  ## X3DExternProtoDeclaration
45
55
 
46
56
  An EXTERNPROTO declaration is represented by the X3DExternProtoDeclaration object. EXTERNPROTO declarations can only be fetched using the X3DExecutionContext object.
@@ -81,14 +91,24 @@ Creates a new default instance of the extern prototype.
81
91
 
82
92
  Triggers the load of the extern prototype. If the extern prototype is already loaded or the load is already in progress, this request is silently ignored.
83
93
 
84
- #### String **toVRMLString** ()
94
+ #### String **toVRMLString** (\[options\])
85
95
 
86
96
  Returns the X3D VRML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this extern prototype.
87
97
 
88
- #### String **toXMLString** ()
98
+ For options see X3DScene.toVRMLString.
99
+
100
+ #### String **toXMLString** (\[options\])
89
101
 
90
102
  Returns the X3D XML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this extern prototype.
91
103
 
104
+ For options see X3DScene.toVRMLString.
105
+
106
+ #### String **toJSONString** (\[options\])
107
+
108
+ Returns the X3D JSON-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this extern prototype.
109
+
110
+ For options see X3DScene.toVRMLString.
111
+
92
112
  ## ProtoDeclarationArray
93
113
 
94
114
  ProtoDeclarationArray is an object that represents an array of X3DProtoDeclaration objects. This is a read-only object. Individual elements of the array can be referenced using the standard C-style dereferencing operator (e.g. *protoDeclarationArrayName*[*index*], where *index* is an integer-valued expression with 0\<=*index*\<length and length is the number of elements in the array).
@@ -144,14 +144,30 @@ 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
- #### String **toXMLString** ()
151
+ ##### Options
152
+
153
+ An object with one or more of these properties:
154
+
155
+ * **style:** string, output style, one of: **"TIDY"**, "COMPACT", "SMALL", "CLEAN"
156
+ * **precision:** integer, float precision, default: 6
157
+ * **doublePrecision:** integer, double precision, default: 14
158
+
159
+ #### String **toXMLString** (\[options\])
152
160
 
153
161
  Returns the X3D XML-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this scene.
154
162
 
163
+ For options see toVRMLString.
164
+
165
+ #### String **toJSONString** (\[options\])
166
+
167
+ Returns the X3D JSON-encoded string that, if parsed as the value of createX3DFromString () of X3DBrowser, produce this scene.
168
+
169
+ For options see toVRMLString.
170
+
155
171
  ## ProfileInfo
156
172
 
157
173
  This object stores information about a particular X3D profile.
@@ -5,9 +5,37 @@ nav: main
5
5
  categories: []
6
6
  tags: [new, releases]
7
7
  ---
8
+ ## X_ITE v8.4.0 Released
9
+
10
+ *Leipzig, 3rd January 2023:* We right now released a new version. With this version toJSONString is implemented and available for X3DScene, SFNode, MFNode, X3DProtoDeclaration, and X3DExternProtoDeclaration.
11
+
12
+ ### New Features
13
+
14
+ - Implemented toJSONString.
15
+
16
+ ## X_ITE v8.3.3 Released
17
+
18
+ *Leipzig, 31st December 2022:* We right now released a new version.
19
+
20
+ ### New Features
21
+
22
+ - Added to*String options (scene, style, precision, doublePrecision).
23
+ - Added output styles (CLEAN, SMALL, COMPACT, TIDY).
24
+ - Prefer PROTO's during parse.
25
+ - Collect joint nodes if no provided (HAnim).
26
+ - Relaxed VRML parser (parse top level statements in MFNode).
27
+ - XML short syntax of prototype instances.
28
+
29
+ ### Bug Fixes
30
+
31
+ - Fixed bug when floating point numbers are printed.
32
+ - Fixed bug when MFImage is printed.
33
+ - Fixed component's highest levels.
34
+ - Fixed double count of headlight.
35
+
8
36
  ## X_ITE v8.3.0 Released
9
37
 
10
- *Leipzig, 14st December 2022:* We right now released a new version.
38
+ *Leipzig, 14th December 2022:* We right now released a new version.
11
39
 
12
40
  ### New Features
13
41
 
@@ -512,7 +540,7 @@ This release also increased pure rendering speed (without routing and scripting)
512
540
  - Fixed picking and Layout node.
513
541
  - Fixed bug with composite glyphs in Text node.
514
542
  - Fixed bug with data URLs.
515
- - Fixed bug in toXMLString and toVRMLString when outputing protos.
543
+ - Fixed bug in toXMLString and toVRMLString when outputting protos.
516
544
 
517
545
  ## X_ITE v4.4.7 Released
518
546
 
@@ -552,7 +580,7 @@ This release also increased pure rendering speed (without routing and scripting)
552
580
  - Fixed bug when parsing SFMatrix3d/f values.
553
581
  - Fixed bug when parsing data URLs.
554
582
  - Fixed shadow handling.
555
- - Fixed bug in MF\* fields pop and shift.
583
+ - Fixed bug in MF* fields pop and shift.
556
584
 
557
585
  ## X_ITE v4.4.3 Released
558
586
 
@@ -879,7 +907,7 @@ You can tune the *shadowIntensity*. It is the intensity of the shadow. 0 means n
879
907
  - Optimizations in IndexedQuadSet and QuadSet
880
908
  - Optimized CoordinateInterpolator, NormalInterpolator, and CoordinateInterpolator2D
881
909
  - Support for more textures for custom shaders
882
- - New »StraigtenHorizon« browser option
910
+ - New »StraightenHorizon« browser option
883
911
  - Better rendering of Text in some cases
884
912
 
885
913
  ### Bug Fixes
@@ -5,7 +5,7 @@ order: 3
5
5
  icon: fas fa-rocket
6
6
  ---
7
7
  <style>
8
- .row, .post, .post-content {
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
- table {
19
- width: 100%;
20
- height: 100%;
21
- table-layout: fixed;
18
+ .row {
19
+ display: flex;
20
+ height: calc(100vh - 180px);
22
21
  }
23
22
 
24
- table td {
25
- width: 50%;
26
- vertical-align: top;
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.warning {
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
- diffuseColor='0 0.5 1'></Material>
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 = output (console .log, "log");
280
- console .info = output (console .info, "info");
281
- console .warning = output (console .warning, "warning");
282
- console .error = output (console .error, "error");
283
- console .debug = output (console .debug, "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
- <table>
288
- <tr>
289
- <td>
290
- <table>
291
- <tr>
292
- <td><x3d-canvas splashScreen="false"></x3d-canvas></td>
293
- </tr>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "8.3.2",
3
+ "version": "8.4.0",
4
4
  "description": "X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.",
5
5
  "homepage": "https://create3000.github.io/x_ite/",
6
6
  "author": "Holger Seelig <holger.seelig@gmail.com>",
@@ -46,15 +46,15 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import Components from "../../x_ite/Components.js";
49
- import TextureProjector from "../../x_ite/Components/ProjectiveTextureMapping/TextureProjector.js";
50
- import TextureProjectorParallel from "../../x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js";
51
- import X3DTextureProjectorNode from "../../x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js";
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: "ProjectiveTextureMapping",
54
+ name: "TextureProjector",
55
55
  types:
56
56
  {
57
- TextureProjector: 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 X3DBaseNode from "../Base/X3DBaseNode.js";
48
+ import Generator from "../InputOutput/Generator.js";
49
49
 
50
50
  const
51
51
  _array = Symbol (),
@@ -223,55 +223,81 @@ X3DInfoArray .prototype = {
223
223
  slice: Array .prototype .slice,
224
224
  some: Array .prototype .some,
225
225
  values: Array .prototype .values,
226
- toString: function (scene)
226
+ toString: function (options = Object .prototype)
227
227
  {
228
- const stream = { string: "" };
228
+ const generator = new Generator (options);
229
229
 
230
- if (scene)
231
- Generator .Get (stream) .PushExecutionContext (scene);
230
+ if (options .scene)
231
+ generator .PushExecutionContext (options .scene);
232
232
 
233
- this .toStream (stream);
233
+ this .toStream (generator);
234
234
 
235
- return stream .string;
235
+ return generator .string;
236
236
  },
237
- toVRMLStream: function (stream)
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 (stream);
247
+ value .toVRMLStream (generator);
244
248
 
245
- stream .string += "\n";
249
+ generator .string += generator .Break ();
246
250
 
247
- if (value instanceof X3DBaseNode)
248
- stream .string += "\n";
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 (stream)
260
+ toXMLStream: function (generator)
257
261
  {
258
262
  for (const value of this [_array])
259
263
  {
260
264
  try
261
265
  {
262
- value .toXMLStream (stream);
266
+ value .toXMLStream (generator);
263
267
 
264
- stream .string += "\n";
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)
276
+ toJSONStream: function (generator, comma)
273
277
  {
274
- stream .string = "[object " + this .getTypeName () + "]";
278
+ let lastProperty = false;
279
+
280
+ for (const value of this [_array])
281
+ {
282
+ try
283
+ {
284
+ value .toJSONStream (generator, true);
285
+
286
+ generator .string += ',';
287
+ generator .string += generator .TidyBreak ();
288
+
289
+ lastProperty = true;
290
+ }
291
+ catch (error)
292
+ {
293
+ // console .error (error);
294
+ }
295
+ }
296
+
297
+ if (lastProperty && !comma)
298
+ generator .string = generator .string .replace (/,(\s*)$/s, "$1");
299
+
300
+ return lastProperty;
275
301
  },
276
302
  };
277
303
 
@@ -131,44 +131,53 @@ X3DObject .prototype =
131
131
  interest ();
132
132
  }
133
133
  },
134
- toString: function (scene)
134
+ toString: function (options = Object .prototype)
135
135
  {
136
- const stream = { string: "" };
136
+ const generator = new Generator (options);
137
137
 
138
- if (scene)
139
- Generator .Get (stream) .PushExecutionContext (scene);
138
+ if (options .scene)
139
+ generator .PushExecutionContext (options .scene);
140
140
 
141
- this .toStream (stream);
141
+ this .toStream (generator);
142
142
 
143
- return stream .string;
143
+ return generator .string;
144
144
  },
145
- toVRMLString: function ()
145
+ toVRMLString: function (options = Object .prototype)
146
146
  {
147
- const stream = { string: "" };
147
+ const generator = new Generator (options);
148
148
 
149
- this .toVRMLStream (stream);
149
+ if (options .scene)
150
+ generator .PushExecutionContext (options .scene);
150
151
 
151
- return stream .string;
152
+ this .toVRMLStream (generator);
153
+
154
+ return generator .string;
152
155
  },
153
- toXMLString: function ()
156
+ toXMLString: function (options = Object .prototype)
154
157
  {
155
- const stream = { string: "" };
158
+ const generator = new Generator (options);
159
+
160
+ if (options .scene)
161
+ generator .PushExecutionContext (options .scene);
156
162
 
157
- this .toXMLStream (stream);
163
+ this .toXMLStream (generator);
158
164
 
159
- return stream .string;
165
+ return generator .string;
160
166
  },
161
- toJSONString: function ()
167
+ toJSONString: function (options = Object .prototype)
162
168
  {
163
- const stream = { string: "" };
169
+ const generator = new Generator (options);
170
+
171
+ if (options .scene)
172
+ generator .PushExecutionContext (options .scene);
164
173
 
165
- this .toVRMLStream (stream); // TODO.
174
+ this .toJSONStream (generator);
166
175
 
167
- return stream .string;
176
+ return generator .string;
168
177
  },
169
- toStream: function (stream)
178
+ toStream: function (generator)
170
179
  {
171
- stream .string = "[object " + this .getTypeName () + "]";
180
+ generator .string = "[object " + this .getTypeName () + "]";
172
181
  },
173
182
  dispose: function () { },
174
183
  };