.. | .. |
---|
219 | 219 | resetsupportItem.addActionListener(this); |
---|
220 | 220 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 221 | linkverticesItem.addActionListener(this); |
---|
| 222 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 223 | + relinkverticesItem.addActionListener(this); |
---|
222 | 224 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 225 | setMasterItem.addActionListener(this); |
---|
224 | 226 | |
---|
.. | .. |
---|
231 | 233 | frontItem.addActionListener(this); |
---|
232 | 234 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | 235 | compositeItem.addActionListener(this); |
---|
| 236 | + hideItem = menu.add(new MenuItem("Hide")); |
---|
| 237 | + hideItem.addActionListener(this); |
---|
| 238 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 239 | + ungroupItem.addActionListener(this); |
---|
234 | 240 | menu.add("-"); |
---|
235 | 241 | randomItem = menu.add(new MenuItem("Random")); |
---|
236 | 242 | randomItem.addActionListener(this); |
---|
.. | .. |
---|
252 | 258 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | 259 | textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | 260 | textureItem.addActionListener(this); |
---|
| 261 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 262 | + billboardItem.addActionListener(this); |
---|
255 | 263 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 264 | csgItem.addActionListener(this); |
---|
257 | 265 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
269 | 277 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 278 | pointflowItem.addActionListener(this); |
---|
271 | 279 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 280 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 281 | resetTransformItem.addActionListener(this); |
---|
276 | 282 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 283 | resetCentroidItem.addActionListener(this); |
---|
278 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
279 | | - ungroupItem.addActionListener(this); |
---|
| 284 | + transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 285 | + transformgeometryItem.addActionListener(this); |
---|
280 | 286 | |
---|
281 | 287 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 288 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 291 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 292 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 293 | genNormalsCADItem.addActionListener(this); |
---|
| 294 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 295 | + genNormalsMESHItem.addActionListener(this); |
---|
| 296 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 297 | + genNormalsMINEItem.addActionListener(this); |
---|
288 | 298 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 299 | stripifyItem.addActionListener(this); |
---|
290 | 300 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
427 | 437 | oe.aConstraints.gridwidth = 1; |
---|
428 | 438 | oe.aConstraints.gridx = 0; |
---|
429 | 439 | |
---|
430 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 440 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
| 441 | + liveCB.setToolTipText("Enabled animation"); |
---|
431 | 442 | liveCB.addItemListener(this); |
---|
432 | 443 | |
---|
433 | 444 | oe.aConstraints.gridx += 1; |
---|
| 445 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 446 | + fastCB.setToolTipText("Fast mode"); |
---|
| 447 | + fastCB.addItemListener(this); |
---|
| 448 | + oe.aConstraints.gridx += 1; |
---|
434 | 449 | oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
| 450 | + supportCB.setToolTipText("Enabled rigging"); |
---|
435 | 451 | supportCB.addItemListener(this); |
---|
436 | 452 | |
---|
437 | 453 | // oe.aConstraints.gridx += 1; |
---|
.. | .. |
---|
439 | 455 | // localCB.addItemListener(this); |
---|
440 | 456 | |
---|
441 | 457 | oe.aConstraints.gridx += 1; |
---|
442 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
| 458 | + oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints); |
---|
| 459 | + crowdCB.setToolTipText("Used for crowds"); |
---|
443 | 460 | crowdCB.addItemListener(this); |
---|
444 | 461 | |
---|
445 | 462 | oe.aConstraints.gridx += 1; |
---|
446 | 463 | oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
| 464 | + smoothCB.setToolTipText("Snapping delay"); |
---|
447 | 465 | smoothCB.addItemListener(this); |
---|
448 | 466 | |
---|
449 | 467 | oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
451 | | - fastCB.addItemListener(this); |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | 468 | oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
| 469 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
454 | 470 | slowCB.addItemListener(this); |
---|
455 | 471 | oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
| 472 | + oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints); |
---|
| 473 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
457 | 474 | boxCB.addItemListener(this); |
---|
| 475 | + oe.aConstraints.gridx += 1; |
---|
| 476 | + oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints); |
---|
| 477 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 478 | + zoomBoxCB.addItemListener(this); |
---|
458 | 479 | |
---|
459 | 480 | // oe.aConstraints.gridx += 1; |
---|
460 | 481 | // oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
.. | .. |
---|
481 | 502 | // debugCB.addItemListener(this); |
---|
482 | 503 | |
---|
483 | 504 | oe.aConstraints.gridx += 1; |
---|
484 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
| 505 | + oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints); |
---|
485 | 506 | oeilCB.addItemListener(this); |
---|
486 | 507 | |
---|
487 | 508 | oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
| 509 | + oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints); |
---|
| 510 | + lookAtCB.setToolTipText("Look-at target"); |
---|
489 | 511 | lookAtCB.addItemListener(this); |
---|
490 | 512 | |
---|
491 | 513 | oe.aConstraints.gridx += 1; |
---|
492 | 514 | oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 515 | + trackCB.setToolTipText("Enable tracking"); |
---|
493 | 516 | trackCB.addItemListener(this); |
---|
494 | 517 | |
---|
495 | 518 | oe.aConstraints.gridx += 1; |
---|
496 | 519 | oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 520 | + screenfitButton.setToolTipText("Screen fit"); |
---|
497 | 521 | screenfitButton.addActionListener(this); |
---|
498 | 522 | oe.aConstraints.gridx += 1; |
---|
499 | 523 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
.. | .. |
---|
501 | 525 | // oe.aConstraints.gridx += 1; |
---|
502 | 526 | oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
503 | 527 | snapobjectButton.addActionListener(this); |
---|
| 528 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
504 | 529 | oe.aConstraints.gridx += 1; |
---|
505 | 530 | |
---|
506 | 531 | //aConstraints.gridx = 0; |
---|
.. | .. |
---|
509 | 534 | oe.aConstraints.gridwidth = 1; |
---|
510 | 535 | |
---|
511 | 536 | oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 537 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | 538 | flashSelectionButton.addActionListener(this); |
---|
| 539 | + |
---|
| 540 | + oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 541 | + |
---|
513 | 542 | oe.aConstraints.gridx += 1; |
---|
514 | 543 | oe.aConstraints.weighty = 0; |
---|
515 | 544 | oe.aConstraints.gridwidth = 1; |
---|
516 | 545 | |
---|
517 | 546 | // |
---|
518 | 547 | oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 548 | + twoButton.setToolTipText("Show center view only"); |
---|
519 | 549 | twoButton.addActionListener(this); |
---|
520 | 550 | oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
521 | 551 | fourButton.addActionListener(this); |
---|
| 552 | + fourButton.setToolTipText("Show left panel only"); |
---|
522 | 553 | oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 554 | + sixButton.setToolTipText("2-column layout left"); |
---|
523 | 555 | sixButton.addActionListener(this); |
---|
524 | 556 | oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 557 | + threeButton.setToolTipText("2-column layout right"); |
---|
525 | 558 | threeButton.addActionListener(this); |
---|
526 | 559 | oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 560 | + sevenButton.setToolTipText("3-column layout"); |
---|
527 | 561 | sevenButton.addActionListener(this); |
---|
528 | 562 | // |
---|
529 | 563 | |
---|
530 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 564 | + oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
| 565 | + rootButton.setToolTipText("Edit object in new tab"); |
---|
531 | 566 | rootButton.addActionListener(this); |
---|
532 | 567 | oe.aConstraints.gridx += 1; |
---|
533 | 568 | oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 569 | + closeButton.setToolTipText("Close tab"); |
---|
534 | 570 | closeButton.addActionListener(this); |
---|
535 | 571 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
536 | 572 | //clearButton.addActionListener(this); |
---|
.. | .. |
---|
636 | 672 | |
---|
637 | 673 | void EditObject(Object3D obj) |
---|
638 | 674 | { |
---|
639 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
640 | | - dummyButton.SetObject(obj); |
---|
641 | | - dummyButton.layout = sevenButton; |
---|
642 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
643 | | - dummyButton.addActionListener(this); |
---|
644 | | - radioPanel.add(dummyButton); |
---|
645 | | - buttonGroup.add(dummyButton); |
---|
646 | | - dummyButton.doClick(); |
---|
| 675 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 676 | + radioButton.SetObject(obj); |
---|
| 677 | + radioButton.layout = sevenButton; |
---|
| 678 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 679 | + radioButton.addActionListener(this); |
---|
| 680 | + radioPanel.add(radioButton); |
---|
| 681 | + buttonGroup.add(radioButton); |
---|
| 682 | + radioButton.doClick(); |
---|
647 | 683 | } |
---|
648 | 684 | void SetupViews(ObjEditor oe) |
---|
649 | 685 | { |
---|
.. | .. |
---|
663 | 699 | JCheckBox fastCB; |
---|
664 | 700 | JCheckBox slowCB; |
---|
665 | 701 | JCheckBox boxCB; |
---|
| 702 | + JCheckBox zoomBoxCB; |
---|
666 | 703 | JCheckBox trackCB; |
---|
667 | 704 | JCheckBox smoothfocusCB; |
---|
668 | 705 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
705 | 742 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 743 | else |
---|
707 | 744 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 745 | + } else if(e.getSource() == liveCB) |
---|
710 | 746 | { |
---|
711 | 747 | cameraView.ToggleLive(); |
---|
712 | 748 | } |
---|
.. | .. |
---|
743 | 779 | Recompile(); |
---|
744 | 780 | cameraView.repaint(); |
---|
745 | 781 | // refreshContents(); |
---|
| 782 | + } |
---|
| 783 | + else if(e.getSource() == zoomBoxCB) |
---|
| 784 | + { |
---|
| 785 | + cameraView.ToggleZoomBoxMode(); |
---|
746 | 786 | } |
---|
747 | 787 | else if(e.getSource() == smoothfocusCB) |
---|
748 | 788 | { |
---|
.. | .. |
---|
1033 | 1073 | torusItem.addActionListener(this); |
---|
1034 | 1074 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | 1075 | superItem.addActionListener(this); |
---|
| 1076 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1077 | + kleinItem.addActionListener(this); |
---|
1036 | 1078 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | 1079 | particleItem.addActionListener(this); |
---|
1038 | 1080 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1106 | 1148 | resetParentItem.addActionListener(this); |
---|
1107 | 1149 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1150 | repairParentItem.addActionListener(this); |
---|
| 1151 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1152 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1153 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1154 | invariantsItem.addActionListener(this); |
---|
1111 | 1155 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1593 | 1637 | { |
---|
1594 | 1638 | makeSomething(new Superellipsoid()); |
---|
1595 | 1639 | } else |
---|
| 1640 | + if (event.getSource() == kleinItem) |
---|
| 1641 | + { |
---|
| 1642 | + makeSomething(new Klein()); |
---|
| 1643 | + } else |
---|
1596 | 1644 | if (event.getSource() == blobItem) |
---|
1597 | 1645 | { |
---|
1598 | 1646 | Blob blob = new Blob(); |
---|
.. | .. |
---|
1762 | 1810 | } else |
---|
1763 | 1811 | if (event.getSource() == computeAOItem) |
---|
1764 | 1812 | { |
---|
1765 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1766 | | - CameraPane.theRenderer.repaint(); |
---|
| 1813 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1814 | + Globals.theRenderer.repaint(); |
---|
1767 | 1815 | } else |
---|
1768 | 1816 | if (event.getSource() == recompileItem) |
---|
1769 | 1817 | { |
---|
.. | .. |
---|
1778 | 1826 | if (event.getSource() == invariantsItem) |
---|
1779 | 1827 | { |
---|
1780 | 1828 | System.out.println("Invariants:"); |
---|
1781 | | - GrafreeD.theApplet3D.universe.invariants(); |
---|
| 1829 | + GrafreeD.grafreeD.universe.invariants(); |
---|
1782 | 1830 | } else |
---|
1783 | 1831 | if (event.getSource() == memoryItem) |
---|
1784 | 1832 | { |
---|
.. | .. |
---|
2001 | 2049 | if (group.selection.size() == 1) |
---|
2002 | 2050 | one = true; |
---|
2003 | 2051 | |
---|
| 2052 | + Object3D merge = null; |
---|
| 2053 | + |
---|
2004 | 2054 | Object3D content = new cGroup(); |
---|
2005 | 2055 | |
---|
2006 | 2056 | for (int i=0; i<group.selection.size(); i++) |
---|
2007 | 2057 | { |
---|
2008 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2058 | + merge = new Merge(group.selection.get(i)); |
---|
2009 | 2059 | |
---|
2010 | 2060 | if (one) |
---|
2011 | | - makeSomething(sel, false); |
---|
| 2061 | + makeSomething(merge, false); |
---|
2012 | 2062 | else |
---|
2013 | | - content.addChild(sel); |
---|
| 2063 | + content.addChild(merge); |
---|
2014 | 2064 | } |
---|
2015 | 2065 | |
---|
2016 | 2066 | if (!one) |
---|
2017 | | - makeSomething(content, false); |
---|
2018 | | - |
---|
2019 | | - ResetModel(); |
---|
2020 | | - refreshContents(); |
---|
| 2067 | + makeSomething(content, true); |
---|
| 2068 | + else |
---|
| 2069 | + { |
---|
| 2070 | + ResetModel(); |
---|
| 2071 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2072 | + refreshContents(); |
---|
| 2073 | + } |
---|
2021 | 2074 | } else |
---|
2022 | 2075 | if (event.getSource() == mergeGeometriesItem) |
---|
2023 | 2076 | { |
---|
.. | .. |
---|
2069 | 2122 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2070 | 2123 | content = ((cGroup)content).get(0); |
---|
2071 | 2124 | |
---|
2072 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2125 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2073 | 2126 | for (int i=0; i<group.selection.size(); i++) |
---|
2074 | 2127 | { |
---|
2075 | 2128 | boolean random = CameraPane.RANDOM; |
---|
.. | .. |
---|
2078 | 2131 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2079 | 2132 | CameraPane.RANDOM = random; |
---|
2080 | 2133 | } |
---|
2081 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2134 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2082 | 2135 | refreshContents(); |
---|
2083 | 2136 | } |
---|
2084 | 2137 | } else |
---|
.. | .. |
---|
2091 | 2144 | group.selection.get(i).linkVerticesThis(null); |
---|
2092 | 2145 | CameraPane.RANDOM = random; |
---|
2093 | 2146 | } |
---|
| 2147 | + |
---|
| 2148 | + refreshContents(); |
---|
| 2149 | + } else |
---|
| 2150 | + if (event.getSource() == relinkverticesItem) |
---|
| 2151 | + { |
---|
| 2152 | + boolean random = CameraPane.RANDOM; |
---|
| 2153 | + CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2154 | + group.selection.RelinkToSupport(); |
---|
| 2155 | + CameraPane.RANDOM = random; |
---|
2094 | 2156 | |
---|
2095 | 2157 | refreshContents(); |
---|
2096 | 2158 | } else |
---|
.. | .. |
---|
2162 | 2224 | if (event.getSource() == grabItem) |
---|
2163 | 2225 | { |
---|
2164 | 2226 | group(new cGroup(), true); |
---|
| 2227 | + } else |
---|
| 2228 | + if (event.getSource() == hideItem) |
---|
| 2229 | + { |
---|
| 2230 | + group(new HiddenObject()); |
---|
2165 | 2231 | } else |
---|
2166 | 2232 | if (event.getSource() == frontItem) |
---|
2167 | 2233 | { |
---|
.. | .. |
---|
2285 | 2351 | { |
---|
2286 | 2352 | group(new TextureNode()); |
---|
2287 | 2353 | } else |
---|
| 2354 | + if (event.getSource() == billboardItem) |
---|
| 2355 | + { |
---|
| 2356 | + group(new BillboardNode()); |
---|
| 2357 | + } else |
---|
2288 | 2358 | if (event.getSource() == shadowXItem) |
---|
2289 | 2359 | { |
---|
2290 | 2360 | CastShadow(0); |
---|
.. | .. |
---|
2299 | 2369 | } else |
---|
2300 | 2370 | if (event.getSource() == ungroupItem) |
---|
2301 | 2371 | { |
---|
2302 | | - ungroup(); |
---|
| 2372 | + //ungroup(); |
---|
| 2373 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2374 | + { |
---|
| 2375 | + Ungroup(group.selection.get(i)); |
---|
| 2376 | + } |
---|
| 2377 | + |
---|
| 2378 | + ClearSelection(false); |
---|
| 2379 | + |
---|
| 2380 | + refreshContents(); |
---|
2303 | 2381 | } else |
---|
2304 | 2382 | if (event.getSource() == genUVItem) |
---|
2305 | 2383 | { |
---|
.. | .. |
---|
2309 | 2387 | { |
---|
2310 | 2388 | GenNormals(true); |
---|
2311 | 2389 | } else |
---|
| 2390 | + if (event.getSource() == genNormalsMESHItem) |
---|
| 2391 | + { |
---|
| 2392 | + GenNormals(true); // TODO |
---|
| 2393 | + } else |
---|
2312 | 2394 | if (event.getSource() == genNormalsORGANItem) |
---|
2313 | 2395 | { |
---|
2314 | 2396 | GenNormals(false); |
---|
| 2397 | + } else |
---|
| 2398 | + if (event.getSource() == genNormalsMINEItem) |
---|
| 2399 | + { |
---|
| 2400 | + GenNormalsMINE(); |
---|
2315 | 2401 | } else |
---|
2316 | 2402 | if (event.getSource() == stripifyItem) |
---|
2317 | 2403 | { |
---|
.. | .. |
---|
2489 | 2575 | |
---|
2490 | 2576 | refreshContents(); |
---|
2491 | 2577 | } else |
---|
| 2578 | + if (event.getSource() == repairShadowItem) |
---|
| 2579 | + { |
---|
| 2580 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2581 | + { |
---|
| 2582 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2583 | + obj.RepairShadow(); |
---|
| 2584 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2585 | +// { |
---|
| 2586 | +// obj.get(i).parent = obj; |
---|
| 2587 | +// } |
---|
| 2588 | + } |
---|
| 2589 | + |
---|
| 2590 | + refreshContents(); |
---|
| 2591 | + } else |
---|
2492 | 2592 | if (event.getSource() == sortbysizeItem) |
---|
2493 | 2593 | { |
---|
2494 | 2594 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2584 | 2684 | // bug |
---|
2585 | 2685 | //gridPanel.setDividerLocation(1.0); |
---|
2586 | 2686 | //bigPanel.setDividerLocation(0.0); |
---|
2587 | | - bigThree.remove(jtp); |
---|
2588 | | - bigThree.remove(cameraPanel); |
---|
| 2687 | + bigThree.remove(scenePanel); |
---|
| 2688 | + bigThree.remove(centralPanel); |
---|
2589 | 2689 | bigThree.remove(XYZPanel); |
---|
2590 | 2690 | aWindowConstraints.gridx = 0; |
---|
2591 | 2691 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2600 | 2700 | // aConstraints.gridheight = 3; |
---|
2601 | 2701 | aWindowConstraints.gridx = 1; |
---|
2602 | 2702 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2603 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2703 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2604 | 2704 | aWindowConstraints.weightx = 0; |
---|
2605 | 2705 | aWindowConstraints.gridx = 4; |
---|
2606 | 2706 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2612 | 2712 | if (event.getSource() == threeButton) |
---|
2613 | 2713 | { |
---|
2614 | 2714 | radio.layout = threeButton; |
---|
2615 | | - bigThree.remove(jtp); |
---|
2616 | | - bigThree.remove(cameraPanel); |
---|
| 2715 | + bigThree.remove(scenePanel); |
---|
| 2716 | + bigThree.remove(centralPanel); |
---|
2617 | 2717 | bigThree.remove(XYZPanel); |
---|
2618 | 2718 | aWindowConstraints.gridx = 0; |
---|
2619 | 2719 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2628 | 2728 | // aConstraints.gridheight = 3; |
---|
2629 | 2729 | aWindowConstraints.gridx = 1; |
---|
2630 | 2730 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2631 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2731 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2632 | 2732 | aWindowConstraints.weightx = 0; |
---|
2633 | 2733 | aWindowConstraints.gridx = 4; |
---|
2634 | 2734 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2640 | 2740 | if (event.getSource() == fourButton) |
---|
2641 | 2741 | { |
---|
2642 | 2742 | radio.layout = fourButton; |
---|
2643 | | - bigThree.remove(jtp); |
---|
2644 | | - bigThree.remove(cameraPanel); |
---|
| 2743 | + bigThree.remove(scenePanel); |
---|
| 2744 | + bigThree.remove(centralPanel); |
---|
2645 | 2745 | bigThree.remove(XYZPanel); |
---|
2646 | 2746 | aWindowConstraints.gridx = 0; |
---|
2647 | 2747 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2650 | 2750 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2651 | 2751 | aWindowConstraints.weightx = 1; |
---|
2652 | 2752 | aWindowConstraints.weighty = 1; |
---|
2653 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 2753 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
2654 | 2754 | aWindowConstraints.weightx = 1; |
---|
2655 | 2755 | aWindowConstraints.gridwidth = 3; |
---|
2656 | 2756 | // aConstraints.gridheight = 3; |
---|
.. | .. |
---|
2668 | 2768 | if (event.getSource() == sixButton) |
---|
2669 | 2769 | { |
---|
2670 | 2770 | radio.layout = sixButton; |
---|
2671 | | - bigThree.remove(jtp); |
---|
2672 | | - bigThree.remove(cameraPanel); |
---|
| 2771 | + bigThree.remove(scenePanel); |
---|
| 2772 | + bigThree.remove(centralPanel); |
---|
2673 | 2773 | bigThree.remove(XYZPanel); |
---|
2674 | 2774 | aWindowConstraints.gridx = 0; |
---|
2675 | 2775 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2678 | 2778 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2679 | 2779 | aWindowConstraints.weightx = 0; |
---|
2680 | 2780 | aWindowConstraints.weighty = 1; |
---|
2681 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 2781 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
2682 | 2782 | aWindowConstraints.weightx = 1; |
---|
2683 | 2783 | aWindowConstraints.gridwidth = 3; |
---|
2684 | 2784 | // aWindowConstraints.gridheight = 3; |
---|
2685 | 2785 | aWindowConstraints.gridx = 1; |
---|
2686 | 2786 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2687 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2787 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2688 | 2788 | aWindowConstraints.weightx = 0; |
---|
2689 | 2789 | aWindowConstraints.gridx = 4; |
---|
2690 | 2790 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2696 | 2796 | if (event.getSource() == sevenButton) |
---|
2697 | 2797 | { |
---|
2698 | 2798 | radio.layout = sevenButton; |
---|
2699 | | - bigThree.remove(jtp); |
---|
2700 | | - bigThree.remove(cameraPanel); |
---|
| 2799 | + bigThree.remove(scenePanel); |
---|
| 2800 | + bigThree.remove(centralPanel); |
---|
2701 | 2801 | bigThree.remove(XYZPanel); |
---|
2702 | 2802 | aWindowConstraints.gridx = 0; |
---|
2703 | 2803 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2706 | 2806 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2707 | 2807 | aWindowConstraints.weightx = 0; |
---|
2708 | 2808 | aWindowConstraints.weighty = 1; |
---|
2709 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 2809 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
2710 | 2810 | aWindowConstraints.weightx = 1; |
---|
2711 | 2811 | aWindowConstraints.gridwidth = 3; |
---|
2712 | 2812 | // aWindowConstraints.gridheight = 3; |
---|
2713 | 2813 | aWindowConstraints.gridx = 1; |
---|
2714 | 2814 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2715 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2815 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2716 | 2816 | aWindowConstraints.weightx = 0; |
---|
2717 | 2817 | aWindowConstraints.gridx = 4; |
---|
2718 | 2818 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2839 | 2939 | } |
---|
2840 | 2940 | |
---|
2841 | 2941 | copy = group; |
---|
2842 | | - //CameraPane.theRenderer.object = group; |
---|
| 2942 | + //Globals.theRenderer.object = group; |
---|
2843 | 2943 | if(!useclient) |
---|
2844 | 2944 | { |
---|
2845 | 2945 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2848 | 2948 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2849 | 2949 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2850 | 2950 | cameraView.object = group; |
---|
2851 | | - cameraView.lighttouched = true; |
---|
| 2951 | + //cameraView.lighttouched = true; |
---|
| 2952 | + Globals.lighttouched = true; |
---|
2852 | 2953 | topView.object = group; |
---|
2853 | 2954 | frontView.object = group; |
---|
2854 | 2955 | sideView.object = group; |
---|
.. | .. |
---|
2884 | 2985 | if (useclient) |
---|
2885 | 2986 | { |
---|
2886 | 2987 | cameraView.object = client; |
---|
2887 | | - cameraView.lighttouched = true; |
---|
| 2988 | + Globals.lighttouched = true; |
---|
2888 | 2989 | //topView.object = client; |
---|
2889 | 2990 | //frontView.object = client; |
---|
2890 | 2991 | //sideView.object = client; |
---|
.. | .. |
---|
2892 | 2993 | else |
---|
2893 | 2994 | { |
---|
2894 | 2995 | cameraView.object = group; |
---|
2895 | | - cameraView.lighttouched = true; |
---|
| 2996 | + Globals.lighttouched = true; |
---|
2896 | 2997 | //topView.object = group; |
---|
2897 | 2998 | //frontView.object = group; |
---|
2898 | 2999 | //sideView.object = group; |
---|
.. | .. |
---|
3173 | 3274 | refreshContents(); |
---|
3174 | 3275 | } |
---|
3175 | 3276 | |
---|
| 3277 | + void GenNormalsMINE() |
---|
| 3278 | + { |
---|
| 3279 | + group.selection.GenNormalsMINE(); |
---|
| 3280 | + |
---|
| 3281 | + refreshContents(); |
---|
| 3282 | + } |
---|
| 3283 | + |
---|
3176 | 3284 | void Stripify() |
---|
3177 | 3285 | { |
---|
3178 | 3286 | group.StripifyS(); |
---|
.. | .. |
---|
3393 | 3501 | String pigment = Object3D.GetPigment(tex); |
---|
3394 | 3502 | //String bump = Object3D.GetBump(tex); |
---|
3395 | 3503 | |
---|
3396 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3504 | + com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
3397 | 3505 | |
---|
3398 | 3506 | double s = v.s; |
---|
3399 | 3507 | |
---|
.. | .. |
---|
3441 | 3549 | |
---|
3442 | 3550 | void Align() |
---|
3443 | 3551 | { |
---|
| 3552 | + if (group.selection.size() == 0) |
---|
| 3553 | + return; |
---|
| 3554 | + |
---|
| 3555 | + cVector bbmin = new cVector(); |
---|
| 3556 | + cVector bbmax = new cVector(); |
---|
| 3557 | + |
---|
| 3558 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3559 | + |
---|
| 3560 | + double dx = bbmax.x - bbmin.x; |
---|
| 3561 | + double dy = bbmax.y - bbmin.y; |
---|
| 3562 | + double dz = bbmax.z - bbmin.z; |
---|
| 3563 | + |
---|
| 3564 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3565 | + |
---|
3444 | 3566 | for (int i=0; i<group.selection.size(); i++) |
---|
3445 | 3567 | { |
---|
3446 | 3568 | Object3D obj = group.selection.get(i); |
---|
3447 | 3569 | |
---|
3448 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3449 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3570 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3571 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3450 | 3572 | } |
---|
3451 | 3573 | |
---|
3452 | 3574 | refreshContents(); |
---|
.. | .. |
---|
3680 | 3802 | group.selection.RelinkToSupport(); // july 2014 |
---|
3681 | 3803 | System.out.println("DONE."); |
---|
3682 | 3804 | refreshContents(); |
---|
3683 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3805 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3684 | 3806 | } |
---|
3685 | 3807 | |
---|
3686 | 3808 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3965 | 4087 | |
---|
3966 | 4088 | objEditor.SetText(); // jan 2014 |
---|
3967 | 4089 | |
---|
3968 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4090 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
3969 | 4091 | CameraPane.flash = true; |
---|
3970 | 4092 | |
---|
3971 | 4093 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
3972 | 4094 | // a camera |
---|
3973 | 4095 | { |
---|
3974 | 4096 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3975 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3976 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3977 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4097 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4098 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4099 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3978 | 4100 | } |
---|
3979 | 4101 | |
---|
3980 | 4102 | refreshContents(); |
---|
.. | .. |
---|
4468 | 4590 | makeSomething(csg); |
---|
4469 | 4591 | } |
---|
4470 | 4592 | |
---|
| 4593 | + void Ungroup(Object3D g) |
---|
| 4594 | + { |
---|
| 4595 | + if (g instanceof HiddenObject) |
---|
| 4596 | + { |
---|
| 4597 | + HiddenObject h = (HiddenObject) g; |
---|
| 4598 | + |
---|
| 4599 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4600 | + { |
---|
| 4601 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4602 | + } |
---|
| 4603 | + } |
---|
| 4604 | + else |
---|
| 4605 | + { |
---|
| 4606 | + for (int i=0; i<g.Size(); i++) |
---|
| 4607 | + { |
---|
| 4608 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4609 | + } |
---|
| 4610 | + } |
---|
| 4611 | + } |
---|
| 4612 | + |
---|
4471 | 4613 | void ungroup() |
---|
4472 | 4614 | { |
---|
4473 | 4615 | /* |
---|
.. | .. |
---|
4827 | 4969 | private MenuItem resetsupportItem; |
---|
4828 | 4970 | private MenuItem resetreferencesItem; |
---|
4829 | 4971 | private MenuItem linkverticesItem; |
---|
| 4972 | + private MenuItem relinkverticesItem; |
---|
4830 | 4973 | private MenuItem setMasterItem; |
---|
4831 | 4974 | private MenuItem resetMeshItem; |
---|
4832 | 4975 | private MenuItem stepAllItem; |
---|
.. | .. |
---|
4845 | 4988 | private MenuItem clearItem; |
---|
4846 | 4989 | private MenuItem clearAllItem; |
---|
4847 | 4990 | private MenuItem genUVItem; |
---|
| 4991 | + private MenuItem genNormalsMESHItem; |
---|
4848 | 4992 | private MenuItem genNormalsCADItem; |
---|
4849 | 4993 | private MenuItem genNormalsORGANItem; |
---|
| 4994 | + private MenuItem genNormalsMINEItem; |
---|
4850 | 4995 | private MenuItem stripifyItem; |
---|
4851 | 4996 | private MenuItem unstripifyItem; |
---|
4852 | 4997 | private MenuItem trimItem; |
---|
.. | .. |
---|
4888 | 5033 | private MenuItem resetCentroidItem; |
---|
4889 | 5034 | private MenuItem transformgeometryItem; |
---|
4890 | 5035 | private MenuItem resetTransformItem; |
---|
| 5036 | + private MenuItem hideItem; |
---|
4891 | 5037 | private MenuItem grabItem; |
---|
4892 | 5038 | private MenuItem backItem; |
---|
4893 | 5039 | private MenuItem frontItem; |
---|
.. | .. |
---|
4908 | 5054 | |
---|
4909 | 5055 | private MenuItem resetParentItem; |
---|
4910 | 5056 | private MenuItem repairParentItem; |
---|
| 5057 | + private MenuItem repairShadowItem; |
---|
4911 | 5058 | private MenuItem sortbysizeItem; |
---|
4912 | 5059 | private MenuItem sortbynameItem; |
---|
4913 | 5060 | |
---|
.. | .. |
---|
4928 | 5075 | private MenuItem coneItem; |
---|
4929 | 5076 | private MenuItem torusItem; |
---|
4930 | 5077 | private MenuItem superItem; |
---|
| 5078 | + private MenuItem kleinItem; |
---|
4931 | 5079 | private MenuItem blobItem; |
---|
4932 | 5080 | private MenuItem latheItem; |
---|
4933 | 5081 | private MenuItem bezierItem; |
---|
.. | .. |
---|
4940 | 5088 | private MenuItem csgItem; |
---|
4941 | 5089 | private MenuItem templateItem; |
---|
4942 | 5090 | private MenuItem textureItem; |
---|
| 5091 | + private MenuItem billboardItem; |
---|
4943 | 5092 | private MenuItem shadowXItem; |
---|
4944 | 5093 | private MenuItem shadowYItem; |
---|
4945 | 5094 | private MenuItem shadowZItem; |
---|