sunrize 1.0.13 → 1.0.14

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 (54) hide show
  1. package/package.json +8 -8
  2. package/src/sunrize/Application/Application.js +3 -3
  3. package/src/sunrize/Application/{SecondaryToolbar.js → Dashboard.js} +6 -2
  4. package/src/sunrize/Application/DataStorage.js +2 -2
  5. package/src/sunrize/Application/Document.js +3 -3
  6. package/src/sunrize/Application/Selection.js +7 -10
  7. package/src/sunrize/Application/Traverse.js +28 -3
  8. package/src/sunrize/Controls/EditUserDefinedFieldPopover.js +2 -2
  9. package/src/sunrize/Controls/RenameNodeInput.js +1 -1
  10. package/src/sunrize/Controls/Splitter.js +1 -1
  11. package/src/sunrize/Controls/Tabs.js +2 -2
  12. package/src/sunrize/Editors/Console.js +3 -3
  13. package/src/sunrize/Editors/Library.js +1 -1
  14. package/src/sunrize/Editors/OutlineEditor.js +4 -4
  15. package/src/sunrize/Editors/OutlineView.js +1 -1
  16. package/src/sunrize/Editors/ScriptEditor.js +1 -1
  17. package/src/sunrize/Tools/CADGeometry/CADAssemblyTool.js +1 -1
  18. package/src/sunrize/Tools/CADGeometry/CADFaceTool.js +1 -1
  19. package/src/sunrize/Tools/CADGeometry/CADLayerTool.js +1 -1
  20. package/src/sunrize/Tools/CADGeometry/CADPartTool.js +1 -1
  21. package/src/sunrize/Tools/Core/X3DNodeTool.js +54 -33
  22. package/src/sunrize/Tools/Core/X3DPrototypeInstanceTool.js +9 -4
  23. package/src/sunrize/Tools/Geospatial/GeoLODTool.js +3 -3
  24. package/src/sunrize/Tools/Geospatial/GeoLocationTool.js +1 -1
  25. package/src/sunrize/Tools/Geospatial/GeoTransformTool.js +1 -1
  26. package/src/sunrize/Tools/Grouping/GroupTool.js +1 -1
  27. package/src/sunrize/Tools/Grouping/StaticGroupTool.js +1 -1
  28. package/src/sunrize/Tools/Grouping/SwitchTool.js +1 -1
  29. package/src/sunrize/Tools/Grouping/TransformTool.js +1 -1
  30. package/src/sunrize/Tools/Grouping/X3DBoundedObjectTool.js +13 -6
  31. package/src/sunrize/Tools/Grouping/X3DTransformNodeTool.js +13 -6
  32. package/src/sunrize/Tools/HAnim/HAnimHumanoidTool.js +1 -1
  33. package/src/sunrize/Tools/HAnim/HAnimJointTool.js +1 -1
  34. package/src/sunrize/Tools/HAnim/HAnimSegmentTool.js +1 -1
  35. package/src/sunrize/Tools/HAnim/HAnimSiteTool.js +1 -1
  36. package/src/sunrize/Tools/Layering/LayerTool.js +1 -1
  37. package/src/sunrize/Tools/Layering/X3DLayerNodeTool.js +3 -3
  38. package/src/sunrize/Tools/Layout/LayoutGroupTool.js +7 -7
  39. package/src/sunrize/Tools/Layout/LayoutLayerTool.js +1 -1
  40. package/src/sunrize/Tools/Layout/ScreenGroupTool.js +1 -1
  41. package/src/sunrize/Tools/Navigation/BillboardTool.js +5 -5
  42. package/src/sunrize/Tools/Navigation/CollisionTool.js +10 -3
  43. package/src/sunrize/Tools/Navigation/LODTool.js +5 -5
  44. package/src/sunrize/Tools/Networking/AnchorTool.js +1 -1
  45. package/src/sunrize/Tools/Networking/InlineTool.js +1 -1
  46. package/src/sunrize/Tools/ParticleSystems/ParticleSystemTool.js +1 -1
  47. package/src/sunrize/Tools/Picking/PickableGroupTool.js +1 -1
  48. package/src/sunrize/Tools/RigidBodyPhysics/CollidableOffsetTool.js +10 -3
  49. package/src/sunrize/Tools/RigidBodyPhysics/CollidableShapeTool.js +10 -3
  50. package/src/sunrize/Tools/Shape/ShapeTool.js +1 -1
  51. package/src/sunrize/Tools/VolumeRendering/IsoSurfaceVolumeDataTool.js +1 -1
  52. package/src/sunrize/Tools/VolumeRendering/SegmentedVolumeDataTool.js +1 -1
  53. package/src/sunrize/Tools/VolumeRendering/VolumeDataTool.js +1 -1
  54. package/src/sunrize/Undo/Editor.js +49 -26
@@ -13,7 +13,7 @@ class GeoTransformTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (GeoTransform .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new GeoTransformTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class GroupTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (Group .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new GroupTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class StaticGroupTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (StaticGroup .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new StaticGroupTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class SwitchTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (Switch .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new SwitchTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class TransformTool extends X3DTransformNodeTool
13
13
 
14
14
  Object .assign (Transform .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new TransformTool (this)
19
19
  },
@@ -9,21 +9,28 @@ class X3DBoundedObjectTool extends X3DNodeTool
9
9
  {
10
10
  async initialize ()
11
11
  {
12
- super .initialize ();
12
+ super .initialize ()
13
13
 
14
- await this .load (__dirname, "X3DBoundedObjectTool.x3d")
14
+ await this .loadTool (__dirname, "X3DBoundedObjectTool.x3d")
15
15
 
16
- this .node .getBrowser () .displayEvents () .addInterest ("reshape", this)
16
+ this .toolNode .getBrowser () .displayEvents () .addInterest ("reshape", this .toolTarget)
17
17
 
18
18
  this .tool .bboxColor = this .bboxColor
19
19
  }
20
20
 
21
+ removeTool ()
22
+ {
23
+ this .toolNode .getBrowser () .displayEvents () .removeInterest ("reshape", this .toolTarget)
24
+
25
+ return super .removeTool ()
26
+ }
27
+
21
28
  static box = new Box3 ()
22
29
 
23
30
  reshape ()
24
31
  {
25
32
  const
26
- bbox = this .node .getBBox (X3DBoundedObjectTool .box),
33
+ bbox = this .toolNode .getBBox (X3DBoundedObjectTool .box),
27
34
  bboxSize = bbox .size,
28
35
  bboxCenter = bbox .center
29
36
 
@@ -36,8 +43,8 @@ class X3DBoundedObjectTool extends X3DNodeTool
36
43
 
37
44
  traverse (type, renderObject)
38
45
  {
39
- this .node .traverse (type, renderObject)
40
- this .innerNode?.traverse (type, renderObject)
46
+ this .toolNode .traverse (type, renderObject)
47
+ this .toolInnerNode ?.traverse (type, renderObject)
41
48
  }
42
49
  }
43
50
 
@@ -9,21 +9,28 @@ class X3DTransformNodeTool extends X3DNodeTool
9
9
  {
10
10
  async initialize ()
11
11
  {
12
- super .initialize ();
12
+ super .initialize ()
13
13
 
14
- await this .load (__dirname, "X3DBoundedObjectTool.x3d")
14
+ await this .loadTool (__dirname, "X3DBoundedObjectTool.x3d")
15
15
 
16
- this .node .getBrowser () .displayEvents () .addInterest ("reshape", this)
16
+ this .toolNode .getBrowser () .displayEvents () .addInterest ("reshape", this .toolTarget)
17
17
 
18
18
  this .tool .bboxColor = this .bboxColor
19
19
  }
20
20
 
21
+ removeTool ()
22
+ {
23
+ this .toolNode .getBrowser () .displayEvents () .removeInterest ("reshape", this .toolTarget)
24
+
25
+ return super .removeTool ()
26
+ }
27
+
21
28
  static box = new Box3 ()
22
29
 
23
30
  reshape ()
24
31
  {
25
32
  const
26
- bbox = this .node .getBBox (X3DTransformNodeTool .box),
33
+ bbox = this .toolNode .getBBox (X3DTransformNodeTool .box),
27
34
  bboxSize = bbox .size,
28
35
  bboxCenter = bbox .center
29
36
 
@@ -36,8 +43,8 @@ class X3DTransformNodeTool extends X3DNodeTool
36
43
 
37
44
  traverse (type, renderObject)
38
45
  {
39
- this .node .traverse (type, renderObject)
40
- this .innerNode?.traverse (type, renderObject)
46
+ this .toolNode .traverse (type, renderObject)
47
+ this .toolInnerNode ?.traverse (type, renderObject)
41
48
  }
42
49
  }
43
50
 
@@ -13,7 +13,7 @@ class HAnimHumanoidTool extends X3DTransformNodeTool
13
13
 
14
14
  Object .assign (HAnimHumanoid .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new HAnimHumanoidTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class HAnimJointTool extends X3DTransformNodeTool
13
13
 
14
14
  Object .assign (HAnimJoint .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new HAnimJointTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class HAnimSegmentTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (HAnimSegment .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new HAnimSegmentTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class HAnimSiteTool extends X3DTransformNodeTool
13
13
 
14
14
  Object .assign (HAnimSite .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new HAnimSiteTool (this)
19
19
  },
@@ -9,7 +9,7 @@ class LayerTool extends X3DLayerNodeTool { }
9
9
 
10
10
  Object .assign (Layer .prototype,
11
11
  {
12
- createTool: function ()
12
+ addTool: function ()
13
13
  {
14
14
  return new LayerTool (this)
15
15
  },
@@ -8,14 +8,14 @@ class X3DLayerNodeTool extends X3DNodeTool
8
8
  {
9
9
  super (node)
10
10
 
11
- this .node .groupNode = this .node .getGroup () .addTool ()
11
+ this .toolNode .groupNode = this .toolNode .getGroup () .addTool ()
12
12
  }
13
13
 
14
14
  removeTool ()
15
15
  {
16
- this .node .groupNode = this .node .getGroup () .removeTool ()
16
+ this .toolNode .groupNode = this .toolNode .getGroup () .removeTool ()
17
17
 
18
- super .removeTool ()
18
+ return super .removeTool ()
19
19
  }
20
20
  }
21
21
 
@@ -30,22 +30,22 @@ Object .assign (LayoutGroupTool .prototype,
30
30
 
31
31
  return function (rectangle)
32
32
  {
33
- const layoutNode = this .node .getLayout ()
33
+ const layoutNode = this .toolNode .getLayout ()
34
34
 
35
35
  if (!layoutNode)
36
- return rectangle .set ();
36
+ return rectangle .set ()
37
37
 
38
- this .node .modelViewMatrix .get (null, null, scale)
38
+ this .toolNode .modelViewMatrix .get (null, null, scale)
39
39
 
40
40
  rectangleSize .set (... layoutNode .getRectangleSize (), 0) .divVec (scale)
41
41
  rectangleCenter .set (... layoutNode .getRectangleCenter (), 0) .divVec (scale)
42
42
 
43
43
  rectangle
44
44
  .set (rectangleSize, rectangleCenter)
45
- .multRight (this .node .getMatrix () .inverse ())
45
+ .multRight (this .toolNode .getMatrix () .inverse ())
46
46
 
47
47
  return rectangle
48
- };
48
+ }
49
49
  })(),
50
50
  reshape: (function ()
51
51
  {
@@ -65,13 +65,13 @@ Object .assign (LayoutGroupTool .prototype,
65
65
 
66
66
  if (!this .tool .rectangleCenter .getValue () .equals (rectangle .center))
67
67
  this .tool .rectangleCenter = rectangle .center
68
- };
68
+ }
69
69
  })(),
70
70
  })
71
71
 
72
72
  Object .assign (LayoutGroup .prototype,
73
73
  {
74
- createTool: function ()
74
+ addTool: function ()
75
75
  {
76
76
  return new LayoutGroupTool (this)
77
77
  },
@@ -9,7 +9,7 @@ class LayoutLayerTool extends X3DLayerNodeTool { }
9
9
 
10
10
  Object .assign (LayoutLayer .prototype,
11
11
  {
12
- createTool: function ()
12
+ addTool: function ()
13
13
  {
14
14
  return new LayoutLayerTool (this)
15
15
  },
@@ -13,7 +13,7 @@ class ScreenGroupTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (ScreenGroup .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new ScreenGroupTool (this)
19
19
  },
@@ -14,23 +14,23 @@ class BillboardTool extends X3DBoundedObjectTool
14
14
  {
15
15
  await super .initialize ()
16
16
 
17
- this .node ._axisOfRotation .addFieldInterest (this .tool .axisOfRotation)
17
+ this .toolNode ._axisOfRotation .addFieldInterest (this .tool .axisOfRotation)
18
18
 
19
19
  this .tool .centerDisplay = true
20
- this .tool .axisOfRotation = this .node ._axisOfRotation
20
+ this .tool .axisOfRotation = this .toolNode ._axisOfRotation
21
21
  }
22
22
 
23
23
  removeTool ()
24
24
  {
25
- super .removeTool ()
25
+ this .toolNode ._axisOfRotation .removeFieldInterest (this .tool .axisOfRotation)
26
26
 
27
- this .node ._axisOfRotation .removeFieldInterest (this .tool .axisOfRotation)
27
+ return super .removeTool ()
28
28
  }
29
29
  }
30
30
 
31
31
  Object .assign (Billboard .prototype,
32
32
  {
33
- createTool: function ()
33
+ addTool: function ()
34
34
  {
35
35
  return new BillboardTool (this)
36
36
  },
@@ -17,20 +17,27 @@ class CollisionTool extends X3DBoundedObjectTool
17
17
  {
18
18
  await super .initialize ()
19
19
 
20
- this .node ._enabled .addInterest (_set_enabled, this)
20
+ this .toolNode ._enabled .addInterest (_set_enabled, this .toolTarget)
21
21
 
22
22
  this [_set_enabled] ()
23
23
  }
24
24
 
25
+ removeTool ()
26
+ {
27
+ this .toolNode ._enabled .removeInterest (_set_enabled, this .toolTarget)
28
+
29
+ return super .removeTool ()
30
+ }
31
+
25
32
  [_set_enabled] ()
26
33
  {
27
- this .tool .bboxStyle = this .node ._enabled .getValue () ? 1 : 2
34
+ this .tool .bboxStyle = this .toolNode ._enabled .getValue () ? 1 : 2
28
35
  }
29
36
  }
30
37
 
31
38
  Object .assign (Collision .prototype,
32
39
  {
33
- createTool: function ()
40
+ addTool: function ()
34
41
  {
35
42
  return new CollisionTool (this)
36
43
  },
@@ -14,23 +14,23 @@ class LODTool extends X3DBoundedObjectTool
14
14
  {
15
15
  await super .initialize ()
16
16
 
17
- this .node ._center .addFieldInterest (this .tool .center)
17
+ this .toolNode ._center .addFieldInterest (this .tool .center)
18
18
 
19
19
  this .tool .centerDisplay = true
20
- this .tool .center = this .node ._center
20
+ this .tool .center = this .toolNode ._center
21
21
  }
22
22
 
23
23
  removeTool ()
24
24
  {
25
- super .removeTool ()
25
+ this .toolNode ._center .removeFieldInterest (this .tool .center)
26
26
 
27
- this .node ._center .removeFieldInterest (this .tool .center)
27
+ return super .removeTool ()
28
28
  }
29
29
  }
30
30
 
31
31
  Object .assign (LOD .prototype,
32
32
  {
33
- createTool: function ()
33
+ addTool: function ()
34
34
  {
35
35
  return new LODTool (this)
36
36
  },
@@ -13,7 +13,7 @@ class AnchorTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (Anchor .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new AnchorTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class InlineTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (Inline .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new InlineTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class ParticleSystemTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (ParticleSystem .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new ParticleSystemTool (this)
19
19
  },
@@ -13,7 +13,7 @@ class PickableGroupTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (PickableGroup .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new PickableGroupTool (this)
19
19
  },
@@ -17,20 +17,27 @@ class CollidableOffsetTool extends X3DBoundedObjectTool
17
17
  {
18
18
  await super .initialize ()
19
19
 
20
- this .node ._enabled .addInterest (_set_enabled, this)
20
+ this .toolNode ._enabled .addInterest (_set_enabled, this .toolTarget)
21
21
 
22
22
  this [_set_enabled] ()
23
23
  }
24
24
 
25
+ removeTool ()
26
+ {
27
+ this .toolNode ._enabled .removeInterest (_set_enabled, this .toolTarget)
28
+
29
+ return super .removeTool ()
30
+ }
31
+
25
32
  [_set_enabled] ()
26
33
  {
27
- this .tool .bboxStyle = this .node ._enabled .getValue () ? 1 : 2
34
+ this .tool .bboxStyle = this .toolNode ._enabled .getValue () ? 1 : 2
28
35
  }
29
36
  }
30
37
 
31
38
  Object .assign (CollidableOffset .prototype,
32
39
  {
33
- createTool: function ()
40
+ addTool: function ()
34
41
  {
35
42
  return new CollidableOffsetTool (this)
36
43
  },
@@ -17,20 +17,27 @@ class CollidableShapeTool extends X3DBoundedObjectTool
17
17
  {
18
18
  await super .initialize ()
19
19
 
20
- this .node ._enabled .addInterest (_set_enabled, this)
20
+ this .toolNode ._enabled .addInterest (_set_enabled, this .toolTarget)
21
21
 
22
22
  this [_set_enabled] ()
23
23
  }
24
24
 
25
+ removeTool ()
26
+ {
27
+ this .toolNode ._enabled .removeInterest (_set_enabled, this .toolTarget)
28
+
29
+ return super .removeTool ()
30
+ }
31
+
25
32
  [_set_enabled] ()
26
33
  {
27
- this .tool .bboxStyle = this .node ._enabled .getValue () ? 1 : 2
34
+ this .tool .bboxStyle = this .toolNode ._enabled .getValue () ? 1 : 2
28
35
  }
29
36
  }
30
37
 
31
38
  Object .assign (CollidableShape .prototype,
32
39
  {
33
- createTool: function ()
40
+ addTool: function ()
34
41
  {
35
42
  return new CollidableShapeTool (this)
36
43
  },
@@ -13,7 +13,7 @@ class ShapeTool extends X3DBoundedObjectTool
13
13
 
14
14
  Object .assign (Shape .prototype,
15
15
  {
16
- createTool: function ()
16
+ addTool: function ()
17
17
  {
18
18
  return new ShapeTool (this)
19
19
  },
@@ -9,7 +9,7 @@ class IsoSurfaceVolumeDataTool extends X3DVolumeDataNodeTool { }
9
9
 
10
10
  Object .assign (IsoSurfaceVolumeData .prototype,
11
11
  {
12
- createTool: function ()
12
+ addTool: function ()
13
13
  {
14
14
  return new IsoSurfaceVolumeDataTool (this)
15
15
  },
@@ -9,7 +9,7 @@ class SegmentedVolumeDataTool extends X3DVolumeDataNodeTool { }
9
9
 
10
10
  Object .assign (SegmentedVolumeData .prototype,
11
11
  {
12
- createTool: function ()
12
+ addTool: function ()
13
13
  {
14
14
  return new SegmentedVolumeDataTool (this)
15
15
  },
@@ -9,7 +9,7 @@ class VolumeDataTool extends X3DVolumeDataNodeTool { }
9
9
 
10
10
  Object .assign (VolumeData .prototype,
11
11
  {
12
- createTool: function ()
12
+ addTool: function ()
13
13
  {
14
14
  return new VolumeDataTool (this)
15
15
  },