x_ite 4.7.5 → 4.7.9
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/.vscode/launch.json +15 -0
- package/.vscode/settings.json +2 -5
- package/Makefile +1 -0
- package/README.md +1 -1
- package/build/components/annotation.build.js +2 -2
- package/build/components/cad-geometry.build.js +2 -2
- package/build/components/cube-map-texturing.build.js +2 -2
- package/build/components/dis.build.js +2 -2
- package/build/components/event-utilities.build.js +2 -2
- package/build/components/geometry2d.build.js +2 -2
- package/build/components/geospatial.build.js +2 -2
- package/build/components/h-anim.build.js +2 -2
- package/build/components/key-device-sensor.build.js +2 -2
- package/build/components/layout.build.js +2 -2
- package/build/components/nurbs.build.js +2 -2
- package/build/components/particle-systems.build.js +2 -2
- package/build/components/picking.build.js +2 -2
- package/build/components/projective-texture-mapping.build.js +2 -2
- package/build/components/rigid-body-physics.build.js +2 -2
- package/build/components/scripting.build.js +2 -2
- package/build/components/texturing-3d.build.js +2 -2
- package/build/components/volume-rendering.build.js +2 -2
- package/build/components/x_ite.build.js +2 -2
- package/build/parts/default.end.frag.js +2 -0
- package/build/parts/default.start.frag.js +8 -0
- package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +2 -2
- package/dist/assets/components/annotation.js +9 -7
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +9 -7
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +9 -7
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +9 -7
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +9 -7
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +9 -7
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +9 -7
- package/dist/assets/components/geospatial.min.js +2 -2
- package/dist/assets/components/h-anim.js +9 -7
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +9 -7
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +9 -7
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +9 -7
- package/dist/assets/components/nurbs.min.js +2 -2
- package/dist/assets/components/particle-systems.js +9 -7
- package/dist/assets/components/particle-systems.min.js +2 -2
- package/dist/assets/components/picking.js +13 -11
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +9 -7
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +9 -7
- package/dist/assets/components/rigid-body-physics.min.js +17 -17
- package/dist/assets/components/scripting.js +16 -9
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +9 -7
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +11 -9
- package/dist/assets/components/volume-rendering.min.js +3 -3
- package/dist/assets/components/x_ite.js +9 -7
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl1/Phong.fs +0 -1
- package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
- package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl2/Phong.fs +0 -1
- package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +4 -3
- package/dist/x_ite.js +28281 -27706
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Accessing-the-External-Browser.md +32 -3
- package/docs/Custom-Shaders.md +165 -174
- package/docs/What's-New.md +61 -6
- package/docs/_config.yml +1 -1
- package/docs/index.md +21 -14
- package/docs/reference/Browser-Services.md +36 -8
- package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
- package/package.json +13 -6
- package/src/assets/components/picking.js +2 -2
- package/src/assets/components/volume-rendering.js +2 -2
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl1/Phong.fs +0 -1
- package/src/assets/shaders/webgl1/Unlit.fs +0 -3
- package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl2/Phong.fs +0 -1
- package/src/assets/shaders/webgl2/Unlit.fs +0 -3
- package/src/bookmarks.js +8 -11
- package/src/examples.js +1 -1
- package/src/locale/de.po +19 -75
- package/src/locale/fr.po +18 -75
- package/src/standard/Time/MicroTime.js +3 -1
- package/src/standard/Utility/DataStorage.js +7 -10
- package/src/tests.js +2 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
- package/src/x_ite/Browser/Core/BrowserTimings.js +13 -24
- package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
- package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +1 -3
- package/src/x_ite/Browser/Networking/urls.js +25 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
- package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +70 -50
- package/src/x_ite/Components/Grouping/Switch.js +1 -1
- package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
- package/src/x_ite/Components/Navigation/Collision.js +1 -1
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
- package/src/x_ite/Components/Scripting/Script.js +7 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
- package/src/x_ite/Components/Shaders.js +9 -9
- package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
- package/src/x_ite/Fields/SFColor.js +20 -7
- package/src/x_ite/Fields/SFColorRGBA.js +6 -6
- package/src/x_ite/Fields/SFDouble.js +2 -2
- package/src/x_ite/Fields/SFFloat.js +2 -2
- package/src/x_ite/Fields/SFImage.js +13 -13
- package/src/x_ite/Fields/SFMatrix3.js +5 -5
- package/src/x_ite/Fields/SFMatrix4.js +6 -6
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +14 -3
- package/src/x_ite/Fields/SFNode.js +23 -19
- package/src/x_ite/Fields/SFNodeCache.js +14 -10
- package/src/x_ite/Fields/SFRotation.js +10 -10
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/Fields/SFTime.js +1 -1
- package/src/x_ite/Fields/SFVec2.js +6 -6
- package/src/x_ite/Fields/SFVec3.js +7 -7
- package/src/x_ite/Fields/SFVec4.js +8 -8
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +7 -6
- package/src/x_ite/InputOutput/Generator.js +85 -65
- package/src/x_ite/Parser/X3DParser.js +6 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/X3D.js +8 -2
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +2 -1
- package/src/x_ite.html +3 -3
- package/src/x_ite.js +21 -12
- package/x_ite.min.html +3 -3
- package/build/parts/default.end.frag +0 -2
- package/build/parts/default.start.frag +0 -6
- package/build/parts/x_ite.start.frag +0 -8
|
@@ -57,7 +57,7 @@ function (X3DField, SFVecPrototypeTemplate, X3DConstants, Vector2)
|
|
|
57
57
|
{
|
|
58
58
|
"use strict";
|
|
59
59
|
|
|
60
|
-
function SFVec2Template (TypeName, Type)
|
|
60
|
+
function SFVec2Template (TypeName, Type, double)
|
|
61
61
|
{
|
|
62
62
|
function SFVec2 (x, y)
|
|
63
63
|
{
|
|
@@ -77,7 +77,7 @@ function (X3DField, SFVecPrototypeTemplate, X3DConstants, Vector2)
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
SFVec2 .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
80
|
-
SFVecPrototypeTemplate (Vector2),
|
|
80
|
+
SFVecPrototypeTemplate (Vector2, double),
|
|
81
81
|
{
|
|
82
82
|
constructor: SFVec2,
|
|
83
83
|
getTypeName: function ()
|
|
@@ -90,7 +90,7 @@ function (X3DField, SFVecPrototypeTemplate, X3DConstants, Vector2)
|
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
const x = {
|
|
94
94
|
get: function ()
|
|
95
95
|
{
|
|
96
96
|
return this .getValue () .x;
|
|
@@ -104,7 +104,7 @@ function (X3DField, SFVecPrototypeTemplate, X3DConstants, Vector2)
|
|
|
104
104
|
configurable: false
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
const y = {
|
|
108
108
|
get: function ()
|
|
109
109
|
{
|
|
110
110
|
return this .getValue () .y;
|
|
@@ -131,7 +131,7 @@ function (X3DField, SFVecPrototypeTemplate, X3DConstants, Vector2)
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
return {
|
|
134
|
-
SFVec2d: SFVec2Template ("SFVec2d", X3DConstants .SFVec2d),
|
|
135
|
-
SFVec2f: SFVec2Template ("SFVec2f", X3DConstants .SFVec2f),
|
|
134
|
+
SFVec2d: SFVec2Template ("SFVec2d", X3DConstants .SFVec2d, true),
|
|
135
|
+
SFVec2f: SFVec2Template ("SFVec2f", X3DConstants .SFVec2f, false),
|
|
136
136
|
};
|
|
137
137
|
});
|
|
@@ -60,7 +60,7 @@ function (X3DField,
|
|
|
60
60
|
{
|
|
61
61
|
"use strict";
|
|
62
62
|
|
|
63
|
-
function SFVec3Template (TypeName, Type)
|
|
63
|
+
function SFVec3Template (TypeName, Type, double)
|
|
64
64
|
{
|
|
65
65
|
function SFVec3 (x, y, z)
|
|
66
66
|
{
|
|
@@ -80,7 +80,7 @@ function (X3DField,
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
SFVec3 .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
83
|
-
SFVecPrototypeTemplate (Vector3),
|
|
83
|
+
SFVecPrototypeTemplate (Vector3, double),
|
|
84
84
|
{
|
|
85
85
|
constructor: SFVec3,
|
|
86
86
|
getTypeName: function ()
|
|
@@ -97,7 +97,7 @@ function (X3DField,
|
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
const x = {
|
|
101
101
|
get: function ()
|
|
102
102
|
{
|
|
103
103
|
return this .getValue () .x;
|
|
@@ -111,7 +111,7 @@ function (X3DField,
|
|
|
111
111
|
configurable: false
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
const y = {
|
|
115
115
|
get: function ()
|
|
116
116
|
{
|
|
117
117
|
return this .getValue () .y;
|
|
@@ -125,7 +125,7 @@ function (X3DField,
|
|
|
125
125
|
configurable: false
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
const z = {
|
|
129
129
|
get: function ()
|
|
130
130
|
{
|
|
131
131
|
return this .getValue () .z;
|
|
@@ -155,7 +155,7 @@ function (X3DField,
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
return {
|
|
158
|
-
SFVec3d: SFVec3Template ("SFVec3d", X3DConstants .SFVec3d),
|
|
159
|
-
SFVec3f: SFVec3Template ("SFVec3f", X3DConstants .SFVec3f),
|
|
158
|
+
SFVec3d: SFVec3Template ("SFVec3d", X3DConstants .SFVec3d, true),
|
|
159
|
+
SFVec3f: SFVec3Template ("SFVec3f", X3DConstants .SFVec3f, false),
|
|
160
160
|
};
|
|
161
161
|
});
|
|
@@ -60,7 +60,7 @@ function (X3DField,
|
|
|
60
60
|
{
|
|
61
61
|
"use strict";
|
|
62
62
|
|
|
63
|
-
function SFVec4Template (TypeName, Type)
|
|
63
|
+
function SFVec4Template (TypeName, Type, double)
|
|
64
64
|
{
|
|
65
65
|
function SFVec4 (x, y, z, w)
|
|
66
66
|
{
|
|
@@ -80,7 +80,7 @@ function (X3DField,
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
SFVec4 .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
83
|
-
SFVecPrototypeTemplate (Vector4),
|
|
83
|
+
SFVecPrototypeTemplate (Vector4, double),
|
|
84
84
|
{
|
|
85
85
|
constructor: SFVec4,
|
|
86
86
|
getTypeName: function ()
|
|
@@ -93,7 +93,7 @@ function (X3DField,
|
|
|
93
93
|
},
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
const x = {
|
|
97
97
|
get: function ()
|
|
98
98
|
{
|
|
99
99
|
return this .getValue () .x;
|
|
@@ -107,7 +107,7 @@ function (X3DField,
|
|
|
107
107
|
configurable: false
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
const y = {
|
|
111
111
|
get: function ()
|
|
112
112
|
{
|
|
113
113
|
return this .getValue () .y;
|
|
@@ -121,7 +121,7 @@ function (X3DField,
|
|
|
121
121
|
configurable: false
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
const z = {
|
|
125
125
|
get: function ()
|
|
126
126
|
{
|
|
127
127
|
return this .getValue () .z;
|
|
@@ -135,7 +135,7 @@ function (X3DField,
|
|
|
135
135
|
configurable: false
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
const w = {
|
|
139
139
|
get: function ()
|
|
140
140
|
{
|
|
141
141
|
return this .getValue () .w;
|
|
@@ -168,7 +168,7 @@ function (X3DField,
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
return {
|
|
171
|
-
SFVec4d: SFVec4Template ("SFVec4d", X3DConstants .SFVec4d),
|
|
172
|
-
SFVec4f: SFVec4Template ("SFVec4f", X3DConstants .SFVec4f),
|
|
171
|
+
SFVec4d: SFVec4Template ("SFVec4d", X3DConstants .SFVec4d, true),
|
|
172
|
+
SFVec4f: SFVec4Template ("SFVec4f", X3DConstants .SFVec4f, false),
|
|
173
173
|
};
|
|
174
174
|
});
|
|
@@ -56,7 +56,7 @@ function (X3DField,
|
|
|
56
56
|
{
|
|
57
57
|
"use strict";
|
|
58
58
|
|
|
59
|
-
return function (Type)
|
|
59
|
+
return function (Type, double)
|
|
60
60
|
{
|
|
61
61
|
return Object .assign (Object .create (X3DField .prototype),
|
|
62
62
|
{
|
|
@@ -126,18 +126,19 @@ function (X3DField,
|
|
|
126
126
|
},
|
|
127
127
|
toStream: function (stream)
|
|
128
128
|
{
|
|
129
|
-
|
|
129
|
+
const
|
|
130
130
|
generator = Generator .Get (stream),
|
|
131
131
|
value = this .getValue (),
|
|
132
|
-
category = generator .Unit (this .getUnit ())
|
|
132
|
+
category = generator .Unit (this .getUnit ()),
|
|
133
|
+
last = value .length - 1;
|
|
133
134
|
|
|
134
|
-
for (
|
|
135
|
+
for (let i = 0; i < last; ++ i)
|
|
135
136
|
{
|
|
136
|
-
stream .string +=
|
|
137
|
+
stream .string += double ? generator .DoublePrecision (generator .ToUnit (category, value [i])) : generator .Precision (generator .ToUnit (category, value [i]));
|
|
137
138
|
stream .string += " ";
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
stream .string +=
|
|
141
|
+
stream .string += double ? generator .DoublePrecision (generator .ToUnit (category, value [last])) : generator .Precision (generator .ToUnit (category, value [last]));
|
|
141
142
|
},
|
|
142
143
|
toVRMLStream: function (stream)
|
|
143
144
|
{
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
******************************************************************************/
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
define ([
|
|
52
51
|
"x_ite/Bits/X3DConstants",
|
|
53
52
|
],
|
|
@@ -57,8 +56,12 @@ function (X3DConstants)
|
|
|
57
56
|
|
|
58
57
|
function Generator ()
|
|
59
58
|
{
|
|
60
|
-
this .indent
|
|
61
|
-
this .indentChar
|
|
59
|
+
this .indent = "";
|
|
60
|
+
this .indentChar = " ";
|
|
61
|
+
this .precision = 6;
|
|
62
|
+
this .doublePrecision = 14;
|
|
63
|
+
this .removeTrailingZeros = /\.?0*$|\.?0*(?=e|E)/;
|
|
64
|
+
|
|
62
65
|
this .executionContextStack = [ null ];
|
|
63
66
|
this .importedNodesIndex = new Map ();
|
|
64
67
|
this .exportedNodesIndex = new Map ();
|
|
@@ -93,11 +96,19 @@ function (X3DConstants)
|
|
|
93
96
|
},
|
|
94
97
|
PadRight: function (string, pad)
|
|
95
98
|
{
|
|
96
|
-
for (
|
|
99
|
+
for (let i = 0, length = pad - string .length; i < length; ++ i)
|
|
97
100
|
string += " ";
|
|
98
101
|
|
|
99
102
|
return string;
|
|
100
103
|
},
|
|
104
|
+
Precision: function (value)
|
|
105
|
+
{
|
|
106
|
+
return Math .fround (value) .toPrecision (this .precision) .replace (this .removeTrailingZeros, "");
|
|
107
|
+
},
|
|
108
|
+
DoublePrecision: function (value)
|
|
109
|
+
{
|
|
110
|
+
return value .toPrecision (this .doublePrecision) .replace (this .removeTrailingZeros, "");
|
|
111
|
+
},
|
|
101
112
|
PushExecutionContext: function (executionContext)
|
|
102
113
|
{
|
|
103
114
|
this .executionContextStack .push (executionContext);
|
|
@@ -145,7 +156,7 @@ function (X3DConstants)
|
|
|
145
156
|
},
|
|
146
157
|
ExportedNodes: function (exportedNodes)
|
|
147
158
|
{
|
|
148
|
-
|
|
159
|
+
const index = this .exportedNodesIndex .get (this .ExecutionContext ());
|
|
149
160
|
|
|
150
161
|
exportedNodes .forEach (function (exportedNode)
|
|
151
162
|
{
|
|
@@ -159,7 +170,7 @@ function (X3DConstants)
|
|
|
159
170
|
},
|
|
160
171
|
ImportedNodes: function (importedNodes)
|
|
161
172
|
{
|
|
162
|
-
|
|
173
|
+
const index = this .importedNodesIndex .get (this .ExecutionContext ());
|
|
163
174
|
|
|
164
175
|
importedNodes .forEach (function (importedNode)
|
|
165
176
|
{
|
|
@@ -197,72 +208,79 @@ function (X3DConstants)
|
|
|
197
208
|
{
|
|
198
209
|
return this .nodes .has (baseNode);
|
|
199
210
|
},
|
|
200
|
-
Name: function (
|
|
211
|
+
Name: (function ()
|
|
201
212
|
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
var name = this .namesByNode .get (baseNode);
|
|
205
|
-
|
|
206
|
-
if (name !== undefined)
|
|
207
|
-
return name;
|
|
208
|
-
|
|
209
|
-
var names = this .names .get (this .ExecutionContext ());
|
|
210
|
-
|
|
211
|
-
// The node has no name
|
|
213
|
+
const _TrailingNumbers = /(_\d+$)/;
|
|
212
214
|
|
|
213
|
-
|
|
215
|
+
return function (baseNode)
|
|
214
216
|
{
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
var name = this .UniqueName ();
|
|
217
|
+
// Is the node already in index
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
this .namesByNode .set (baseNode, name);
|
|
219
|
+
const name = this .namesByNode .get (baseNode);
|
|
221
220
|
|
|
221
|
+
if (name !== undefined)
|
|
222
|
+
{
|
|
222
223
|
return name;
|
|
223
224
|
}
|
|
225
|
+
else
|
|
226
|
+
{
|
|
227
|
+
const names = this .names .get (this .ExecutionContext ());
|
|
224
228
|
|
|
225
|
-
|
|
229
|
+
// The node has no name
|
|
226
230
|
|
|
227
|
-
|
|
228
|
-
|
|
231
|
+
if (baseNode .getName () .length === 0)
|
|
232
|
+
{
|
|
233
|
+
if (this .NeedsName (baseNode))
|
|
234
|
+
{
|
|
235
|
+
const name = this .UniqueName ();
|
|
229
236
|
|
|
230
|
-
|
|
237
|
+
names .set (name, baseNode);
|
|
238
|
+
this .namesByNode .set (baseNode, name);
|
|
231
239
|
|
|
232
|
-
|
|
240
|
+
return name;
|
|
241
|
+
}
|
|
233
242
|
|
|
234
|
-
|
|
235
|
-
var hasNumber = name .match (_TrailingNumbers) !== null;
|
|
243
|
+
// The node doesn't need a name
|
|
236
244
|
|
|
237
|
-
|
|
245
|
+
return baseNode .getName ();
|
|
246
|
+
}
|
|
238
247
|
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
if (this .NeedsName (baseNode))
|
|
242
|
-
name = this .UniqueName ();
|
|
248
|
+
// The node has a name
|
|
243
249
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
else
|
|
248
|
-
{
|
|
249
|
-
var
|
|
250
|
-
i = 0,
|
|
251
|
-
newName = hasNumber ? name + '_' + (++ i) : name;
|
|
250
|
+
let name = baseNode .getName ();
|
|
251
|
+
const hasNumber = name .match (_TrailingNumbers) !== null;
|
|
252
252
|
|
|
253
|
-
|
|
254
|
-
{
|
|
255
|
-
newName = name + '_' + (++ i);
|
|
256
|
-
}
|
|
253
|
+
name = name .replace (_TrailingNumbers, "");
|
|
257
254
|
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
if (name .length === 0)
|
|
256
|
+
{
|
|
257
|
+
if (this .NeedsName (baseNode))
|
|
258
|
+
name = this .UniqueName ();
|
|
260
259
|
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
else
|
|
261
|
+
return "";
|
|
262
|
+
}
|
|
263
|
+
else
|
|
264
|
+
{
|
|
265
|
+
let
|
|
266
|
+
i = 0,
|
|
267
|
+
newName = hasNumber ? name + '_' + (++ i) : name;
|
|
263
268
|
|
|
264
|
-
|
|
265
|
-
|
|
269
|
+
while (names .has (newName))
|
|
270
|
+
{
|
|
271
|
+
newName = name + '_' + (++ i);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
name = newName;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
names .set (name, baseNode);
|
|
278
|
+
this .namesByNode .set (baseNode, name);
|
|
279
|
+
|
|
280
|
+
return name;
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
})(),
|
|
266
284
|
NeedsName: function (baseNode)
|
|
267
285
|
{
|
|
268
286
|
if (baseNode .getCloneCount () > 1)
|
|
@@ -271,7 +289,7 @@ function (X3DConstants)
|
|
|
271
289
|
if (baseNode .hasRoutes ())
|
|
272
290
|
return true;
|
|
273
291
|
|
|
274
|
-
|
|
292
|
+
const
|
|
275
293
|
executionContext = baseNode .getExecutionContext (),
|
|
276
294
|
index = this .importedNodesIndex .get (executionContext);
|
|
277
295
|
|
|
@@ -280,24 +298,26 @@ function (X3DConstants)
|
|
|
280
298
|
if (index .has (baseNode))
|
|
281
299
|
return true;
|
|
282
300
|
}
|
|
301
|
+
else
|
|
302
|
+
{
|
|
303
|
+
const index = this .exportedNodesIndex .get (executionContext);
|
|
283
304
|
|
|
284
|
-
|
|
305
|
+
if (index)
|
|
306
|
+
{
|
|
307
|
+
if (index .has (baseNode))
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
285
310
|
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
if (index .has (baseNode))
|
|
289
|
-
return true;
|
|
311
|
+
return false;
|
|
290
312
|
}
|
|
291
|
-
|
|
292
|
-
return false;
|
|
293
313
|
},
|
|
294
314
|
UniqueName: function ()
|
|
295
315
|
{
|
|
296
|
-
|
|
316
|
+
const names = this .names .get (this .ExecutionContext ());
|
|
297
317
|
|
|
298
318
|
for (; ;)
|
|
299
319
|
{
|
|
300
|
-
|
|
320
|
+
const name = '_' + (++ this .newName);
|
|
301
321
|
|
|
302
322
|
if (names .has (name))
|
|
303
323
|
continue;
|
|
@@ -307,7 +327,7 @@ function (X3DConstants)
|
|
|
307
327
|
},
|
|
308
328
|
LocalName: function (baseNode)
|
|
309
329
|
{
|
|
310
|
-
|
|
330
|
+
const importedName = this .importedNames .get (baseNode);
|
|
311
331
|
|
|
312
332
|
if (importedName !== undefined)
|
|
313
333
|
return importedName;
|
|
@@ -373,7 +393,7 @@ function (X3DConstants)
|
|
|
373
393
|
{
|
|
374
394
|
if (this .units)
|
|
375
395
|
{
|
|
376
|
-
|
|
396
|
+
const executionContext = this .ExecutionContext ();
|
|
377
397
|
|
|
378
398
|
if (executionContext)
|
|
379
399
|
return executionContext .toUnit (category, value);
|
|
@@ -130,6 +130,12 @@ define (function ()
|
|
|
130
130
|
providerUrls .add (providerUrl);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
if (typeof globalRequire === "function" && typeof __filename === "string")
|
|
134
|
+
{
|
|
135
|
+
for (const url of providerUrls)
|
|
136
|
+
globalRequire (url);
|
|
137
|
+
}
|
|
138
|
+
|
|
133
139
|
return Array .from (providerUrls);
|
|
134
140
|
};
|
|
135
141
|
})(),
|
package/src/x_ite/X3D.js
CHANGED
|
@@ -106,7 +106,12 @@ function ($,
|
|
|
106
106
|
|
|
107
107
|
function getComponentUrl (name)
|
|
108
108
|
{
|
|
109
|
-
|
|
109
|
+
const url = urls .getProviderUrl (name);
|
|
110
|
+
|
|
111
|
+
if (typeof globalRequire === "function" && typeof __filename === "string")
|
|
112
|
+
globalRequire (url);
|
|
113
|
+
|
|
114
|
+
return url;
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
function createBrowser (url, parameter)
|
|
@@ -180,11 +185,12 @@ function ($,
|
|
|
180
185
|
});
|
|
181
186
|
}
|
|
182
187
|
|
|
188
|
+
require .getComponentUrl = getComponentUrl;
|
|
189
|
+
|
|
183
190
|
Object .assign (X3D,
|
|
184
191
|
{
|
|
185
192
|
require: require,
|
|
186
193
|
define: define,
|
|
187
|
-
getComponentUrl: getComponentUrl,
|
|
188
194
|
|
|
189
195
|
getBrowser: getBrowser,
|
|
190
196
|
createBrowser: createBrowser,
|
package/src/x_ite.config.js
CHANGED
|
@@ -36,11 +36,6 @@ require .config ({
|
|
|
36
36
|
"location": "../node_modules/opentype.js",
|
|
37
37
|
"main": "dist/opentype.js"
|
|
38
38
|
},
|
|
39
|
-
{
|
|
40
|
-
"name": "sprintf",
|
|
41
|
-
"location": "../node_modules/sprintf-js",
|
|
42
|
-
"main": "dist/sprintf.min.js"
|
|
43
|
-
},
|
|
44
39
|
{
|
|
45
40
|
"name": "contextMenu",
|
|
46
41
|
"location": "../node_modules/jquery-contextmenu",
|
package/src/x_ite.css
CHANGED
|
@@ -93,7 +93,7 @@ X3DCanvas .x_ite-private-notification {
|
|
|
93
93
|
|
|
94
94
|
X3DCanvas .x_ite-private-notification span {
|
|
95
95
|
padding: 0px 24px 0px 20px;
|
|
96
|
-
background: url(assets/images/icon.bw.png) no-repeat 0px
|
|
96
|
+
background: url(assets/images/icon.bw.png) no-repeat 0px 2px;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
X3DCanvas .x_ite-private-browser-timings {
|
|
@@ -336,6 +336,7 @@ X3DCanvas #context-menu-layer {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
.x_ite-private-menu .context-menu-separator {
|
|
339
|
+
padding-top: 0;
|
|
339
340
|
padding-bottom: 0;
|
|
340
341
|
border-bottom: 1px solid #111;
|
|
341
342
|
}
|
package/src/x_ite.html
CHANGED
|
@@ -34,7 +34,7 @@ body {
|
|
|
34
34
|
padding-bottom: 100px;
|
|
35
35
|
background: black;
|
|
36
36
|
color: white;
|
|
37
|
-
font-family: PT Sans, sans;
|
|
37
|
+
font-family: PT Sans, sans-serif;
|
|
38
38
|
line-height: 1.3;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -114,7 +114,7 @@ main.color-management .browser {
|
|
|
114
114
|
background: #313131;
|
|
115
115
|
color: white;
|
|
116
116
|
vertical-align: middle;
|
|
117
|
-
font-family: PT Sans;
|
|
117
|
+
font-family: PT Sans, sans-serif;
|
|
118
118
|
font-size: 10pt;
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -130,7 +130,7 @@ main.color-management .browser {
|
|
|
130
130
|
background: #313131;
|
|
131
131
|
color: white;
|
|
132
132
|
vertical-align: middle;
|
|
133
|
-
font-family: PT Sans;
|
|
133
|
+
font-family: PT Sans, sans-serif;
|
|
134
134
|
font-size: 10pt;
|
|
135
135
|
}
|
|
136
136
|
|
package/src/x_ite.js
CHANGED
|
@@ -46,9 +46,6 @@
|
|
|
46
46
|
*
|
|
47
47
|
******************************************************************************/
|
|
48
48
|
|
|
49
|
-
if (typeof module === 'undefined')
|
|
50
|
-
var module = { };
|
|
51
|
-
|
|
52
49
|
require .config ({
|
|
53
50
|
"waitSeconds": 0,
|
|
54
51
|
});
|
|
@@ -71,7 +68,10 @@ define .hide = function ()
|
|
|
71
68
|
|
|
72
69
|
const getScriptURL = (function ()
|
|
73
70
|
{
|
|
74
|
-
|
|
71
|
+
if (document .currentScript)
|
|
72
|
+
var src = document .currentScript .src;
|
|
73
|
+
else if (typeof __filename === "string")
|
|
74
|
+
var src = __filename;
|
|
75
75
|
|
|
76
76
|
return function ()
|
|
77
77
|
{
|
|
@@ -85,15 +85,21 @@ const getScriptURL = (function ()
|
|
|
85
85
|
|
|
86
86
|
function X_ITE (callback, fallback)
|
|
87
87
|
{
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
PrivateX3D (callback, fallback);
|
|
91
|
-
}
|
|
92
|
-
else
|
|
88
|
+
const promise = new Promise (function (resolve, reject)
|
|
93
89
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
if (PrivateX3D)
|
|
91
|
+
{
|
|
92
|
+
PrivateX3D (resolve, reject);
|
|
93
|
+
PrivateX3D (callback, fallback);
|
|
94
|
+
}
|
|
95
|
+
else
|
|
96
|
+
{
|
|
97
|
+
callbacks .push (resolve, callback);
|
|
98
|
+
fallbacks .push (reject, fallback);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return promise;
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
function fallback (error)
|
|
@@ -129,6 +135,9 @@ const getScriptURL = (function ()
|
|
|
129
135
|
// Now assign temporary X3D.
|
|
130
136
|
window .X3D = X_ITE;
|
|
131
137
|
|
|
138
|
+
if (typeof globalModule === "object" && typeof globalModule .exports === "object")
|
|
139
|
+
globalModule .exports = X_ITE;
|
|
140
|
+
|
|
132
141
|
// IE fix.
|
|
133
142
|
document .createElement ("X3DCanvas");
|
|
134
143
|
|
package/x_ite.min.html
CHANGED
|
@@ -32,7 +32,7 @@ body {
|
|
|
32
32
|
padding-bottom: 100px;
|
|
33
33
|
background: black;
|
|
34
34
|
color: white;
|
|
35
|
-
font-family: PT Sans, sans;
|
|
35
|
+
font-family: PT Sans, sans-serif;
|
|
36
36
|
line-height: 1.3;
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -112,7 +112,7 @@ main.color-management .browser {
|
|
|
112
112
|
background: #313131;
|
|
113
113
|
color: white;
|
|
114
114
|
vertical-align: middle;
|
|
115
|
-
font-family: PT Sans;
|
|
115
|
+
font-family: PT Sans, sans-serif;
|
|
116
116
|
font-size: 10pt;
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -128,7 +128,7 @@ main.color-management .browser {
|
|
|
128
128
|
background: #313131;
|
|
129
129
|
color: white;
|
|
130
130
|
vertical-align: middle;
|
|
131
|
-
font-family: PT Sans;
|
|
131
|
+
font-family: PT Sans, sans-serif;
|
|
132
132
|
font-size: 10pt;
|
|
133
133
|
}
|
|
134
134
|
|