.. | .. |
---|
765 | 765 | shadowYItem.addActionListener(this); |
---|
766 | 766 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
767 | 767 | shadowZItem.addActionListener(this); |
---|
768 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
769 | | - attributeItem.addActionListener(this); |
---|
770 | 768 | |
---|
771 | 769 | if (Globals.ADVANCED) |
---|
772 | 770 | { |
---|
| 771 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 772 | + attributeItem.addActionListener(this); |
---|
773 | 773 | menu.add("-"); |
---|
774 | 774 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
775 | 775 | linkerItem.addActionListener(this); |
---|
.. | .. |
---|
779 | 779 | pointflowItem.addActionListener(this); |
---|
780 | 780 | } |
---|
781 | 781 | menu.add("-"); |
---|
| 782 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 783 | + textureRatioRItem.addActionListener(this); |
---|
| 784 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 785 | + textureRatioGItem.addActionListener(this); |
---|
| 786 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 787 | + textureRatioBItem.addActionListener(this); |
---|
| 788 | + menu.add("-"); |
---|
782 | 789 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
783 | 790 | resetTransformItem.addActionListener(this); |
---|
784 | 791 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
785 | 792 | resetCentroidItem.addActionListener(this); |
---|
786 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 793 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
787 | 794 | resetCentroidXZItem.addActionListener(this); |
---|
788 | 795 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
789 | 796 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
1217 | 1224 | torusButton.setToolTipText("Create torus"); |
---|
1218 | 1225 | torusButton.addActionListener(this); |
---|
1219 | 1226 | |
---|
1220 | | - if (Globals.ADVANCED) |
---|
| 1227 | + if (false) //Globals.ADVANCED) |
---|
1221 | 1228 | { |
---|
1222 | 1229 | oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1223 | 1230 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
.. | .. |
---|
1493 | 1500 | |
---|
1494 | 1501 | void EditObject(Object3D obj) |
---|
1495 | 1502 | { |
---|
1496 | | - assert(obj instanceof Composite); |
---|
| 1503 | + //assert(obj instanceof Composite); |
---|
1497 | 1504 | |
---|
1498 | 1505 | // if (obj.versionlist == null) |
---|
1499 | 1506 | // { |
---|
.. | .. |
---|
3612 | 3619 | { |
---|
3613 | 3620 | TransformChildren(); |
---|
3614 | 3621 | } else |
---|
| 3622 | + if (source == textureRatioRItem) |
---|
| 3623 | + { |
---|
| 3624 | + TextureRatio(0); |
---|
| 3625 | + } else |
---|
| 3626 | + if (source == textureRatioGItem) |
---|
| 3627 | + { |
---|
| 3628 | + TextureRatio(1); |
---|
| 3629 | + } else |
---|
| 3630 | + if (source == textureRatioBItem) |
---|
| 3631 | + { |
---|
| 3632 | + TextureRatio(2); |
---|
| 3633 | + } else |
---|
3615 | 3634 | if (source == resetTransformItem) |
---|
3616 | 3635 | { |
---|
3617 | 3636 | ResetTransform(); |
---|
.. | .. |
---|
3984 | 4003 | if (source == closeButton) |
---|
3985 | 4004 | { |
---|
3986 | 4005 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
3987 | | - Replace(); |
---|
| 4006 | + if (copy.versionlist != null) |
---|
| 4007 | + Replace(); |
---|
3988 | 4008 | |
---|
3989 | 4009 | cRadio ab; |
---|
3990 | 4010 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
.. | .. |
---|
4084 | 4104 | } else |
---|
4085 | 4105 | if(source instanceof cRadio) |
---|
4086 | 4106 | { |
---|
4087 | | - Replace(); |
---|
| 4107 | + if (copy.versionlist != null) |
---|
| 4108 | + Replace(); |
---|
4088 | 4109 | |
---|
4089 | 4110 | group.parent = keepparent; |
---|
4090 | 4111 | group.attributes = 0; |
---|
.. | .. |
---|
4137 | 4158 | */ |
---|
4138 | 4159 | radio.layout.doClick(); |
---|
4139 | 4160 | |
---|
4140 | | - assert(copy instanceof Composite); |
---|
| 4161 | + //assert(copy instanceof Composite); |
---|
4141 | 4162 | |
---|
4142 | 4163 | if (copy.versionlist == null) |
---|
4143 | 4164 | { |
---|
.. | .. |
---|
4148 | 4169 | // and check if any of these nodes are reachable below the root. |
---|
4149 | 4170 | Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
4150 | 4171 | |
---|
4151 | | - if (copy.versionlist == null && !copy.HasTags()) |
---|
| 4172 | + if (copy instanceof Composite && copy.versionlist == null && !copy.HasTags()) |
---|
4152 | 4173 | { |
---|
4153 | 4174 | copy.versionlist = new Object3D[100]; |
---|
4154 | 4175 | |
---|
.. | .. |
---|
4275 | 4296 | refreshContents(); |
---|
4276 | 4297 | } |
---|
4277 | 4298 | |
---|
| 4299 | + void TextureRatio(int axis) |
---|
| 4300 | + { |
---|
| 4301 | + Object3D obj; |
---|
| 4302 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4303 | + { |
---|
| 4304 | + obj = (Object3D)e.nextElement(); |
---|
| 4305 | + obj.TextureRatio(axis); |
---|
| 4306 | + } |
---|
| 4307 | + |
---|
| 4308 | + refreshContents(); |
---|
| 4309 | + } |
---|
| 4310 | + |
---|
4278 | 4311 | void ResetTransform() |
---|
4279 | 4312 | { |
---|
4280 | 4313 | ResetTransform(-1); |
---|
.. | .. |
---|
4290 | 4323 | if (obj.toParent == null) |
---|
4291 | 4324 | continue; |
---|
4292 | 4325 | |
---|
4293 | | - if (mask == -1) |
---|
4294 | | - { |
---|
4295 | | - if (obj instanceof Camera) // jan 2014 |
---|
4296 | | - { |
---|
4297 | | - LA.matIdentity(obj.toParent); |
---|
4298 | | - LA.matIdentity(obj.fromParent); |
---|
4299 | | - } |
---|
4300 | | - else |
---|
4301 | | - { |
---|
4302 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4303 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4304 | | - } |
---|
4305 | | - TouchTransform(obj); |
---|
4306 | | - continue; |
---|
4307 | | - } |
---|
4308 | | - if ((mask&2) != 0) // Scale/rotation |
---|
4309 | | - { |
---|
4310 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4311 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4312 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4313 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4314 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4315 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4316 | | - } |
---|
4317 | | - if ((mask&1) != 0) // Translation |
---|
4318 | | - { |
---|
4319 | | - if (obj.toParent != null) |
---|
4320 | | - { |
---|
4321 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4322 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4323 | | - } |
---|
4324 | | - } |
---|
| 4326 | + obj.ResetTransform(mask); |
---|
| 4327 | + |
---|
4325 | 4328 | if (obj.parent == null) |
---|
4326 | 4329 | { |
---|
4327 | 4330 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4829 | 4832 | for (int i=0; i<group.selection.size(); i++) |
---|
4830 | 4833 | { |
---|
4831 | 4834 | Object3D obj = group.selection.get(i); |
---|
| 4835 | + |
---|
| 4836 | + if (obj.toParent == null) |
---|
| 4837 | + { |
---|
| 4838 | + obj.toParent = LA.newMatrix(); |
---|
| 4839 | + obj.fromParent = LA.newMatrix(); |
---|
| 4840 | + } |
---|
4832 | 4841 | |
---|
4833 | 4842 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4834 | 4843 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
.. | .. |
---|
5412 | 5421 | } |
---|
5413 | 5422 | } |
---|
5414 | 5423 | |
---|
5415 | | - rootButton.setEnabled(allComposites); |
---|
| 5424 | + rootButton.setEnabled(true); // allComposites); |
---|
5416 | 5425 | } |
---|
5417 | 5426 | |
---|
5418 | 5427 | void refreshContents(boolean cp) |
---|
.. | .. |
---|
6392 | 6401 | private MenuItem maxTexturesItem; |
---|
6393 | 6402 | private MenuItem panoTexturesItem; |
---|
6394 | 6403 | |
---|
| 6404 | + private MenuItem textureRatioRItem; |
---|
| 6405 | + private MenuItem textureRatioGItem; |
---|
| 6406 | + private MenuItem textureRatioBItem; |
---|
6395 | 6407 | private MenuItem resetCentroidItem; |
---|
6396 | 6408 | private MenuItem resetCentroidXZItem; |
---|
6397 | 6409 | private MenuItem resetTransformItem; |
---|