.. | .. |
---|
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 |
---|
.. | .. |
---|
318 | 318 | resetTransformItem.addActionListener(this); |
---|
319 | 319 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 320 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 321 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 322 | + resetCentroidXZItem.addActionListener(this); |
---|
| 323 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 324 | + transformGeometryItem.addActionListener(this); |
---|
| 325 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 326 | + transformChildrenItem.addActionListener(this); |
---|
323 | 327 | |
---|
324 | 328 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 329 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
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")); |
---|
.. | .. |
---|
491 | 496 | liveCB.setToolTipText("Enabled 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); |
---|
.. | .. |
---|
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 | } |
---|
.. | .. |
---|
3745 | 3784 | return; |
---|
3746 | 3785 | |
---|
3747 | 3786 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3787 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 3788 | |
---|
3750 | 3789 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 3790 | |
---|
.. | .. |
---|
3939 | 3978 | |
---|
3940 | 3979 | void ClipMesh() |
---|
3941 | 3980 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3981 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 3982 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3983 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 3984 | |
---|
3946 | 3985 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 3986 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 3989 | // { |
---|
3951 | 3990 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 3991 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 3992 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 3993 | } |
---|
3955 | 3994 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 3995 | System.out.println("DONE."); |
---|
.. | .. |
---|
4290 | 4329 | { |
---|
4291 | 4330 | if (group.selection.isEmpty()) |
---|
4292 | 4331 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4332 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4333 | Composite tGroup = null; |
---|
4295 | 4334 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4335 | { |
---|
4297 | 4336 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4337 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4338 | } |
---|
4300 | 4339 | |
---|
4301 | 4340 | if (cut) |
---|
.. | .. |
---|
4335 | 4374 | //System.out.println("cut " + child); |
---|
4336 | 4375 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4376 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4377 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4378 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4379 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4380 | + Grafreed.clipboard = tmp; |
---|
4342 | 4381 | } |
---|
4343 | 4382 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4383 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4384 | tGroup.add/*Child*/(child); |
---|
4346 | 4385 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4386 | + Grafreed.clipboard = child; |
---|
4348 | 4387 | } |
---|
4349 | 4388 | |
---|
4350 | 4389 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4415 | //System.out.println("cut " + elem); |
---|
4377 | 4416 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4417 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4418 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4419 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4420 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4421 | + Grafreed.clipboard = tmp; |
---|
4383 | 4422 | } |
---|
4384 | 4423 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4424 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4425 | tGroup.add/*Child*/(child); |
---|
4387 | 4426 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4427 | + Grafreed.clipboard = child; |
---|
4389 | 4428 | } |
---|
4390 | 4429 | |
---|
4391 | 4430 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4431 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4432 | + Grafreed.clipboard = tGroup; |
---|
4394 | 4433 | if (cut) |
---|
4395 | 4434 | { |
---|
4396 | 4435 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4443 | // return; |
---|
4405 | 4444 | boolean first = true; |
---|
4406 | 4445 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4446 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4447 | { |
---|
4409 | 4448 | Composite temp; |
---|
4410 | 4449 | |
---|
.. | .. |
---|
4415 | 4454 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4455 | */ |
---|
4417 | 4456 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4457 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4458 | { |
---|
4420 | 4459 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4460 | |
---|
.. | .. |
---|
4449 | 4488 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4489 | //temp.addChild(cb); |
---|
4451 | 4490 | //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()); |
---|
| 4491 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4492 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4493 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4494 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4495 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4496 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4497 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4498 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4499 | } |
---|
4461 | 4500 | |
---|
4462 | 4501 | ResetModel(); |
---|
.. | .. |
---|
4505 | 4544 | { |
---|
4506 | 4545 | boolean first = true; |
---|
4507 | 4546 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4547 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4548 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4549 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 4550 | Object3D copy; |
---|
4512 | 4551 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 4552 | { |
---|
.. | .. |
---|
4517 | 4556 | } |
---|
4518 | 4557 | } else |
---|
4519 | 4558 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4559 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 4560 | } |
---|
4522 | 4561 | } |
---|
4523 | 4562 | } |
---|
.. | .. |
---|
4962 | 5001 | |
---|
4963 | 5002 | void ImportVRMLX3D() |
---|
4964 | 5003 | { |
---|
4965 | | - if (GrafreeD.standAlone) |
---|
| 5004 | + if (Grafreed.standAlone) |
---|
4966 | 5005 | { |
---|
4967 | 5006 | /**/ |
---|
4968 | 5007 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4979 | 5018 | |
---|
4980 | 5019 | String GetFile(String dialogName) |
---|
4981 | 5020 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5021 | + if (Grafreed.standAlone) |
---|
4983 | 5022 | { |
---|
4984 | 5023 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5024 | browser.show(); |
---|
.. | .. |
---|
5153 | 5192 | private MenuItem panoTexturesItem; |
---|
5154 | 5193 | |
---|
5155 | 5194 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5195 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5196 | private MenuItem resetTransformItem; |
---|
| 5197 | + private MenuItem transformGeometryItem; |
---|
| 5198 | + private MenuItem transformChildrenItem; |
---|
5158 | 5199 | private MenuItem hideItem; |
---|
5159 | 5200 | private MenuItem grabItem; |
---|
5160 | 5201 | private MenuItem backItem; |
---|