sunrize 1.7.63 → 1.8.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 (40) hide show
  1. package/package.json +4 -4
  2. package/src/Application/ActionKeys.js +3 -3
  3. package/src/Application/Application.js +1 -1
  4. package/src/Application/Dashboard.js +87 -6
  5. package/src/Application/Document.js +144 -24
  6. package/src/Application/Hierarchy.js +268 -0
  7. package/src/Application/Selection.js +6 -6
  8. package/src/Components/Grouping/StaticGroup.js +1 -1
  9. package/src/Components/Grouping/Switch.js +34 -0
  10. package/src/Components/Navigation/Collision.js +70 -0
  11. package/src/Components/Navigation/LOD.js +34 -0
  12. package/src/Editors/Library.js +1 -1
  13. package/src/Editors/OutlineEditor.js +6 -2
  14. package/src/Editors/OutlineRouteGraph.js +4 -4
  15. package/src/Editors/OutlineView.js +210 -63
  16. package/src/Tools/Core/X3DNodeTool.js +2 -0
  17. package/src/Tools/EnvironmentalSensor/X3DEnvironmentalSensorNodeTool.x3d +1 -0
  18. package/src/Tools/Geometry2D/Arc2DTool.js +1 -0
  19. package/src/Tools/Geometry2D/ArcClose2DTool.js +1 -0
  20. package/src/Tools/Geometry2D/Circle2DTool.js +1 -0
  21. package/src/Tools/Geometry2D/Disk2DTool.js +2 -0
  22. package/src/Tools/Geometry2D/Rectangle2DTool.js +1 -0
  23. package/src/Tools/Geometry3D/BoxTool.js +1 -0
  24. package/src/Tools/Geometry3D/ConeTool.js +1 -0
  25. package/src/Tools/Geometry3D/CylinderTool.js +1 -0
  26. package/src/Tools/Geometry3D/SphereTool.js +1 -0
  27. package/src/Tools/Grouping/X3DBoundedObjectTool.x3d +28 -12
  28. package/src/Tools/Grouping/X3DTransformNodeTool.x3d +30 -12
  29. package/src/Tools/Lighting/X3DLightNodeTool.x3d +1 -0
  30. package/src/Tools/Navigation/X3DViewpointNodeTool.x3d +1 -0
  31. package/src/Tools/SnapTool/X3DSnapNodeTool.js +8 -6
  32. package/src/Tools/Sound/ListenerPointSourceTool.x3d +1 -0
  33. package/src/Tools/Sound/SoundTool.x3d +5 -0
  34. package/src/Tools/Sound/SpatialSoundTool.x3d +2 -1
  35. package/src/Tools/TextureProjection/X3DTextureProjectorNodeTool.x3d +1 -0
  36. package/src/Undo/Editor.js +1 -1
  37. package/src/Undo/UndoManager.js +4 -4
  38. package/src/X3D.js +1 -1
  39. package/src/assets/themes/default-template.css +6 -0
  40. package/src/assets/themes/default.css +6 -0
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "http://www.web3d.org/specifications/x3d-4.0.dtd">
3
- <X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
2
+ <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
3
+ <X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
4
4
  <head>
5
5
  <component name='Layout' level='2'/>
6
6
  <component name='Scripting' level='1'/>
@@ -9,11 +9,13 @@
9
9
  <meta name='comment' content='Rise and Shine'/>
10
10
  <meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
11
11
  <meta name='creator' content='Holger Seelig'/>
12
- <meta name='generator' content='Sunrize X3D Editor V1.7.1, https://create3000.github.io/sunrize/'/>
13
- <meta name='modified' content='Sat, 29 Jun 2024 11:06:25 GMT'/>
12
+ <meta name='generator' content='Sunrize X3D Editor V1.7.63, https://create3000.github.io/sunrize/'/>
13
+ <meta name='modified' content='Sat, 12 Apr 2025 11:32:53 GMT'/>
14
14
  </head>
15
15
  <Scene>
16
- <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'/>
16
+ <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
17
+ <field accessType='inputOutput' type='SFBool' name='instanced'/>
18
+ </ExternProtoDeclare>
17
19
  <ProtoDeclare name='X3DBoundedObjectTool'>
18
20
  <ProtoInterface>
19
21
  <field accessType='inputOutput' type='SFBool' name='selected'/>
@@ -22,7 +24,7 @@
22
24
  <field accessType='inputOutput' type='SFVec3f' name='axisOfRotation'/>
23
25
  <field accessType='inputOutput' type='SFBool' name='rectangleDisplay'/>
24
26
  <field accessType='inputOutput' type='SFVec3f' name='rectangleSize' value='1 1 1'/>
25
- <field accessType='inputOutput' type='SFVec3f' name='rectangleCenter'/>
27
+ <field accessType='inputOutput' type='SFBool' name='bboxEvents' value='true'/>
26
28
  <field accessType='inputOutput' type='SFBool' name='bboxDisplay'/>
27
29
  <field accessType='inputOutput' type='SFInt32' name='bboxStyle' value='1'/>
28
30
  <field accessType='inputOutput' type='SFColor' name='bboxColor' value='1 1 1'/>
@@ -36,6 +38,23 @@
36
38
  <IS>
37
39
  <connect nodeField='translation' protoField='bboxCenter'/>
38
40
  </IS>
41
+ <Transform DEF='Box'>
42
+ <IS>
43
+ <connect nodeField='scale' protoField='bboxSize'/>
44
+ <connect nodeField='visible' protoField='bboxEvents'/>
45
+ </IS>
46
+ <Shape>
47
+ <Appearance
48
+ alphaMode='MASK'>
49
+ <UnlitMaterial
50
+ transparency='1'/>
51
+ <DepthMode
52
+ polygonOffset='-1 -1'/>
53
+ </Appearance>
54
+ <Box
55
+ size='1 1 1'/>
56
+ </Shape>
57
+ </Transform>
39
58
  <Shape DEF='BoundingBox_1'
40
59
  castShadow='false'>
41
60
  <IS>
@@ -48,13 +67,11 @@
48
67
  <connect nodeField='linetype' protoField='bboxStyle'/>
49
68
  </IS>
50
69
  </LineProperties>
51
- <Material DEF='BBoxMaterial'
52
- diffuseColor='0 0 0'>
70
+ <UnlitMaterial>
53
71
  <IS>
54
72
  <connect nodeField='emissiveColor' protoField='bboxColor'/>
55
73
  </IS>
56
- </Material>
57
- <ProtoInstance name='ToolShader' DEF='_11' containerField='shaders'/>
74
+ </UnlitMaterial>
58
75
  <DepthMode
59
76
  polygonOffset='-1 -1'/>
60
77
  </Appearance>
@@ -91,7 +108,7 @@
91
108
  <Appearance DEF='Red_1'>
92
109
  <Material
93
110
  diffuseColor='1 0 0'/>
94
- <ProtoInstance name='ToolShader' USE='_11' containerField='shaders'/>
111
+ <ProtoInstance name='ToolShader' DEF='_11' containerField='shaders'/>
95
112
  <DepthMode USE='_12'/>
96
113
  </Appearance>
97
114
  <Cone DEF='Arrow_1'
@@ -228,7 +245,6 @@
228
245
  </Group>
229
246
  <Transform DEF='Rectangle'>
230
247
  <IS>
231
- <connect nodeField='translation' protoField='rectangleCenter'/>
232
248
  <connect nodeField='visible' protoField='rectangleDisplay'/>
233
249
  </IS>
234
250
  <Shape DEF='Box_1'
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "http://www.web3d.org/specifications/x3d-4.0.dtd">
3
- <X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
2
+ <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 4.0//EN" "https://www.web3d.org/specifications/x3d-4.0.dtd">
3
+ <X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
4
4
  <head>
5
5
  <component name='Geometry2D' level='2'/>
6
6
  <component name='Layout' level='2'/>
@@ -11,11 +11,13 @@
11
11
  <meta name='comment' content='Rise and Shine'/>
12
12
  <meta name='created' content='Fri, 29 Aug 2014 13:13:27 GMT'/>
13
13
  <meta name='creator' content='Holger Seelig'/>
14
- <meta name='generator' content='Sunrize X3D Editor V1.7.1, https://create3000.github.io/sunrize/'/>
15
- <meta name='modified' content='Sat, 29 Jun 2024 11:08:56 GMT'/>
14
+ <meta name='generator' content='Sunrize X3D Editor V1.7.63, https://create3000.github.io/sunrize/'/>
15
+ <meta name='modified' content='Sat, 12 Apr 2025 11:32:03 GMT'/>
16
16
  </head>
17
17
  <Scene>
18
- <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'/>
18
+ <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
19
+ <field accessType='inputOutput' type='SFBool' name='instanced'/>
20
+ </ExternProtoDeclare>
19
21
  <ExternProtoDeclare name='BooleanSwitch' url='"BooleanSwitch.x3d#BooleanSwitch"'>
20
22
  <field accessType='inputOutput' type='SFBool' name='whichChoice'/>
21
23
  <field accessType='inputOutput' type='SFBool' name='visible'/>
@@ -51,6 +53,7 @@
51
53
  <field accessType='inputOutput' type='SFBool' name='scaleDisplay' value='true'/>
52
54
  <field accessType='inputOutput' type='SFBool' name='centerDisplay' value='true'/>
53
55
  <field accessType='inputOutput' type='SFBool' name='centerTool' value='true'/>
56
+ <field accessType='inputOutput' type='SFBool' name='bboxEvents' value='true'/>
54
57
  <field accessType='inputOutput' type='SFBool' name='bboxDisplay' value='true'/>
55
58
  <field accessType='inputOutput' type='SFColor' name='bboxColor' value='1 1 1'/>
56
59
  <field accessType='inputOutput' type='SFVec3f' name='bboxSize' value='1 1 1'/>
@@ -75,6 +78,23 @@
75
78
  <IS>
76
79
  <connect nodeField='translation' protoField='bboxCenter'/>
77
80
  </IS>
81
+ <Transform DEF='Box'>
82
+ <IS>
83
+ <connect nodeField='scale' protoField='bboxSize'/>
84
+ <connect nodeField='visible' protoField='bboxEvents'/>
85
+ </IS>
86
+ <Shape>
87
+ <Appearance
88
+ alphaMode='MASK'>
89
+ <UnlitMaterial
90
+ transparency='1'/>
91
+ <DepthMode
92
+ polygonOffset='-1 -1'/>
93
+ </Appearance>
94
+ <Box
95
+ size='1 1 1'/>
96
+ </Shape>
97
+ </Transform>
78
98
  <Shape DEF='BoundingBox_1'
79
99
  castShadow='false'>
80
100
  <IS>
@@ -83,13 +103,11 @@
83
103
  <Appearance>
84
104
  <LineProperties DEF='_2'
85
105
  linewidthScaleFactor='2'/>
86
- <Material DEF='BBoxMaterial'
87
- diffuseColor='0 0 0'>
106
+ <UnlitMaterial>
88
107
  <IS>
89
108
  <connect nodeField='emissiveColor' protoField='bboxColor'/>
90
109
  </IS>
91
- </Material>
92
- <ProtoInstance name='ToolShader' DEF='_3' containerField='shaders'/>
110
+ </UnlitMaterial>
93
111
  <DepthMode
94
112
  polygonOffset='-1 -1'/>
95
113
  </Appearance>
@@ -135,7 +153,7 @@
135
153
  <Appearance DEF='Red_1'>
136
154
  <Material
137
155
  diffuseColor='1 0 0'/>
138
- <ProtoInstance name='ToolShader' USE='_3' containerField='shaders'/>
156
+ <ProtoInstance name='ToolShader' DEF='_3' containerField='shaders'/>
139
157
  <DepthMode USE='_4'/>
140
158
  </Appearance>
141
159
  <Cone DEF='Arrow_1'
@@ -649,7 +667,7 @@
649
667
  </IS>
650
668
  <ProtoInstance name='BooleanSwitch' DEF='CenterLine'>
651
669
  <fieldValue name='children'>
652
- <Shape DEF='_1'
670
+ <Shape
653
671
  castShadow='false'>
654
672
  <Appearance DEF='CenterLineStyle'>
655
673
  <LineProperties
@@ -972,7 +990,7 @@ function set_bboxSize ()
972
990
  <field accessType='outputOnly' type='SFBool' name='scale'/>
973
991
  <field accessType='outputOnly' type='SFInt32' name='whichChoice_changed'/>
974
992
  <field accessType='outputOnly' type='SFString' name='activeTool'/>
975
- <field accessType='initializeOnly' type='SFTime' name='time'/>
993
+ <field accessType='initializeOnly' type='SFTime' name='time' value='-1'/>
976
994
  <field accessType='initializeOnly' type='SFInt32' name='tool'/>
977
995
  <IS>
978
996
  <connect nodeField='tools' protoField='tools'/>
@@ -276,6 +276,7 @@ async function initialize ()
276
276
  tool .undo = false;
277
277
  tool .tools = new MFString ("TRANSLATE");
278
278
  tool .centerDisplay = false;
279
+ tool .bboxEvents = false;
279
280
  tool .bboxDisplay = false;
280
281
  }
281
282
 
@@ -186,6 +186,7 @@ async function initialize ()
186
186
  tool .undo = false;
187
187
  tool .tools = new MFString ("TRANSLATE", "ROTATE");
188
188
  tool .centerDisplay = false;
189
+ tool .bboxEvents = false;
189
190
  tool .bboxDisplay = false;
190
191
  }
191
192
 
@@ -19,14 +19,14 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
19
19
  {
20
20
  super .connectTool ();
21
21
 
22
- $(this .getBrowser () .element .shadowRoot) .find ("canvas")
22
+ $(this .getBrowser () .element)
23
23
  .on (`mousedown.X3DSnapNodeTool${this .getId ()}`, event => this .onmousedown (event))
24
24
  .on (`mouseup.X3DSnapNodeTool${this .getId ()}`, event => this .onmouseup (event));
25
25
  }
26
26
 
27
27
  disconnectTool ()
28
28
  {
29
- $(this .getBrowser () .element .shadowRoot) .find ("canvas")
29
+ $(this .getBrowser () .element)
30
30
  .off (`.X3DSnapNodeTool${this .getId ()}`);
31
31
 
32
32
  super .disconnectTool ();
@@ -48,10 +48,11 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
48
48
  return;
49
49
  }
50
50
 
51
+ // Stop event propagation.
52
+
51
53
  event .preventDefault ();
52
- event .stopImmediatePropagation ();
53
54
 
54
- $(this .getBrowser () .element .shadowRoot) .find ("canvas")
55
+ $(this .getBrowser () .element)
55
56
  .on (`mousemove.X3DSnapNodeTool${this .getId ()}`, event => this .onmousemove (event));
56
57
 
57
58
  this .changePosition (this .getBrowser () .getHit ());
@@ -59,7 +60,7 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
59
60
 
60
61
  onmouseup (event)
61
62
  {
62
- $(this .getBrowser () .element .shadowRoot) .find ("canvas")
63
+ $(this .getBrowser () .element)
63
64
  .off (`mousemove.X3DSnapNodeTool${this .getId ()}`);
64
65
 
65
66
  this .tool .snapped = false;
@@ -72,8 +73,9 @@ class X3DSnapNodeTool extends X3DActiveLayerNodeTool
72
73
  if (!this .getBrowser () .touch (x, y))
73
74
  return;
74
75
 
76
+ // Stop event propagation.
77
+
75
78
  event .preventDefault ();
76
- event .stopImmediatePropagation ();
77
79
 
78
80
  this .changePosition (this .getBrowser () .getHit ());
79
81
  }
@@ -73,6 +73,7 @@ async function initialize ()
73
73
  tool .undo = false;
74
74
  tool .tools = new MFString ("TRANSLATE", "ROTATE");
75
75
  tool .centerDisplay = false;
76
+ tool .bboxEvents = false;
76
77
  tool .bboxDisplay = false;
77
78
  }
78
79
  ]]>
@@ -344,6 +344,7 @@ async function initialize ()
344
344
  tool .undo = false;
345
345
  tool .tools = new MFString ("TRANSLATE", "ROTATE");
346
346
  tool .centerDisplay = false;
347
+ tool .bboxEvents = false;
347
348
  tool .bboxDisplay = false;
348
349
  }
349
350
 
@@ -412,6 +413,7 @@ async function set_minBackTime ()
412
413
  tool .yAxisDisplay = false;
413
414
  tool .zAxisDisplay = false;
414
415
  tool .centerDisplay = false;
416
+ tool .bboxEvents = false;
415
417
  tool .bboxDisplay = false;
416
418
  }
417
419
 
@@ -482,6 +484,7 @@ async function set_minFrontTime ()
482
484
  tool .yAxisDisplay = false;
483
485
  tool .zAxisDisplay = false;
484
486
  tool .centerDisplay = false;
487
+ tool .bboxEvents = false;
485
488
  tool .bboxDisplay = false;
486
489
  }
487
490
 
@@ -552,6 +555,7 @@ async function set_maxBackTime ()
552
555
  tool .xAxisDisplay = false;
553
556
  tool .zAxisDisplay = false;
554
557
  tool .centerDisplay = false;
558
+ tool .bboxEvents = false;
555
559
  tool .bboxDisplay = false;
556
560
  }
557
561
 
@@ -622,6 +626,7 @@ async function set_maxFrontTime ()
622
626
  tool .xAxisDisplay = false;
623
627
  tool .zAxisDisplay = false;
624
628
  tool .centerDisplay = false;
629
+ tool .bboxEvents = false;
625
630
  tool .bboxDisplay = false;
626
631
  }
627
632
 
@@ -54,7 +54,7 @@ function initialize ()
54
54
 
55
55
  function eventsProcessed ()
56
56
  {
57
- const
57
+ const
58
58
  uDimension = dimension,
59
59
  vDimension = Math .ceil ((dimension * coneAngle) / (4 * Math .PI)),
60
60
  angle = coneAngle / 2,
@@ -288,6 +288,7 @@ async function initialize ()
288
288
  tool .undo = false;
289
289
  tool .tools = new MFString ("TRANSLATE", "ROTATE");
290
290
  tool .centerDisplay = false;
291
+ tool .bboxEvents = false;
291
292
  tool .bboxDisplay = false;
292
293
  }
293
294
 
@@ -231,6 +231,7 @@ async function initialize ()
231
231
  tool .undo = false;
232
232
  tool .tools = new MFString ("TRANSLATE", "ROTATE");
233
233
  tool .centerDisplay = false;
234
+ tool .bboxEvents = false;
234
235
  tool .bboxDisplay = false;
235
236
  }
236
237
 
@@ -2424,7 +2424,7 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
2424
2424
  });
2425
2425
 
2426
2426
  const
2427
- center = moveCenter ? bboxCenter .copy () : (sourcePosition ?? axis .copy () .add (bboxCenter)),
2427
+ center = (moveCenter ? bboxCenter .copy () : (sourcePosition ?.copy () ?? bboxCenter .copy () .add (axis))) .subtract (modelMatrices [0] .origin),
2428
2428
  translation = targetPosition .copy () .subtract (center),
2429
2429
  rotation = new X3D .Rotation4 (sourceNormal ?? axis, targetNormal .copy () .negate ()),
2430
2430
  snapMatrix = new X3D .Matrix4 () .set (translation, rotation, null, null, center);
@@ -59,7 +59,7 @@ module .exports = class UndoManager
59
59
 
60
60
  // Propagate change.
61
61
 
62
- this .processInterests ();
62
+ this .#processInterests ();
63
63
  }
64
64
 
65
65
  redo ()
@@ -105,7 +105,7 @@ module .exports = class UndoManager
105
105
 
106
106
  // Propagate change.
107
107
 
108
- this .processInterests ();
108
+ this .#processInterests ();
109
109
  }
110
110
 
111
111
  /**
@@ -159,7 +159,7 @@ module .exports = class UndoManager
159
159
 
160
160
  // Propagate change.
161
161
 
162
- this .processInterests ();
162
+ this .#processInterests ();
163
163
  }
164
164
 
165
165
  /**
@@ -197,7 +197,7 @@ module .exports = class UndoManager
197
197
  this .#interest .delete (key);
198
198
  }
199
199
 
200
- processInterests ()
200
+ #processInterests ()
201
201
  {
202
202
  for (const callback of this .#interest .values ())
203
203
  callback ();
package/src/X3D.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const X3D = require ("x_ite/x_ite.min.js");
3
+ const X3D = require ("x_ite/x_ite.js");
4
4
 
5
5
  X3D .TYPE_SCRIPT_PATH = require .resolve ("x_ite/x_ite.d.ts");
6
6
  X3D .X3DUOM_PATH = require .resolve ("x_ite/X3DUOM.xml");
@@ -501,6 +501,12 @@ body.light .qtip-tipsy {
501
501
  color: var(--accent-color);
502
502
  }
503
503
 
504
+ .vertical-toolbar .material-icons.disabled,
505
+ .vertical-toolbar .material-symbols-outlined.disabled {
506
+ pointer-events: none;
507
+ color: var(--system-gray3);
508
+ }
509
+
504
510
  .large-toolbar .material-icons {
505
511
  margin: 5px auto;
506
512
  width: var(--large-icon-size);
@@ -501,6 +501,12 @@ body.light .qtip-tipsy {
501
501
  color: var(--accent-color);
502
502
  }
503
503
 
504
+ .vertical-toolbar .material-icons.disabled,
505
+ .vertical-toolbar .material-symbols-outlined.disabled {
506
+ pointer-events: none;
507
+ color: var(--system-gray3);
508
+ }
509
+
504
510
  .large-toolbar .material-icons {
505
511
  margin: 5px auto;
506
512
  width: var(--large-icon-size);