sunrize 1.2.1 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,8 +11,8 @@
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.1.9, https://create3000.github.io/sunrize/'/>
15
- <meta name='modified' content='Wed, 22 Nov 2023 19:20:52 GMT'/>
14
+ <meta name='generator' content='Sunrize X3D Editor V1.2.2, https://create3000.github.io/sunrize/'/>
15
+ <meta name='modified' content='Fri, 24 Nov 2023 22:43:39 GMT'/>
16
16
  </head>
17
17
  <Scene>
18
18
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
@@ -31,13 +31,13 @@
31
31
  <ProtoInterface>
32
32
  <field accessType='inputOutput' type='SFBool' name='selected'/>
33
33
  <field accessType='inputOutput' type='SFString' name='group' value='TRANSFORM_TOOL'/>
34
- <field accessType='inputOutput' type='SFBool' name='grouped'/>
34
+ <field accessType='inputOutput' type='SFBool' name='grouping'/>
35
+ <field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
35
36
  <field accessType='inputOutput' type='SFVec3f' name='translation'/>
36
37
  <field accessType='inputOutput' type='SFRotation' name='rotation'/>
37
38
  <field accessType='inputOutput' type='SFVec3f' name='scale' value='1 1 1'/>
38
39
  <field accessType='inputOutput' type='SFRotation' name='scaleOrientation'/>
39
40
  <field accessType='inputOutput' type='SFVec3f' name='center'/>
40
- <field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
41
41
  <field accessType='inputOutput' type='SFBool' name='keys' value='true'/>
42
42
  <field accessType='inputOutput' type='MFString' name='tools' value='"TRANSLATE", "ROTATE", "SCALE"'/>
43
43
  <field accessType='inputOutput' type='SFString' name='translateMode' value='TRANSLATE_ALONG_AXIS'/>
@@ -55,8 +55,7 @@
55
55
  <field accessType='inputOutput' type='SFVec3f' name='bboxSize' value='1 1 1'/>
56
56
  <field accessType='inputOutput' type='SFVec3f' name='bboxCenter'/>
57
57
  <field accessType='outputOnly' type='SFBool' name='keepCenter'/>
58
- <field accessType='outputOnly' type='SFInt32' name='activeTool'/>
59
- <field accessType='outputOnly' type='SFBool' name='isCenterActive'/>
58
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
60
59
  <field accessType='outputOnly' type='SFBool' name='isActive'/>
61
60
  </ProtoInterface>
62
61
  <ProtoBody>
@@ -636,7 +635,7 @@
636
635
  </IS>
637
636
  <ProtoInstance name='BooleanSwitch' DEF='CenterLine'>
638
637
  <fieldValue name='children'>
639
- <Shape DEF='_16'
638
+ <Shape DEF='_15'
640
639
  castShadow='false'>
641
640
  <Appearance DEF='CenterLineStyle'>
642
641
  <LineProperties
@@ -951,7 +950,8 @@ function set_bboxSize ()
951
950
  <field accessType='outputOnly' type='SFBool' name='translate'/>
952
951
  <field accessType='outputOnly' type='SFBool' name='rotate'/>
953
952
  <field accessType='outputOnly' type='SFBool' name='scale'/>
954
- <field accessType='outputOnly' type='SFInt32' name='activeTool'/>
953
+ <field accessType='outputOnly' type='SFInt32' name='whichChoice_changed'/>
954
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
955
955
  <field accessType='initializeOnly' type='SFTime' name='time'/>
956
956
  <field accessType='initializeOnly' type='SFInt32' name='tool'/>
957
957
  <IS>
@@ -978,7 +978,7 @@ function set_time (value)
978
978
  {
979
979
  time = 0;
980
980
 
981
- set_next ();
981
+ set_dlbclick ();
982
982
  }
983
983
  else
984
984
  {
@@ -986,7 +986,7 @@ function set_time (value)
986
986
  }
987
987
  }
988
988
 
989
- function set_next ()
989
+ function set_dlbclick ()
990
990
  {
991
991
  if (bboxSize .length ())
992
992
  set_tool ((tool + 1) % tools .length);
@@ -996,29 +996,30 @@ function set_next ()
996
996
 
997
997
  function set_tool (value)
998
998
  {
999
- tool = value;
1000
- translate = false;
1001
- rotate = false;
1002
- scale = false;
999
+ tool = value;
1000
+ translate = false;
1001
+ rotate = false;
1002
+ scale = false;
1003
+ activeTool = tools [value];
1003
1004
 
1004
- switch (tools [value])
1005
+ switch (activeTool)
1005
1006
  {
1006
1007
  case "TRANSLATE":
1007
1008
  {
1008
- translate = true;
1009
- activeTool = 0;
1009
+ translate = true;
1010
+ whichChoice_changed = 0;
1010
1011
  break;
1011
1012
  }
1012
1013
  case "ROTATE":
1013
1014
  {
1014
- rotate = true;
1015
- activeTool = 1;
1015
+ rotate = true;
1016
+ whichChoice_changed = 1;
1016
1017
  break;
1017
1018
  }
1018
1019
  case "SCALE":
1019
1020
  {
1020
- scale = true;
1021
- activeTool = 2;
1021
+ scale = true;
1022
+ whichChoice_changed = 2;
1022
1023
  break;
1023
1024
  }
1024
1025
  }
@@ -1567,7 +1568,7 @@ function translate (scaledMatrix, distanceFromCenter)
1567
1568
  directOutput='true'>
1568
1569
  <field accessType='inputOnly' type='SFBool' name='set_moveCenterToBBoxCenter'/>
1569
1570
  <field accessType='inputOnly' type='SFTime' name='set_toggleCenterTool'/>
1570
- <field accessType='inputOutput' type='SFBool' name='grouped'/>
1571
+ <field accessType='inputOutput' type='SFBool' name='grouping'/>
1571
1572
  <field accessType='inputOutput' type='SFBool' name='active'/>
1572
1573
  <field accessType='inputOutput' type='SFVec3f' name='translation'/>
1573
1574
  <field accessType='inputOutput' type='SFRotation' name='rotation'/>
@@ -1576,6 +1577,8 @@ function translate (scaledMatrix, distanceFromCenter)
1576
1577
  <field accessType='inputOutput' type='SFVec3f' name='center'/>
1577
1578
  <field accessType='inputOutput' type='SFVec3f' name='bboxCenter'/>
1578
1579
  <field accessType='outputOnly' type='SFBool' name='keepCenter'/>
1580
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
1581
+ <field accessType='outputOnly' type='SFBool' name='isActive'/>
1579
1582
  <field accessType='initializeOnly' type='SFMatrix4f' name='initialMatrix'/>
1580
1583
  <field accessType='initializeOnly' type='SFNode' name='coord'>
1581
1584
  <Coordinate USE='CenterLineCoord'/>
@@ -1583,8 +1586,10 @@ function translate (scaledMatrix, distanceFromCenter)
1583
1586
  <field accessType='initializeOnly' type='SFNode' name='centerTool'>
1584
1587
  <Transform USE='CenterTool'/>
1585
1588
  </field>
1589
+ <field accessType='initializeOnly' type='SFNode' name='modeScript'>
1590
+ <Script USE='ModeScript'/>
1591
+ </field>
1586
1592
  <IS>
1587
- <connect nodeField='active' protoField='isCenterActive'/>
1588
1593
  <connect nodeField='translation' protoField='translation'/>
1589
1594
  <connect nodeField='rotation' protoField='rotation'/>
1590
1595
  <connect nodeField='scale' protoField='scale'/>
@@ -1592,6 +1597,8 @@ function translate (scaledMatrix, distanceFromCenter)
1592
1597
  <connect nodeField='center' protoField='center'/>
1593
1598
  <connect nodeField='bboxCenter' protoField='bboxCenter'/>
1594
1599
  <connect nodeField='keepCenter' protoField='keepCenter'/>
1600
+ <connect nodeField='activeTool' protoField='activeTool'/>
1601
+ <connect nodeField='isActive' protoField='isActive'/>
1595
1602
  </IS>
1596
1603
  <![CDATA[ecmascript:
1597
1604
 
@@ -1631,7 +1638,7 @@ async function set_toggleCenterTool ()
1631
1638
 
1632
1639
  const tool = await centerTool .getValue () .addTool () .getToolInstance ();
1633
1640
 
1634
- Browser .addRoute (tool, "grouped", this, "grouped");
1641
+ Browser .addRoute (tool, "grouping", this, "grouping");
1635
1642
  Browser .addRoute (tool, "isActive", this, "active");
1636
1643
 
1637
1644
  tool .group = "CENTER_TOOL";
@@ -1641,17 +1648,20 @@ async function set_toggleCenterTool ()
1641
1648
  tool .bboxDisplay = false;
1642
1649
  }
1643
1650
 
1644
- function set_grouped (value)
1651
+ function set_grouping (value)
1645
1652
  {
1646
- set_active (value);
1653
+ if (!value)
1654
+ return;
1655
+
1656
+ initialMatrix .setTransform (translation, rotation, scale, scaleOrientation, center);
1647
1657
  }
1648
1658
 
1649
1659
  function set_active (value)
1650
1660
  {
1651
- if (!value)
1652
- return;
1661
+ activeTool = value ? "CENTER" : modeScript .activeTool;
1662
+ isActive = value;
1653
1663
 
1654
- initialMatrix .setTransform (translation, rotation, scale, scaleOrientation, center);
1664
+ set_grouping (value);
1655
1665
  }
1656
1666
 
1657
1667
  function set_center ()
@@ -1659,7 +1669,7 @@ function set_center ()
1659
1669
  coord .point [0] = center;
1660
1670
  coord .point [1] = bboxCenter;
1661
1671
 
1662
- if (active || grouped)
1672
+ if (active || grouping)
1663
1673
  initialMatrix .getTransform (translation, null, null, null, center);
1664
1674
  }
1665
1675
 
@@ -1676,12 +1686,12 @@ function set_bboxCenter ()
1676
1686
  <ROUTE fromNode='YTranslationSensor' fromField='isActive' toNode='TranslateScript' toField='set_active'/>
1677
1687
  <ROUTE fromNode='XTranslationSensor' fromField='isActive' toNode='TranslateScript' toField='set_active'/>
1678
1688
  <ROUTE fromNode='ModeTouch' fromField='touchTime' toNode='ModeScript' toField='set_time'/>
1679
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='_22' toField='set_whichChoice'/>
1680
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='_23' toField='set_whichChoice'/>
1681
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='_24' toField='set_whichChoice'/>
1682
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='_25' toField='set_whichChoice'/>
1683
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='_26' toField='set_whichChoice'/>
1684
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='_27' toField='set_whichChoice'/>
1689
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='_22' toField='set_whichChoice'/>
1690
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='_23' toField='set_whichChoice'/>
1691
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='_24' toField='set_whichChoice'/>
1692
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='_25' toField='set_whichChoice'/>
1693
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='_26' toField='set_whichChoice'/>
1694
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='_27' toField='set_whichChoice'/>
1685
1695
  <ROUTE fromNode='ModeScript' fromField='translate' toNode='ZTranslationSensor' toField='set_enabled'/>
1686
1696
  <ROUTE fromNode='ModeScript' fromField='translate' toNode='YTranslationSensor' toField='set_enabled'/>
1687
1697
  <ROUTE fromNode='ModeScript' fromField='translate' toNode='XTranslationSensor' toField='set_enabled'/>
@@ -1697,7 +1707,7 @@ function set_bboxCenter ()
1697
1707
  <ROUTE fromNode='XScaleBackSensor' fromField='translation_changed' toNode='ScaleScript' toField='set_xScaleBack'/>
1698
1708
  <ROUTE fromNode='YScaleBackSensor' fromField='translation_changed' toNode='ScaleScript' toField='set_yScaleBack'/>
1699
1709
  <ROUTE fromNode='ZScaleBackSensor' fromField='translation_changed' toNode='ScaleScript' toField='set_zScaleBack'/>
1700
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='UniformScaleHandles' toField='set_whichChoice'/>
1710
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='UniformScaleHandles' toField='set_whichChoice'/>
1701
1711
  <ROUTE fromNode='ScaleSensor8' fromField='isActive' toNode='ScaleScript' toField='set_active'/>
1702
1712
  <ROUTE fromNode='ScaleSensor8' fromField='translation_changed' toNode='ScaleScript' toField='set_scale8'/>
1703
1713
  <ROUTE fromNode='ScaleSensor7' fromField='isActive' toNode='ScaleScript' toField='set_active'/>
@@ -1733,7 +1743,7 @@ function set_bboxCenter ()
1733
1743
  <ROUTE fromNode='ModeScript' fromField='scale' toNode='YScaleFrontSensor' toField='set_enabled'/>
1734
1744
  <ROUTE fromNode='ModeScript' fromField='scale' toNode='XScaleBackSensor' toField='set_enabled'/>
1735
1745
  <ROUTE fromNode='ModeScript' fromField='scale' toNode='XScaleFrontSensor' toField='set_enabled'/>
1736
- <ROUTE fromNode='ModeScript' fromField='activeTool' toNode='RotationHandles' toField='set_whichChoice'/>
1746
+ <ROUTE fromNode='ModeScript' fromField='whichChoice_changed' toNode='RotationHandles' toField='set_whichChoice'/>
1737
1747
  <ROUTE fromNode='ZRotationSensor' fromField='isActive' toNode='RotateScript' toField='set_active'/>
1738
1748
  <ROUTE fromNode='YRotationSensor_1' fromField='isActive' toNode='RotateScript' toField='set_active'/>
1739
1749
  <ROUTE fromNode='XRotationSensor_1' fromField='isActive' toNode='RotateScript' toField='set_active'/>
@@ -1749,8 +1759,8 @@ function set_bboxCenter ()
1749
1759
  </ProtoDeclare>
1750
1760
  <ProtoInstance name='Tool'>
1751
1761
  <fieldValue name='group' value=''/>
1752
- <fieldValue name='translation' value='-0.8999743 0 0'/>
1753
1762
  <fieldValue name='undo' value='false'/>
1763
+ <fieldValue name='translation' value='-0.8999743 0 0'/>
1754
1764
  <fieldValue name='scaleUniform' value='true'/>
1755
1765
  <fieldValue name='bboxSize' value='2 3 4'/>
1756
1766
  </ProtoInstance>
@@ -12,6 +12,11 @@ class DirectionalLightTool extends X3DLightNodeTool
12
12
 
13
13
  this .tool .type = 0;
14
14
  }
15
+
16
+ beginUndo ()
17
+ {
18
+ this .undoSaveInitialValues (["direction"]);
19
+ }
15
20
  }
16
21
 
17
22
  module .exports = DirectionalLightTool;
@@ -12,6 +12,11 @@ class PointLightTool extends X3DLightNodeTool
12
12
 
13
13
  this .tool .type = 1;
14
14
  }
15
+
16
+ beginUndo ()
17
+ {
18
+ this .undoSaveInitialValues (["location"]);
19
+ }
15
20
  }
16
21
 
17
22
  module .exports = PointLightTool;
@@ -15,6 +15,11 @@ class SpotLightTool extends X3DLightNodeTool
15
15
 
16
16
  this .tool .type = 2;
17
17
  }
18
+
19
+ beginUndo ()
20
+ {
21
+ this .undoSaveInitialValues (["location", "direction"]);
22
+ }
18
23
  }
19
24
 
20
25
  module .exports = SpotLightTool;
@@ -18,34 +18,6 @@ class X3DLightNodeTool extends X3DChildNodeTool
18
18
 
19
19
  this .tool .getField ("isActive") .addInterest ("handleUndo", this);
20
20
  }
21
-
22
- #initialLocation;
23
- #initialDirection;
24
-
25
- beginUndo ()
26
- {
27
- this .#initialLocation = this ._location ?.copy ();
28
- this .#initialDirection = this ._direction ?.copy ();
29
- }
30
-
31
- endUndo ()
32
- {
33
- const
34
- location = this ._location ?.copy (),
35
- direction = this ._direction ?.copy ();
36
-
37
- if (location)
38
- this ._location = this .#initialLocation;
39
-
40
- if (direction)
41
- this ._direction = this .#initialDirection;
42
-
43
- if (location)
44
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._location, location);
45
-
46
- if (direction)
47
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._direction, direction);
48
- }
49
21
  }
50
22
 
51
23
  module .exports = X3DLightNodeTool;
@@ -7,9 +7,9 @@
7
7
  <meta name='comment' content='Rise and Shine'/>
8
8
  <meta name='created' content='Fri, 01 Aug 2014 17:41:58 GMT'/>
9
9
  <meta name='creator' content='Holger Seelig'/>
10
- <meta name='generator' content='Sunrize X3D Editor V1.1.9, https://create3000.github.io/sunrize/'/>
10
+ <meta name='generator' content='Sunrize X3D Editor V1.2.1, https://create3000.github.io/sunrize/'/>
11
11
  <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Lighting/X3DLightNodeTool.x3d'/>
12
- <meta name='modified' content='Thu, 23 Nov 2023 02:13:22 GMT'/>
12
+ <meta name='modified' content='Fri, 24 Nov 2023 10:07:29 GMT'/>
13
13
  </head>
14
14
  <Scene>
15
15
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
@@ -18,7 +18,7 @@
18
18
  <ProtoInterface>
19
19
  <field accessType='inputOutput' type='SFBool' name='selected'/>
20
20
  <field accessType='inputOutput' type='SFString' name='group' value='TRANSFORM_TOOL'/>
21
- <field accessType='inputOutput' type='SFBool' name='grouped'/>
21
+ <field accessType='inputOutput' type='SFBool' name='grouping'/>
22
22
  <field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
23
23
  <field accessType='inputOutput' type='SFInt32' name='type'/>
24
24
  <field accessType='inputOutput' type='SFBool' name='on' value='true'/>
@@ -29,7 +29,7 @@
29
29
  <field accessType='inputOutput' type='SFFloat' name='beamWidth'/>
30
30
  <field accessType='inputOutput' type='SFFloat' name='cutOffAngle'/>
31
31
  <field accessType='outputOnly' type='SFNode' name='transformTool'/>
32
- <field accessType='outputOnly' type='SFInt32' name='activeTool'/>
32
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
33
33
  <field accessType='outputOnly' type='SFBool' name='isActive'/>
34
34
  </ProtoInterface>
35
35
  <ProtoBody>
@@ -153,30 +153,18 @@
153
153
  </Transform>
154
154
  </Transform>
155
155
  <Transform DEF='PointLight'>
156
- <Transform DEF='Ray1'
156
+ <Transform DEF='Rays_1'
157
157
  scale='2 2 2'>
158
- <Shape DEF='_7'
158
+ <Shape
159
159
  castShadow='false'>
160
160
  <Appearance USE='_2'/>
161
161
  <IndexedLineSet
162
- coordIndex='0, 1, -1, 2, 3, -1, 4, 5, -1'>
162
+ coordIndex='0, 1, -1, 2, 3, -1, 4, 5, -1, 6, 7, -1, 8, 9, -1, 10, 11, -1, 12, 13, -1, 14, 15, -1, 16, 17, -1'>
163
163
  <Coordinate
164
- point='-1 0 0, 1 0 0, 0 -1 0, 0 1 0, 0 0 -1, 0 0 1'/>
164
+ point='-1 0 0, 1 0 0, 0 -1 0, 0 1 0, 0 0 -1, 0 0 1, -0.5 0.7071068 -0.5, 0.5 -0.7071068 0.5, -0.5 -0.7071068 -0.5, 0.5 0.7071068 0.5, 0.7071068 0 -0.7071068, -0.7071068 0 0.7071068, -0.5 0.7071068 0.5, 0.5 -0.7071068 -0.5, -0.5 -0.7071068 0.5, 0.5 0.7071068 -0.5, -0.7071068 0 -0.7071068, 0.7071068 0 0.7071068'/>
165
165
  </IndexedLineSet>
166
166
  </Shape>
167
167
  </Transform>
168
- <Transform DEF='Ray2'
169
- rotation='0.28108510281603 -0.678597248219043 -0.678599248219775 1.09606'
170
- scale='2 2 2'
171
- scaleOrientation='-0.174907009752728 -0.321006017899136 -0.930786051900166 0.279268999999999'>
172
- <Shape USE='_7'/>
173
- </Transform>
174
- <Transform DEF='Ray3'
175
- rotation='-0.281083991080502 0.678599978466327 -0.678596978466422 1.09606'
176
- scale='2 2 2'
177
- scaleOrientation='-0.985767661913664 0.161218944707131 -0.0476504836574296 0.470038'>
178
- <Shape USE='_7'/>
179
- </Transform>
180
168
  <Shape DEF='Sphere'
181
169
  castShadow='false'>
182
170
  <Appearance USE='_5'/>
@@ -207,43 +195,15 @@
207
195
  <Appearance USE='_5'/>
208
196
  <Sphere/>
209
197
  </Shape>
210
- <Transform DEF='Ray1_1'
198
+ <Transform DEF='Rays_2'
211
199
  scale='2 2 2'>
212
200
  <Shape
213
201
  castShadow='false'>
214
202
  <Appearance USE='_2'/>
215
203
  <IndexedLineSet
216
- coordIndex='0, 1, -1, 2, 3, -1, 4, 5, -1'>
204
+ coordIndex='0, 1, -1, 2, 3, -1, 4, 5, -1, 6, 7, -1, 8, 9, -1, 10, 11, -1, 12, 13, -1, 14, 15, -1, 16, 17, -1'>
217
205
  <Coordinate
218
- point='-1 0 0, 1 0 0, 0 -1 0, 0 1 0, 0 0 -1, 0 0 1'/>
219
- </IndexedLineSet>
220
- </Shape>
221
- </Transform>
222
- <Transform DEF='Ray2_1'
223
- rotation='0.28108510281603 -0.678597248219043 -0.678599248219775 1.09606'
224
- scale='2 2 2'
225
- scaleOrientation='0.747418900311875 -0.663392911518968 0.035704795237819 1.19385'>
226
- <Shape
227
- castShadow='false'>
228
- <Appearance USE='_2'/>
229
- <IndexedLineSet
230
- coordIndex='0, 1, -1, 2, 3, -1, 4, 5, -1'>
231
- <Coordinate
232
- point='0 0 0, 1 0 0, 0 0 0, 0 1 0, 0 0 0, 0 0 1'/>
233
- </IndexedLineSet>
234
- </Shape>
235
- </Transform>
236
- <Transform DEF='Ray3_1'
237
- rotation='-0.281083991080502 0.678599978466327 -0.678596978466422 1.09606'
238
- scale='2 2 2'
239
- scaleOrientation='-0.805953410514892 -0.138029070305539 0.575662293215391 0.849512'>
240
- <Shape
241
- castShadow='false'>
242
- <Appearance USE='_2'/>
243
- <IndexedLineSet
244
- coordIndex='0, 1, -1, 2, 3, -1, 4, 5, -1'>
245
- <Coordinate
246
- point='-1 0 0, 0 0 0, 0 -1 0, 0 0 0, 0 0 0, 0 0 1'/>
206
+ point='-1 0 0, 1 0 0, 0 -1 0, 0 1 0, 0 0 0, 0 0 1, 0 0 0, 0.5 -0.7071068 0.5, 0 0 0, 0.5 0.7071068 0.5, 0 0 0, -0.7071068 0 0.7071068, -0.5 0.7071068 0.5, 0 0 0, -0.5 -0.7071068 0.5, 0 0 0, 0 0 0, 0.7071068 0 0.7071068'/>
247
207
  </IndexedLineSet>
248
208
  </Shape>
249
209
  </Transform>
@@ -277,7 +237,7 @@
277
237
  <field accessType='inputOnly' type='SFRotation' name='set_rotation'/>
278
238
  <field accessType='inputOutput' type='SFFloat' name='beamWidth'/>
279
239
  <field accessType='inputOutput' type='SFFloat' name='cutOffAngle'/>
280
- <field accessType='inputOutput' type='SFInt32' name='activeTool'/>
240
+ <field accessType='inputOutput' type='SFString' name='activeTool'/>
281
241
  <field accessType='inputOutput' type='SFBool' name='active'/>
282
242
  <field accessType='inputOutput' type='SFNode' name='transform'>
283
243
  <Transform USE='TransformTool'/>
@@ -327,7 +287,7 @@ async function set_type (value)
327
287
  {
328
288
  if (value === 1)
329
289
  return;
330
-
290
+
331
291
  const tool = await transform .getValue () .addTool () .getToolInstance ();
332
292
 
333
293
  tool .tools .push ("ROTATE");
@@ -378,7 +338,7 @@ function set_direction (value)
378
338
 
379
339
  changing = true;
380
340
 
381
- transform .rotation = straightenHorizon (new SFRotation (new SFVec3f (0, 0, 1), value),
341
+ transform .rotation = straightenHorizon (new SFRotation (new SFVec3f (0, 0, 1), value),
382
342
  new SFVec3f (0, 1, 0));
383
343
  }
384
344
 
@@ -447,6 +407,8 @@ function set_angle ()
447
407
  <ROUTE fromNode='TransformTool' fromField='rotation_changed' toNode='Tool' toField='set_rotation'/>
448
408
  </ProtoBody>
449
409
  </ProtoDeclare>
450
- <ProtoInstance name='Tool'/>
410
+ <ProtoInstance name='Tool'>
411
+ <fieldValue name='type' value='2'/>
412
+ </ProtoInstance>
451
413
  </Scene>
452
414
  </X3D>
@@ -31,26 +31,9 @@ class X3DViewpointNodeTool extends X3DChildNodeTool
31
31
  super .disposeTool ();
32
32
  }
33
33
 
34
- #initialPosition;
35
- #initialOrientation;
36
-
37
34
  beginUndo ()
38
35
  {
39
- this .#initialPosition = this ._position .copy ();
40
- this .#initialOrientation = this ._orientation .copy ();
41
- }
42
-
43
- endUndo ()
44
- {
45
- const
46
- position = this ._position .copy (),
47
- orientation = this ._orientation .copy ();
48
-
49
- this ._position = this .#initialPosition;
50
- this ._orientation = this .#initialOrientation;
51
-
52
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._position, position);
53
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._orientation, orientation);
36
+ this .undoSaveInitialValues (["position", "orientation"]);
54
37
  }
55
38
  }
56
39
 
@@ -19,14 +19,14 @@
19
19
  <ProtoInterface>
20
20
  <field accessType='inputOutput' type='SFBool' name='selected'/>
21
21
  <field accessType='inputOutput' type='SFString' name='group' value='TRANSFORM_TOOL'/>
22
- <field accessType='inputOutput' type='SFBool' name='grouped'/>
22
+ <field accessType='inputOutput' type='SFBool' name='grouping'/>
23
23
  <field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
24
24
  <field accessType='inputOutput' type='SFInt32' name='type'/>
25
25
  <field accessType='inputOutput' type='SFVec3f' name='position'/>
26
26
  <field accessType='inputOutput' type='SFRotation' name='orientation'/>
27
27
  <field accessType='inputOutput' type='SFBool' name='bound'/>
28
28
  <field accessType='outputOnly' type='SFNode' name='transformTool'/>
29
- <field accessType='outputOnly' type='SFInt32' name='activeTool'/>
29
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
30
30
  <field accessType='outputOnly' type='SFBool' name='isActive'/>
31
31
  </ProtoInterface>
32
32
  <ProtoBody>
@@ -159,7 +159,7 @@
159
159
  <Script DEF='ToolScript'
160
160
  directOutput='true'>
161
161
  <field accessType='inputOutput' type='SFBool' name='selected'/>
162
- <field accessType='inputOutput' type='SFInt32' name='activeTool'/>
162
+ <field accessType='inputOutput' type='SFString' name='activeTool'/>
163
163
  <field accessType='inputOutput' type='SFBool' name='active'/>
164
164
  <field accessType='initializeOnly' type='SFNode' name='material'>
165
165
  <Material USE='_4'/>
@@ -2,7 +2,7 @@
2
2
 
3
3
  const
4
4
  X3DChildNodeTool = require ("../Core/X3DChildNodeTool"),
5
- Editor = require ("../../Undo/Editor");
5
+ _ = require ("../../Application/GetText");
6
6
 
7
7
  class SoundTool extends X3DChildNodeTool
8
8
  {
@@ -22,26 +22,48 @@ class SoundTool extends X3DChildNodeTool
22
22
  this .tool .getField ("isActive") .addInterest ("handleUndo", this);
23
23
  }
24
24
 
25
- #initialLocation;
26
- #initialDirection;
27
-
28
25
  beginUndo ()
29
26
  {
30
- this .#initialLocation = this ._location .copy ();
31
- this .#initialDirection = this ._direction .copy ();
27
+ this .undoSaveInitialValues (["location", "direction", "minBack", "minFront", "maxBack", "maxFront"]);
32
28
  }
33
29
 
34
- endUndo ()
30
+ getUndoDescription (activeTool, name)
35
31
  {
36
- const
37
- location = this ._location .copy (),
38
- direction = this ._direction .copy ();
32
+ switch (activeTool)
33
+ {
34
+ case "MIN_BACK":
35
+ {
36
+ if (name)
37
+ return _ ("Translate field »minBack« of Node %s »%s«");
38
+
39
+ return _ ("Translate »minBack« of Node %s");
40
+ }
41
+ case "MIN_FRONT":
42
+ {
43
+ if (name)
44
+ return _ ("Translate field »minFront of Node %s »%s«");
45
+
46
+ return _ ("Translate »minFront« of Node %s");
47
+ }
48
+ case "MAX_BACK":
49
+ {
50
+ if (name)
51
+ return _ ("Translate field »maxBack« of Node %s »%s«");
39
52
 
40
- this ._location = this .#initialLocation;
41
- this ._direction = this .#initialDirection;
53
+ return _ ("Translate »maxBack« of Node %s");
54
+ }
55
+ case "MAX_FRONT":
56
+ {
57
+ if (name)
58
+ return _ ("Translate field »maxFront« of Node %s »%s«");
42
59
 
43
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._location, location);
44
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._direction, direction);
60
+ return _ ("Translate »maxFront of Node %s");
61
+ }
62
+ default:
63
+ {
64
+ return super .getUndoDescription (activeTool, name);
65
+ }
66
+ }
45
67
  }
46
68
  }
47
69