.. | .. |
---|
98 | 98 | |
---|
99 | 99 | void CloneClipboard(boolean supports) |
---|
100 | 100 | { |
---|
101 | | - assert(GrafreeD.clipboard.parent == null); |
---|
102 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
103 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
104 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
105 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 106 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 109 | } |
---|
110 | 110 | |
---|
111 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 119 | // obj.support = null; |
---|
120 | 120 | if (!supports) |
---|
121 | 121 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 123 | obj.parent = parent; |
---|
124 | 124 | // obj.support = support; |
---|
125 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
210 | 210 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 211 | if (Globals.ADVANCED) |
---|
212 | 212 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 213 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 214 | revertMeshItem.addActionListener(this); |
---|
219 | 215 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
318 | 314 | resetTransformItem.addActionListener(this); |
---|
319 | 315 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 316 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 317 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 318 | + resetCentroidXZItem.addActionListener(this); |
---|
| 319 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 320 | + transformGeometryItem.addActionListener(this); |
---|
| 321 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 322 | + transformChildrenItem.addActionListener(this); |
---|
323 | 323 | |
---|
324 | 324 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 325 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 368 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 369 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 370 | clearMaterialsItem.addActionListener(this); |
---|
| 371 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 372 | + resetAllItem.addActionListener(this); |
---|
| 373 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 374 | + stepAllItem.addActionListener(this); |
---|
371 | 375 | menu.add("-"); |
---|
372 | 376 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 377 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 426 | sortbysizeItem.addActionListener(this); |
---|
423 | 427 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 428 | sortbynameItem.addActionListener(this); |
---|
| 429 | + menu.add("-"); |
---|
| 430 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 431 | + shareGeometriesItem.addActionListener(this); |
---|
| 432 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 433 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 434 | if (Globals.ADVANCED) |
---|
426 | 435 | { |
---|
427 | | - menu.add("-"); |
---|
| 436 | + // Pretty much the same as duplicate and clone. |
---|
428 | 437 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 438 | extractGeometriesItem.addActionListener(this); |
---|
430 | 439 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 440 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 441 | } |
---|
437 | 442 | |
---|
438 | 443 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
.. | .. |
---|
488 | 493 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 494 | |
---|
490 | 495 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 496 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 497 | liveCB.addItemListener(this); |
---|
493 | 498 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 499 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 500 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 501 | oneStepButton.addActionListener(this); |
---|
497 | 502 | |
---|
.. | .. |
---|
503 | 508 | trackCB.setToolTipText("Enable tracking"); |
---|
504 | 509 | trackCB.addItemListener(this); |
---|
505 | 510 | |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 511 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | 512 | screenfitButton.setToolTipText("Screen fit"); |
---|
508 | 513 | screenfitButton.addActionListener(this); |
---|
509 | 514 | |
---|
.. | .. |
---|
512 | 517 | |
---|
513 | 518 | if (Globals.ADVANCED) |
---|
514 | 519 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 520 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 521 | snapobjectButton.addActionListener(this); |
---|
517 | 522 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 523 | } |
---|
519 | 524 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 525 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 526 | flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 527 | flashSelectionButton.addActionListener(this); |
---|
523 | 528 | |
---|
524 | 529 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 530 | |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 531 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 532 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 533 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 534 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 535 | fourButton.addActionListener(this); |
---|
531 | 536 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 537 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 538 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 539 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 540 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 541 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 542 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 543 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 544 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 545 | sevenButton.addActionListener(this); |
---|
541 | 546 | // |
---|
542 | 547 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 548 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 549 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 550 | rootButton.addActionListener(this); |
---|
546 | 551 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 552 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 553 | closeButton.setToolTipText("Close tab"); |
---|
549 | 554 | closeButton.addActionListener(this); |
---|
550 | 555 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
552 | 557 | |
---|
553 | 558 | cGridBag commandsPanel = new cGridBag(); |
---|
554 | 559 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 560 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | 561 | editButton.setToolTipText("Edit selection"); |
---|
557 | 562 | editButton.addActionListener(this); |
---|
558 | 563 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 564 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | 565 | uneditButton.setToolTipText("Unedit selection"); |
---|
561 | 566 | uneditButton.addActionListener(this); |
---|
562 | 567 | |
---|
.. | .. |
---|
564 | 569 | allParamsButton.setToolTipText("Edit all params"); |
---|
565 | 570 | allParamsButton.addActionListener(this); |
---|
566 | 571 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 572 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 573 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 574 | clearPanelButton.addActionListener(this); |
---|
570 | 575 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 576 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 577 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 578 | unselectButton.addActionListener(this); |
---|
574 | 579 | |
---|
.. | .. |
---|
651 | 656 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
652 | 657 | zoomBoxCB.addItemListener(this); |
---|
653 | 658 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 659 | + if (true) // Globals.ADVANCED) |
---|
655 | 660 | { |
---|
656 | 661 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | 662 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
969 | 974 | |
---|
970 | 975 | flashIt = false; |
---|
971 | 976 | CameraPane pane = (CameraPane) target; |
---|
972 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 977 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
973 | 978 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
974 | 979 | |
---|
975 | 980 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1542 | 1547 | |
---|
1543 | 1548 | void Overwrite(int mask) |
---|
1544 | 1549 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1550 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1551 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1552 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1553 | |
---|
1549 | 1554 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1555 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1892 | 1897 | if (source == invariantsItem) |
---|
1893 | 1898 | { |
---|
1894 | 1899 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1900 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 1901 | } else |
---|
1897 | 1902 | if (source == memoryItem) |
---|
1898 | 1903 | { |
---|
.. | .. |
---|
1967 | 1972 | } else |
---|
1968 | 1973 | if (source == duplicateItem) |
---|
1969 | 1974 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 1975 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 1976 | loadClipboard(false); |
---|
1972 | 1977 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 1978 | + Grafreed.clipboard = keep; |
---|
1974 | 1979 | } else |
---|
1975 | 1980 | if (source == cloneItem) |
---|
1976 | 1981 | { |
---|
.. | .. |
---|
2190 | 2195 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2196 | // refreshContents(); |
---|
2192 | 2197 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2198 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2199 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2200 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2201 | |
---|
2197 | 2202 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2203 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2247 | } else |
---|
2243 | 2248 | if (source == setMasterItem) |
---|
2244 | 2249 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2250 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2251 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2252 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2253 | |
---|
2249 | 2254 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2255 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2262 | { |
---|
2258 | 2263 | if (group.selection.size() == 1) |
---|
2259 | 2264 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2265 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2266 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2267 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2268 | |
---|
2264 | 2269 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2270 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2281 | { |
---|
2277 | 2282 | RevertMeshes(); |
---|
2278 | 2283 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2284 | + if (source == resetAllItem) |
---|
2280 | 2285 | { |
---|
2281 | 2286 | ResetAll(); |
---|
2282 | 2287 | } else |
---|
.. | .. |
---|
2614 | 2619 | { |
---|
2615 | 2620 | SmoothMesh(); |
---|
2616 | 2621 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 2622 | + if (source == transformGeometryItem) |
---|
2618 | 2623 | { |
---|
2619 | 2624 | TransformGeometry(); |
---|
| 2625 | + } else |
---|
| 2626 | + if (source == transformChildrenItem) |
---|
| 2627 | + { |
---|
| 2628 | + TransformChildren(); |
---|
2620 | 2629 | } else |
---|
2621 | 2630 | if (source == resetTransformItem) |
---|
2622 | 2631 | { |
---|
.. | .. |
---|
2624 | 2633 | } else |
---|
2625 | 2634 | if (source == resetCentroidItem) |
---|
2626 | 2635 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 2636 | + ResetCentroid(true); |
---|
| 2637 | + } else |
---|
| 2638 | + if (source == resetCentroidXZItem) |
---|
| 2639 | + { |
---|
| 2640 | + ResetCentroid(false); |
---|
2628 | 2641 | } else |
---|
2629 | 2642 | if (source == resetParentItem) |
---|
2630 | 2643 | { |
---|
.. | .. |
---|
3140 | 3153 | refreshContents(); |
---|
3141 | 3154 | } |
---|
3142 | 3155 | |
---|
| 3156 | + void TransformChildren() |
---|
| 3157 | + { |
---|
| 3158 | + Object3D obj; |
---|
| 3159 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3160 | + { |
---|
| 3161 | + obj = (Object3D)e.nextElement(); |
---|
| 3162 | + obj.KeepTextureMatrices(); |
---|
| 3163 | + obj.TransformChildren(); |
---|
| 3164 | + obj.RestoreTextureMatrices(); |
---|
| 3165 | + |
---|
| 3166 | +// if (obj.parent == null) |
---|
| 3167 | +// { |
---|
| 3168 | +// System.out.println("NULL PARENT!"); |
---|
| 3169 | +// new Exception().printStackTrace(); |
---|
| 3170 | +// } |
---|
| 3171 | +// else |
---|
| 3172 | +// TouchTransform(obj); |
---|
| 3173 | +// //obj.parent.Touch(); |
---|
| 3174 | + } |
---|
| 3175 | + |
---|
| 3176 | + refreshContents(); |
---|
| 3177 | + } |
---|
3143 | 3178 | |
---|
3144 | 3179 | void ResetTransform() |
---|
3145 | 3180 | { |
---|
.. | .. |
---|
3252 | 3287 | refreshContents(); |
---|
3253 | 3288 | } |
---|
3254 | 3289 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3290 | + void ResetCentroid(boolean full) |
---|
3256 | 3291 | { |
---|
3257 | 3292 | Object3D obj; |
---|
3258 | 3293 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3302 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3303 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3304 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3305 | + if (full) |
---|
| 3306 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3307 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3308 | obj.TransformMesh(Object3D.mat); |
---|
| 3309 | + |
---|
3273 | 3310 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3311 | + if (full) |
---|
| 3312 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3313 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3314 | + |
---|
3276 | 3315 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3316 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3317 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3338 | 3377 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3378 | |
---|
3340 | 3379 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3380 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3381 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3382 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3383 | |
---|
3345 | 3384 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3385 | } |
---|
.. | .. |
---|
3554 | 3593 | |
---|
3555 | 3594 | void ParseVertices() |
---|
3556 | 3595 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 3596 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3597 | + Grafreed.epsequal = true; |
---|
3559 | 3598 | |
---|
3560 | 3599 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 3600 | { |
---|
.. | .. |
---|
3580 | 3619 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 3620 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 3621 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 3622 | + g.add(Grafreed.clipboard); |
---|
3584 | 3623 | |
---|
3585 | 3624 | buffer.add(g); |
---|
3586 | 3625 | } |
---|
.. | .. |
---|
3595 | 3634 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 3635 | } |
---|
3597 | 3636 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 3637 | + Grafreed.epsequal = epsequal; |
---|
3599 | 3638 | |
---|
3600 | 3639 | refreshContents(); |
---|
3601 | 3640 | } |
---|
.. | .. |
---|
3613 | 3652 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 3653 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 3654 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3655 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3656 | + |
---|
| 3657 | + try |
---|
| 3658 | + { |
---|
| 3659 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3660 | + } |
---|
| 3661 | + catch (Exception e) |
---|
| 3662 | + { |
---|
| 3663 | + System.err.println("FAIL: " + node); |
---|
| 3664 | + } |
---|
3617 | 3665 | |
---|
3618 | 3666 | double s = v.s; |
---|
3619 | 3667 | |
---|
.. | .. |
---|
3745 | 3793 | return; |
---|
3746 | 3794 | |
---|
3747 | 3795 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3796 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 3797 | |
---|
3750 | 3798 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 3799 | |
---|
.. | .. |
---|
3939 | 3987 | |
---|
3940 | 3988 | void ClipMesh() |
---|
3941 | 3989 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3990 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 3991 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3992 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 3993 | |
---|
3946 | 3994 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 3995 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 3998 | // { |
---|
3951 | 3999 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4000 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4001 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4002 | } |
---|
3955 | 4003 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4004 | System.out.println("DONE."); |
---|
.. | .. |
---|
4290 | 4338 | { |
---|
4291 | 4339 | if (group.selection.isEmpty()) |
---|
4292 | 4340 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4341 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4342 | Composite tGroup = null; |
---|
4295 | 4343 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4344 | { |
---|
4297 | 4345 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4346 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4347 | } |
---|
4300 | 4348 | |
---|
4301 | 4349 | if (cut) |
---|
.. | .. |
---|
4335 | 4383 | //System.out.println("cut " + child); |
---|
4336 | 4384 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4385 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4386 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4387 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4388 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4389 | + Grafreed.clipboard = tmp; |
---|
4342 | 4390 | } |
---|
4343 | 4391 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4392 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4393 | tGroup.add/*Child*/(child); |
---|
4346 | 4394 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4395 | + Grafreed.clipboard = child; |
---|
4348 | 4396 | } |
---|
4349 | 4397 | |
---|
4350 | 4398 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4424 | //System.out.println("cut " + elem); |
---|
4377 | 4425 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4426 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4427 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4428 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4429 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4430 | + Grafreed.clipboard = tmp; |
---|
4383 | 4431 | } |
---|
4384 | 4432 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4433 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4434 | tGroup.add/*Child*/(child); |
---|
4387 | 4435 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4436 | + Grafreed.clipboard = child; |
---|
4389 | 4437 | } |
---|
4390 | 4438 | |
---|
4391 | 4439 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4440 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4441 | + Grafreed.clipboard = tGroup; |
---|
4394 | 4442 | if (cut) |
---|
4395 | 4443 | { |
---|
4396 | 4444 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4452 | // return; |
---|
4405 | 4453 | boolean first = true; |
---|
4406 | 4454 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4455 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4456 | { |
---|
4409 | 4457 | Composite temp; |
---|
4410 | 4458 | |
---|
.. | .. |
---|
4415 | 4463 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4464 | */ |
---|
4417 | 4465 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4466 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4467 | { |
---|
4420 | 4468 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4469 | |
---|
.. | .. |
---|
4449 | 4497 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4498 | //temp.addChild(cb); |
---|
4451 | 4499 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4452 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4453 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4454 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4455 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4456 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4500 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4501 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4502 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4503 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4504 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4505 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4506 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4507 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4508 | } |
---|
4461 | 4509 | |
---|
4462 | 4510 | ResetModel(); |
---|
.. | .. |
---|
4505 | 4553 | { |
---|
4506 | 4554 | boolean first = true; |
---|
4507 | 4555 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4556 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4557 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4558 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 4559 | Object3D copy; |
---|
4512 | 4560 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 4561 | { |
---|
.. | .. |
---|
4517 | 4565 | } |
---|
4518 | 4566 | } else |
---|
4519 | 4567 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4568 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 4569 | } |
---|
4522 | 4570 | } |
---|
4523 | 4571 | } |
---|
.. | .. |
---|
4962 | 5010 | |
---|
4963 | 5011 | void ImportVRMLX3D() |
---|
4964 | 5012 | { |
---|
4965 | | - if (GrafreeD.standAlone) |
---|
| 5013 | + if (Grafreed.standAlone) |
---|
4966 | 5014 | { |
---|
4967 | 5015 | /**/ |
---|
4968 | 5016 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4979 | 5027 | |
---|
4980 | 5028 | String GetFile(String dialogName) |
---|
4981 | 5029 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5030 | + if (Grafreed.standAlone) |
---|
4983 | 5031 | { |
---|
4984 | 5032 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5033 | browser.show(); |
---|
.. | .. |
---|
5092 | 5140 | private MenuItem linkverticesItem; |
---|
5093 | 5141 | private MenuItem relinkverticesItem; |
---|
5094 | 5142 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5143 | + private MenuItem resetAllItem; |
---|
5096 | 5144 | private MenuItem stepAllItem; |
---|
5097 | 5145 | private MenuItem revertMeshItem; |
---|
5098 | 5146 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5153 | 5201 | private MenuItem panoTexturesItem; |
---|
5154 | 5202 | |
---|
5155 | 5203 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5204 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5205 | private MenuItem resetTransformItem; |
---|
| 5206 | + private MenuItem transformGeometryItem; |
---|
| 5207 | + private MenuItem transformChildrenItem; |
---|
5158 | 5208 | private MenuItem hideItem; |
---|
5159 | 5209 | private MenuItem grabItem; |
---|
5160 | 5210 | private MenuItem backItem; |
---|