.. | .. |
---|
415 | 415 | this.copy = this.group = group; |
---|
416 | 416 | //selectees = this.group.selectees; |
---|
417 | 417 | |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
418 | 420 | if (copy.versionlist == null) |
---|
419 | 421 | { |
---|
420 | 422 | copy.versionlist = new Object3D[100]; |
---|
421 | 423 | copy.versionindex = -1; |
---|
422 | 424 | |
---|
423 | | - Save(true); |
---|
| 425 | + //Save(true); |
---|
424 | 426 | } |
---|
425 | 427 | |
---|
426 | 428 | if(ui) |
---|
.. | .. |
---|
449 | 451 | copy.versionlist = new Object3D[100]; |
---|
450 | 452 | copy.versionindex = -1; |
---|
451 | 453 | |
---|
452 | | - Save(true); |
---|
| 454 | + //Save(true); |
---|
453 | 455 | } |
---|
454 | 456 | } |
---|
455 | 457 | |
---|
.. | .. |
---|
540 | 542 | // menu.add("-"); |
---|
541 | 543 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
542 | 544 | duplicateItem.addActionListener(this); |
---|
543 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 545 | + |
---|
| 546 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
544 | 547 | cloneItem.addActionListener(this); |
---|
545 | | - if (Globals.ADVANCED) |
---|
| 548 | + //if (Globals.ADVANCED) |
---|
546 | 549 | { |
---|
547 | 550 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
548 | 551 | cloneSupportItem.addActionListener(this); |
---|
549 | 552 | } |
---|
| 553 | + oe.jTree.popup.addSeparator(); |
---|
550 | 554 | menu.add("-"); |
---|
551 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 555 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
552 | 556 | cutItem.addActionListener(this); |
---|
553 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 557 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
554 | 558 | copyItem.addActionListener(this); |
---|
555 | 559 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
556 | 560 | pasteItem.addActionListener(this); |
---|
557 | 561 | |
---|
558 | | - menu.add("-"); |
---|
559 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 562 | + oe.jTree.popup.addSeparator(); |
---|
| 563 | + //menu.add("-"); |
---|
| 564 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
560 | 565 | pasteIntoItem.addActionListener(this); |
---|
561 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 566 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
562 | 567 | pasteLinkItem.addActionListener(this); |
---|
563 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 568 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
564 | 569 | pasteCloneItem.addActionListener(this); |
---|
565 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 570 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
566 | 571 | // pasteExpandItem.addActionListener(this); |
---|
567 | | - menu.add("-"); |
---|
568 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
569 | | - deleteItem.addActionListener(this); |
---|
| 572 | + //menu.add("-"); |
---|
| 573 | + oe.jTree.popup.addSeparator(); |
---|
570 | 574 | |
---|
571 | 575 | if (Globals.ADVANCED) |
---|
572 | 576 | { |
---|
.. | .. |
---|
701 | 705 | setMasterItem.addActionListener(this); |
---|
702 | 706 | } |
---|
703 | 707 | |
---|
704 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
705 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
706 | | -// grabItem.addActionListener(this); |
---|
| 708 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 709 | + |
---|
707 | 710 | backItem = menu.add(new MenuItem("Back")); |
---|
708 | 711 | backItem.addActionListener(this); |
---|
709 | 712 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
711 | 714 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
712 | 715 | // compositeItem.addActionListener(this); |
---|
713 | 716 | |
---|
| 717 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 718 | + grabItem.addActionListener(this); |
---|
| 719 | + |
---|
714 | 720 | if (Globals.ADVANCED) |
---|
715 | 721 | { |
---|
716 | 722 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
717 | 723 | hideItem.addActionListener(this); |
---|
718 | 724 | } |
---|
719 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 725 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
720 | 726 | ungroupItem.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.jTree.popup.addSeparator(); |
---|
| 729 | + |
---|
| 730 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 731 | + deleteItem.addActionListener(this); |
---|
721 | 732 | |
---|
722 | 733 | // menu.add("-"); |
---|
723 | 734 | // |
---|
.. | .. |
---|
923 | 934 | |
---|
924 | 935 | JTabbedPane resourcecontainer; |
---|
925 | 936 | cGridBag currenttab; |
---|
926 | | - boolean added; // patch for jar |
---|
| 937 | + //boolean added; // patch for jar |
---|
927 | 938 | |
---|
928 | 939 | int tabcount = 0; |
---|
929 | 940 | int colcount = 0; |
---|
.. | .. |
---|
940 | 951 | // System.out.println(); |
---|
941 | 952 | |
---|
942 | 953 | if (//rowcount == 0 || |
---|
943 | | - path.length == 1) |
---|
| 954 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
944 | 955 | { |
---|
945 | 956 | currenttab = new cGridBag(); |
---|
946 | | - added = false; |
---|
947 | 957 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
948 | 958 | currenttab.setName(tabname); |
---|
| 959 | + //added = false; |
---|
| 960 | + resourcecontainer.add(currenttab); |
---|
| 961 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
949 | 962 | rowcount = 1; |
---|
950 | 963 | colcount = 0; |
---|
951 | 964 | texturecount = 0; |
---|
.. | .. |
---|
953 | 966 | |
---|
954 | 967 | if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
955 | 968 | { |
---|
956 | | - if (!added) |
---|
| 969 | + //if (!added) |
---|
957 | 970 | { |
---|
958 | | - added = true; |
---|
959 | | - resourcecontainer.add(currenttab); |
---|
| 971 | + //added = true; |
---|
960 | 972 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
961 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 973 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
962 | 974 | } |
---|
963 | 975 | |
---|
964 | 976 | AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
.. | .. |
---|
1026 | 1038 | oe.radioPanel.add(dummyButton); |
---|
1027 | 1039 | oe.buttonGroup.add(dummyButton); |
---|
1028 | 1040 | */ |
---|
1029 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1041 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1030 | 1042 | |
---|
1031 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1043 | + versionManagerPanel.preferredHeight = 4; |
---|
1032 | 1044 | |
---|
1033 | 1045 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1034 | 1046 | |
---|
.. | .. |
---|
1043 | 1055 | // maxButton.addActionListener(this); |
---|
1044 | 1056 | } |
---|
1045 | 1057 | |
---|
1046 | | -// cButton gcButton; |
---|
1047 | | -// |
---|
| 1058 | + cButton gcButton; |
---|
| 1059 | + |
---|
1048 | 1060 | // oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1049 | 1061 | // gcButton.setToolTipText("Garbage collect"); |
---|
1050 | 1062 | // gcButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
1059 | 1071 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1060 | 1072 | collapseButton.addActionListener(this); |
---|
1061 | 1073 | |
---|
1062 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1074 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1063 | 1075 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1064 | 1076 | maximize3DButton.addActionListener(this); |
---|
1065 | 1077 | |
---|
.. | .. |
---|
1094 | 1106 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1095 | 1107 | restoreCameraButton.addActionListener(this); |
---|
1096 | 1108 | |
---|
1097 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1098 | 1110 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1099 | 1111 | saveVersionButton.addActionListener(this); |
---|
1100 | 1112 | |
---|
1101 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1102 | 1114 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1103 | 1115 | deleteVersionButton.addActionListener(this); |
---|
| 1116 | + deleteVersionButton.setEnabled(false); |
---|
1104 | 1117 | |
---|
1105 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1106 | 1119 | previousVersionButton.setToolTipText("Previous version"); |
---|
1107 | 1120 | previousVersionButton.addActionListener(this); |
---|
1108 | 1121 | previousVersionButton.setEnabled(false); |
---|
.. | .. |
---|
1111 | 1124 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | 1125 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1113 | 1126 | restoreButton.addActionListener(this); |
---|
1114 | | - //restoreButton.setEnabled(false); |
---|
| 1127 | + restoreButton.setEnabled(false); |
---|
1115 | 1128 | |
---|
1116 | 1129 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1117 | 1130 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1118 | 1131 | replaceButton.addActionListener(this); |
---|
1119 | | - //replaceButton.setEnabled(false); |
---|
| 1132 | + replaceButton.setEnabled(false); |
---|
1120 | 1133 | |
---|
1121 | | - copyOptionsPanel.add(updown); |
---|
| 1134 | + versionManagerPanel.add(updown); |
---|
1122 | 1135 | |
---|
1123 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1124 | 1137 | nextVersionButton.setToolTipText("Next version"); |
---|
1125 | 1138 | nextVersionButton.addActionListener(this); |
---|
1126 | 1139 | nextVersionButton.setEnabled(false); |
---|
.. | .. |
---|
1181 | 1194 | boxButton.setToolTipText("Create box"); |
---|
1182 | 1195 | boxButton.addActionListener(this); |
---|
1183 | 1196 | |
---|
| 1197 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1198 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1199 | + superButton.addActionListener(this); |
---|
| 1200 | + |
---|
1184 | 1201 | row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1185 | 1202 | sphereButton.setToolTipText("Create sphere"); |
---|
1186 | 1203 | sphereButton.addActionListener(this); |
---|
.. | .. |
---|
1192 | 1209 | row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1193 | 1210 | torusButton.setToolTipText("Create torus"); |
---|
1194 | 1211 | torusButton.addActionListener(this); |
---|
1195 | | - |
---|
1196 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1197 | | - superButton.setToolTipText("Create superellipsoid"); |
---|
1198 | | - superButton.addActionListener(this); |
---|
1199 | 1212 | |
---|
1200 | 1213 | if (Globals.ADVANCED) |
---|
1201 | 1214 | { |
---|
.. | .. |
---|
1245 | 1258 | cGridBag textures = new cGridBag(); |
---|
1246 | 1259 | |
---|
1247 | 1260 | CreateTexturePanel(textures); |
---|
| 1261 | + |
---|
| 1262 | + resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
1248 | 1263 | |
---|
1249 | 1264 | oe.toolboxPanel.add(textures); |
---|
1250 | 1265 | |
---|
.. | .. |
---|
1296 | 1311 | |
---|
1297 | 1312 | cGridBag jSPPanel = new cGridBag(); |
---|
1298 | 1313 | |
---|
| 1314 | + jSPPanel.preferredHeight = 20; |
---|
| 1315 | + |
---|
1299 | 1316 | JScrollPane jSP; |
---|
1300 | 1317 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1301 | 1318 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1304 | 1321 | oe.treePanel.add(jSPPanel); |
---|
1305 | 1322 | oe.treePanel.Return(); |
---|
1306 | 1323 | |
---|
1307 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1324 | + oe.treePanel.add(versionManagerPanel); |
---|
1308 | 1325 | oe.treePanel.Return(); |
---|
1309 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1310 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1311 | | - sliderPane.preferredHeight = 1; |
---|
| 1326 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1327 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1328 | + versionSliderPane.preferredHeight = 3; |
---|
1312 | 1329 | |
---|
1313 | 1330 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1314 | 1331 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1498 | 1515 | |
---|
1499 | 1516 | oe.SetupViews(); |
---|
1500 | 1517 | |
---|
| 1518 | + if (Globals.DEBUG) |
---|
1501 | 1519 | System.out.println("SetupViews"); |
---|
1502 | 1520 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1503 | 1521 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2159 | 2177 | shadow.material = new cMaterial(obj.material); |
---|
2160 | 2178 | shadow.material.diffuse = 0.0001f; |
---|
2161 | 2179 | shadow.material.specular = 0.0001f; |
---|
2162 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2180 | + shadow.material.opacity = 0.75f; |
---|
| 2181 | + |
---|
| 2182 | + AllocProjectedVertices(shadow); |
---|
| 2183 | + |
---|
| 2184 | + shadow.projectedVertices[1].x = 300; |
---|
2163 | 2185 | |
---|
2164 | 2186 | makeSomething(shadow); |
---|
2165 | 2187 | } |
---|
.. | .. |
---|
2680 | 2702 | } else |
---|
2681 | 2703 | if (source == loopItem || source == loopButton) |
---|
2682 | 2704 | { |
---|
| 2705 | + if (!group.selection.isEmpty()) |
---|
| 2706 | + { |
---|
2683 | 2707 | Composite csg = new GroupLeaf(); |
---|
2684 | 2708 | csg.count = 5; |
---|
2685 | | - group(csg); |
---|
2686 | 2709 | Composite child = new cGroup("Branch"); |
---|
2687 | 2710 | csg.addChild(child); |
---|
2688 | 2711 | child.addChild(csg); |
---|
| 2712 | + group(csg); |
---|
| 2713 | + } |
---|
2689 | 2714 | } else |
---|
2690 | 2715 | if (source == doubleItem) |
---|
2691 | 2716 | { |
---|
| 2717 | + if (!group.selection.isEmpty()) |
---|
| 2718 | + { |
---|
2692 | 2719 | Composite csg = new GroupLeaf("Fork"); |
---|
2693 | 2720 | csg.count = 5; |
---|
2694 | | - group(csg); |
---|
2695 | 2721 | Composite child = new cGroup("Branch A"); |
---|
2696 | 2722 | csg.addChild(child); |
---|
2697 | 2723 | child.addChild(csg); |
---|
2698 | 2724 | child = new cGroup("Branch B"); |
---|
2699 | 2725 | csg.addChild(child); |
---|
2700 | 2726 | child.addChild(csg); |
---|
| 2727 | + group(csg); |
---|
| 2728 | + } |
---|
2701 | 2729 | } else |
---|
2702 | 2730 | if (source == tripleItem) |
---|
2703 | 2731 | { |
---|
| 2732 | + if (!group.selection.isEmpty()) |
---|
| 2733 | + { |
---|
2704 | 2734 | Composite csg = new GroupLeaf("Trident"); |
---|
2705 | 2735 | csg.count = 4; |
---|
2706 | 2736 | group(csg); |
---|
.. | .. |
---|
2713 | 2743 | child = new cGroup(); |
---|
2714 | 2744 | csg.addChild(child); |
---|
2715 | 2745 | child.addChild(csg); |
---|
| 2746 | + } |
---|
2716 | 2747 | } else |
---|
2717 | 2748 | if (source == computeAOItem) |
---|
2718 | 2749 | { |
---|
.. | .. |
---|
3348 | 3379 | } else |
---|
3349 | 3380 | if (source == ungroupItem || source == ungroupButton) |
---|
3350 | 3381 | { |
---|
3351 | | - boolean hasRoot = false; |
---|
| 3382 | + boolean canUngroup = true; |
---|
3352 | 3383 | |
---|
3353 | 3384 | for (int i=0; i<group.selection.size(); i++) |
---|
3354 | 3385 | { |
---|
3355 | | - if (group.selection.get(i) == group) |
---|
| 3386 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3387 | + |
---|
| 3388 | + if (selectedItem.Size() == 0) |
---|
3356 | 3389 | { |
---|
3357 | | - hasRoot = true; |
---|
| 3390 | + // Cannot ungroup leaves |
---|
| 3391 | + canUngroup = false; |
---|
| 3392 | + break; |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + if (selectedItem == group) |
---|
| 3396 | + { |
---|
| 3397 | + // Cannot ungroup root |
---|
| 3398 | + canUngroup = false; |
---|
3358 | 3399 | break; |
---|
3359 | 3400 | } |
---|
3360 | 3401 | } |
---|
3361 | 3402 | |
---|
3362 | | - if (!hasRoot) |
---|
| 3403 | + if (canUngroup) |
---|
3363 | 3404 | { |
---|
3364 | 3405 | for (int i=0; i<group.selection.size(); i++) |
---|
3365 | 3406 | { |
---|
3366 | | - Ungroup(group.selection.get(i)); |
---|
| 3407 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3408 | + |
---|
| 3409 | + Ungroup(selectedItem); |
---|
3367 | 3410 | } |
---|
3368 | 3411 | |
---|
3369 | 3412 | ClearSelection(false); |
---|
.. | .. |
---|
3927 | 3970 | if (source == closeButton) |
---|
3928 | 3971 | { |
---|
3929 | 3972 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3973 | + Replace(); |
---|
| 3974 | + |
---|
3930 | 3975 | cRadio ab; |
---|
3931 | 3976 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3932 | 3977 | { |
---|
.. | .. |
---|
4025 | 4070 | } else |
---|
4026 | 4071 | if(source instanceof cRadio) |
---|
4027 | 4072 | { |
---|
| 4073 | + Replace(); |
---|
| 4074 | + |
---|
4028 | 4075 | group.parent = keepparent; |
---|
4029 | 4076 | group.attributes = 0; |
---|
4030 | 4077 | //group.editWindow = null; |
---|
.. | .. |
---|
4080 | 4127 | |
---|
4081 | 4128 | if (copy.versionlist == null) |
---|
4082 | 4129 | { |
---|
4083 | | - copy.versionlist = new Object3D[100]; |
---|
4084 | 4130 | copy.versionindex = -1; |
---|
4085 | 4131 | |
---|
4086 | | - Save(true); |
---|
| 4132 | + // Cannot work with loops |
---|
| 4133 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4134 | + // and check if any of these nodes are reachable below the root. |
---|
| 4135 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4136 | + |
---|
| 4137 | + if (!copy.HasTags()) |
---|
| 4138 | + { |
---|
| 4139 | + copy.versionlist = new Object3D[100]; |
---|
| 4140 | + |
---|
| 4141 | + Save(true); |
---|
| 4142 | + } |
---|
| 4143 | + |
---|
| 4144 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4087 | 4145 | } |
---|
4088 | 4146 | |
---|
4089 | 4147 | SetVersionStates(); |
---|
.. | .. |
---|
4231 | 4289 | TouchTransform(obj); |
---|
4232 | 4290 | continue; |
---|
4233 | 4291 | } |
---|
4234 | | - if ((mask&2) != 0) // Scale |
---|
| 4292 | + if ((mask&2) != 0) // Scale/rotation |
---|
4235 | 4293 | { |
---|
4236 | 4294 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4237 | 4295 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4239 | 4297 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4240 | 4298 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4241 | 4299 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4242 | | - } |
---|
4243 | | - if ((mask&4) != 0) // Rotation |
---|
4244 | | - { |
---|
4245 | | - // ? |
---|
4246 | 4300 | } |
---|
4247 | 4301 | if ((mask&1) != 0) // Translation |
---|
4248 | 4302 | { |
---|
.. | .. |
---|
5325 | 5379 | |
---|
5326 | 5380 | boolean allComposites = true; |
---|
5327 | 5381 | |
---|
| 5382 | + if (group.selection != null) |
---|
5328 | 5383 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5329 | 5384 | { |
---|
5330 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5385 | + Object next = e.nextElement(); |
---|
| 5386 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5331 | 5387 | { |
---|
5332 | 5388 | allComposites = false; |
---|
5333 | 5389 | break; |
---|
.. | .. |
---|
5339 | 5395 | |
---|
5340 | 5396 | void refreshContents(boolean cp) |
---|
5341 | 5397 | { |
---|
| 5398 | + if (false) |
---|
5342 | 5399 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5343 | 5400 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5344 | 5401 | { |
---|
.. | .. |
---|
6232 | 6289 | private MenuItem lookAtItem; |
---|
6233 | 6290 | private MenuItem lookFromItem; |
---|
6234 | 6291 | private MenuItem switchViewItem; |
---|
6235 | | - private MenuItem cutItem; |
---|
| 6292 | + private JMenuItem cutItem; |
---|
6236 | 6293 | private MenuItem undoItem; |
---|
6237 | 6294 | private MenuItem redoItem; |
---|
6238 | 6295 | private JMenuItem duplicateItem; |
---|
6239 | | - private MenuItem cloneItem; |
---|
| 6296 | + private JMenuItem cloneItem; |
---|
6240 | 6297 | private MenuItem cloneSupportItem; |
---|
6241 | 6298 | private MenuItem overwriteGeoItem; |
---|
6242 | 6299 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6257 | 6314 | private MenuItem cloneGeometriesItem; |
---|
6258 | 6315 | private MenuItem shareGeometriesItem; |
---|
6259 | 6316 | private MenuItem mergeGeometriesItem; |
---|
6260 | | - private MenuItem copyItem; |
---|
| 6317 | + private JMenuItem copyItem; |
---|
6261 | 6318 | private MenuItem pasteItem; |
---|
6262 | | - private MenuItem pasteIntoItem; |
---|
6263 | | - private MenuItem pasteLinkItem; |
---|
6264 | | - private MenuItem pasteCloneItem; |
---|
6265 | | - private MenuItem pasteExpandItem; |
---|
6266 | | - private MenuItem deleteItem; |
---|
| 6319 | + private JMenuItem pasteIntoItem; |
---|
| 6320 | + private JMenuItem pasteLinkItem; |
---|
| 6321 | + private JMenuItem pasteCloneItem; |
---|
| 6322 | + private JMenuItem pasteExpandItem; |
---|
| 6323 | + private JMenuItem deleteItem; |
---|
6267 | 6324 | private MenuItem clearAllItem; |
---|
6268 | 6325 | private MenuItem genUVItem; |
---|
6269 | 6326 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6318 | 6375 | private MenuItem transformGeometryItem; |
---|
6319 | 6376 | private MenuItem transformChildrenItem; |
---|
6320 | 6377 | private MenuItem hideItem; |
---|
6321 | | - private MenuItem grabItem; |
---|
| 6378 | + private JMenuItem grabItem; |
---|
6322 | 6379 | private MenuItem backItem; |
---|
6323 | 6380 | private MenuItem frontItem; |
---|
6324 | 6381 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6331 | 6388 | private MenuItem switchTransfoItem; |
---|
6332 | 6389 | private MenuItem morphItem; |
---|
6333 | 6390 | private MenuItem linkerItem; |
---|
6334 | | - private MenuItem ungroupItem; |
---|
| 6391 | + private JMenuItem ungroupItem; |
---|
6335 | 6392 | private MenuItem editItem; |
---|
6336 | 6393 | private MenuItem openWindowItem; |
---|
6337 | 6394 | private MenuItem editLeafItem; |
---|