.. | .. |
---|
29 | 29 | { |
---|
30 | 30 | cButton skyboxButton; |
---|
31 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
32 | | - row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | 34 | skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
46 | 46 | { |
---|
47 | 47 | cButton textureButton; |
---|
48 | 48 | final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
49 | | - row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
50 | 50 | textureButton.setToolTipText(c + count); |
---|
51 | 51 | textureButton.addActionListener(new ActionListener() |
---|
52 | 52 | { |
---|
.. | .. |
---|
347 | 347 | |
---|
348 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
349 | 349 | { |
---|
350 | | - JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
351 | 351 | |
---|
352 | 352 | AddSkyboxTab0(skyboxpane); |
---|
353 | 353 | AddSkyboxTab1(skyboxpane); |
---|
.. | .. |
---|
366 | 366 | } |
---|
367 | 367 | |
---|
368 | 368 | refreshContents(); |
---|
369 | | - } |
---|
370 | | - |
---|
371 | | - public void Show3DView() |
---|
372 | | - { |
---|
373 | | - // bug |
---|
374 | | - //gridPanel.setDividerLocation(1.0); |
---|
375 | | - //bigPanel.setDividerLocation(0.0); |
---|
376 | | - bigThree.ClearUI(); |
---|
377 | | - bigThree.add(centralPanel); |
---|
378 | | - bigThree.FlushUI(); |
---|
379 | 369 | } |
---|
380 | 370 | |
---|
381 | 371 | //ObjEditor objEditor; |
---|
.. | .. |
---|
415 | 405 | this.copy = this.group = group; |
---|
416 | 406 | //selectees = this.group.selectees; |
---|
417 | 407 | |
---|
418 | | - if (copy.versionlist == null) |
---|
419 | | - { |
---|
420 | | - copy.versionlist = new Object3D[100]; |
---|
421 | | - copy.versionindex = -1; |
---|
422 | | - |
---|
423 | | - Save(true); |
---|
424 | | - } |
---|
| 408 | + assert(false); |
---|
| 409 | + |
---|
| 410 | +// if (copy.versionlist == null) |
---|
| 411 | +// { |
---|
| 412 | +// copy.versionlist = new Object3D[100]; |
---|
| 413 | +// copy.versionindex = -1; |
---|
| 414 | +// |
---|
| 415 | +// //Save(true); |
---|
| 416 | +// } |
---|
425 | 417 | |
---|
426 | 418 | if(ui) |
---|
427 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
444 | 436 | |
---|
445 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
446 | 438 | |
---|
447 | | - if (copy.versionlist == null) |
---|
448 | | - { |
---|
449 | | - copy.versionlist = new Object3D[100]; |
---|
450 | | - copy.versionindex = -1; |
---|
451 | | - |
---|
452 | | - Save(true); |
---|
453 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
454 | 446 | } |
---|
455 | 447 | |
---|
456 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
491 | 483 | |
---|
492 | 484 | Object3D parent = obj.parent; |
---|
493 | 485 | obj.parent = null; |
---|
| 486 | + |
---|
494 | 487 | // Object3D support = obj.support; |
---|
495 | 488 | // obj.support = null; |
---|
496 | 489 | if (!supports) |
---|
497 | 490 | obj.SaveSupports(); |
---|
| 491 | + |
---|
498 | 492 | Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
| 493 | + |
---|
| 494 | + clone.ResetUUIDs(); |
---|
| 495 | + |
---|
499 | 496 | obj.parent = parent; |
---|
500 | 497 | // obj.support = support; |
---|
501 | 498 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
565 | 562 | pasteLinkItem.addActionListener(this); |
---|
566 | 563 | pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
567 | 564 | pasteCloneItem.addActionListener(this); |
---|
568 | | -// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
569 | | -// pasteExpandItem.addActionListener(this); |
---|
| 565 | +// CRASH |
---|
| 566 | + pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
| 567 | +// |
---|
| 568 | + pasteExpandItem.addActionListener(this); |
---|
570 | 569 | //menu.add("-"); |
---|
571 | 570 | oe.jTree.popup.addSeparator(); |
---|
572 | | - |
---|
573 | | - deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
574 | | - deleteItem.addActionListener(this); |
---|
575 | 571 | |
---|
576 | 572 | if (Globals.ADVANCED) |
---|
577 | 573 | { |
---|
.. | .. |
---|
706 | 702 | setMasterItem.addActionListener(this); |
---|
707 | 703 | } |
---|
708 | 704 | |
---|
709 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
710 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
711 | | -// grabItem.addActionListener(this); |
---|
| 705 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 706 | + |
---|
712 | 707 | backItem = menu.add(new MenuItem("Back")); |
---|
713 | 708 | backItem.addActionListener(this); |
---|
714 | 709 | frontItem = menu.add(new MenuItem("Front")); |
---|
715 | 710 | frontItem.addActionListener(this); |
---|
716 | 711 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
717 | 712 | // compositeItem.addActionListener(this); |
---|
| 713 | + |
---|
| 714 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 715 | + grabItem.addActionListener(this); |
---|
718 | 716 | |
---|
719 | 717 | if (Globals.ADVANCED) |
---|
720 | 718 | { |
---|
.. | .. |
---|
723 | 721 | } |
---|
724 | 722 | ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
725 | 723 | ungroupItem.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.jTree.popup.addSeparator(); |
---|
| 726 | + |
---|
| 727 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 728 | + deleteItem.addActionListener(this); |
---|
726 | 729 | |
---|
727 | 730 | // menu.add("-"); |
---|
728 | 731 | // |
---|
.. | .. |
---|
759 | 762 | shadowYItem.addActionListener(this); |
---|
760 | 763 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
761 | 764 | shadowZItem.addActionListener(this); |
---|
| 765 | + |
---|
762 | 766 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
763 | 767 | attributeItem.addActionListener(this); |
---|
764 | | - |
---|
765 | 768 | if (Globals.ADVANCED) |
---|
766 | 769 | { |
---|
767 | 770 | menu.add("-"); |
---|
.. | .. |
---|
773 | 776 | pointflowItem.addActionListener(this); |
---|
774 | 777 | } |
---|
775 | 778 | menu.add("-"); |
---|
| 779 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 780 | + textureRatioRItem.addActionListener(this); |
---|
| 781 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 782 | + textureRatioGItem.addActionListener(this); |
---|
| 783 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 784 | + textureRatioBItem.addActionListener(this); |
---|
| 785 | + menu.add("-"); |
---|
776 | 786 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
777 | 787 | resetTransformItem.addActionListener(this); |
---|
778 | 788 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
779 | 789 | resetCentroidItem.addActionListener(this); |
---|
780 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 790 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
781 | 791 | resetCentroidXZItem.addActionListener(this); |
---|
782 | 792 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
783 | 793 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
793 | 803 | genNormalsCADItem.addActionListener(this); |
---|
794 | 804 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
795 | 805 | genNormalsMESHItem.addActionListener(this); |
---|
796 | | - if (Globals.ADVANCED) |
---|
| 806 | + //if (Globals.ADVANCED) |
---|
797 | 807 | { |
---|
798 | 808 | genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
799 | 809 | genNormalsMINEItem.addActionListener(this); |
---|
.. | .. |
---|
829 | 839 | } |
---|
830 | 840 | |
---|
831 | 841 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 842 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 843 | + clearVersionsItem.addActionListener(this); |
---|
832 | 844 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
833 | 845 | clearMaterialsItem.addActionListener(this); |
---|
834 | 846 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
851 | 863 | hideleavesItem.addActionListener(this); |
---|
852 | 864 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
853 | 865 | showleavesItem.addActionListener(this); |
---|
854 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 866 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
855 | 867 | markleavesItem.addActionListener(this); |
---|
856 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 868 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
857 | 869 | unmarkleavesItem.addActionListener(this); |
---|
858 | 870 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
859 | 871 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
930 | 942 | cGridBag currenttab; |
---|
931 | 943 | //boolean added; // patch for jar |
---|
932 | 944 | |
---|
| 945 | + int totalcount = 0; |
---|
| 946 | + |
---|
933 | 947 | int tabcount = 0; |
---|
934 | 948 | int colcount = 0; |
---|
935 | 949 | int rowcount = 0; |
---|
.. | .. |
---|
952 | 966 | currenttab.setName(tabname); |
---|
953 | 967 | //added = false; |
---|
954 | 968 | resourcecontainer.add(currenttab); |
---|
955 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 969 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname); |
---|
956 | 970 | rowcount = 1; |
---|
957 | 971 | colcount = 0; |
---|
958 | 972 | texturecount = 0; |
---|
959 | 973 | } |
---|
960 | 974 | |
---|
961 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 975 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
962 | 976 | { |
---|
963 | 977 | //if (!added) |
---|
964 | 978 | { |
---|
.. | .. |
---|
967 | 981 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
968 | 982 | } |
---|
969 | 983 | |
---|
970 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 984 | + columns = 5; |
---|
| 985 | + |
---|
| 986 | + if (path[0].contains("D&R") || path[0].contains("Paint")) |
---|
| 987 | + columns = 4; |
---|
| 988 | + |
---|
| 989 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 990 | + totalcount++; |
---|
971 | 991 | |
---|
972 | 992 | if (++colcount >= columns) |
---|
973 | 993 | { |
---|
.. | .. |
---|
993 | 1013 | container.add(resourcecontainer); |
---|
994 | 1014 | |
---|
995 | 1015 | Grafreed.ParseResources("textures", this); |
---|
| 1016 | + |
---|
| 1017 | + // 935. System.out.println("Total = " + totalcount); |
---|
996 | 1018 | } |
---|
997 | 1019 | |
---|
998 | 1020 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1032 | 1054 | oe.radioPanel.add(dummyButton); |
---|
1033 | 1055 | oe.buttonGroup.add(dummyButton); |
---|
1034 | 1056 | */ |
---|
1035 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1057 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1036 | 1058 | |
---|
1037 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1059 | + versionManagerPanel.preferredHeight = 4; |
---|
1038 | 1060 | |
---|
1039 | 1061 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1040 | 1062 | |
---|
.. | .. |
---|
1061 | 1083 | // } |
---|
1062 | 1084 | // }); |
---|
1063 | 1085 | |
---|
1064 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1086 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1088 | + fullScreenButton.addActionListener(this); |
---|
| 1089 | + |
---|
| 1090 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1065 | 1091 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1066 | 1092 | collapseButton.addActionListener(this); |
---|
1067 | 1093 | |
---|
1068 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1069 | | - maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1070 | | - maximize3DButton.addActionListener(this); |
---|
| 1094 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1095 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1096 | +// maximize3DButton.addActionListener(this); |
---|
1071 | 1097 | |
---|
1072 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1098 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1073 | 1099 | twoButton.setToolTipText("Show 3D view only"); |
---|
1074 | 1100 | twoButton.addActionListener(this); |
---|
1075 | 1101 | this.fullscreenLayout = twoButton; |
---|
1076 | 1102 | |
---|
1077 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1103 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1078 | 1104 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1079 | 1105 | threeButton.addActionListener(this); |
---|
1080 | 1106 | if (Globals.ADVANCED) |
---|
1081 | 1107 | { |
---|
1082 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1108 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1083 | 1109 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1084 | 1110 | sixButton.addActionListener(this); |
---|
1085 | 1111 | } |
---|
.. | .. |
---|
1088 | 1114 | // sevenButton.addActionListener(this); |
---|
1089 | 1115 | // |
---|
1090 | 1116 | |
---|
1091 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1092 | | - fullButton.setToolTipText("Full-screen window"); |
---|
1093 | | - fullButton.addActionListener(this); |
---|
1094 | | - |
---|
1095 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1096 | 1118 | screenfitButton.setToolTipText("Screen fit"); |
---|
1097 | 1119 | screenfitButton.addActionListener(this); |
---|
1098 | 1120 | |
---|
1099 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1121 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1100 | 1122 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1101 | 1123 | restoreCameraButton.addActionListener(this); |
---|
1102 | 1124 | |
---|
1103 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1125 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1104 | 1126 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1105 | 1127 | saveVersionButton.addActionListener(this); |
---|
1106 | 1128 | |
---|
1107 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1130 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1109 | 1131 | deleteVersionButton.addActionListener(this); |
---|
| 1132 | + deleteVersionButton.setEnabled(false); |
---|
1110 | 1133 | |
---|
1111 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | 1135 | previousVersionButton.setToolTipText("Previous version"); |
---|
1113 | 1136 | previousVersionButton.addActionListener(this); |
---|
1114 | 1137 | previousVersionButton.setEnabled(false); |
---|
1115 | 1138 | |
---|
1116 | 1139 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1117 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1118 | 1141 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1119 | 1142 | restoreButton.addActionListener(this); |
---|
1120 | | - //restoreButton.setEnabled(false); |
---|
| 1143 | + restoreButton.setEnabled(false); |
---|
1121 | 1144 | |
---|
1122 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1145 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1123 | 1146 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1124 | 1147 | replaceButton.addActionListener(this); |
---|
1125 | | - //replaceButton.setEnabled(false); |
---|
| 1148 | + replaceButton.setEnabled(false); |
---|
1126 | 1149 | |
---|
1127 | | - copyOptionsPanel.add(updown); |
---|
| 1150 | + versionManagerPanel.add(updown); |
---|
1128 | 1151 | |
---|
1129 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1152 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1153 | nextVersionButton.setToolTipText("Next version"); |
---|
1131 | 1154 | nextVersionButton.addActionListener(this); |
---|
1132 | 1155 | nextVersionButton.setEnabled(false); |
---|
1133 | 1156 | |
---|
1134 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1157 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1135 | 1158 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1136 | 1159 | oneStepButton.addActionListener(this); |
---|
1137 | 1160 | |
---|
.. | .. |
---|
1154 | 1177 | |
---|
1155 | 1178 | if (Globals.ADVANCED) |
---|
1156 | 1179 | { |
---|
1157 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1158 | 1181 | snapobjectButton.addActionListener(this); |
---|
1159 | 1182 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1160 | 1183 | |
---|
1161 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1162 | 1185 | fourButton.addActionListener(this); |
---|
1163 | 1186 | fourButton.setToolTipText("Show control panel only"); |
---|
1164 | 1187 | } |
---|
.. | .. |
---|
1166 | 1189 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1167 | 1190 | |
---|
1168 | 1191 | |
---|
1169 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1192 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1170 | 1193 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1171 | 1194 | rootButton.addActionListener(this); |
---|
1172 | 1195 | |
---|
1173 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1196 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1174 | 1197 | closeButton.setToolTipText("Close tab"); |
---|
1175 | 1198 | closeButton.addActionListener(this); |
---|
1176 | 1199 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
1177 | 1200 | //clearButton.addActionListener(this); |
---|
1178 | 1201 | |
---|
1179 | 1202 | cGridBag row1 = new cGridBag(); |
---|
| 1203 | + row1.preferredHeight = 8; |
---|
1180 | 1204 | |
---|
1181 | 1205 | // INSERT |
---|
1182 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1183 | 1207 | gridButton.setToolTipText("Create ground"); |
---|
1184 | 1208 | gridButton.addActionListener(this); |
---|
1185 | 1209 | |
---|
1186 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1187 | 1211 | boxButton.setToolTipText("Create box"); |
---|
1188 | 1212 | boxButton.addActionListener(this); |
---|
1189 | 1213 | |
---|
1190 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1191 | 1215 | superButton.setToolTipText("Create superellipsoid"); |
---|
1192 | 1216 | superButton.addActionListener(this); |
---|
1193 | 1217 | |
---|
1194 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1218 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1195 | 1219 | sphereButton.setToolTipText("Create sphere"); |
---|
1196 | 1220 | sphereButton.addActionListener(this); |
---|
1197 | 1221 | |
---|
1198 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1222 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1199 | 1223 | coneButton.setToolTipText("Create cone"); |
---|
1200 | 1224 | coneButton.addActionListener(this); |
---|
1201 | 1225 | |
---|
1202 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1226 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1203 | 1227 | torusButton.setToolTipText("Create torus"); |
---|
1204 | 1228 | torusButton.addActionListener(this); |
---|
1205 | 1229 | |
---|
1206 | | - if (Globals.ADVANCED) |
---|
| 1230 | + if (false) //Globals.ADVANCED) |
---|
1207 | 1231 | { |
---|
1208 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1209 | 1233 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1210 | 1234 | kleinButton.addActionListener(this); |
---|
1211 | 1235 | } |
---|
1212 | 1236 | |
---|
1213 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1237 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1214 | 1238 | particlesButton.setToolTipText("Create particle system"); |
---|
1215 | 1239 | particlesButton.addActionListener(this); |
---|
1216 | 1240 | |
---|
1217 | 1241 | oe.toolboxPanel.add(row1); |
---|
1218 | 1242 | |
---|
1219 | 1243 | cGridBag row2 = new cGridBag(); |
---|
| 1244 | + row2.preferredHeight = 8; |
---|
1220 | 1245 | |
---|
1221 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1246 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1222 | 1247 | groupButton.setToolTipText("Create group"); |
---|
1223 | 1248 | groupButton.addActionListener(this); |
---|
1224 | 1249 | |
---|
1225 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1250 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1226 | 1251 | compositeButton.setToolTipText("Create composite"); |
---|
1227 | 1252 | compositeButton.addActionListener(this); |
---|
1228 | 1253 | |
---|
1229 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1254 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1230 | 1255 | switchButton.setToolTipText("Create item switcher"); |
---|
1231 | 1256 | switchButton.addActionListener(this); |
---|
1232 | 1257 | |
---|
1233 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1258 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1234 | 1259 | loopButton.setToolTipText("Create loop"); |
---|
1235 | 1260 | loopButton.addActionListener(this); |
---|
1236 | 1261 | |
---|
1237 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1262 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1238 | 1263 | textureButton.setToolTipText("Create texture"); |
---|
1239 | 1264 | textureButton.addActionListener(this); |
---|
1240 | 1265 | |
---|
1241 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1266 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1242 | 1267 | overlayButton.setToolTipText("Create overlay"); |
---|
1243 | 1268 | overlayButton.addActionListener(this); |
---|
1244 | 1269 | |
---|
1245 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1270 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1246 | 1271 | lightButton.setToolTipText("Create light"); |
---|
1247 | 1272 | lightButton.addActionListener(this); |
---|
1248 | 1273 | |
---|
.. | .. |
---|
1252 | 1277 | |
---|
1253 | 1278 | CreateTexturePanel(textures); |
---|
1254 | 1279 | |
---|
| 1280 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1281 | + |
---|
| 1282 | + if (tabCount > 0) |
---|
| 1283 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1284 | + |
---|
1255 | 1285 | oe.toolboxPanel.add(textures); |
---|
1256 | 1286 | |
---|
1257 | 1287 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1259 | 1289 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1260 | 1290 | |
---|
1261 | 1291 | // EDIT panel |
---|
1262 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1292 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1263 | 1293 | editButton.setToolTipText("Pin selection controls"); |
---|
1264 | 1294 | editButton.addActionListener(this); |
---|
1265 | 1295 | |
---|
1266 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1296 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1267 | 1297 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1268 | 1298 | uneditButton.addActionListener(this); |
---|
1269 | 1299 | |
---|
.. | .. |
---|
1271 | 1301 | allParamsButton.setToolTipText("Show all controls"); |
---|
1272 | 1302 | allParamsButton.addActionListener(this); |
---|
1273 | 1303 | |
---|
1274 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1304 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1275 | 1305 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1276 | 1306 | clearPanelButton.addActionListener(this); |
---|
1277 | 1307 | |
---|
.. | .. |
---|
1279 | 1309 | //unselectButton.setToolTipText("Unselect"); |
---|
1280 | 1310 | //unselectButton.addActionListener(this); |
---|
1281 | 1311 | |
---|
1282 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1312 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1283 | 1313 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1284 | 1314 | flashSelectionButton.addActionListener(this); |
---|
1285 | 1315 | |
---|
.. | .. |
---|
1302 | 1332 | |
---|
1303 | 1333 | cGridBag jSPPanel = new cGridBag(); |
---|
1304 | 1334 | |
---|
| 1335 | + jSPPanel.preferredHeight = 20; |
---|
| 1336 | + |
---|
1305 | 1337 | JScrollPane jSP; |
---|
1306 | 1338 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1307 | 1339 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1310 | 1342 | oe.treePanel.add(jSPPanel); |
---|
1311 | 1343 | oe.treePanel.Return(); |
---|
1312 | 1344 | |
---|
1313 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1345 | + oe.treePanel.add(versionManagerPanel); |
---|
1314 | 1346 | oe.treePanel.Return(); |
---|
1315 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1316 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1317 | | - sliderPane.preferredHeight = 1; |
---|
| 1347 | + |
---|
| 1348 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1349 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1350 | + versionSliderPane.preferredHeight = 3; |
---|
1318 | 1351 | |
---|
1319 | 1352 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1320 | 1353 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1371 | 1404 | // supportCB.setToolTipText("Enable rigging"); |
---|
1372 | 1405 | // supportCB.addItemListener(this); |
---|
1373 | 1406 | |
---|
1374 | | - panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1407 | + panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints); |
---|
1375 | 1408 | freezeCB.setToolTipText("Fast moving camera"); |
---|
1376 | 1409 | freezeCB.addItemListener(this); |
---|
1377 | 1410 | |
---|
.. | .. |
---|
1380 | 1413 | |
---|
1381 | 1414 | panel.Return(); |
---|
1382 | 1415 | |
---|
| 1416 | + if (Globals.ADVANCED) |
---|
| 1417 | + { |
---|
1383 | 1418 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
1384 | 1419 | crowdCB.setToolTipText("Used for crowds"); |
---|
1385 | 1420 | crowdCB.addItemListener(this); |
---|
| 1421 | + } |
---|
1386 | 1422 | |
---|
1387 | 1423 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
1388 | 1424 | smoothCB.setToolTipText("Snapping delay"); |
---|
.. | .. |
---|
1395 | 1431 | minshaderCB.setToolTipText("Minimal fast shader"); |
---|
1396 | 1432 | minshaderCB.addItemListener(this); |
---|
1397 | 1433 | |
---|
1398 | | -// constraints.gridy += 1; |
---|
1399 | 1434 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
1400 | 1435 | // speakerMocapCB.addItemListener(this); |
---|
1401 | 1436 | |
---|
1402 | | - panel.Return(); |
---|
1403 | | - |
---|
1404 | 1437 | if (false) |
---|
1405 | 1438 | { |
---|
1406 | 1439 | // handled in scripts |
---|
1407 | | - //constraints.gridy += 1; |
---|
1408 | 1440 | panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
1409 | 1441 | speakerCameraCB.addItemListener(this); |
---|
1410 | 1442 | |
---|
1411 | | - //constraints.gridy += 1; |
---|
1412 | 1443 | panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
1413 | 1444 | speakerFocusCB.addItemListener(this); |
---|
1414 | 1445 | |
---|
1415 | | - //constraints.gridy += 1; |
---|
1416 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
1417 | | - smoothfocusCB.addItemListener(this); |
---|
1418 | 1446 | panel.Return(); |
---|
1419 | 1447 | } |
---|
1420 | 1448 | |
---|
1421 | | -//constraints.gridx += 1; |
---|
| 1449 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1450 | + smoothfocusCB.addItemListener(this); |
---|
| 1451 | + |
---|
| 1452 | + panel.Return(); |
---|
| 1453 | + |
---|
1422 | 1454 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
1423 | 1455 | // debugCB.addItemListener(this); |
---|
1424 | 1456 | |
---|
.. | .. |
---|
1472 | 1504 | |
---|
1473 | 1505 | void EditObject(Object3D obj) |
---|
1474 | 1506 | { |
---|
1475 | | - assert(obj instanceof Composite); |
---|
| 1507 | + //assert(obj instanceof Composite); |
---|
1476 | 1508 | |
---|
1477 | 1509 | // if (obj.versionlist == null) |
---|
1478 | 1510 | // { |
---|
.. | .. |
---|
1504 | 1536 | |
---|
1505 | 1537 | oe.SetupViews(); |
---|
1506 | 1538 | |
---|
| 1539 | + if (Globals.DEBUG) |
---|
1507 | 1540 | System.out.println("SetupViews"); |
---|
1508 | 1541 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1509 | 1542 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2056 | 2089 | Object3D obj = (Object3D)group.selection.elementAt(0); |
---|
2057 | 2090 | objEditor.ScreenFit(obj, false); |
---|
2058 | 2091 | |
---|
2059 | | - cameraView.pingthread.StepToTarget(true); |
---|
| 2092 | + cameraView.pingthread.StepToTarget(); //true); |
---|
2060 | 2093 | refreshContents(); |
---|
2061 | 2094 | } |
---|
2062 | 2095 | |
---|
.. | .. |
---|
2093 | 2126 | obj.parent.TransformToWorld(maxima); //, maxima); |
---|
2094 | 2127 | } |
---|
2095 | 2128 | |
---|
2096 | | - Object3D shadow = new Object3D("Shadow " + obj.name); |
---|
| 2129 | + Object3D shadow = new Object3D("Shadow" + obj.name); |
---|
2097 | 2130 | |
---|
2098 | 2131 | shadow.toParent = LA.newMatrix(); |
---|
2099 | 2132 | shadow.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
2107 | 2140 | switch(axis) |
---|
2108 | 2141 | { |
---|
2109 | 2142 | case 0 : |
---|
2110 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2111 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
2112 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2113 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2143 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2144 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2145 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2146 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
2114 | 2147 | norm = cVector.X; |
---|
2115 | 2148 | break; |
---|
2116 | 2149 | case 1 : |
---|
2117 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2118 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2119 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2120 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2150 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2151 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2152 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2153 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
2121 | 2154 | norm = cVector.Y; |
---|
2122 | 2155 | break; |
---|
2123 | 2156 | case 2 : |
---|
2124 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2125 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2126 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
2127 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2157 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2158 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2159 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2160 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
2128 | 2161 | norm = cVector.Z; |
---|
2129 | 2162 | break; |
---|
2130 | 2163 | } |
---|
.. | .. |
---|
2693 | 2726 | if (!group.selection.isEmpty()) |
---|
2694 | 2727 | { |
---|
2695 | 2728 | Composite csg = new GroupLeaf(); |
---|
| 2729 | + group(csg); |
---|
2696 | 2730 | csg.count = 5; |
---|
2697 | 2731 | Composite child = new cGroup("Branch"); |
---|
2698 | 2732 | csg.addChild(child); |
---|
2699 | 2733 | child.addChild(csg); |
---|
2700 | | - group(csg); |
---|
2701 | 2734 | } |
---|
2702 | 2735 | } else |
---|
2703 | 2736 | if (source == doubleItem) |
---|
.. | .. |
---|
2705 | 2738 | if (!group.selection.isEmpty()) |
---|
2706 | 2739 | { |
---|
2707 | 2740 | Composite csg = new GroupLeaf("Fork"); |
---|
| 2741 | + group(csg); |
---|
2708 | 2742 | csg.count = 5; |
---|
2709 | 2743 | Composite child = new cGroup("Branch A"); |
---|
2710 | 2744 | csg.addChild(child); |
---|
.. | .. |
---|
2712 | 2746 | child = new cGroup("Branch B"); |
---|
2713 | 2747 | csg.addChild(child); |
---|
2714 | 2748 | child.addChild(csg); |
---|
2715 | | - group(csg); |
---|
2716 | 2749 | } |
---|
2717 | 2750 | } else |
---|
2718 | 2751 | if (source == tripleItem) |
---|
.. | .. |
---|
2778 | 2811 | { |
---|
2779 | 2812 | Maximize(); |
---|
2780 | 2813 | } else |
---|
2781 | | - if (source == fullButton) |
---|
| 2814 | + if (source == fullScreenButton) |
---|
2782 | 2815 | { |
---|
2783 | 2816 | ToggleFullScreen(); |
---|
2784 | 2817 | } else |
---|
.. | .. |
---|
2787 | 2820 | this.expandedLayout = radio.layout; |
---|
2788 | 2821 | CollapseToolbar(); |
---|
2789 | 2822 | } else |
---|
2790 | | - if (source == maximize3DButton) |
---|
2791 | | - { |
---|
2792 | | - this.expandedLayout = radio.layout; |
---|
2793 | | - radio.layout = twoButton; |
---|
2794 | | - Show3DView(); |
---|
2795 | | - CollapseToolbar(); |
---|
2796 | | - } else |
---|
| 2823 | +// if (source == maximize3DButton) |
---|
| 2824 | +// { |
---|
| 2825 | +// this.expandedLayout = radio.layout; |
---|
| 2826 | +// radio.layout = twoButton; |
---|
| 2827 | +// CollapseToolbar(); |
---|
| 2828 | +// Show3DView(); |
---|
| 2829 | +// } else |
---|
2797 | 2830 | if (source == previousVersionButton) |
---|
2798 | 2831 | { |
---|
2799 | 2832 | // Go to previous version |
---|
.. | .. |
---|
2821 | 2854 | if (source == saveVersionButton) |
---|
2822 | 2855 | { |
---|
2823 | 2856 | // Save a new version |
---|
2824 | | - if (!Save(true)) |
---|
| 2857 | + if (!DuplicateVersion()) //true)) |
---|
2825 | 2858 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2826 | 2859 | } else |
---|
2827 | 2860 | if (source == deleteVersionButton) |
---|
.. | .. |
---|
3446 | 3479 | { |
---|
3447 | 3480 | ClearMaterials(); |
---|
3448 | 3481 | } else |
---|
| 3482 | + if (source == clearVersionsItem) |
---|
| 3483 | + { |
---|
| 3484 | + ClearVersions(); |
---|
| 3485 | + } else |
---|
3449 | 3486 | if (source == liveleavesItem) |
---|
3450 | 3487 | { |
---|
3451 | 3488 | LiveLeaves(true); |
---|
.. | .. |
---|
3585 | 3622 | if (source == transformChildrenItem) |
---|
3586 | 3623 | { |
---|
3587 | 3624 | TransformChildren(); |
---|
| 3625 | + } else |
---|
| 3626 | + if (source == textureRatioRItem) |
---|
| 3627 | + { |
---|
| 3628 | + TextureRatio(0); |
---|
| 3629 | + } else |
---|
| 3630 | + if (source == textureRatioGItem) |
---|
| 3631 | + { |
---|
| 3632 | + TextureRatio(1); |
---|
| 3633 | + } else |
---|
| 3634 | + if (source == textureRatioBItem) |
---|
| 3635 | + { |
---|
| 3636 | + TextureRatio(2); |
---|
3588 | 3637 | } else |
---|
3589 | 3638 | if (source == resetTransformItem) |
---|
3590 | 3639 | { |
---|
.. | .. |
---|
3958 | 4007 | if (source == closeButton) |
---|
3959 | 4008 | { |
---|
3960 | 4009 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 4010 | + if (copy.versionlist != null) |
---|
| 4011 | + Replace(); |
---|
| 4012 | + |
---|
3961 | 4013 | cRadio ab; |
---|
3962 | 4014 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3963 | 4015 | { |
---|
.. | .. |
---|
4056 | 4108 | } else |
---|
4057 | 4109 | if(source instanceof cRadio) |
---|
4058 | 4110 | { |
---|
| 4111 | + if (copy.versionlist != null) |
---|
| 4112 | + Replace(); |
---|
| 4113 | + |
---|
4059 | 4114 | group.parent = keepparent; |
---|
4060 | 4115 | group.attributes = 0; |
---|
4061 | 4116 | //group.editWindow = null; |
---|
.. | .. |
---|
4107 | 4162 | */ |
---|
4108 | 4163 | radio.layout.doClick(); |
---|
4109 | 4164 | |
---|
4110 | | - assert(copy instanceof Composite); |
---|
| 4165 | + //assert(copy instanceof Composite); |
---|
4111 | 4166 | |
---|
4112 | 4167 | if (copy.versionlist == null) |
---|
4113 | 4168 | { |
---|
4114 | | - copy.versionlist = new Object3D[100]; |
---|
4115 | 4169 | copy.versionindex = -1; |
---|
4116 | 4170 | |
---|
4117 | | - Save(true); |
---|
| 4171 | + // Cannot work with loops |
---|
| 4172 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4173 | + // and check if any of these nodes are reachable below the root. |
---|
| 4174 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4175 | + |
---|
| 4176 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4177 | + { |
---|
| 4178 | + if (copy.versionlist == null) |
---|
| 4179 | + copy.versionlist = new Object3D[100]; |
---|
| 4180 | + |
---|
| 4181 | + //Save(true); |
---|
| 4182 | + } |
---|
| 4183 | + else |
---|
| 4184 | + copy.versionindex = -2; |
---|
| 4185 | + |
---|
| 4186 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4118 | 4187 | } |
---|
4119 | 4188 | |
---|
4120 | 4189 | SetVersionStates(); |
---|
.. | .. |
---|
4232 | 4301 | refreshContents(); |
---|
4233 | 4302 | } |
---|
4234 | 4303 | |
---|
| 4304 | + void TextureRatio(int axis) |
---|
| 4305 | + { |
---|
| 4306 | + Object3D obj; |
---|
| 4307 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4308 | + { |
---|
| 4309 | + obj = (Object3D)e.nextElement(); |
---|
| 4310 | + obj.TextureRatio(axis); |
---|
| 4311 | + } |
---|
| 4312 | + |
---|
| 4313 | + refreshContents(); |
---|
| 4314 | + } |
---|
| 4315 | + |
---|
4235 | 4316 | void ResetTransform() |
---|
4236 | 4317 | { |
---|
4237 | 4318 | ResetTransform(-1); |
---|
| 4319 | + } |
---|
| 4320 | + |
---|
| 4321 | + void ScaleSelection(int scale) |
---|
| 4322 | + { |
---|
| 4323 | + Object3D obj; |
---|
| 4324 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4325 | + { |
---|
| 4326 | + obj = (Object3D)e.nextElement(); |
---|
| 4327 | + |
---|
| 4328 | + if (obj.toParent == null) |
---|
| 4329 | + continue; |
---|
| 4330 | + |
---|
| 4331 | + obj.Scale(scale); |
---|
| 4332 | + |
---|
| 4333 | + if (obj.parent == null) |
---|
| 4334 | + { |
---|
| 4335 | + System.out.println("NULL PARENT!"); |
---|
| 4336 | + // new Exception().printStackTrace(); |
---|
| 4337 | + } |
---|
| 4338 | + else |
---|
| 4339 | + TouchTransform(obj); |
---|
| 4340 | + //obj.parent.Touch(); |
---|
| 4341 | + } |
---|
| 4342 | + |
---|
| 4343 | + refreshContents(); |
---|
4238 | 4344 | } |
---|
4239 | 4345 | |
---|
4240 | 4346 | void ResetTransform(int mask) |
---|
.. | .. |
---|
4247 | 4353 | if (obj.toParent == null) |
---|
4248 | 4354 | continue; |
---|
4249 | 4355 | |
---|
4250 | | - if (mask == -1) |
---|
4251 | | - { |
---|
4252 | | - if (obj instanceof Camera) // jan 2014 |
---|
4253 | | - { |
---|
4254 | | - LA.matIdentity(obj.toParent); |
---|
4255 | | - LA.matIdentity(obj.fromParent); |
---|
4256 | | - } |
---|
4257 | | - else |
---|
4258 | | - { |
---|
4259 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4260 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4261 | | - } |
---|
4262 | | - TouchTransform(obj); |
---|
4263 | | - continue; |
---|
4264 | | - } |
---|
4265 | | - if ((mask&2) != 0) // Scale |
---|
4266 | | - { |
---|
4267 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4268 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4269 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4270 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4271 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4272 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4273 | | - } |
---|
4274 | | - if ((mask&4) != 0) // Rotation |
---|
4275 | | - { |
---|
4276 | | - // ? |
---|
4277 | | - } |
---|
4278 | | - if ((mask&1) != 0) // Translation |
---|
4279 | | - { |
---|
4280 | | - if (obj.toParent != null) |
---|
4281 | | - { |
---|
4282 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4283 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4284 | | - } |
---|
4285 | | - } |
---|
| 4356 | + obj.ResetTransform(mask); |
---|
| 4357 | + |
---|
4286 | 4358 | if (obj.parent == null) |
---|
4287 | 4359 | { |
---|
4288 | 4360 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4791 | 4863 | { |
---|
4792 | 4864 | Object3D obj = group.selection.get(i); |
---|
4793 | 4865 | |
---|
| 4866 | + if (obj.toParent == null) |
---|
| 4867 | + { |
---|
| 4868 | + obj.toParent = LA.newMatrix(); |
---|
| 4869 | + obj.fromParent = LA.newMatrix(); |
---|
| 4870 | + } |
---|
| 4871 | + |
---|
4794 | 4872 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4795 | 4873 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4796 | 4874 | } |
---|
4797 | 4875 | |
---|
| 4876 | + Globals.lighttouched = true; |
---|
4798 | 4877 | refreshContents(); |
---|
4799 | 4878 | } |
---|
4800 | 4879 | |
---|
.. | .. |
---|
5082 | 5161 | refreshContents(); |
---|
5083 | 5162 | } |
---|
5084 | 5163 | |
---|
| 5164 | + void ClearVersions() |
---|
| 5165 | + { |
---|
| 5166 | + group.selection.ClearVersions(); |
---|
| 5167 | + refreshContents(); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
5085 | 5170 | void FlipV(boolean flip) |
---|
5086 | 5171 | { |
---|
5087 | 5172 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5320 | 5405 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5321 | 5406 | // a camera |
---|
5322 | 5407 | { |
---|
5323 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5408 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5324 | 5409 | { |
---|
5325 | 5410 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5326 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5411 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true); |
---|
5327 | 5412 | } |
---|
5328 | 5413 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
5329 | 5414 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
.. | .. |
---|
5359 | 5444 | if (group.selection != null) |
---|
5360 | 5445 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5361 | 5446 | { |
---|
5362 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5447 | + Object next = e.nextElement(); |
---|
| 5448 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5363 | 5449 | { |
---|
5364 | 5450 | allComposites = false; |
---|
5365 | 5451 | break; |
---|
5366 | 5452 | } |
---|
5367 | 5453 | } |
---|
5368 | 5454 | |
---|
5369 | | - rootButton.setEnabled(allComposites); |
---|
| 5455 | + rootButton.setEnabled(true); // allComposites); |
---|
5370 | 5456 | } |
---|
5371 | 5457 | |
---|
5372 | 5458 | void refreshContents(boolean cp) |
---|
5373 | 5459 | { |
---|
| 5460 | + if (Globals.SHOWINFO) |
---|
5374 | 5461 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5375 | 5462 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5376 | 5463 | { |
---|
.. | .. |
---|
6321 | 6408 | private MenuItem clipMeshItem; |
---|
6322 | 6409 | private MenuItem smoothMeshItem; |
---|
6323 | 6410 | private MenuItem clearMaterialsItem; |
---|
| 6411 | + private MenuItem clearVersionsItem; |
---|
6324 | 6412 | |
---|
6325 | 6413 | private MenuItem liveleavesItem; |
---|
6326 | 6414 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6344 | 6432 | private MenuItem maxTexturesItem; |
---|
6345 | 6433 | private MenuItem panoTexturesItem; |
---|
6346 | 6434 | |
---|
| 6435 | + private MenuItem textureRatioRItem; |
---|
| 6436 | + private MenuItem textureRatioGItem; |
---|
| 6437 | + private MenuItem textureRatioBItem; |
---|
6347 | 6438 | private MenuItem resetCentroidItem; |
---|
6348 | 6439 | private MenuItem resetCentroidXZItem; |
---|
6349 | 6440 | private MenuItem resetTransformItem; |
---|
6350 | 6441 | private MenuItem transformGeometryItem; |
---|
6351 | 6442 | private MenuItem transformChildrenItem; |
---|
6352 | 6443 | private MenuItem hideItem; |
---|
6353 | | - private MenuItem grabItem; |
---|
| 6444 | + private JMenuItem grabItem; |
---|
6354 | 6445 | private MenuItem backItem; |
---|
6355 | 6446 | private MenuItem frontItem; |
---|
6356 | 6447 | private MenuItem cameraItem; |
---|