.. | .. |
---|
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); |
---|
.. | .. |
---|
357 | 366 | } |
---|
358 | 367 | |
---|
359 | 368 | refreshContents(); |
---|
360 | | - } |
---|
361 | | - |
---|
362 | | - public void Show3DView() |
---|
363 | | - { |
---|
364 | | - // bug |
---|
365 | | - //gridPanel.setDividerLocation(1.0); |
---|
366 | | - //bigPanel.setDividerLocation(0.0); |
---|
367 | | - bigThree.ClearUI(); |
---|
368 | | - bigThree.add(centralPanel); |
---|
369 | | - bigThree.FlushUI(); |
---|
370 | 369 | } |
---|
371 | 370 | |
---|
372 | 371 | //ObjEditor objEditor; |
---|
.. | .. |
---|
406 | 405 | this.copy = this.group = group; |
---|
407 | 406 | //selectees = this.group.selectees; |
---|
408 | 407 | |
---|
409 | | - if (copy.versionlist == null) |
---|
410 | | - { |
---|
411 | | - copy.versionlist = new Object3D[100]; |
---|
412 | | - copy.versionindex = -1; |
---|
413 | | - |
---|
414 | | - Save(true); |
---|
415 | | - } |
---|
| 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 | +// } |
---|
416 | 417 | |
---|
417 | 418 | if(ui) |
---|
418 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
435 | 436 | |
---|
436 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
437 | 438 | |
---|
438 | | - if (copy.versionlist == null) |
---|
439 | | - { |
---|
440 | | - copy.versionlist = new Object3D[100]; |
---|
441 | | - copy.versionindex = -1; |
---|
442 | | - |
---|
443 | | - Save(true); |
---|
444 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
445 | 446 | } |
---|
446 | 447 | |
---|
447 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
531 | 532 | // menu.add("-"); |
---|
532 | 533 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
533 | 534 | duplicateItem.addActionListener(this); |
---|
534 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 535 | + |
---|
| 536 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
535 | 537 | cloneItem.addActionListener(this); |
---|
536 | | - if (Globals.ADVANCED) |
---|
| 538 | + //if (Globals.ADVANCED) |
---|
537 | 539 | { |
---|
538 | 540 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
539 | 541 | cloneSupportItem.addActionListener(this); |
---|
540 | 542 | } |
---|
| 543 | + oe.jTree.popup.addSeparator(); |
---|
541 | 544 | menu.add("-"); |
---|
542 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 545 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
543 | 546 | cutItem.addActionListener(this); |
---|
544 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 547 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
545 | 548 | copyItem.addActionListener(this); |
---|
546 | 549 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
547 | 550 | pasteItem.addActionListener(this); |
---|
548 | 551 | |
---|
549 | | - menu.add("-"); |
---|
550 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 552 | + oe.jTree.popup.addSeparator(); |
---|
| 553 | + //menu.add("-"); |
---|
| 554 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
551 | 555 | pasteIntoItem.addActionListener(this); |
---|
552 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 556 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
553 | 557 | pasteLinkItem.addActionListener(this); |
---|
554 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 558 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
555 | 559 | pasteCloneItem.addActionListener(this); |
---|
556 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 560 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
557 | 561 | // pasteExpandItem.addActionListener(this); |
---|
558 | | - menu.add("-"); |
---|
559 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
560 | | - deleteItem.addActionListener(this); |
---|
| 562 | + //menu.add("-"); |
---|
| 563 | + oe.jTree.popup.addSeparator(); |
---|
561 | 564 | |
---|
562 | 565 | if (Globals.ADVANCED) |
---|
563 | 566 | { |
---|
.. | .. |
---|
692 | 695 | setMasterItem.addActionListener(this); |
---|
693 | 696 | } |
---|
694 | 697 | |
---|
695 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
696 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
697 | | -// grabItem.addActionListener(this); |
---|
| 698 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 699 | + |
---|
698 | 700 | backItem = menu.add(new MenuItem("Back")); |
---|
699 | 701 | backItem.addActionListener(this); |
---|
700 | 702 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
702 | 704 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
703 | 705 | // compositeItem.addActionListener(this); |
---|
704 | 706 | |
---|
| 707 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 708 | + grabItem.addActionListener(this); |
---|
| 709 | + |
---|
705 | 710 | if (Globals.ADVANCED) |
---|
706 | 711 | { |
---|
707 | 712 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
708 | 713 | hideItem.addActionListener(this); |
---|
709 | 714 | } |
---|
710 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 715 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
711 | 716 | ungroupItem.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.jTree.popup.addSeparator(); |
---|
| 719 | + |
---|
| 720 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 721 | + deleteItem.addActionListener(this); |
---|
712 | 722 | |
---|
713 | 723 | // menu.add("-"); |
---|
714 | 724 | // |
---|
.. | .. |
---|
745 | 755 | shadowYItem.addActionListener(this); |
---|
746 | 756 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
747 | 757 | shadowZItem.addActionListener(this); |
---|
| 758 | + |
---|
748 | 759 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
749 | 760 | attributeItem.addActionListener(this); |
---|
750 | | - |
---|
751 | 761 | if (Globals.ADVANCED) |
---|
752 | 762 | { |
---|
753 | 763 | menu.add("-"); |
---|
.. | .. |
---|
759 | 769 | pointflowItem.addActionListener(this); |
---|
760 | 770 | } |
---|
761 | 771 | menu.add("-"); |
---|
| 772 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 773 | + textureRatioRItem.addActionListener(this); |
---|
| 774 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 775 | + textureRatioGItem.addActionListener(this); |
---|
| 776 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 777 | + textureRatioBItem.addActionListener(this); |
---|
| 778 | + menu.add("-"); |
---|
762 | 779 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
763 | 780 | resetTransformItem.addActionListener(this); |
---|
764 | 781 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
765 | 782 | resetCentroidItem.addActionListener(this); |
---|
766 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 783 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
767 | 784 | resetCentroidXZItem.addActionListener(this); |
---|
768 | 785 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
769 | 786 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
815 | 832 | } |
---|
816 | 833 | |
---|
817 | 834 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 835 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 836 | + clearVersionsItem.addActionListener(this); |
---|
818 | 837 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
819 | 838 | clearMaterialsItem.addActionListener(this); |
---|
820 | 839 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
837 | 856 | hideleavesItem.addActionListener(this); |
---|
838 | 857 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
839 | 858 | showleavesItem.addActionListener(this); |
---|
840 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 859 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
841 | 860 | markleavesItem.addActionListener(this); |
---|
842 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 861 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
843 | 862 | unmarkleavesItem.addActionListener(this); |
---|
844 | 863 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
845 | 864 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
914 | 933 | |
---|
915 | 934 | JTabbedPane resourcecontainer; |
---|
916 | 935 | cGridBag currenttab; |
---|
917 | | - boolean added; // patch for jar |
---|
| 936 | + //boolean added; // patch for jar |
---|
918 | 937 | |
---|
| 938 | + int totalcount = 0; |
---|
| 939 | + |
---|
919 | 940 | int tabcount = 0; |
---|
920 | 941 | int colcount = 0; |
---|
921 | 942 | int rowcount = 0; |
---|
.. | .. |
---|
931 | 952 | // System.out.println(); |
---|
932 | 953 | |
---|
933 | 954 | if (//rowcount == 0 || |
---|
934 | | - path.length == 1) |
---|
| 955 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
935 | 956 | { |
---|
936 | 957 | currenttab = new cGridBag(); |
---|
937 | | - added = false; |
---|
938 | 958 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
939 | 959 | currenttab.setName(tabname); |
---|
| 960 | + //added = false; |
---|
| 961 | + resourcecontainer.add(currenttab); |
---|
| 962 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
940 | 963 | rowcount = 1; |
---|
941 | 964 | colcount = 0; |
---|
942 | 965 | texturecount = 0; |
---|
943 | 966 | } |
---|
944 | 967 | |
---|
945 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 968 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
946 | 969 | { |
---|
947 | | - if (!added) |
---|
| 970 | + //if (!added) |
---|
948 | 971 | { |
---|
949 | | - added = true; |
---|
950 | | - resourcecontainer.add(currenttab); |
---|
| 972 | + //added = true; |
---|
951 | 973 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
952 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 974 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
953 | 975 | } |
---|
954 | 976 | |
---|
955 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 977 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 978 | + totalcount++; |
---|
956 | 979 | |
---|
957 | 980 | if (++colcount >= columns) |
---|
958 | 981 | { |
---|
.. | .. |
---|
978 | 1001 | container.add(resourcecontainer); |
---|
979 | 1002 | |
---|
980 | 1003 | Grafreed.ParseResources("textures", this); |
---|
| 1004 | + |
---|
| 1005 | + // 935. System.out.println("Total = " + totalcount); |
---|
981 | 1006 | } |
---|
982 | 1007 | |
---|
983 | 1008 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1017 | 1042 | oe.radioPanel.add(dummyButton); |
---|
1018 | 1043 | oe.buttonGroup.add(dummyButton); |
---|
1019 | 1044 | */ |
---|
1020 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1045 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1021 | 1046 | |
---|
1022 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1047 | + versionManagerPanel.preferredHeight = 4; |
---|
1023 | 1048 | |
---|
1024 | 1049 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1025 | 1050 | |
---|
.. | .. |
---|
1034 | 1059 | // maxButton.addActionListener(this); |
---|
1035 | 1060 | } |
---|
1036 | 1061 | |
---|
1037 | | -// cButton gcButton; |
---|
1038 | | -// |
---|
| 1062 | + cButton gcButton; |
---|
| 1063 | + |
---|
1039 | 1064 | // oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1040 | 1065 | // gcButton.setToolTipText("Garbage collect"); |
---|
1041 | 1066 | // gcButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
1046 | 1071 | // } |
---|
1047 | 1072 | // }); |
---|
1048 | 1073 | |
---|
1049 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1074 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1076 | + fullScreenButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1050 | 1079 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1051 | 1080 | collapseButton.addActionListener(this); |
---|
1052 | 1081 | |
---|
1053 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1054 | | - maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1055 | | - maximize3DButton.addActionListener(this); |
---|
| 1082 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1084 | +// maximize3DButton.addActionListener(this); |
---|
1056 | 1085 | |
---|
1057 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1086 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1058 | 1087 | twoButton.setToolTipText("Show 3D view only"); |
---|
1059 | 1088 | twoButton.addActionListener(this); |
---|
1060 | 1089 | this.fullscreenLayout = twoButton; |
---|
1061 | 1090 | |
---|
1062 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1091 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1063 | 1092 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1064 | 1093 | threeButton.addActionListener(this); |
---|
1065 | 1094 | if (Globals.ADVANCED) |
---|
1066 | 1095 | { |
---|
1067 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1096 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1097 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1069 | 1098 | sixButton.addActionListener(this); |
---|
1070 | 1099 | } |
---|
.. | .. |
---|
1073 | 1102 | // sevenButton.addActionListener(this); |
---|
1074 | 1103 | // |
---|
1075 | 1104 | |
---|
1076 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1077 | | - fullButton.setToolTipText("Full-screen window"); |
---|
1078 | | - fullButton.addActionListener(this); |
---|
1079 | | - |
---|
1080 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1105 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1081 | 1106 | screenfitButton.setToolTipText("Screen fit"); |
---|
1082 | 1107 | screenfitButton.addActionListener(this); |
---|
1083 | 1108 | |
---|
1084 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1085 | 1110 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1086 | 1111 | restoreCameraButton.addActionListener(this); |
---|
1087 | 1112 | |
---|
1088 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1114 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1090 | 1115 | saveVersionButton.addActionListener(this); |
---|
1091 | 1116 | |
---|
1092 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1093 | 1118 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1094 | 1119 | deleteVersionButton.addActionListener(this); |
---|
| 1120 | + deleteVersionButton.setEnabled(false); |
---|
1095 | 1121 | |
---|
1096 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1122 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1097 | 1123 | previousVersionButton.setToolTipText("Previous version"); |
---|
1098 | 1124 | previousVersionButton.addActionListener(this); |
---|
1099 | 1125 | previousVersionButton.setEnabled(false); |
---|
1100 | 1126 | |
---|
1101 | 1127 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1102 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1103 | 1129 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1104 | 1130 | restoreButton.addActionListener(this); |
---|
1105 | | - //restoreButton.setEnabled(false); |
---|
| 1131 | + restoreButton.setEnabled(false); |
---|
1106 | 1132 | |
---|
1107 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1133 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1134 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1109 | 1135 | replaceButton.addActionListener(this); |
---|
1110 | | - //replaceButton.setEnabled(false); |
---|
| 1136 | + replaceButton.setEnabled(false); |
---|
1111 | 1137 | |
---|
1112 | | - copyOptionsPanel.add(updown); |
---|
| 1138 | + versionManagerPanel.add(updown); |
---|
1113 | 1139 | |
---|
1114 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1115 | 1141 | nextVersionButton.setToolTipText("Next version"); |
---|
1116 | 1142 | nextVersionButton.addActionListener(this); |
---|
1117 | 1143 | nextVersionButton.setEnabled(false); |
---|
1118 | 1144 | |
---|
1119 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1145 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1120 | 1146 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1121 | 1147 | oneStepButton.addActionListener(this); |
---|
1122 | 1148 | |
---|
.. | .. |
---|
1139 | 1165 | |
---|
1140 | 1166 | if (Globals.ADVANCED) |
---|
1141 | 1167 | { |
---|
1142 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1143 | 1169 | snapobjectButton.addActionListener(this); |
---|
1144 | 1170 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1145 | 1171 | |
---|
1146 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1172 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1147 | 1173 | fourButton.addActionListener(this); |
---|
1148 | 1174 | fourButton.setToolTipText("Show control panel only"); |
---|
1149 | 1175 | } |
---|
.. | .. |
---|
1151 | 1177 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1152 | 1178 | |
---|
1153 | 1179 | |
---|
1154 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1155 | 1181 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1156 | 1182 | rootButton.addActionListener(this); |
---|
1157 | 1183 | |
---|
1158 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1159 | 1185 | closeButton.setToolTipText("Close tab"); |
---|
1160 | 1186 | closeButton.addActionListener(this); |
---|
1161 | 1187 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1164 | 1190 | cGridBag row1 = new cGridBag(); |
---|
1165 | 1191 | |
---|
1166 | 1192 | // INSERT |
---|
1167 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1193 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1168 | 1194 | gridButton.setToolTipText("Create ground"); |
---|
1169 | 1195 | gridButton.addActionListener(this); |
---|
1170 | 1196 | |
---|
1171 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1197 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1172 | 1198 | boxButton.setToolTipText("Create box"); |
---|
1173 | 1199 | boxButton.addActionListener(this); |
---|
1174 | 1200 | |
---|
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); |
---|
| 1201 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1188 | 1202 | superButton.setToolTipText("Create superellipsoid"); |
---|
1189 | 1203 | superButton.addActionListener(this); |
---|
1190 | 1204 | |
---|
1191 | | - if (Globals.ADVANCED) |
---|
| 1205 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1207 | + sphereButton.addActionListener(this); |
---|
| 1208 | + |
---|
| 1209 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + coneButton.setToolTipText("Create cone"); |
---|
| 1211 | + coneButton.addActionListener(this); |
---|
| 1212 | + |
---|
| 1213 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + torusButton.setToolTipText("Create torus"); |
---|
| 1215 | + torusButton.addActionListener(this); |
---|
| 1216 | + |
---|
| 1217 | + if (false) //Globals.ADVANCED) |
---|
1192 | 1218 | { |
---|
1193 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1194 | 1220 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1195 | 1221 | kleinButton.addActionListener(this); |
---|
1196 | 1222 | } |
---|
1197 | 1223 | |
---|
1198 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1199 | 1225 | particlesButton.setToolTipText("Create particle system"); |
---|
1200 | 1226 | particlesButton.addActionListener(this); |
---|
1201 | 1227 | |
---|
.. | .. |
---|
1203 | 1229 | |
---|
1204 | 1230 | cGridBag row2 = new cGridBag(); |
---|
1205 | 1231 | |
---|
1206 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1207 | 1233 | groupButton.setToolTipText("Create group"); |
---|
1208 | 1234 | groupButton.addActionListener(this); |
---|
1209 | 1235 | |
---|
1210 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1211 | 1237 | compositeButton.setToolTipText("Create composite"); |
---|
1212 | 1238 | compositeButton.addActionListener(this); |
---|
1213 | 1239 | |
---|
1214 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1215 | 1241 | switchButton.setToolTipText("Create item switcher"); |
---|
1216 | 1242 | switchButton.addActionListener(this); |
---|
1217 | 1243 | |
---|
1218 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1219 | 1245 | loopButton.setToolTipText("Create loop"); |
---|
1220 | 1246 | loopButton.addActionListener(this); |
---|
1221 | 1247 | |
---|
1222 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1223 | 1249 | textureButton.setToolTipText("Create texture"); |
---|
1224 | 1250 | textureButton.addActionListener(this); |
---|
1225 | 1251 | |
---|
1226 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1227 | 1253 | overlayButton.setToolTipText("Create overlay"); |
---|
1228 | 1254 | overlayButton.addActionListener(this); |
---|
1229 | 1255 | |
---|
1230 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1256 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1231 | 1257 | lightButton.setToolTipText("Create light"); |
---|
1232 | 1258 | lightButton.addActionListener(this); |
---|
1233 | 1259 | |
---|
.. | .. |
---|
1237 | 1263 | |
---|
1238 | 1264 | CreateTexturePanel(textures); |
---|
1239 | 1265 | |
---|
| 1266 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1267 | + |
---|
| 1268 | + if (tabCount > 0) |
---|
| 1269 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1270 | + |
---|
1240 | 1271 | oe.toolboxPanel.add(textures); |
---|
1241 | 1272 | |
---|
1242 | 1273 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1244 | 1275 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1245 | 1276 | |
---|
1246 | 1277 | // EDIT panel |
---|
1247 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1278 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1248 | 1279 | editButton.setToolTipText("Pin selection controls"); |
---|
1249 | 1280 | editButton.addActionListener(this); |
---|
1250 | 1281 | |
---|
1251 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1282 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1252 | 1283 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1253 | 1284 | uneditButton.addActionListener(this); |
---|
1254 | 1285 | |
---|
.. | .. |
---|
1256 | 1287 | allParamsButton.setToolTipText("Show all controls"); |
---|
1257 | 1288 | allParamsButton.addActionListener(this); |
---|
1258 | 1289 | |
---|
1259 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1290 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1260 | 1291 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1261 | 1292 | clearPanelButton.addActionListener(this); |
---|
1262 | 1293 | |
---|
.. | .. |
---|
1264 | 1295 | //unselectButton.setToolTipText("Unselect"); |
---|
1265 | 1296 | //unselectButton.addActionListener(this); |
---|
1266 | 1297 | |
---|
1267 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1298 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1268 | 1299 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1269 | 1300 | flashSelectionButton.addActionListener(this); |
---|
1270 | 1301 | |
---|
.. | .. |
---|
1287 | 1318 | |
---|
1288 | 1319 | cGridBag jSPPanel = new cGridBag(); |
---|
1289 | 1320 | |
---|
| 1321 | + jSPPanel.preferredHeight = 20; |
---|
| 1322 | + |
---|
1290 | 1323 | JScrollPane jSP; |
---|
1291 | 1324 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1292 | 1325 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1295 | 1328 | oe.treePanel.add(jSPPanel); |
---|
1296 | 1329 | oe.treePanel.Return(); |
---|
1297 | 1330 | |
---|
1298 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1331 | + oe.treePanel.add(versionManagerPanel); |
---|
1299 | 1332 | oe.treePanel.Return(); |
---|
1300 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1301 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1302 | | - sliderPane.preferredHeight = 1; |
---|
| 1333 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1334 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1335 | + versionSliderPane.preferredHeight = 3; |
---|
1303 | 1336 | |
---|
1304 | 1337 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1305 | 1338 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1457 | 1490 | |
---|
1458 | 1491 | void EditObject(Object3D obj) |
---|
1459 | 1492 | { |
---|
1460 | | - assert(obj instanceof Composite); |
---|
| 1493 | + //assert(obj instanceof Composite); |
---|
1461 | 1494 | |
---|
1462 | | - if (obj.versionlist == null) |
---|
1463 | | - { |
---|
1464 | | - obj.versionlist = new Object3D[100]; |
---|
1465 | | - obj.versionindex = -1; |
---|
1466 | | - } |
---|
| 1495 | +// if (obj.versionlist == null) |
---|
| 1496 | +// { |
---|
| 1497 | +// obj.versionlist = new Object3D[100]; |
---|
| 1498 | +// obj.versionindex = -1; |
---|
| 1499 | +// } |
---|
1467 | 1500 | |
---|
1468 | 1501 | cRadio radioButton = new cRadio(obj.name); |
---|
1469 | 1502 | |
---|
.. | .. |
---|
1489 | 1522 | |
---|
1490 | 1523 | oe.SetupViews(); |
---|
1491 | 1524 | |
---|
| 1525 | + if (Globals.DEBUG) |
---|
1492 | 1526 | System.out.println("SetupViews"); |
---|
1493 | 1527 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1494 | 1528 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2092 | 2126 | switch(axis) |
---|
2093 | 2127 | { |
---|
2094 | 2128 | 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; |
---|
| 2129 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2130 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2131 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2132 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
2099 | 2133 | norm = cVector.X; |
---|
2100 | 2134 | break; |
---|
2101 | 2135 | 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; |
---|
| 2136 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2137 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2138 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2139 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
2106 | 2140 | norm = cVector.Y; |
---|
2107 | 2141 | break; |
---|
2108 | 2142 | 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; |
---|
| 2143 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2144 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2145 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2146 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
2113 | 2147 | norm = cVector.Z; |
---|
2114 | 2148 | break; |
---|
2115 | 2149 | } |
---|
.. | .. |
---|
2150 | 2184 | shadow.material = new cMaterial(obj.material); |
---|
2151 | 2185 | shadow.material.diffuse = 0.0001f; |
---|
2152 | 2186 | shadow.material.specular = 0.0001f; |
---|
2153 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2187 | + shadow.material.opacity = 0.75f; |
---|
| 2188 | + |
---|
| 2189 | + AllocProjectedVertices(shadow); |
---|
| 2190 | + |
---|
| 2191 | + shadow.projectedVertices[1].x = 300; |
---|
2154 | 2192 | |
---|
2155 | 2193 | makeSomething(shadow); |
---|
2156 | 2194 | } |
---|
.. | .. |
---|
2671 | 2709 | } else |
---|
2672 | 2710 | if (source == loopItem || source == loopButton) |
---|
2673 | 2711 | { |
---|
| 2712 | + if (!group.selection.isEmpty()) |
---|
| 2713 | + { |
---|
2674 | 2714 | Composite csg = new GroupLeaf(); |
---|
2675 | | - csg.count = 5; |
---|
2676 | 2715 | group(csg); |
---|
| 2716 | + csg.count = 5; |
---|
2677 | 2717 | Composite child = new cGroup("Branch"); |
---|
2678 | 2718 | csg.addChild(child); |
---|
2679 | 2719 | child.addChild(csg); |
---|
| 2720 | + } |
---|
2680 | 2721 | } else |
---|
2681 | 2722 | if (source == doubleItem) |
---|
2682 | 2723 | { |
---|
| 2724 | + if (!group.selection.isEmpty()) |
---|
| 2725 | + { |
---|
2683 | 2726 | Composite csg = new GroupLeaf("Fork"); |
---|
2684 | | - csg.count = 5; |
---|
2685 | 2727 | group(csg); |
---|
| 2728 | + csg.count = 5; |
---|
2686 | 2729 | Composite child = new cGroup("Branch A"); |
---|
2687 | 2730 | csg.addChild(child); |
---|
2688 | 2731 | child.addChild(csg); |
---|
2689 | 2732 | child = new cGroup("Branch B"); |
---|
2690 | 2733 | csg.addChild(child); |
---|
2691 | 2734 | child.addChild(csg); |
---|
| 2735 | + } |
---|
2692 | 2736 | } else |
---|
2693 | 2737 | if (source == tripleItem) |
---|
2694 | 2738 | { |
---|
| 2739 | + if (!group.selection.isEmpty()) |
---|
| 2740 | + { |
---|
2695 | 2741 | Composite csg = new GroupLeaf("Trident"); |
---|
2696 | 2742 | csg.count = 4; |
---|
2697 | 2743 | group(csg); |
---|
.. | .. |
---|
2704 | 2750 | child = new cGroup(); |
---|
2705 | 2751 | csg.addChild(child); |
---|
2706 | 2752 | child.addChild(csg); |
---|
| 2753 | + } |
---|
2707 | 2754 | } else |
---|
2708 | 2755 | if (source == computeAOItem) |
---|
2709 | 2756 | { |
---|
.. | .. |
---|
2750 | 2797 | { |
---|
2751 | 2798 | Maximize(); |
---|
2752 | 2799 | } else |
---|
2753 | | - if (source == fullButton) |
---|
| 2800 | + if (source == fullScreenButton) |
---|
2754 | 2801 | { |
---|
2755 | 2802 | ToggleFullScreen(); |
---|
2756 | 2803 | } else |
---|
.. | .. |
---|
2759 | 2806 | this.expandedLayout = radio.layout; |
---|
2760 | 2807 | CollapseToolbar(); |
---|
2761 | 2808 | } else |
---|
2762 | | - if (source == maximize3DButton) |
---|
2763 | | - { |
---|
2764 | | - this.expandedLayout = radio.layout; |
---|
2765 | | - radio.layout = twoButton; |
---|
2766 | | - Show3DView(); |
---|
2767 | | - CollapseToolbar(); |
---|
2768 | | - } else |
---|
| 2809 | +// if (source == maximize3DButton) |
---|
| 2810 | +// { |
---|
| 2811 | +// this.expandedLayout = radio.layout; |
---|
| 2812 | +// radio.layout = twoButton; |
---|
| 2813 | +// CollapseToolbar(); |
---|
| 2814 | +// Show3DView(); |
---|
| 2815 | +// } else |
---|
2769 | 2816 | if (source == previousVersionButton) |
---|
2770 | 2817 | { |
---|
2771 | 2818 | // Go to previous version |
---|
.. | .. |
---|
3339 | 3386 | } else |
---|
3340 | 3387 | if (source == ungroupItem || source == ungroupButton) |
---|
3341 | 3388 | { |
---|
3342 | | - boolean hasRoot = false; |
---|
| 3389 | + boolean canUngroup = true; |
---|
3343 | 3390 | |
---|
3344 | 3391 | for (int i=0; i<group.selection.size(); i++) |
---|
3345 | 3392 | { |
---|
3346 | | - if (group.selection.get(i) == group) |
---|
| 3393 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3394 | + |
---|
| 3395 | + if (selectedItem.Size() == 0) |
---|
3347 | 3396 | { |
---|
3348 | | - hasRoot = true; |
---|
| 3397 | + // Cannot ungroup leaves |
---|
| 3398 | + canUngroup = false; |
---|
| 3399 | + break; |
---|
| 3400 | + } |
---|
| 3401 | + |
---|
| 3402 | + if (selectedItem == group) |
---|
| 3403 | + { |
---|
| 3404 | + // Cannot ungroup root |
---|
| 3405 | + canUngroup = false; |
---|
3349 | 3406 | break; |
---|
3350 | 3407 | } |
---|
3351 | 3408 | } |
---|
3352 | 3409 | |
---|
3353 | | - if (!hasRoot) |
---|
| 3410 | + if (canUngroup) |
---|
3354 | 3411 | { |
---|
3355 | 3412 | for (int i=0; i<group.selection.size(); i++) |
---|
3356 | 3413 | { |
---|
3357 | | - Ungroup(group.selection.get(i)); |
---|
| 3414 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3415 | + |
---|
| 3416 | + Ungroup(selectedItem); |
---|
3358 | 3417 | } |
---|
3359 | 3418 | |
---|
3360 | 3419 | ClearSelection(false); |
---|
.. | .. |
---|
3405 | 3464 | if (source == clearMaterialsItem) |
---|
3406 | 3465 | { |
---|
3407 | 3466 | ClearMaterials(); |
---|
| 3467 | + } else |
---|
| 3468 | + if (source == clearVersionsItem) |
---|
| 3469 | + { |
---|
| 3470 | + ClearVersions(); |
---|
3408 | 3471 | } else |
---|
3409 | 3472 | if (source == liveleavesItem) |
---|
3410 | 3473 | { |
---|
.. | .. |
---|
3545 | 3608 | if (source == transformChildrenItem) |
---|
3546 | 3609 | { |
---|
3547 | 3610 | TransformChildren(); |
---|
| 3611 | + } else |
---|
| 3612 | + if (source == textureRatioRItem) |
---|
| 3613 | + { |
---|
| 3614 | + TextureRatio(0); |
---|
| 3615 | + } else |
---|
| 3616 | + if (source == textureRatioGItem) |
---|
| 3617 | + { |
---|
| 3618 | + TextureRatio(1); |
---|
| 3619 | + } else |
---|
| 3620 | + if (source == textureRatioBItem) |
---|
| 3621 | + { |
---|
| 3622 | + TextureRatio(2); |
---|
3548 | 3623 | } else |
---|
3549 | 3624 | if (source == resetTransformItem) |
---|
3550 | 3625 | { |
---|
.. | .. |
---|
3918 | 3993 | if (source == closeButton) |
---|
3919 | 3994 | { |
---|
3920 | 3995 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3996 | + if (copy.versionlist != null) |
---|
| 3997 | + Replace(); |
---|
| 3998 | + |
---|
3921 | 3999 | cRadio ab; |
---|
3922 | 4000 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3923 | 4001 | { |
---|
.. | .. |
---|
4016 | 4094 | } else |
---|
4017 | 4095 | if(source instanceof cRadio) |
---|
4018 | 4096 | { |
---|
| 4097 | + if (copy.versionlist != null) |
---|
| 4098 | + Replace(); |
---|
| 4099 | + |
---|
4019 | 4100 | group.parent = keepparent; |
---|
4020 | 4101 | group.attributes = 0; |
---|
4021 | 4102 | //group.editWindow = null; |
---|
.. | .. |
---|
4067 | 4148 | */ |
---|
4068 | 4149 | radio.layout.doClick(); |
---|
4069 | 4150 | |
---|
4070 | | - SetUndoStates(); |
---|
| 4151 | + //assert(copy instanceof Composite); |
---|
| 4152 | + |
---|
| 4153 | + if (copy.versionlist == null) |
---|
| 4154 | + { |
---|
| 4155 | + copy.versionindex = -1; |
---|
| 4156 | + |
---|
| 4157 | + // Cannot work with loops |
---|
| 4158 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4159 | + // and check if any of these nodes are reachable below the root. |
---|
| 4160 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4161 | + |
---|
| 4162 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4163 | + { |
---|
| 4164 | + if (copy.versionlist == null) |
---|
| 4165 | + copy.versionlist = new Object3D[100]; |
---|
| 4166 | + |
---|
| 4167 | + //Save(true); |
---|
| 4168 | + } |
---|
| 4169 | + else |
---|
| 4170 | + copy.versionindex = -2; |
---|
| 4171 | + |
---|
| 4172 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4173 | + } |
---|
| 4174 | + |
---|
| 4175 | + SetVersionStates(); |
---|
4071 | 4176 | |
---|
4072 | 4177 | ClearUnpinned(); |
---|
4073 | 4178 | |
---|
.. | .. |
---|
4182 | 4287 | refreshContents(); |
---|
4183 | 4288 | } |
---|
4184 | 4289 | |
---|
| 4290 | + void TextureRatio(int axis) |
---|
| 4291 | + { |
---|
| 4292 | + Object3D obj; |
---|
| 4293 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4294 | + { |
---|
| 4295 | + obj = (Object3D)e.nextElement(); |
---|
| 4296 | + obj.TextureRatio(axis); |
---|
| 4297 | + } |
---|
| 4298 | + |
---|
| 4299 | + refreshContents(); |
---|
| 4300 | + } |
---|
| 4301 | + |
---|
4185 | 4302 | void ResetTransform() |
---|
4186 | 4303 | { |
---|
4187 | 4304 | ResetTransform(-1); |
---|
.. | .. |
---|
4197 | 4314 | if (obj.toParent == null) |
---|
4198 | 4315 | continue; |
---|
4199 | 4316 | |
---|
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 | | - } |
---|
| 4317 | + obj.ResetTransform(mask); |
---|
| 4318 | + |
---|
4236 | 4319 | if (obj.parent == null) |
---|
4237 | 4320 | { |
---|
4238 | 4321 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4741 | 4824 | { |
---|
4742 | 4825 | Object3D obj = group.selection.get(i); |
---|
4743 | 4826 | |
---|
| 4827 | + if (obj.toParent == null) |
---|
| 4828 | + { |
---|
| 4829 | + obj.toParent = LA.newMatrix(); |
---|
| 4830 | + obj.fromParent = LA.newMatrix(); |
---|
| 4831 | + } |
---|
| 4832 | + |
---|
4744 | 4833 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4745 | 4834 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4746 | 4835 | } |
---|
.. | .. |
---|
5032 | 5121 | refreshContents(); |
---|
5033 | 5122 | } |
---|
5034 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
5035 | 5130 | void FlipV(boolean flip) |
---|
5036 | 5131 | { |
---|
5037 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5270 | 5365 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5271 | 5366 | // a camera |
---|
5272 | 5367 | { |
---|
5273 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5368 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5274 | 5369 | { |
---|
5275 | 5370 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5276 | 5371 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
5306 | 5401 | |
---|
5307 | 5402 | boolean allComposites = true; |
---|
5308 | 5403 | |
---|
| 5404 | + if (group.selection != null) |
---|
5309 | 5405 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5310 | 5406 | { |
---|
5311 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5407 | + Object next = e.nextElement(); |
---|
| 5408 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5312 | 5409 | { |
---|
5313 | 5410 | allComposites = false; |
---|
5314 | 5411 | break; |
---|
5315 | 5412 | } |
---|
5316 | 5413 | } |
---|
5317 | 5414 | |
---|
5318 | | - rootButton.setEnabled(allComposites); |
---|
| 5415 | + rootButton.setEnabled(true); // allComposites); |
---|
5319 | 5416 | } |
---|
5320 | 5417 | |
---|
5321 | 5418 | void refreshContents(boolean cp) |
---|
5322 | 5419 | { |
---|
| 5420 | + if (Globals.SHOWINFO) |
---|
5323 | 5421 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5324 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5325 | 5423 | { |
---|
.. | .. |
---|
6213 | 6311 | private MenuItem lookAtItem; |
---|
6214 | 6312 | private MenuItem lookFromItem; |
---|
6215 | 6313 | private MenuItem switchViewItem; |
---|
6216 | | - private MenuItem cutItem; |
---|
| 6314 | + private JMenuItem cutItem; |
---|
6217 | 6315 | private MenuItem undoItem; |
---|
6218 | 6316 | private MenuItem redoItem; |
---|
6219 | 6317 | private JMenuItem duplicateItem; |
---|
6220 | | - private MenuItem cloneItem; |
---|
| 6318 | + private JMenuItem cloneItem; |
---|
6221 | 6319 | private MenuItem cloneSupportItem; |
---|
6222 | 6320 | private MenuItem overwriteGeoItem; |
---|
6223 | 6321 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6238 | 6336 | private MenuItem cloneGeometriesItem; |
---|
6239 | 6337 | private MenuItem shareGeometriesItem; |
---|
6240 | 6338 | private MenuItem mergeGeometriesItem; |
---|
6241 | | - private MenuItem copyItem; |
---|
| 6339 | + private JMenuItem copyItem; |
---|
6242 | 6340 | private MenuItem pasteItem; |
---|
6243 | | - private MenuItem pasteIntoItem; |
---|
6244 | | - private MenuItem pasteLinkItem; |
---|
6245 | | - private MenuItem pasteCloneItem; |
---|
6246 | | - private MenuItem pasteExpandItem; |
---|
6247 | | - private MenuItem deleteItem; |
---|
| 6341 | + private JMenuItem pasteIntoItem; |
---|
| 6342 | + private JMenuItem pasteLinkItem; |
---|
| 6343 | + private JMenuItem pasteCloneItem; |
---|
| 6344 | + private JMenuItem pasteExpandItem; |
---|
| 6345 | + private JMenuItem deleteItem; |
---|
6248 | 6346 | private MenuItem clearAllItem; |
---|
6249 | 6347 | private MenuItem genUVItem; |
---|
6250 | 6348 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6270 | 6368 | private MenuItem clipMeshItem; |
---|
6271 | 6369 | private MenuItem smoothMeshItem; |
---|
6272 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
6273 | 6372 | |
---|
6274 | 6373 | private MenuItem liveleavesItem; |
---|
6275 | 6374 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6293 | 6392 | private MenuItem maxTexturesItem; |
---|
6294 | 6393 | private MenuItem panoTexturesItem; |
---|
6295 | 6394 | |
---|
| 6395 | + private MenuItem textureRatioRItem; |
---|
| 6396 | + private MenuItem textureRatioGItem; |
---|
| 6397 | + private MenuItem textureRatioBItem; |
---|
6296 | 6398 | private MenuItem resetCentroidItem; |
---|
6297 | 6399 | private MenuItem resetCentroidXZItem; |
---|
6298 | 6400 | private MenuItem resetTransformItem; |
---|
6299 | 6401 | private MenuItem transformGeometryItem; |
---|
6300 | 6402 | private MenuItem transformChildrenItem; |
---|
6301 | 6403 | private MenuItem hideItem; |
---|
6302 | | - private MenuItem grabItem; |
---|
| 6404 | + private JMenuItem grabItem; |
---|
6303 | 6405 | private MenuItem backItem; |
---|
6304 | 6406 | private MenuItem frontItem; |
---|
6305 | 6407 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6312 | 6414 | private MenuItem switchTransfoItem; |
---|
6313 | 6415 | private MenuItem morphItem; |
---|
6314 | 6416 | private MenuItem linkerItem; |
---|
6315 | | - private MenuItem ungroupItem; |
---|
| 6417 | + private JMenuItem ungroupItem; |
---|
6316 | 6418 | private MenuItem editItem; |
---|
6317 | 6419 | private MenuItem openWindowItem; |
---|
6318 | 6420 | private MenuItem editLeafItem; |
---|