.. | .. |
---|
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 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
36 | 36 | { |
---|
37 | 37 | @Override |
---|
.. | .. |
---|
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 | { |
---|
.. | .. |
---|
73 | 73 | cGridBag row5 = new cGridBag(); |
---|
74 | 74 | cGridBag row6 = new cGridBag(); |
---|
75 | 75 | |
---|
76 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
77 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
78 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
79 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
330 | 330 | |
---|
331 | 331 | public void ChangeSkybox(String skybox) |
---|
332 | 332 | { |
---|
333 | | - //cameraView.envyoff = false; |
---|
334 | | - group.skyboxname = skybox; |
---|
335 | | - group.skyboxext = "jpg"; |
---|
336 | | - cameraView.repaint(); |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
337 | 346 | } |
---|
338 | 347 | |
---|
339 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
340 | 349 | { |
---|
341 | | - JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
342 | 351 | |
---|
343 | 352 | AddSkyboxTab0(skyboxpane); |
---|
344 | 353 | AddSkyboxTab1(skyboxpane); |
---|
.. | .. |
---|
406 | 415 | this.copy = this.group = group; |
---|
407 | 416 | //selectees = this.group.selectees; |
---|
408 | 417 | |
---|
409 | | - if (copy.versionlist == null) |
---|
410 | | - { |
---|
411 | | - copy.versionlist = new Object3D[100]; |
---|
412 | | - copy.versionindex = -1; |
---|
413 | | - |
---|
414 | | - Save(true); |
---|
415 | | - } |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
| 420 | +// if (copy.versionlist == null) |
---|
| 421 | +// { |
---|
| 422 | +// copy.versionlist = new Object3D[100]; |
---|
| 423 | +// copy.versionindex = -1; |
---|
| 424 | +// |
---|
| 425 | +// //Save(true); |
---|
| 426 | +// } |
---|
416 | 427 | |
---|
417 | 428 | if(ui) |
---|
418 | 429 | SetupUI(objEditor); |
---|
.. | .. |
---|
435 | 446 | |
---|
436 | 447 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
437 | 448 | |
---|
438 | | - if (copy.versionlist == null) |
---|
439 | | - { |
---|
440 | | - copy.versionlist = new Object3D[100]; |
---|
441 | | - copy.versionindex = -1; |
---|
442 | | - |
---|
443 | | - Save(true); |
---|
444 | | - } |
---|
| 449 | +// if (copy.versionlist == null) |
---|
| 450 | +// { |
---|
| 451 | +// copy.versionlist = new Object3D[100]; |
---|
| 452 | +// copy.versionindex = -1; |
---|
| 453 | +// |
---|
| 454 | +// //Save(true); |
---|
| 455 | +// } |
---|
445 | 456 | } |
---|
446 | 457 | |
---|
447 | 458 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
531 | 542 | // menu.add("-"); |
---|
532 | 543 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
533 | 544 | duplicateItem.addActionListener(this); |
---|
534 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 545 | + |
---|
| 546 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
535 | 547 | cloneItem.addActionListener(this); |
---|
536 | | - if (Globals.ADVANCED) |
---|
| 548 | + //if (Globals.ADVANCED) |
---|
537 | 549 | { |
---|
538 | 550 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
539 | 551 | cloneSupportItem.addActionListener(this); |
---|
540 | 552 | } |
---|
| 553 | + oe.jTree.popup.addSeparator(); |
---|
541 | 554 | menu.add("-"); |
---|
542 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 555 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
543 | 556 | cutItem.addActionListener(this); |
---|
544 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 557 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
545 | 558 | copyItem.addActionListener(this); |
---|
546 | 559 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
547 | 560 | pasteItem.addActionListener(this); |
---|
548 | 561 | |
---|
549 | | - menu.add("-"); |
---|
550 | | - 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")); |
---|
551 | 565 | pasteIntoItem.addActionListener(this); |
---|
552 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 566 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
553 | 567 | pasteLinkItem.addActionListener(this); |
---|
554 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 568 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
555 | 569 | pasteCloneItem.addActionListener(this); |
---|
556 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 570 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
557 | 571 | // pasteExpandItem.addActionListener(this); |
---|
558 | | - menu.add("-"); |
---|
559 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
560 | | - deleteItem.addActionListener(this); |
---|
| 572 | + //menu.add("-"); |
---|
| 573 | + oe.jTree.popup.addSeparator(); |
---|
561 | 574 | |
---|
562 | 575 | if (Globals.ADVANCED) |
---|
563 | 576 | { |
---|
.. | .. |
---|
692 | 705 | setMasterItem.addActionListener(this); |
---|
693 | 706 | } |
---|
694 | 707 | |
---|
695 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
696 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
697 | | -// grabItem.addActionListener(this); |
---|
| 708 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 709 | + |
---|
698 | 710 | backItem = menu.add(new MenuItem("Back")); |
---|
699 | 711 | backItem.addActionListener(this); |
---|
700 | 712 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
702 | 714 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
703 | 715 | // compositeItem.addActionListener(this); |
---|
704 | 716 | |
---|
| 717 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 718 | + grabItem.addActionListener(this); |
---|
| 719 | + |
---|
705 | 720 | if (Globals.ADVANCED) |
---|
706 | 721 | { |
---|
707 | 722 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
708 | 723 | hideItem.addActionListener(this); |
---|
709 | 724 | } |
---|
710 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 725 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
711 | 726 | ungroupItem.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.jTree.popup.addSeparator(); |
---|
| 729 | + |
---|
| 730 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 731 | + deleteItem.addActionListener(this); |
---|
712 | 732 | |
---|
713 | 733 | // menu.add("-"); |
---|
714 | 734 | // |
---|
.. | .. |
---|
745 | 765 | shadowYItem.addActionListener(this); |
---|
746 | 766 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
747 | 767 | shadowZItem.addActionListener(this); |
---|
748 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
749 | | - attributeItem.addActionListener(this); |
---|
750 | 768 | |
---|
751 | 769 | if (Globals.ADVANCED) |
---|
752 | 770 | { |
---|
| 771 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 772 | + attributeItem.addActionListener(this); |
---|
753 | 773 | menu.add("-"); |
---|
754 | 774 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
755 | 775 | linkerItem.addActionListener(this); |
---|
.. | .. |
---|
759 | 779 | pointflowItem.addActionListener(this); |
---|
760 | 780 | } |
---|
761 | 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("-"); |
---|
762 | 789 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
763 | 790 | resetTransformItem.addActionListener(this); |
---|
764 | 791 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
765 | 792 | resetCentroidItem.addActionListener(this); |
---|
766 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 793 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
767 | 794 | resetCentroidXZItem.addActionListener(this); |
---|
768 | 795 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
769 | 796 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
815 | 842 | } |
---|
816 | 843 | |
---|
817 | 844 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 845 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 846 | + clearVersionsItem.addActionListener(this); |
---|
818 | 847 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
819 | 848 | clearMaterialsItem.addActionListener(this); |
---|
820 | 849 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
837 | 866 | hideleavesItem.addActionListener(this); |
---|
838 | 867 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
839 | 868 | showleavesItem.addActionListener(this); |
---|
840 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 869 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
841 | 870 | markleavesItem.addActionListener(this); |
---|
842 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 871 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
843 | 872 | unmarkleavesItem.addActionListener(this); |
---|
844 | 873 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
845 | 874 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
914 | 943 | |
---|
915 | 944 | JTabbedPane resourcecontainer; |
---|
916 | 945 | cGridBag currenttab; |
---|
917 | | - boolean added; // patch for jar |
---|
| 946 | + //boolean added; // patch for jar |
---|
918 | 947 | |
---|
| 948 | + int totalcount = 0; |
---|
| 949 | + |
---|
919 | 950 | int tabcount = 0; |
---|
920 | 951 | int colcount = 0; |
---|
921 | 952 | int rowcount = 0; |
---|
.. | .. |
---|
931 | 962 | // System.out.println(); |
---|
932 | 963 | |
---|
933 | 964 | if (//rowcount == 0 || |
---|
934 | | - path.length == 1) |
---|
| 965 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
935 | 966 | { |
---|
936 | 967 | currenttab = new cGridBag(); |
---|
937 | | - added = false; |
---|
938 | 968 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
939 | 969 | currenttab.setName(tabname); |
---|
| 970 | + //added = false; |
---|
| 971 | + resourcecontainer.add(currenttab); |
---|
| 972 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
940 | 973 | rowcount = 1; |
---|
941 | 974 | colcount = 0; |
---|
942 | 975 | texturecount = 0; |
---|
943 | 976 | } |
---|
944 | 977 | |
---|
945 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 978 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
946 | 979 | { |
---|
947 | | - if (!added) |
---|
| 980 | + //if (!added) |
---|
948 | 981 | { |
---|
949 | | - added = true; |
---|
950 | | - resourcecontainer.add(currenttab); |
---|
| 982 | + //added = true; |
---|
951 | 983 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
952 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 984 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
953 | 985 | } |
---|
954 | 986 | |
---|
955 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 987 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 988 | + totalcount++; |
---|
956 | 989 | |
---|
957 | 990 | if (++colcount >= columns) |
---|
958 | 991 | { |
---|
.. | .. |
---|
978 | 1011 | container.add(resourcecontainer); |
---|
979 | 1012 | |
---|
980 | 1013 | Grafreed.ParseResources("textures", this); |
---|
| 1014 | + |
---|
| 1015 | + // 935. System.out.println("Total = " + totalcount); |
---|
981 | 1016 | } |
---|
982 | 1017 | |
---|
983 | 1018 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1017 | 1052 | oe.radioPanel.add(dummyButton); |
---|
1018 | 1053 | oe.buttonGroup.add(dummyButton); |
---|
1019 | 1054 | */ |
---|
1020 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1055 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1021 | 1056 | |
---|
1022 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1057 | + versionManagerPanel.preferredHeight = 4; |
---|
1023 | 1058 | |
---|
1024 | 1059 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1025 | 1060 | |
---|
.. | .. |
---|
1034 | 1069 | // maxButton.addActionListener(this); |
---|
1035 | 1070 | } |
---|
1036 | 1071 | |
---|
1037 | | -// cButton gcButton; |
---|
1038 | | -// |
---|
| 1072 | + cButton gcButton; |
---|
| 1073 | + |
---|
1039 | 1074 | // oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1040 | 1075 | // gcButton.setToolTipText("Garbage collect"); |
---|
1041 | 1076 | // gcButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
1046 | 1081 | // } |
---|
1047 | 1082 | // }); |
---|
1048 | 1083 | |
---|
1049 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1050 | 1085 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1051 | 1086 | collapseButton.addActionListener(this); |
---|
1052 | 1087 | |
---|
1053 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1054 | 1089 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1055 | 1090 | maximize3DButton.addActionListener(this); |
---|
1056 | 1091 | |
---|
1057 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1058 | 1093 | twoButton.setToolTipText("Show 3D view only"); |
---|
1059 | 1094 | twoButton.addActionListener(this); |
---|
1060 | 1095 | this.fullscreenLayout = twoButton; |
---|
1061 | 1096 | |
---|
1062 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1097 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1063 | 1098 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1064 | 1099 | threeButton.addActionListener(this); |
---|
1065 | 1100 | if (Globals.ADVANCED) |
---|
1066 | 1101 | { |
---|
1067 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1102 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1103 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1069 | 1104 | sixButton.addActionListener(this); |
---|
1070 | 1105 | } |
---|
.. | .. |
---|
1073 | 1108 | // sevenButton.addActionListener(this); |
---|
1074 | 1109 | // |
---|
1075 | 1110 | |
---|
1076 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1111 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1077 | 1112 | fullButton.setToolTipText("Full-screen window"); |
---|
1078 | 1113 | fullButton.addActionListener(this); |
---|
1079 | 1114 | |
---|
1080 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1115 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1081 | 1116 | screenfitButton.setToolTipText("Screen fit"); |
---|
1082 | 1117 | screenfitButton.addActionListener(this); |
---|
1083 | 1118 | |
---|
1084 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1119 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1085 | 1120 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1086 | 1121 | restoreCameraButton.addActionListener(this); |
---|
1087 | 1122 | |
---|
1088 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1124 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1090 | 1125 | saveVersionButton.addActionListener(this); |
---|
1091 | 1126 | |
---|
1092 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1127 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1093 | 1128 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1094 | 1129 | deleteVersionButton.addActionListener(this); |
---|
| 1130 | + deleteVersionButton.setEnabled(false); |
---|
1095 | 1131 | |
---|
1096 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1132 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1097 | 1133 | previousVersionButton.setToolTipText("Previous version"); |
---|
1098 | 1134 | previousVersionButton.addActionListener(this); |
---|
1099 | 1135 | previousVersionButton.setEnabled(false); |
---|
1100 | 1136 | |
---|
1101 | 1137 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1102 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1138 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1103 | 1139 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1104 | 1140 | restoreButton.addActionListener(this); |
---|
1105 | | - //restoreButton.setEnabled(false); |
---|
| 1141 | + restoreButton.setEnabled(false); |
---|
1106 | 1142 | |
---|
1107 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1143 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1144 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1109 | 1145 | replaceButton.addActionListener(this); |
---|
1110 | | - //replaceButton.setEnabled(false); |
---|
| 1146 | + replaceButton.setEnabled(false); |
---|
1111 | 1147 | |
---|
1112 | | - copyOptionsPanel.add(updown); |
---|
| 1148 | + versionManagerPanel.add(updown); |
---|
1113 | 1149 | |
---|
1114 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1150 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1115 | 1151 | nextVersionButton.setToolTipText("Next version"); |
---|
1116 | 1152 | nextVersionButton.addActionListener(this); |
---|
1117 | 1153 | nextVersionButton.setEnabled(false); |
---|
1118 | 1154 | |
---|
1119 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1155 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1120 | 1156 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1121 | 1157 | oneStepButton.addActionListener(this); |
---|
1122 | 1158 | |
---|
.. | .. |
---|
1139 | 1175 | |
---|
1140 | 1176 | if (Globals.ADVANCED) |
---|
1141 | 1177 | { |
---|
1142 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1178 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1143 | 1179 | snapobjectButton.addActionListener(this); |
---|
1144 | 1180 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1145 | 1181 | |
---|
1146 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1182 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1147 | 1183 | fourButton.addActionListener(this); |
---|
1148 | 1184 | fourButton.setToolTipText("Show control panel only"); |
---|
1149 | 1185 | } |
---|
.. | .. |
---|
1151 | 1187 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1152 | 1188 | |
---|
1153 | 1189 | |
---|
1154 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1190 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1155 | 1191 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1156 | 1192 | rootButton.addActionListener(this); |
---|
1157 | 1193 | |
---|
1158 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1159 | 1195 | closeButton.setToolTipText("Close tab"); |
---|
1160 | 1196 | closeButton.addActionListener(this); |
---|
1161 | 1197 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1164 | 1200 | cGridBag row1 = new cGridBag(); |
---|
1165 | 1201 | |
---|
1166 | 1202 | // INSERT |
---|
1167 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1203 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1168 | 1204 | gridButton.setToolTipText("Create ground"); |
---|
1169 | 1205 | gridButton.addActionListener(this); |
---|
1170 | 1206 | |
---|
1171 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1207 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1172 | 1208 | boxButton.setToolTipText("Create box"); |
---|
1173 | 1209 | boxButton.addActionListener(this); |
---|
1174 | 1210 | |
---|
1175 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1176 | | - sphereButton.setToolTipText("Create sphere"); |
---|
1177 | | - sphereButton.addActionListener(this); |
---|
1178 | | - |
---|
1179 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1180 | | - coneButton.setToolTipText("Create cone"); |
---|
1181 | | - coneButton.addActionListener(this); |
---|
1182 | | - |
---|
1183 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1184 | | - torusButton.setToolTipText("Create torus"); |
---|
1185 | | - torusButton.addActionListener(this); |
---|
1186 | | - |
---|
1187 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1211 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1188 | 1212 | superButton.setToolTipText("Create superellipsoid"); |
---|
1189 | 1213 | superButton.addActionListener(this); |
---|
1190 | 1214 | |
---|
1191 | | - if (Globals.ADVANCED) |
---|
| 1215 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1216 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1217 | + sphereButton.addActionListener(this); |
---|
| 1218 | + |
---|
| 1219 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + coneButton.setToolTipText("Create cone"); |
---|
| 1221 | + coneButton.addActionListener(this); |
---|
| 1222 | + |
---|
| 1223 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + torusButton.setToolTipText("Create torus"); |
---|
| 1225 | + torusButton.addActionListener(this); |
---|
| 1226 | + |
---|
| 1227 | + if (false) //Globals.ADVANCED) |
---|
1192 | 1228 | { |
---|
1193 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1229 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1194 | 1230 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1195 | 1231 | kleinButton.addActionListener(this); |
---|
1196 | 1232 | } |
---|
1197 | 1233 | |
---|
1198 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1234 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1199 | 1235 | particlesButton.setToolTipText("Create particle system"); |
---|
1200 | 1236 | particlesButton.addActionListener(this); |
---|
1201 | 1237 | |
---|
.. | .. |
---|
1203 | 1239 | |
---|
1204 | 1240 | cGridBag row2 = new cGridBag(); |
---|
1205 | 1241 | |
---|
1206 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1242 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1207 | 1243 | groupButton.setToolTipText("Create group"); |
---|
1208 | 1244 | groupButton.addActionListener(this); |
---|
1209 | 1245 | |
---|
1210 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1246 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1211 | 1247 | compositeButton.setToolTipText("Create composite"); |
---|
1212 | 1248 | compositeButton.addActionListener(this); |
---|
1213 | 1249 | |
---|
1214 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1250 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1215 | 1251 | switchButton.setToolTipText("Create item switcher"); |
---|
1216 | 1252 | switchButton.addActionListener(this); |
---|
1217 | 1253 | |
---|
1218 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1254 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1219 | 1255 | loopButton.setToolTipText("Create loop"); |
---|
1220 | 1256 | loopButton.addActionListener(this); |
---|
1221 | 1257 | |
---|
1222 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1258 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1223 | 1259 | textureButton.setToolTipText("Create texture"); |
---|
1224 | 1260 | textureButton.addActionListener(this); |
---|
1225 | 1261 | |
---|
1226 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1262 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1227 | 1263 | overlayButton.setToolTipText("Create overlay"); |
---|
1228 | 1264 | overlayButton.addActionListener(this); |
---|
1229 | 1265 | |
---|
1230 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1266 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1231 | 1267 | lightButton.setToolTipText("Create light"); |
---|
1232 | 1268 | lightButton.addActionListener(this); |
---|
1233 | 1269 | |
---|
.. | .. |
---|
1237 | 1273 | |
---|
1238 | 1274 | CreateTexturePanel(textures); |
---|
1239 | 1275 | |
---|
| 1276 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1277 | + |
---|
| 1278 | + if (tabCount > 0) |
---|
| 1279 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1280 | + |
---|
1240 | 1281 | oe.toolboxPanel.add(textures); |
---|
1241 | 1282 | |
---|
1242 | 1283 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1244 | 1285 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1245 | 1286 | |
---|
1246 | 1287 | // EDIT panel |
---|
1247 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1288 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1248 | 1289 | editButton.setToolTipText("Pin selection controls"); |
---|
1249 | 1290 | editButton.addActionListener(this); |
---|
1250 | 1291 | |
---|
1251 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1292 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1252 | 1293 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1253 | 1294 | uneditButton.addActionListener(this); |
---|
1254 | 1295 | |
---|
.. | .. |
---|
1256 | 1297 | allParamsButton.setToolTipText("Show all controls"); |
---|
1257 | 1298 | allParamsButton.addActionListener(this); |
---|
1258 | 1299 | |
---|
1259 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1300 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1260 | 1301 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1261 | 1302 | clearPanelButton.addActionListener(this); |
---|
1262 | 1303 | |
---|
.. | .. |
---|
1264 | 1305 | //unselectButton.setToolTipText("Unselect"); |
---|
1265 | 1306 | //unselectButton.addActionListener(this); |
---|
1266 | 1307 | |
---|
1267 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1308 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1268 | 1309 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1269 | 1310 | flashSelectionButton.addActionListener(this); |
---|
1270 | 1311 | |
---|
.. | .. |
---|
1287 | 1328 | |
---|
1288 | 1329 | cGridBag jSPPanel = new cGridBag(); |
---|
1289 | 1330 | |
---|
| 1331 | + jSPPanel.preferredHeight = 20; |
---|
| 1332 | + |
---|
1290 | 1333 | JScrollPane jSP; |
---|
1291 | 1334 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1292 | 1335 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1295 | 1338 | oe.treePanel.add(jSPPanel); |
---|
1296 | 1339 | oe.treePanel.Return(); |
---|
1297 | 1340 | |
---|
1298 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1341 | + oe.treePanel.add(versionManagerPanel); |
---|
1299 | 1342 | oe.treePanel.Return(); |
---|
1300 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1301 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1302 | | - sliderPane.preferredHeight = 1; |
---|
| 1343 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1344 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1345 | + versionSliderPane.preferredHeight = 3; |
---|
1303 | 1346 | |
---|
1304 | 1347 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1305 | 1348 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1457 | 1500 | |
---|
1458 | 1501 | void EditObject(Object3D obj) |
---|
1459 | 1502 | { |
---|
1460 | | - assert(obj instanceof Composite); |
---|
| 1503 | + //assert(obj instanceof Composite); |
---|
1461 | 1504 | |
---|
1462 | | - if (obj.versionlist == null) |
---|
1463 | | - { |
---|
1464 | | - obj.versionlist = new Object3D[100]; |
---|
1465 | | - obj.versionindex = -1; |
---|
1466 | | - } |
---|
| 1505 | +// if (obj.versionlist == null) |
---|
| 1506 | +// { |
---|
| 1507 | +// obj.versionlist = new Object3D[100]; |
---|
| 1508 | +// obj.versionindex = -1; |
---|
| 1509 | +// } |
---|
1467 | 1510 | |
---|
1468 | 1511 | cRadio radioButton = new cRadio(obj.name); |
---|
1469 | 1512 | |
---|
.. | .. |
---|
1489 | 1532 | |
---|
1490 | 1533 | oe.SetupViews(); |
---|
1491 | 1534 | |
---|
| 1535 | + if (Globals.DEBUG) |
---|
1492 | 1536 | System.out.println("SetupViews"); |
---|
1493 | 1537 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1494 | 1538 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2092 | 2136 | switch(axis) |
---|
2093 | 2137 | { |
---|
2094 | 2138 | case 0 : |
---|
2095 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2096 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
2097 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2098 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2139 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2140 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2141 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2142 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
2099 | 2143 | norm = cVector.X; |
---|
2100 | 2144 | break; |
---|
2101 | 2145 | case 1 : |
---|
2102 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2103 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2104 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2105 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2146 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2147 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2148 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2149 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
2106 | 2150 | norm = cVector.Y; |
---|
2107 | 2151 | break; |
---|
2108 | 2152 | case 2 : |
---|
2109 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2110 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2111 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
2112 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2153 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2154 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2155 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2156 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
2113 | 2157 | norm = cVector.Z; |
---|
2114 | 2158 | break; |
---|
2115 | 2159 | } |
---|
.. | .. |
---|
2150 | 2194 | shadow.material = new cMaterial(obj.material); |
---|
2151 | 2195 | shadow.material.diffuse = 0.0001f; |
---|
2152 | 2196 | shadow.material.specular = 0.0001f; |
---|
2153 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2197 | + shadow.material.opacity = 0.75f; |
---|
| 2198 | + |
---|
| 2199 | + AllocProjectedVertices(shadow); |
---|
| 2200 | + |
---|
| 2201 | + shadow.projectedVertices[1].x = 300; |
---|
2154 | 2202 | |
---|
2155 | 2203 | makeSomething(shadow); |
---|
2156 | 2204 | } |
---|
.. | .. |
---|
2671 | 2719 | } else |
---|
2672 | 2720 | if (source == loopItem || source == loopButton) |
---|
2673 | 2721 | { |
---|
| 2722 | + if (!group.selection.isEmpty()) |
---|
| 2723 | + { |
---|
2674 | 2724 | Composite csg = new GroupLeaf(); |
---|
2675 | 2725 | csg.count = 5; |
---|
2676 | | - group(csg); |
---|
2677 | 2726 | Composite child = new cGroup("Branch"); |
---|
2678 | 2727 | csg.addChild(child); |
---|
2679 | 2728 | child.addChild(csg); |
---|
| 2729 | + group(csg); |
---|
| 2730 | + } |
---|
2680 | 2731 | } else |
---|
2681 | 2732 | if (source == doubleItem) |
---|
2682 | 2733 | { |
---|
| 2734 | + if (!group.selection.isEmpty()) |
---|
| 2735 | + { |
---|
2683 | 2736 | Composite csg = new GroupLeaf("Fork"); |
---|
2684 | 2737 | csg.count = 5; |
---|
2685 | | - group(csg); |
---|
2686 | 2738 | Composite child = new cGroup("Branch A"); |
---|
2687 | 2739 | csg.addChild(child); |
---|
2688 | 2740 | child.addChild(csg); |
---|
2689 | 2741 | child = new cGroup("Branch B"); |
---|
2690 | 2742 | csg.addChild(child); |
---|
2691 | 2743 | child.addChild(csg); |
---|
| 2744 | + group(csg); |
---|
| 2745 | + } |
---|
2692 | 2746 | } else |
---|
2693 | 2747 | if (source == tripleItem) |
---|
2694 | 2748 | { |
---|
| 2749 | + if (!group.selection.isEmpty()) |
---|
| 2750 | + { |
---|
2695 | 2751 | Composite csg = new GroupLeaf("Trident"); |
---|
2696 | 2752 | csg.count = 4; |
---|
2697 | 2753 | group(csg); |
---|
.. | .. |
---|
2704 | 2760 | child = new cGroup(); |
---|
2705 | 2761 | csg.addChild(child); |
---|
2706 | 2762 | child.addChild(csg); |
---|
| 2763 | + } |
---|
2707 | 2764 | } else |
---|
2708 | 2765 | if (source == computeAOItem) |
---|
2709 | 2766 | { |
---|
.. | .. |
---|
3339 | 3396 | } else |
---|
3340 | 3397 | if (source == ungroupItem || source == ungroupButton) |
---|
3341 | 3398 | { |
---|
3342 | | - boolean hasRoot = false; |
---|
| 3399 | + boolean canUngroup = true; |
---|
3343 | 3400 | |
---|
3344 | 3401 | for (int i=0; i<group.selection.size(); i++) |
---|
3345 | 3402 | { |
---|
3346 | | - if (group.selection.get(i) == group) |
---|
| 3403 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3404 | + |
---|
| 3405 | + if (selectedItem.Size() == 0) |
---|
3347 | 3406 | { |
---|
3348 | | - hasRoot = true; |
---|
| 3407 | + // Cannot ungroup leaves |
---|
| 3408 | + canUngroup = false; |
---|
| 3409 | + break; |
---|
| 3410 | + } |
---|
| 3411 | + |
---|
| 3412 | + if (selectedItem == group) |
---|
| 3413 | + { |
---|
| 3414 | + // Cannot ungroup root |
---|
| 3415 | + canUngroup = false; |
---|
3349 | 3416 | break; |
---|
3350 | 3417 | } |
---|
3351 | 3418 | } |
---|
3352 | 3419 | |
---|
3353 | | - if (!hasRoot) |
---|
| 3420 | + if (canUngroup) |
---|
3354 | 3421 | { |
---|
3355 | 3422 | for (int i=0; i<group.selection.size(); i++) |
---|
3356 | 3423 | { |
---|
3357 | | - Ungroup(group.selection.get(i)); |
---|
| 3424 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3425 | + |
---|
| 3426 | + Ungroup(selectedItem); |
---|
3358 | 3427 | } |
---|
3359 | 3428 | |
---|
3360 | 3429 | ClearSelection(false); |
---|
.. | .. |
---|
3405 | 3474 | if (source == clearMaterialsItem) |
---|
3406 | 3475 | { |
---|
3407 | 3476 | ClearMaterials(); |
---|
| 3477 | + } else |
---|
| 3478 | + if (source == clearVersionsItem) |
---|
| 3479 | + { |
---|
| 3480 | + ClearVersions(); |
---|
3408 | 3481 | } else |
---|
3409 | 3482 | if (source == liveleavesItem) |
---|
3410 | 3483 | { |
---|
.. | .. |
---|
3545 | 3618 | if (source == transformChildrenItem) |
---|
3546 | 3619 | { |
---|
3547 | 3620 | TransformChildren(); |
---|
| 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); |
---|
3548 | 3633 | } else |
---|
3549 | 3634 | if (source == resetTransformItem) |
---|
3550 | 3635 | { |
---|
.. | .. |
---|
3918 | 4003 | if (source == closeButton) |
---|
3919 | 4004 | { |
---|
3920 | 4005 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 4006 | + if (copy.versionlist != null) |
---|
| 4007 | + Replace(); |
---|
| 4008 | + |
---|
3921 | 4009 | cRadio ab; |
---|
3922 | 4010 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3923 | 4011 | { |
---|
.. | .. |
---|
4016 | 4104 | } else |
---|
4017 | 4105 | if(source instanceof cRadio) |
---|
4018 | 4106 | { |
---|
| 4107 | + if (copy.versionlist != null) |
---|
| 4108 | + Replace(); |
---|
| 4109 | + |
---|
4019 | 4110 | group.parent = keepparent; |
---|
4020 | 4111 | group.attributes = 0; |
---|
4021 | 4112 | //group.editWindow = null; |
---|
.. | .. |
---|
4067 | 4158 | */ |
---|
4068 | 4159 | radio.layout.doClick(); |
---|
4069 | 4160 | |
---|
4070 | | - SetUndoStates(); |
---|
| 4161 | + //assert(copy instanceof Composite); |
---|
| 4162 | + |
---|
| 4163 | + if (copy.versionlist == null) |
---|
| 4164 | + { |
---|
| 4165 | + copy.versionindex = -1; |
---|
| 4166 | + |
---|
| 4167 | + // Cannot work with loops |
---|
| 4168 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4169 | + // and check if any of these nodes are reachable below the root. |
---|
| 4170 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4171 | + |
---|
| 4172 | + if (copy instanceof Composite && copy.versionlist == null && !copy.HasTags()) |
---|
| 4173 | + { |
---|
| 4174 | + copy.versionlist = new Object3D[100]; |
---|
| 4175 | + |
---|
| 4176 | + //Save(true); |
---|
| 4177 | + } |
---|
| 4178 | + else |
---|
| 4179 | + copy.versionindex = -2; |
---|
| 4180 | + |
---|
| 4181 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4182 | + } |
---|
| 4183 | + |
---|
| 4184 | + SetVersionStates(); |
---|
4071 | 4185 | |
---|
4072 | 4186 | ClearUnpinned(); |
---|
4073 | 4187 | |
---|
.. | .. |
---|
4182 | 4296 | refreshContents(); |
---|
4183 | 4297 | } |
---|
4184 | 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 | + |
---|
4185 | 4311 | void ResetTransform() |
---|
4186 | 4312 | { |
---|
4187 | 4313 | ResetTransform(-1); |
---|
.. | .. |
---|
4197 | 4323 | if (obj.toParent == null) |
---|
4198 | 4324 | continue; |
---|
4199 | 4325 | |
---|
4200 | | - if (mask == -1) |
---|
4201 | | - { |
---|
4202 | | - if (obj instanceof Camera) // jan 2014 |
---|
4203 | | - { |
---|
4204 | | - LA.matIdentity(obj.toParent); |
---|
4205 | | - LA.matIdentity(obj.fromParent); |
---|
4206 | | - } |
---|
4207 | | - else |
---|
4208 | | - { |
---|
4209 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4210 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4211 | | - } |
---|
4212 | | - TouchTransform(obj); |
---|
4213 | | - continue; |
---|
4214 | | - } |
---|
4215 | | - if ((mask&2) != 0) // Scale |
---|
4216 | | - { |
---|
4217 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4218 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4219 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4220 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4221 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4222 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4223 | | - } |
---|
4224 | | - if ((mask&4) != 0) // Rotation |
---|
4225 | | - { |
---|
4226 | | - // ? |
---|
4227 | | - } |
---|
4228 | | - if ((mask&1) != 0) // Translation |
---|
4229 | | - { |
---|
4230 | | - if (obj.toParent != null) |
---|
4231 | | - { |
---|
4232 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4233 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4234 | | - } |
---|
4235 | | - } |
---|
| 4326 | + obj.ResetTransform(mask); |
---|
| 4327 | + |
---|
4236 | 4328 | if (obj.parent == null) |
---|
4237 | 4329 | { |
---|
4238 | 4330 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4741 | 4833 | { |
---|
4742 | 4834 | Object3D obj = group.selection.get(i); |
---|
4743 | 4835 | |
---|
| 4836 | + if (obj.toParent == null) |
---|
| 4837 | + { |
---|
| 4838 | + obj.toParent = LA.newMatrix(); |
---|
| 4839 | + obj.fromParent = LA.newMatrix(); |
---|
| 4840 | + } |
---|
| 4841 | + |
---|
4744 | 4842 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4745 | 4843 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4746 | 4844 | } |
---|
.. | .. |
---|
5032 | 5130 | refreshContents(); |
---|
5033 | 5131 | } |
---|
5034 | 5132 | |
---|
| 5133 | + void ClearVersions() |
---|
| 5134 | + { |
---|
| 5135 | + group.selection.ClearVersions(); |
---|
| 5136 | + refreshContents(); |
---|
| 5137 | + } |
---|
| 5138 | + |
---|
5035 | 5139 | void FlipV(boolean flip) |
---|
5036 | 5140 | { |
---|
5037 | 5141 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5306 | 5410 | |
---|
5307 | 5411 | boolean allComposites = true; |
---|
5308 | 5412 | |
---|
| 5413 | + if (group.selection != null) |
---|
5309 | 5414 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5310 | 5415 | { |
---|
5311 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5416 | + Object next = e.nextElement(); |
---|
| 5417 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5312 | 5418 | { |
---|
5313 | 5419 | allComposites = false; |
---|
5314 | 5420 | break; |
---|
5315 | 5421 | } |
---|
5316 | 5422 | } |
---|
5317 | 5423 | |
---|
5318 | | - rootButton.setEnabled(allComposites); |
---|
| 5424 | + rootButton.setEnabled(true); // allComposites); |
---|
5319 | 5425 | } |
---|
5320 | 5426 | |
---|
5321 | 5427 | void refreshContents(boolean cp) |
---|
5322 | 5428 | { |
---|
| 5429 | + if (Globals.ADVANCED) |
---|
5323 | 5430 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5324 | 5431 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5325 | 5432 | { |
---|
.. | .. |
---|
6213 | 6320 | private MenuItem lookAtItem; |
---|
6214 | 6321 | private MenuItem lookFromItem; |
---|
6215 | 6322 | private MenuItem switchViewItem; |
---|
6216 | | - private MenuItem cutItem; |
---|
| 6323 | + private JMenuItem cutItem; |
---|
6217 | 6324 | private MenuItem undoItem; |
---|
6218 | 6325 | private MenuItem redoItem; |
---|
6219 | 6326 | private JMenuItem duplicateItem; |
---|
6220 | | - private MenuItem cloneItem; |
---|
| 6327 | + private JMenuItem cloneItem; |
---|
6221 | 6328 | private MenuItem cloneSupportItem; |
---|
6222 | 6329 | private MenuItem overwriteGeoItem; |
---|
6223 | 6330 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6238 | 6345 | private MenuItem cloneGeometriesItem; |
---|
6239 | 6346 | private MenuItem shareGeometriesItem; |
---|
6240 | 6347 | private MenuItem mergeGeometriesItem; |
---|
6241 | | - private MenuItem copyItem; |
---|
| 6348 | + private JMenuItem copyItem; |
---|
6242 | 6349 | private MenuItem pasteItem; |
---|
6243 | | - private MenuItem pasteIntoItem; |
---|
6244 | | - private MenuItem pasteLinkItem; |
---|
6245 | | - private MenuItem pasteCloneItem; |
---|
6246 | | - private MenuItem pasteExpandItem; |
---|
6247 | | - private MenuItem deleteItem; |
---|
| 6350 | + private JMenuItem pasteIntoItem; |
---|
| 6351 | + private JMenuItem pasteLinkItem; |
---|
| 6352 | + private JMenuItem pasteCloneItem; |
---|
| 6353 | + private JMenuItem pasteExpandItem; |
---|
| 6354 | + private JMenuItem deleteItem; |
---|
6248 | 6355 | private MenuItem clearAllItem; |
---|
6249 | 6356 | private MenuItem genUVItem; |
---|
6250 | 6357 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6270 | 6377 | private MenuItem clipMeshItem; |
---|
6271 | 6378 | private MenuItem smoothMeshItem; |
---|
6272 | 6379 | private MenuItem clearMaterialsItem; |
---|
| 6380 | + private MenuItem clearVersionsItem; |
---|
6273 | 6381 | |
---|
6274 | 6382 | private MenuItem liveleavesItem; |
---|
6275 | 6383 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6293 | 6401 | private MenuItem maxTexturesItem; |
---|
6294 | 6402 | private MenuItem panoTexturesItem; |
---|
6295 | 6403 | |
---|
| 6404 | + private MenuItem textureRatioRItem; |
---|
| 6405 | + private MenuItem textureRatioGItem; |
---|
| 6406 | + private MenuItem textureRatioBItem; |
---|
6296 | 6407 | private MenuItem resetCentroidItem; |
---|
6297 | 6408 | private MenuItem resetCentroidXZItem; |
---|
6298 | 6409 | private MenuItem resetTransformItem; |
---|
6299 | 6410 | private MenuItem transformGeometryItem; |
---|
6300 | 6411 | private MenuItem transformChildrenItem; |
---|
6301 | 6412 | private MenuItem hideItem; |
---|
6302 | | - private MenuItem grabItem; |
---|
| 6413 | + private JMenuItem grabItem; |
---|
6303 | 6414 | private MenuItem backItem; |
---|
6304 | 6415 | private MenuItem frontItem; |
---|
6305 | 6416 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6312 | 6423 | private MenuItem switchTransfoItem; |
---|
6313 | 6424 | private MenuItem morphItem; |
---|
6314 | 6425 | private MenuItem linkerItem; |
---|
6315 | | - private MenuItem ungroupItem; |
---|
| 6426 | + private JMenuItem ungroupItem; |
---|
6316 | 6427 | private MenuItem editItem; |
---|
6317 | 6428 | private MenuItem openWindowItem; |
---|
6318 | 6429 | private MenuItem editLeafItem; |
---|