.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
.. | .. |
---|
83 | 84 | |
---|
84 | 85 | void CloneSelection(boolean supports) |
---|
85 | 86 | { |
---|
86 | | - // Object3D keep = GraphreeD.clipboard; |
---|
| 87 | + // Object3D keep = GrafreeD.clipboard; |
---|
87 | 88 | //Object3D obj; |
---|
88 | 89 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
89 | 90 | { |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GraphreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
102 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GraphreeD.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)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GraphreeD.clipboard, false)); |
---|
107 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
| 108 | + GrafreeD.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GraphreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
219 | 220 | resetsupportItem.addActionListener(this); |
---|
220 | 221 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 222 | linkverticesItem.addActionListener(this); |
---|
| 223 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 224 | + relinkverticesItem.addActionListener(this); |
---|
222 | 225 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 226 | setMasterItem.addActionListener(this); |
---|
224 | 227 | |
---|
225 | 228 | oe.menuBar.add(menu = new Menu("Group")); |
---|
226 | 229 | grabItem = menu.add(new MenuItem("Grab")); |
---|
227 | 230 | grabItem.addActionListener(this); |
---|
228 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
229 | | - frontItem.addActionListener(this); |
---|
230 | 231 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 232 | backItem.addActionListener(this); |
---|
| 233 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 234 | + frontItem.addActionListener(this); |
---|
232 | 235 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | 236 | compositeItem.addActionListener(this); |
---|
| 237 | + hideItem = menu.add(new MenuItem("Hide")); |
---|
| 238 | + hideItem.addActionListener(this); |
---|
| 239 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 240 | + ungroupItem.addActionListener(this); |
---|
234 | 241 | menu.add("-"); |
---|
235 | 242 | randomItem = menu.add(new MenuItem("Random")); |
---|
236 | 243 | randomItem.addActionListener(this); |
---|
.. | .. |
---|
252 | 259 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | 260 | textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | 261 | textureItem.addActionListener(this); |
---|
| 262 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 263 | + billboardItem.addActionListener(this); |
---|
255 | 264 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 265 | csgItem.addActionListener(this); |
---|
257 | 266 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
269 | 278 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 279 | pointflowItem.addActionListener(this); |
---|
271 | 280 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 281 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 282 | resetTransformItem.addActionListener(this); |
---|
276 | 283 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 284 | resetCentroidItem.addActionListener(this); |
---|
278 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
279 | | - ungroupItem.addActionListener(this); |
---|
| 285 | + transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 286 | + transformgeometryItem.addActionListener(this); |
---|
280 | 287 | |
---|
281 | 288 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 289 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 292 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 293 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 294 | genNormalsCADItem.addActionListener(this); |
---|
| 295 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 296 | + genNormalsMESHItem.addActionListener(this); |
---|
| 297 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 298 | + genNormalsMINEItem.addActionListener(this); |
---|
288 | 299 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 300 | stripifyItem.addActionListener(this); |
---|
290 | 301 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
380 | 391 | |
---|
381 | 392 | |
---|
382 | 393 | oe.menuBar.add(menu = new Menu("Include")); |
---|
383 | | - importGFDItem = menu.add(new MenuItem("GraphreeD Object...")); |
---|
| 394 | + importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
384 | 395 | importGFDItem.addActionListener(this); |
---|
385 | 396 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
386 | 397 | importVRMLX3DItem.addActionListener(this); |
---|
.. | .. |
---|
423 | 434 | oe.radioPanel.add(dummyButton); |
---|
424 | 435 | oe.buttonGroup.add(dummyButton); |
---|
425 | 436 | */ |
---|
426 | | - aConstraints.gridy += 1; |
---|
427 | | - oe.aConstraints.gridwidth = 1; |
---|
428 | | - oe.aConstraints.gridx = 0; |
---|
| 437 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
429 | 438 | |
---|
430 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 439 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
| 440 | + liveCB.setToolTipText("Enabled animation"); |
---|
431 | 441 | liveCB.addItemListener(this); |
---|
432 | 442 | |
---|
433 | | - oe.aConstraints.gridx += 1; |
---|
434 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
435 | | - supportCB.addItemListener(this); |
---|
436 | | - |
---|
437 | | - // oe.aConstraints.gridx += 1; |
---|
438 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
439 | | - // localCB.addItemListener(this); |
---|
440 | | - |
---|
441 | | - oe.aConstraints.gridx += 1; |
---|
442 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
443 | | - crowdCB.addItemListener(this); |
---|
444 | | - |
---|
445 | | - oe.aConstraints.gridx += 1; |
---|
446 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
447 | | - smoothCB.addItemListener(this); |
---|
448 | | - |
---|
449 | | - 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 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
454 | | - slowCB.addItemListener(this); |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
457 | | - boxCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
461 | | -// speakerMocapCB.addItemListener(this); |
---|
462 | | - |
---|
463 | | - if (false) |
---|
464 | | - { |
---|
465 | | - // handled in scripts |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
468 | | - speakerCameraCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
472 | | - speakerFocusCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
476 | | - smoothfocusCB.addItemListener(this); |
---|
477 | | - } |
---|
478 | | - |
---|
479 | | -//oe.aConstraints.gridx += 1; |
---|
480 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
481 | | -// debugCB.addItemListener(this); |
---|
482 | | - |
---|
483 | | - oe.aConstraints.gridx += 1; |
---|
484 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
485 | | - oeilCB.addItemListener(this); |
---|
486 | | - |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
489 | | - lookAtCB.addItemListener(this); |
---|
490 | | - |
---|
491 | | - oe.aConstraints.gridx += 1; |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 443 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
| 444 | + trackCB.setToolTipText("Enable tracking"); |
---|
493 | 445 | trackCB.addItemListener(this); |
---|
494 | 446 | |
---|
495 | | - oe.aConstraints.gridx += 1; |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 447 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 448 | + screenfitButton.setToolTipText("Screen fit"); |
---|
497 | 449 | screenfitButton.addActionListener(this); |
---|
498 | | - oe.aConstraints.gridx += 1; |
---|
| 450 | + |
---|
499 | 451 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
500 | 452 | // screenfitpointButton.addActionListener(this); |
---|
501 | 453 | // oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
| 454 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
503 | 455 | snapobjectButton.addActionListener(this); |
---|
| 456 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
504 | 457 | oe.aConstraints.gridx += 1; |
---|
505 | 458 | |
---|
506 | 459 | //aConstraints.gridx = 0; |
---|
.. | .. |
---|
508 | 461 | oe.aConstraints.weighty = 0; |
---|
509 | 462 | oe.aConstraints.gridwidth = 1; |
---|
510 | 463 | |
---|
511 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 464 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 465 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | 466 | flashSelectionButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
516 | 467 | |
---|
517 | | - // |
---|
518 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 468 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 469 | + |
---|
| 470 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 471 | + twoButton.setToolTipText("Show center view only"); |
---|
519 | 472 | twoButton.addActionListener(this); |
---|
520 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 473 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 474 | fourButton.addActionListener(this); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 475 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 476 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 477 | + sixButton.setToolTipText("2-column layout left"); |
---|
523 | 478 | sixButton.addActionListener(this); |
---|
524 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 479 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 480 | + threeButton.setToolTipText("2-column layout right"); |
---|
525 | 481 | threeButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 482 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 483 | + sevenButton.setToolTipText("3-column layout"); |
---|
527 | 484 | sevenButton.addActionListener(this); |
---|
528 | 485 | // |
---|
529 | 486 | |
---|
530 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 487 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 488 | + rootButton.setToolTipText("Edit object in new tab"); |
---|
531 | 489 | rootButton.addActionListener(this); |
---|
532 | 490 | oe.aConstraints.gridx += 1; |
---|
533 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 491 | + oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 492 | + closeButton.setToolTipText("Close tab"); |
---|
534 | 493 | closeButton.addActionListener(this); |
---|
535 | 494 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
536 | 495 | //clearButton.addActionListener(this); |
---|
.. | .. |
---|
633 | 592 | radio.layout = sevenButton; |
---|
634 | 593 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
635 | 594 | } |
---|
| 595 | + |
---|
| 596 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 597 | + { |
---|
| 598 | + //constraints.gridx = 0; |
---|
| 599 | + //constraints.gridy = 0; |
---|
| 600 | + panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 601 | + fastCB.setToolTipText("Fast mode"); |
---|
| 602 | + fastCB.addItemListener(this); |
---|
| 603 | + //constraints.gridy += 1; |
---|
| 604 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 605 | + supportCB.setToolTipText("Enabled rigging"); |
---|
| 606 | + supportCB.addItemListener(this); |
---|
| 607 | + |
---|
| 608 | + // constraints.gridy += 1; |
---|
| 609 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 610 | + // localCB.addItemListener(this); |
---|
| 611 | + |
---|
| 612 | + //constraints.gridy += 1; |
---|
| 613 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 614 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 615 | + crowdCB.addItemListener(this); |
---|
| 616 | + |
---|
| 617 | + //constraints.gridy += 1; |
---|
| 618 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 619 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 620 | + smoothCB.addItemListener(this); |
---|
| 621 | + |
---|
| 622 | + //constraints.gridy += 1; |
---|
| 623 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 624 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 625 | + slowCB.addItemListener(this); |
---|
| 626 | + //constraints.gridy += 1; |
---|
| 627 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 628 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 629 | + boxCB.addItemListener(this); |
---|
| 630 | + //constraints.gridy += 1; |
---|
| 631 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 632 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 633 | + zoomBoxCB.addItemListener(this); |
---|
| 634 | + |
---|
| 635 | +// constraints.gridy += 1; |
---|
| 636 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 637 | +// speakerMocapCB.addItemListener(this); |
---|
| 638 | + |
---|
| 639 | + if (false) |
---|
| 640 | + { |
---|
| 641 | + // handled in scripts |
---|
| 642 | + //constraints.gridy += 1; |
---|
| 643 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 644 | + speakerCameraCB.addItemListener(this); |
---|
| 645 | + |
---|
| 646 | + //constraints.gridy += 1; |
---|
| 647 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 648 | + speakerFocusCB.addItemListener(this); |
---|
| 649 | + |
---|
| 650 | + //constraints.gridy += 1; |
---|
| 651 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 652 | + smoothfocusCB.addItemListener(this); |
---|
| 653 | + } |
---|
| 654 | + |
---|
| 655 | +//constraints.gridx += 1; |
---|
| 656 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 657 | +// debugCB.addItemListener(this); |
---|
| 658 | + |
---|
| 659 | + //constraints.gridy += 1; |
---|
| 660 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 661 | + oeilCB.addItemListener(this); |
---|
| 662 | + |
---|
| 663 | + //constraints.gridy += 1; |
---|
| 664 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 665 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 666 | + lookAtCB.addItemListener(this); |
---|
| 667 | + |
---|
| 668 | + } |
---|
636 | 669 | |
---|
637 | 670 | void EditObject(Object3D obj) |
---|
638 | 671 | { |
---|
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(); |
---|
| 672 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 673 | + radioButton.SetObject(obj); |
---|
| 674 | + radioButton.layout = sevenButton; |
---|
| 675 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 676 | + radioButton.addActionListener(this); |
---|
| 677 | + radioPanel.add(radioButton); |
---|
| 678 | + buttonGroup.add(radioButton); |
---|
| 679 | + radioButton.doClick(); |
---|
647 | 680 | } |
---|
648 | 681 | void SetupViews(ObjEditor oe) |
---|
649 | 682 | { |
---|
.. | .. |
---|
663 | 696 | JCheckBox fastCB; |
---|
664 | 697 | JCheckBox slowCB; |
---|
665 | 698 | JCheckBox boxCB; |
---|
| 699 | + JCheckBox zoomBoxCB; |
---|
666 | 700 | JCheckBox trackCB; |
---|
667 | 701 | JCheckBox smoothfocusCB; |
---|
668 | 702 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
705 | 739 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 740 | else |
---|
707 | 741 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 742 | + } else if(e.getSource() == liveCB) |
---|
710 | 743 | { |
---|
711 | 744 | cameraView.ToggleLive(); |
---|
712 | 745 | } |
---|
.. | .. |
---|
743 | 776 | Recompile(); |
---|
744 | 777 | cameraView.repaint(); |
---|
745 | 778 | // refreshContents(); |
---|
| 779 | + } |
---|
| 780 | + else if(e.getSource() == zoomBoxCB) |
---|
| 781 | + { |
---|
| 782 | + cameraView.ToggleZoomBoxMode(); |
---|
746 | 783 | } |
---|
747 | 784 | else if(e.getSource() == smoothfocusCB) |
---|
748 | 785 | { |
---|
.. | .. |
---|
1033 | 1070 | torusItem.addActionListener(this); |
---|
1034 | 1071 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | 1072 | superItem.addActionListener(this); |
---|
| 1073 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1074 | + kleinItem.addActionListener(this); |
---|
1036 | 1075 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | 1076 | particleItem.addActionListener(this); |
---|
1038 | 1077 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1106 | 1145 | resetParentItem.addActionListener(this); |
---|
1107 | 1146 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1147 | repairParentItem.addActionListener(this); |
---|
| 1148 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1149 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1150 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1151 | invariantsItem.addActionListener(this); |
---|
1111 | 1152 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1441 | 1482 | |
---|
1442 | 1483 | void Overwrite(int mask) |
---|
1443 | 1484 | { |
---|
1444 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1485 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1445 | 1486 | { |
---|
1446 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1487 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
1447 | 1488 | |
---|
1448 | 1489 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1449 | 1490 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1466 | 1507 | // |
---|
1467 | 1508 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1468 | 1509 | { |
---|
| 1510 | + Object source = event.getSource(); |
---|
1469 | 1511 | /* |
---|
1470 | 1512 | if (event.getSource() == nameField) |
---|
1471 | 1513 | { |
---|
.. | .. |
---|
1477 | 1519 | } |
---|
1478 | 1520 | else |
---|
1479 | 1521 | */ |
---|
1480 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1522 | + if (source == lookAtItem || source == lookFromItem) |
---|
1481 | 1523 | { |
---|
1482 | 1524 | ScreenFit(); |
---|
1483 | 1525 | } else |
---|
1484 | | - if (event.getSource() == switchItem) |
---|
| 1526 | + if (source == switchItem) |
---|
1485 | 1527 | { |
---|
1486 | 1528 | cVector v1 = new cVector(); |
---|
1487 | 1529 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1490 | 1532 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1491 | 1533 | objEditor.cameraView.repaint(); |
---|
1492 | 1534 | } else |
---|
1493 | | - if (event.getSource() == rectoidItem) |
---|
| 1535 | + if (source == rectoidItem) |
---|
1494 | 1536 | { |
---|
1495 | 1537 | makeSomething(new Box()); |
---|
1496 | 1538 | } else |
---|
1497 | | - if (event.getSource() == particleItem) |
---|
| 1539 | + if (source == particleItem) |
---|
1498 | 1540 | { |
---|
1499 | 1541 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1500 | 1542 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1515 | 1557 | applyExample(particleGeom, "SMOKE"); |
---|
1516 | 1558 | makeSomething(particleGeom); |
---|
1517 | 1559 | } else |
---|
1518 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1560 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1519 | 1561 | { |
---|
1520 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1562 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1521 | 1563 | |
---|
1522 | 1564 | ragdoll.toParent = LA.newMatrix(); |
---|
1523 | 1565 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1535 | 1577 | } else |
---|
1536 | 1578 | /* |
---|
1537 | 1579 | */ |
---|
1538 | | - if (event.getSource() == heightFieldItem) |
---|
| 1580 | + if (source == heightFieldItem) |
---|
1539 | 1581 | { |
---|
1540 | 1582 | Object3D obj = new Object3D(); |
---|
1541 | 1583 | |
---|
.. | .. |
---|
1573 | 1615 | |
---|
1574 | 1616 | makeSomething(obj); |
---|
1575 | 1617 | } else |
---|
1576 | | - if (event.getSource() == gridItem) |
---|
| 1618 | + if (source == gridItem) |
---|
1577 | 1619 | { |
---|
1578 | 1620 | makeSomething(new Grid()); |
---|
1579 | 1621 | } else |
---|
1580 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1622 | + if (source == ellipsoidItem) |
---|
1581 | 1623 | { |
---|
1582 | 1624 | makeSomething(new Sphere()); |
---|
1583 | 1625 | } else |
---|
1584 | | - if (event.getSource() == coneItem) |
---|
| 1626 | + if (source == coneItem) |
---|
1585 | 1627 | { |
---|
1586 | 1628 | makeSomething(new Cone()); |
---|
1587 | 1629 | } else |
---|
1588 | | - if (event.getSource() == torusItem) |
---|
| 1630 | + if (source == torusItem) |
---|
1589 | 1631 | { |
---|
1590 | 1632 | makeSomething(new Torus()); |
---|
1591 | 1633 | } else |
---|
1592 | | - if (event.getSource() == superItem) |
---|
| 1634 | + if (source == superItem) |
---|
1593 | 1635 | { |
---|
1594 | 1636 | makeSomething(new Superellipsoid()); |
---|
1595 | 1637 | } else |
---|
1596 | | - if (event.getSource() == blobItem) |
---|
| 1638 | + if (source == kleinItem) |
---|
| 1639 | + { |
---|
| 1640 | + makeSomething(new Klein()); |
---|
| 1641 | + } else |
---|
| 1642 | + if (source == blobItem) |
---|
1597 | 1643 | { |
---|
1598 | 1644 | Blob blob = new Blob(); |
---|
1599 | 1645 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1601 | 1647 | //blob.retile(); |
---|
1602 | 1648 | makeSomething(blob); |
---|
1603 | 1649 | } else |
---|
1604 | | - if (event.getSource() == latheItem) |
---|
| 1650 | + if (source == latheItem) |
---|
1605 | 1651 | { |
---|
1606 | 1652 | makeSomething(new Lathe()); |
---|
1607 | 1653 | } else |
---|
1608 | | - if (event.getSource() == bezierItem) |
---|
| 1654 | + if (source == bezierItem) |
---|
1609 | 1655 | { |
---|
1610 | 1656 | makeSomething(new BezierSurface()); |
---|
1611 | 1657 | } else |
---|
1612 | | - if (event.getSource() == checkerItem) |
---|
| 1658 | + if (source == checkerItem) |
---|
1613 | 1659 | { |
---|
1614 | 1660 | /* |
---|
1615 | 1661 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1624 | 1670 | */ |
---|
1625 | 1671 | makeSomething(new Checker()); |
---|
1626 | 1672 | } else |
---|
1627 | | - if (event.getSource() == meshItem) |
---|
| 1673 | + if (source == meshItem) |
---|
1628 | 1674 | { |
---|
1629 | 1675 | Object3D itemtomake = new Object3D(); |
---|
1630 | 1676 | Object3D child; |
---|
.. | .. |
---|
1645 | 1691 | makeSomething(child); |
---|
1646 | 1692 | } |
---|
1647 | 1693 | } else |
---|
1648 | | - if (event.getSource() == springItem) |
---|
| 1694 | + if (source == springItem) |
---|
1649 | 1695 | { |
---|
1650 | 1696 | cSpring s = new cSpring(); |
---|
1651 | 1697 | s.setup(); |
---|
1652 | 1698 | makeSomething(s); |
---|
1653 | 1699 | } else |
---|
1654 | | - if (event.getSource() == flagItem) |
---|
| 1700 | + if (source == flagItem) |
---|
1655 | 1701 | { |
---|
1656 | 1702 | cSpring s = new cFlag(); |
---|
1657 | 1703 | s.setup(); |
---|
1658 | 1704 | makeSomething(s); |
---|
1659 | 1705 | } else |
---|
1660 | | - if (event.getSource() == lightItem) |
---|
| 1706 | + if (source == lightItem) |
---|
1661 | 1707 | { |
---|
1662 | 1708 | makeSomething(new Light()); |
---|
1663 | 1709 | } else |
---|
1664 | | - if (event.getSource() == csgItem) |
---|
| 1710 | + if (source == csgItem) |
---|
1665 | 1711 | { |
---|
1666 | 1712 | group(new CSG()); |
---|
1667 | 1713 | } else |
---|
1668 | | - if (event.getSource() == templateItem) |
---|
| 1714 | + if (source == templateItem) |
---|
1669 | 1715 | { |
---|
1670 | 1716 | group(new cTemplate()); |
---|
1671 | 1717 | } else |
---|
1672 | | - if (event.getSource() == attributeItem) |
---|
| 1718 | + if (source == attributeItem) |
---|
1673 | 1719 | { |
---|
1674 | 1720 | makeSomething(new Attribute()); |
---|
1675 | 1721 | } else |
---|
1676 | | - if (event.getSource() == pointflowItem) |
---|
| 1722 | + if (source == pointflowItem) |
---|
1677 | 1723 | { |
---|
1678 | 1724 | makeSomething(new PointFlow()); |
---|
1679 | 1725 | } else |
---|
.. | .. |
---|
1685 | 1731 | } else |
---|
1686 | 1732 | */ |
---|
1687 | 1733 | |
---|
1688 | | - if (event.getSource() == superLoopItem) |
---|
| 1734 | + if (source == superLoopItem) |
---|
1689 | 1735 | { |
---|
1690 | 1736 | Composite g = new cGroup(); |
---|
1691 | 1737 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1707 | 1753 | |
---|
1708 | 1754 | group(g); |
---|
1709 | 1755 | } else |
---|
1710 | | - if (event.getSource() == loopItem) |
---|
| 1756 | + if (source == loopItem) |
---|
1711 | 1757 | { |
---|
1712 | 1758 | Composite csg = new GroupLeaf(); |
---|
1713 | 1759 | csg.count = 5; |
---|
.. | .. |
---|
1716 | 1762 | csg.addChild(child); |
---|
1717 | 1763 | child.addChild(csg); |
---|
1718 | 1764 | } else |
---|
1719 | | - if (event.getSource() == doubleItem) |
---|
| 1765 | + if (source == doubleItem) |
---|
1720 | 1766 | { |
---|
1721 | 1767 | Composite csg = new GroupLeaf(); |
---|
1722 | 1768 | csg.count = 5; |
---|
.. | .. |
---|
1728 | 1774 | csg.addChild(child); |
---|
1729 | 1775 | child.addChild(csg); |
---|
1730 | 1776 | } else |
---|
1731 | | - if (event.getSource() == tripleItem) |
---|
| 1777 | + if (source == tripleItem) |
---|
1732 | 1778 | { |
---|
1733 | 1779 | Composite csg = new GroupLeaf(); |
---|
1734 | 1780 | csg.count = 4; |
---|
.. | .. |
---|
1744 | 1790 | child.addChild(csg); |
---|
1745 | 1791 | } else |
---|
1746 | 1792 | |
---|
1747 | | - if (event.getSource() == importGFDItem) |
---|
| 1793 | + if (source == importGFDItem) |
---|
1748 | 1794 | { |
---|
1749 | 1795 | ImportGFD(); |
---|
1750 | 1796 | } else |
---|
1751 | | - if (event.getSource() == importVRMLX3DItem) |
---|
| 1797 | + if (source == importVRMLX3DItem) |
---|
1752 | 1798 | { |
---|
1753 | 1799 | ImportVRMLX3D(); |
---|
1754 | 1800 | } else |
---|
1755 | | - if (event.getSource() == import3DSItem) |
---|
| 1801 | + if (source == import3DSItem) |
---|
1756 | 1802 | { |
---|
1757 | 1803 | objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1758 | 1804 | } else |
---|
1759 | | - if (event.getSource() == importOBJItem) |
---|
| 1805 | + if (source == importOBJItem) |
---|
1760 | 1806 | { |
---|
1761 | 1807 | objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1762 | 1808 | } else |
---|
1763 | | - if (event.getSource() == computeAOItem) |
---|
| 1809 | + if (source == computeAOItem) |
---|
1764 | 1810 | { |
---|
1765 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1766 | | - CameraPane.theRenderer.repaint(); |
---|
| 1811 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1812 | + Globals.theRenderer.repaint(); |
---|
1767 | 1813 | } else |
---|
1768 | | - if (event.getSource() == recompileItem) |
---|
| 1814 | + if (source == recompileItem) |
---|
1769 | 1815 | { |
---|
1770 | 1816 | Recompile(); |
---|
1771 | 1817 | refreshContents(); |
---|
1772 | 1818 | } else |
---|
1773 | | - if (event.getSource() == editScriptItem) |
---|
| 1819 | + if (source == editScriptItem) |
---|
1774 | 1820 | { |
---|
1775 | 1821 | OpenDialog(); |
---|
1776 | 1822 | refreshContents(); |
---|
1777 | 1823 | } else |
---|
1778 | | - if (event.getSource() == invariantsItem) |
---|
| 1824 | + if (source == invariantsItem) |
---|
1779 | 1825 | { |
---|
1780 | 1826 | System.out.println("Invariants:"); |
---|
1781 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1827 | + GrafreeD.grafreeD.universe.invariants(); |
---|
1782 | 1828 | } else |
---|
1783 | | - if (event.getSource() == memoryItem) |
---|
| 1829 | + if (source == memoryItem) |
---|
1784 | 1830 | { |
---|
1785 | 1831 | //System.out.println("Invariants:"); |
---|
1786 | 1832 | PrintMemory(); |
---|
1787 | 1833 | } else |
---|
1788 | | - if (event.getSource() == pathItem) |
---|
| 1834 | + if (source == pathItem) |
---|
1789 | 1835 | { |
---|
1790 | 1836 | PrintPath(); |
---|
1791 | 1837 | } else |
---|
1792 | | - if (event.getSource() == analyzeItem) |
---|
| 1838 | + if (source == analyzeItem) |
---|
1793 | 1839 | { |
---|
1794 | 1840 | AnalyzeObject(); |
---|
1795 | 1841 | } else |
---|
1796 | | - if (event.getSource() == dumpItem) |
---|
| 1842 | + if (source == dumpItem) |
---|
1797 | 1843 | { |
---|
1798 | 1844 | DumpObject(); |
---|
1799 | 1845 | } else |
---|
1800 | | - if (event.getSource() == screenfitButton) |
---|
| 1846 | + if (source == screenfitButton) |
---|
1801 | 1847 | { |
---|
1802 | 1848 | //Reload(lastConverter, lastFilename, true); |
---|
1803 | 1849 | ScreenFit(); |
---|
1804 | 1850 | } else |
---|
1805 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1851 | + if (source == screenfitpointButton) |
---|
1806 | 1852 | { |
---|
1807 | 1853 | //Reload(lastConverter, lastFilename, true); |
---|
1808 | 1854 | ScreenFitPoint(); |
---|
1809 | 1855 | } else |
---|
1810 | | - if (event.getSource() == snapobjectButton) |
---|
| 1856 | + if (source == snapobjectButton) |
---|
1811 | 1857 | { |
---|
1812 | 1858 | //Reload(lastConverter, lastFilename, true); |
---|
1813 | 1859 | SnapObject(); |
---|
.. | .. |
---|
1818 | 1864 | // Recompile(); |
---|
1819 | 1865 | // refreshContents(); |
---|
1820 | 1866 | // } else |
---|
1821 | | - if (event.getSource() == gcButton) |
---|
| 1867 | + if (source == gcButton) |
---|
1822 | 1868 | { |
---|
1823 | 1869 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1824 | 1870 | System.gc(); |
---|
1825 | 1871 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1826 | 1872 | } else |
---|
1827 | | - if (event.getSource() == editLeafItem) |
---|
| 1873 | + if (source == editLeafItem) |
---|
1828 | 1874 | { |
---|
1829 | 1875 | Object3D obj; |
---|
1830 | 1876 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1838 | 1884 | } |
---|
1839 | 1885 | refreshContents(true); |
---|
1840 | 1886 | } else |
---|
1841 | | - if (event.getSource() == openWindowItem) |
---|
| 1887 | + if (source == openWindowItem) |
---|
1842 | 1888 | { |
---|
1843 | 1889 | EditSelection(true); |
---|
1844 | 1890 | } else |
---|
1845 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 1891 | + if (source == cutItem || source == clearButton) |
---|
1846 | 1892 | { |
---|
1847 | 1893 | loadClipboard(true); |
---|
1848 | 1894 | } else |
---|
1849 | | - if (event.getSource() == duplicateItem) |
---|
| 1895 | + if (source == duplicateItem) |
---|
1850 | 1896 | { |
---|
1851 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 1897 | + Object3D keep = GrafreeD.clipboard; |
---|
1852 | 1898 | loadClipboard(false); |
---|
1853 | 1899 | paste(false); |
---|
1854 | | - GraphreeD.clipboard = keep; |
---|
| 1900 | + GrafreeD.clipboard = keep; |
---|
1855 | 1901 | } else |
---|
1856 | | - if (event.getSource() == cloneItem) |
---|
| 1902 | + if (source == cloneItem) |
---|
1857 | 1903 | { |
---|
1858 | 1904 | CloneSelection(false); |
---|
1859 | 1905 | } else |
---|
1860 | | - if (event.getSource() == cloneSupportItem) |
---|
| 1906 | + if (source == cloneSupportItem) |
---|
1861 | 1907 | { |
---|
1862 | 1908 | CloneSelection(true); |
---|
1863 | 1909 | } else |
---|
1864 | | - if (event.getSource() == copyItem) |
---|
| 1910 | + if (source == copyItem) |
---|
1865 | 1911 | { |
---|
1866 | 1912 | loadClipboard(false); |
---|
1867 | 1913 | } else |
---|
1868 | | - if (event.getSource() == pasteItem) |
---|
| 1914 | + if (source == pasteItem) |
---|
1869 | 1915 | { |
---|
1870 | 1916 | paste(false); |
---|
1871 | 1917 | } else |
---|
1872 | | - if (event.getSource() == pasteLinkItem) |
---|
| 1918 | + if (source == pasteLinkItem) |
---|
1873 | 1919 | { |
---|
1874 | 1920 | pasteInto(false); |
---|
1875 | 1921 | } else |
---|
1876 | | - if (event.getSource() == pasteCloneItem) |
---|
| 1922 | + if (source == pasteCloneItem) |
---|
1877 | 1923 | { |
---|
1878 | 1924 | pasteInto(true); |
---|
1879 | 1925 | } else |
---|
1880 | | - if (event.getSource() == pasteExpandItem) |
---|
| 1926 | + if (source == pasteExpandItem) |
---|
1881 | 1927 | { |
---|
1882 | 1928 | paste(true); |
---|
1883 | 1929 | } else |
---|
1884 | | - if (event.getSource() == synchronizeItem) |
---|
| 1930 | + if (source == synchronizeItem) |
---|
1885 | 1931 | { |
---|
1886 | 1932 | Overwrite(Object3D.TRANSFORM); |
---|
1887 | 1933 | } else |
---|
1888 | | - if (event.getSource() == overwriteNameItem) |
---|
| 1934 | + if (source == overwriteNameItem) |
---|
1889 | 1935 | { |
---|
1890 | 1936 | Overwrite(Object3D.NAME); |
---|
1891 | 1937 | } else |
---|
1892 | | - if (event.getSource() == overwriteUVItem) |
---|
| 1938 | + if (source == overwriteUVItem) |
---|
1893 | 1939 | { |
---|
1894 | 1940 | Overwrite(Object3D.UV); |
---|
1895 | 1941 | } else |
---|
1896 | | - if (event.getSource() == overwriteMatItem) |
---|
| 1942 | + if (source == overwriteMatItem) |
---|
1897 | 1943 | { |
---|
| 1944 | + /* july 2015 |
---|
1898 | 1945 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1899 | | - Overwrite(Object3D.MATERIAL); |
---|
| 1946 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1900 | 1947 | else |
---|
1901 | 1948 | { |
---|
1902 | 1949 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1908 | 1955 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1909 | 1956 | } |
---|
1910 | 1957 | } |
---|
| 1958 | + */ |
---|
| 1959 | + |
---|
| 1960 | + Overwrite(dropAttributes); |
---|
1911 | 1961 | } |
---|
1912 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 1962 | + if (source == overwriteGeoItem) |
---|
1913 | 1963 | { |
---|
1914 | 1964 | Overwrite(Object3D.GEOMETRY); |
---|
1915 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1965 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1916 | 1966 | // { |
---|
1917 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1967 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1918 | 1968 | // |
---|
1919 | 1969 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1920 | 1970 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1926 | 1976 | // refreshContents(); |
---|
1927 | 1977 | // } |
---|
1928 | 1978 | } else |
---|
1929 | | - if (event.getSource() == generateMeshItem) |
---|
| 1979 | + if (source == generateMeshItem) |
---|
1930 | 1980 | { |
---|
1931 | 1981 | //if (group.selection.size() == 1) |
---|
1932 | 1982 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1937 | 1987 | ResetModel(); |
---|
1938 | 1988 | refreshContents(); |
---|
1939 | 1989 | } else |
---|
1940 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 1990 | + if (source == extractGeometriesItem) |
---|
1941 | 1991 | { |
---|
1942 | 1992 | boolean one = false; |
---|
1943 | 1993 | |
---|
.. | .. |
---|
1964 | 2014 | ResetModel(); |
---|
1965 | 2015 | refreshContents(); |
---|
1966 | 2016 | } else |
---|
1967 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2017 | + if (source == cloneGeometriesItem) |
---|
1968 | 2018 | { |
---|
1969 | 2019 | boolean one = false; |
---|
1970 | 2020 | |
---|
.. | .. |
---|
1990 | 2040 | ResetModel(); |
---|
1991 | 2041 | refreshContents(); |
---|
1992 | 2042 | } else |
---|
1993 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2043 | + if (source == shareGeometriesItem) |
---|
1994 | 2044 | { |
---|
1995 | 2045 | boolean one = false; |
---|
1996 | 2046 | |
---|
1997 | 2047 | if (group.selection.size() == 1) |
---|
1998 | 2048 | one = true; |
---|
1999 | 2049 | |
---|
| 2050 | + Object3D merge = null; |
---|
| 2051 | + |
---|
2000 | 2052 | Object3D content = new cGroup(); |
---|
2001 | 2053 | |
---|
2002 | 2054 | for (int i=0; i<group.selection.size(); i++) |
---|
2003 | 2055 | { |
---|
2004 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2056 | + merge = new Merge(group.selection.get(i)); |
---|
2005 | 2057 | |
---|
2006 | 2058 | if (one) |
---|
2007 | | - makeSomething(sel, false); |
---|
| 2059 | + makeSomething(merge, false); |
---|
2008 | 2060 | else |
---|
2009 | | - content.addChild(sel); |
---|
| 2061 | + content.addChild(merge); |
---|
2010 | 2062 | } |
---|
2011 | 2063 | |
---|
2012 | 2064 | if (!one) |
---|
2013 | | - makeSomething(content, false); |
---|
2014 | | - |
---|
2015 | | - ResetModel(); |
---|
2016 | | - refreshContents(); |
---|
| 2065 | + makeSomething(content, true); |
---|
| 2066 | + else |
---|
| 2067 | + { |
---|
| 2068 | + ResetModel(); |
---|
| 2069 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2070 | + refreshContents(); |
---|
| 2071 | + } |
---|
2017 | 2072 | } else |
---|
2018 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2073 | + if (source == mergeGeometriesItem) |
---|
2019 | 2074 | { |
---|
2020 | 2075 | boolean one = false; |
---|
2021 | 2076 | |
---|
.. | .. |
---|
2045 | 2100 | ResetModel(); |
---|
2046 | 2101 | refreshContents(); |
---|
2047 | 2102 | } else |
---|
2048 | | - if (event.getSource() == linkverticesItem) |
---|
| 2103 | + if (source == linkverticesItem) |
---|
2049 | 2104 | { |
---|
2050 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2105 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2051 | 2106 | // { |
---|
2052 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2107 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2053 | 2108 | // |
---|
2054 | 2109 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2055 | 2110 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2058 | 2113 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2059 | 2114 | // refreshContents(); |
---|
2060 | 2115 | // } |
---|
2061 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2116 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
2062 | 2117 | { |
---|
2063 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2118 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2064 | 2119 | |
---|
2065 | 2120 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2066 | 2121 | content = ((cGroup)content).get(0); |
---|
2067 | 2122 | |
---|
2068 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2123 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2069 | 2124 | for (int i=0; i<group.selection.size(); i++) |
---|
2070 | 2125 | { |
---|
2071 | 2126 | boolean random = CameraPane.RANDOM; |
---|
.. | .. |
---|
2074 | 2129 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2075 | 2130 | CameraPane.RANDOM = random; |
---|
2076 | 2131 | } |
---|
2077 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2132 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2078 | 2133 | refreshContents(); |
---|
2079 | 2134 | } |
---|
2080 | 2135 | } else |
---|
2081 | | - if (event.getSource() == resetsupportItem) |
---|
| 2136 | + if (source == resetsupportItem) |
---|
2082 | 2137 | { |
---|
2083 | 2138 | for (int i=0; i<group.selection.size(); i++) |
---|
2084 | 2139 | { |
---|
.. | .. |
---|
2090 | 2145 | |
---|
2091 | 2146 | refreshContents(); |
---|
2092 | 2147 | } else |
---|
2093 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2148 | + if (source == relinkverticesItem) |
---|
| 2149 | + { |
---|
| 2150 | + boolean random = CameraPane.RANDOM; |
---|
| 2151 | + CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2152 | + group.selection.RelinkToSupport(); |
---|
| 2153 | + CameraPane.RANDOM = random; |
---|
| 2154 | + |
---|
| 2155 | + refreshContents(); |
---|
| 2156 | + } else |
---|
| 2157 | + if (source == resetreferencesItem) |
---|
2094 | 2158 | { |
---|
2095 | 2159 | for (int i=0; i<group.selection.size(); i++) |
---|
2096 | 2160 | { |
---|
.. | .. |
---|
2099 | 2163 | |
---|
2100 | 2164 | refreshContents(); |
---|
2101 | 2165 | } else |
---|
2102 | | - if (event.getSource() == setMasterItem) |
---|
| 2166 | + if (source == setMasterItem) |
---|
2103 | 2167 | { |
---|
2104 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2168 | + if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2105 | 2169 | { |
---|
2106 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2170 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2107 | 2171 | |
---|
2108 | 2172 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2109 | 2173 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2112 | 2176 | refreshContents(); |
---|
2113 | 2177 | } |
---|
2114 | 2178 | } else |
---|
2115 | | - if (event.getSource() == poseMeshItem) |
---|
| 2179 | + if (source == poseMeshItem) |
---|
2116 | 2180 | { |
---|
2117 | 2181 | if (group.selection.size() == 1) |
---|
2118 | 2182 | { |
---|
2119 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2183 | + if (GrafreeD.clipboard.size() == 1) |
---|
2120 | 2184 | { |
---|
2121 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2185 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2122 | 2186 | |
---|
2123 | 2187 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2124 | 2188 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2131 | 2195 | } |
---|
2132 | 2196 | |
---|
2133 | 2197 | } else |
---|
2134 | | - if (event.getSource() == revertMeshItem) |
---|
| 2198 | + if (source == revertMeshItem) |
---|
2135 | 2199 | { |
---|
2136 | 2200 | RevertMeshes(); |
---|
2137 | 2201 | } else |
---|
2138 | | - if (event.getSource() == resetMeshItem) |
---|
| 2202 | + if (source == resetMeshItem) |
---|
2139 | 2203 | { |
---|
2140 | 2204 | ResetAll(); |
---|
2141 | 2205 | } else |
---|
2142 | | - if (event.getSource() == stepAllItem) |
---|
| 2206 | + if (source == stepAllItem) |
---|
2143 | 2207 | { |
---|
2144 | 2208 | StepAll(); |
---|
2145 | 2209 | } else |
---|
2146 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2210 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2147 | 2211 | { |
---|
2148 | 2212 | //int indices[] = jList.getSelectedIndices(); |
---|
2149 | 2213 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2151 | 2215 | |
---|
2152 | 2216 | ClearSelection(false); |
---|
2153 | 2217 | } else |
---|
2154 | | - if (event.getSource() == clearAllItem) |
---|
| 2218 | + if (source == clearAllItem) |
---|
2155 | 2219 | { |
---|
2156 | 2220 | ClearSelection(true); |
---|
2157 | 2221 | } else |
---|
2158 | | - if (event.getSource() == grabItem) |
---|
| 2222 | + if (source == grabItem) |
---|
2159 | 2223 | { |
---|
2160 | 2224 | group(new cGroup(), true); |
---|
2161 | 2225 | } else |
---|
2162 | | - if (event.getSource() == frontItem) |
---|
| 2226 | + if (source == hideItem) |
---|
| 2227 | + { |
---|
| 2228 | + group(new HiddenObject()); |
---|
| 2229 | + } else |
---|
| 2230 | + if (source == frontItem) |
---|
2163 | 2231 | { |
---|
2164 | 2232 | front(); |
---|
2165 | 2233 | } else |
---|
2166 | | - if (event.getSource() == backItem) |
---|
| 2234 | + if (source == backItem) |
---|
2167 | 2235 | { |
---|
2168 | 2236 | back(); |
---|
2169 | 2237 | } else |
---|
2170 | | - if (event.getSource() == cameraItem) |
---|
| 2238 | + if (source == cameraItem) |
---|
2171 | 2239 | { |
---|
2172 | 2240 | makeSomething(new Camera()); |
---|
2173 | 2241 | } else |
---|
2174 | | - if (event.getSource() == compositeItem) |
---|
| 2242 | + if (source == compositeItem) |
---|
2175 | 2243 | { |
---|
2176 | 2244 | group(new Composite()); |
---|
2177 | 2245 | } else |
---|
2178 | | - if (event.getSource() == randomItem) |
---|
| 2246 | + if (source == randomItem) |
---|
2179 | 2247 | { |
---|
2180 | 2248 | RandomNode random = new RandomNode(); |
---|
2181 | 2249 | group(random); |
---|
2182 | 2250 | if (random.size() > 0) |
---|
2183 | 2251 | random.name = random.get(0).name + "Rnd"; |
---|
2184 | 2252 | } else |
---|
2185 | | - if (event.getSource() == physicsItem) |
---|
| 2253 | + if (source == physicsItem) |
---|
2186 | 2254 | { |
---|
2187 | 2255 | group(new PhysicsNode()); |
---|
2188 | 2256 | } else |
---|
2189 | | - if (event.getSource() == frameselectorItem) |
---|
| 2257 | + if (source == frameselectorItem) |
---|
2190 | 2258 | { |
---|
2191 | 2259 | for (int i=0; i<group.selection.size(); i++) |
---|
2192 | 2260 | { |
---|
.. | .. |
---|
2198 | 2266 | ResetModel(); |
---|
2199 | 2267 | refreshContents(); |
---|
2200 | 2268 | } else |
---|
2201 | | - if (event.getSource() == switchGeoItem) |
---|
| 2269 | + if (source == switchGeoItem) |
---|
2202 | 2270 | { |
---|
2203 | 2271 | for (int i=0; i<group.selection.size(); i++) |
---|
2204 | 2272 | { |
---|
.. | .. |
---|
2210 | 2278 | ResetModel(); |
---|
2211 | 2279 | refreshContents(); |
---|
2212 | 2280 | } else |
---|
2213 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2281 | + if (source == switchTransfoItem) |
---|
2214 | 2282 | { |
---|
2215 | 2283 | for (int i=0; i<group.selection.size(); i++) |
---|
2216 | 2284 | { |
---|
.. | .. |
---|
2222 | 2290 | ResetModel(); |
---|
2223 | 2291 | refreshContents(); |
---|
2224 | 2292 | } else |
---|
2225 | | - if (event.getSource() == morphItem) |
---|
| 2293 | + if (source == morphItem) |
---|
2226 | 2294 | { |
---|
2227 | 2295 | for (int i=0; i<group.selection.size(); i++) |
---|
2228 | 2296 | { |
---|
.. | .. |
---|
2234 | 2302 | ResetModel(); |
---|
2235 | 2303 | refreshContents(); |
---|
2236 | 2304 | } else |
---|
2237 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2305 | + if (source == scriptNodeItem) |
---|
2238 | 2306 | { |
---|
2239 | 2307 | boolean atleastone = false; |
---|
2240 | 2308 | |
---|
.. | .. |
---|
2273 | 2341 | } |
---|
2274 | 2342 | } |
---|
2275 | 2343 | } else |
---|
2276 | | - if (event.getSource() == linkerItem) |
---|
| 2344 | + if (source == linkerItem) |
---|
2277 | 2345 | { |
---|
2278 | 2346 | group(new cLinker()); |
---|
2279 | 2347 | } else |
---|
2280 | | - if (event.getSource() == textureItem) |
---|
| 2348 | + if (source == textureItem) |
---|
2281 | 2349 | { |
---|
2282 | 2350 | group(new TextureNode()); |
---|
2283 | 2351 | } else |
---|
2284 | | - if (event.getSource() == shadowXItem) |
---|
| 2352 | + if (source == billboardItem) |
---|
| 2353 | + { |
---|
| 2354 | + group(new BillboardNode()); |
---|
| 2355 | + } else |
---|
| 2356 | + if (source == shadowXItem) |
---|
2285 | 2357 | { |
---|
2286 | 2358 | CastShadow(0); |
---|
2287 | 2359 | } else |
---|
2288 | | - if (event.getSource() == shadowYItem) |
---|
| 2360 | + if (source == shadowYItem) |
---|
2289 | 2361 | { |
---|
2290 | 2362 | CastShadow(1); |
---|
2291 | 2363 | } else |
---|
2292 | | - if (event.getSource() == shadowZItem) |
---|
| 2364 | + if (source == shadowZItem) |
---|
2293 | 2365 | { |
---|
2294 | 2366 | CastShadow(2); |
---|
2295 | 2367 | } else |
---|
2296 | | - if (event.getSource() == ungroupItem) |
---|
| 2368 | + if (source == ungroupItem) |
---|
2297 | 2369 | { |
---|
2298 | | - ungroup(); |
---|
| 2370 | + //ungroup(); |
---|
| 2371 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2372 | + { |
---|
| 2373 | + Ungroup(group.selection.get(i)); |
---|
| 2374 | + } |
---|
| 2375 | + |
---|
| 2376 | + ClearSelection(false); |
---|
| 2377 | + |
---|
| 2378 | + refreshContents(); |
---|
2299 | 2379 | } else |
---|
2300 | | - if (event.getSource() == genUVItem) |
---|
| 2380 | + if (source == genUVItem) |
---|
2301 | 2381 | { |
---|
2302 | 2382 | GenUV(); |
---|
2303 | 2383 | } else |
---|
2304 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2384 | + if (source == genNormalsCADItem) |
---|
2305 | 2385 | { |
---|
2306 | 2386 | GenNormals(true); |
---|
2307 | 2387 | } else |
---|
2308 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2388 | + if (source == genNormalsMESHItem) |
---|
| 2389 | + { |
---|
| 2390 | + GenNormals(true); // TODO |
---|
| 2391 | + } else |
---|
| 2392 | + if (source == genNormalsORGANItem) |
---|
2309 | 2393 | { |
---|
2310 | 2394 | GenNormals(false); |
---|
2311 | 2395 | } else |
---|
2312 | | - if (event.getSource() == stripifyItem) |
---|
| 2396 | + if (source == genNormalsMINEItem) |
---|
| 2397 | + { |
---|
| 2398 | + GenNormalsMINE(); |
---|
| 2399 | + } else |
---|
| 2400 | + if (source == stripifyItem) |
---|
2313 | 2401 | { |
---|
2314 | 2402 | Stripify(); |
---|
2315 | 2403 | } else |
---|
2316 | | - if (event.getSource() == unstripifyItem) |
---|
| 2404 | + if (source == unstripifyItem) |
---|
2317 | 2405 | { |
---|
2318 | 2406 | Unstripify(); |
---|
2319 | 2407 | } else |
---|
2320 | | - if (event.getSource() == trimItem) |
---|
| 2408 | + if (source == trimItem) |
---|
2321 | 2409 | { |
---|
2322 | 2410 | Trim(); |
---|
2323 | 2411 | } else |
---|
2324 | | - if (event.getSource() == untrimItem) |
---|
| 2412 | + if (source == untrimItem) |
---|
2325 | 2413 | { |
---|
2326 | 2414 | Untrim(); |
---|
2327 | 2415 | } else |
---|
2328 | | - if (event.getSource() == clearColorsItem) |
---|
| 2416 | + if (source == clearColorsItem) |
---|
2329 | 2417 | { |
---|
2330 | 2418 | ClearColors(); |
---|
2331 | 2419 | } else |
---|
2332 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2420 | + if (source == clearMaterialsItem) |
---|
2333 | 2421 | { |
---|
2334 | 2422 | ClearMaterials(); |
---|
2335 | 2423 | } else |
---|
2336 | | - if (event.getSource() == liveleavesItem) |
---|
| 2424 | + if (source == liveleavesItem) |
---|
2337 | 2425 | { |
---|
2338 | 2426 | LiveLeaves(true); |
---|
2339 | 2427 | } else |
---|
2340 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2428 | + if (source == unliveleavesItem) |
---|
2341 | 2429 | { |
---|
2342 | 2430 | LiveLeaves(false); |
---|
2343 | 2431 | } else |
---|
2344 | | - if (event.getSource() == supportleavesItem) |
---|
| 2432 | + if (source == supportleavesItem) |
---|
2345 | 2433 | { |
---|
2346 | 2434 | SupportLeaves(true); |
---|
2347 | 2435 | } else |
---|
2348 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2436 | + if (source == unsupportleavesItem) |
---|
2349 | 2437 | { |
---|
2350 | 2438 | SupportLeaves(false); |
---|
2351 | 2439 | } else |
---|
2352 | | - if (event.getSource() == hideleavesItem) |
---|
| 2440 | + if (source == hideleavesItem) |
---|
2353 | 2441 | { |
---|
2354 | 2442 | HideLeaves(true); |
---|
2355 | 2443 | } else |
---|
2356 | | - if (event.getSource() == showleavesItem) |
---|
| 2444 | + if (source == showleavesItem) |
---|
2357 | 2445 | { |
---|
2358 | 2446 | HideLeaves(false); |
---|
2359 | 2447 | } else |
---|
2360 | | - if (event.getSource() == markleavesItem) |
---|
| 2448 | + if (source == markleavesItem) |
---|
2361 | 2449 | { |
---|
2362 | 2450 | MarkLeaves(true); |
---|
2363 | 2451 | } else |
---|
2364 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2452 | + if (source == unmarkleavesItem) |
---|
2365 | 2453 | { |
---|
2366 | 2454 | MarkLeaves(false); |
---|
2367 | 2455 | } else |
---|
2368 | | - if (event.getSource() == flipVItem) |
---|
| 2456 | + if (source == flipVItem) |
---|
2369 | 2457 | { |
---|
2370 | 2458 | FlipV(true); |
---|
2371 | 2459 | } else |
---|
2372 | | - if (event.getSource() == unflipVItem) |
---|
| 2460 | + if (source == unflipVItem) |
---|
2373 | 2461 | { |
---|
2374 | 2462 | FlipV(false); |
---|
2375 | 2463 | } else |
---|
2376 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2464 | + if (source == lowTexturesItem) |
---|
2377 | 2465 | { |
---|
2378 | 2466 | SetTexRes(0); |
---|
2379 | 2467 | } else |
---|
2380 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2468 | + if (source == normalTexturesItem) |
---|
2381 | 2469 | { |
---|
2382 | 2470 | SetTexRes(1); |
---|
2383 | 2471 | } else |
---|
2384 | | - if (event.getSource() == highTexturesItem) |
---|
| 2472 | + if (source == highTexturesItem) |
---|
2385 | 2473 | { |
---|
2386 | 2474 | SetTexRes(2); |
---|
2387 | 2475 | } else |
---|
2388 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2476 | + if (source == veryhighTexturesItem) |
---|
2389 | 2477 | { |
---|
2390 | 2478 | SetTexRes(3); |
---|
2391 | 2479 | } else |
---|
2392 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2480 | + if (source == maxTexturesItem) |
---|
2393 | 2481 | { |
---|
2394 | 2482 | SetTexRes(4); |
---|
2395 | 2483 | } else |
---|
2396 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2484 | + if (source == panoTexturesItem) |
---|
2397 | 2485 | { |
---|
2398 | 2486 | SetTexRes(5); |
---|
2399 | 2487 | } else |
---|
2400 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2488 | + if (source == reverseNormalsItem) |
---|
2401 | 2489 | { |
---|
2402 | 2490 | ReverseNormals(); |
---|
2403 | 2491 | } else |
---|
2404 | | - if (event.getSource() == parseverticesItem) |
---|
| 2492 | + if (source == parseverticesItem) |
---|
2405 | 2493 | { |
---|
2406 | 2494 | ParseVertices(); |
---|
2407 | 2495 | } else |
---|
2408 | | - if (event.getSource() == textureFieldItem) |
---|
| 2496 | + if (source == textureFieldItem) |
---|
2409 | 2497 | { |
---|
2410 | 2498 | TextureVertices(); |
---|
2411 | 2499 | } else |
---|
2412 | | - if (event.getSource() == alignItem) |
---|
| 2500 | + if (source == alignItem) |
---|
2413 | 2501 | { |
---|
2414 | 2502 | Align(); |
---|
2415 | 2503 | } else |
---|
2416 | | - if (event.getSource() == mirrorItem) |
---|
| 2504 | + if (source == mirrorItem) |
---|
2417 | 2505 | { |
---|
2418 | 2506 | MirrorPoses(); |
---|
2419 | 2507 | } else |
---|
2420 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2508 | + if (source == reduceMorphItem) |
---|
2421 | 2509 | { |
---|
2422 | 2510 | MeshReduction(false); |
---|
2423 | 2511 | } else |
---|
2424 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2512 | + if (source == reduce34MorphItem) |
---|
2425 | 2513 | { |
---|
2426 | 2514 | MeshReduction(true); |
---|
2427 | 2515 | } else |
---|
2428 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2516 | + if (source == reverseTrianglesItem) |
---|
2429 | 2517 | { |
---|
2430 | 2518 | ReverseTriangles(); |
---|
2431 | 2519 | } else |
---|
2432 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2520 | + if (source == reduceMeshItem) |
---|
2433 | 2521 | { |
---|
2434 | 2522 | ReduceMesh(false); |
---|
2435 | 2523 | } else |
---|
2436 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2524 | + if (source == reduce34MeshItem) |
---|
2437 | 2525 | { |
---|
2438 | 2526 | ReduceMesh(true); |
---|
2439 | 2527 | } else |
---|
2440 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2528 | + if (source == increaseMeshItem) |
---|
2441 | 2529 | { |
---|
2442 | 2530 | IncreaseMesh(); |
---|
2443 | 2531 | } else |
---|
2444 | | - if (event.getSource() == clipMeshItem) |
---|
| 2532 | + if (source == clipMeshItem) |
---|
2445 | 2533 | { |
---|
2446 | 2534 | ClipMesh(); |
---|
2447 | 2535 | } else |
---|
2448 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2536 | + if (source == smoothMeshItem) |
---|
2449 | 2537 | { |
---|
2450 | 2538 | SmoothMesh(); |
---|
2451 | 2539 | } else |
---|
2452 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2540 | + if (source == transformgeometryItem) |
---|
2453 | 2541 | { |
---|
2454 | 2542 | TransformGeometry(); |
---|
2455 | 2543 | } else |
---|
2456 | | - if (event.getSource() == resetTransformItem) |
---|
| 2544 | + if (source == resetTransformItem) |
---|
2457 | 2545 | { |
---|
2458 | 2546 | ResetTransform(); |
---|
2459 | 2547 | } else |
---|
2460 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2548 | + if (source == resetCentroidItem) |
---|
2461 | 2549 | { |
---|
2462 | 2550 | ResetCentroid(); |
---|
2463 | 2551 | } else |
---|
2464 | | - if (event.getSource() == resetParentItem) |
---|
| 2552 | + if (source == resetParentItem) |
---|
2465 | 2553 | { |
---|
2466 | 2554 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2467 | 2555 | { |
---|
.. | .. |
---|
2471 | 2559 | |
---|
2472 | 2560 | refreshContents(); |
---|
2473 | 2561 | } else |
---|
2474 | | - if (event.getSource() == repairParentItem) |
---|
| 2562 | + if (source == repairParentItem) |
---|
2475 | 2563 | { |
---|
2476 | 2564 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2477 | 2565 | { |
---|
.. | .. |
---|
2485 | 2573 | |
---|
2486 | 2574 | refreshContents(); |
---|
2487 | 2575 | } else |
---|
2488 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2576 | + if (source == repairShadowItem) |
---|
| 2577 | + { |
---|
| 2578 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2579 | + { |
---|
| 2580 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2581 | + obj.RepairShadow(); |
---|
| 2582 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2583 | +// { |
---|
| 2584 | +// obj.get(i).parent = obj; |
---|
| 2585 | +// } |
---|
| 2586 | + } |
---|
| 2587 | + |
---|
| 2588 | + refreshContents(); |
---|
| 2589 | + } else |
---|
| 2590 | + if (source == sortbysizeItem) |
---|
2489 | 2591 | { |
---|
2490 | 2592 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2491 | 2593 | { |
---|
.. | .. |
---|
2497 | 2599 | ResetModel(); |
---|
2498 | 2600 | refreshContents(); |
---|
2499 | 2601 | } else |
---|
2500 | | - if (event.getSource() == sortbynameItem) |
---|
| 2602 | + if (source == sortbynameItem) |
---|
2501 | 2603 | { |
---|
2502 | 2604 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2503 | 2605 | { |
---|
.. | .. |
---|
2509 | 2611 | ResetModel(); |
---|
2510 | 2612 | refreshContents(); |
---|
2511 | 2613 | } else |
---|
2512 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2614 | + if (source == attachPigmentItem) |
---|
2513 | 2615 | { |
---|
2514 | 2616 | String texture = GetFile("Attach pigment"); |
---|
2515 | 2617 | Object3D obj; |
---|
.. | .. |
---|
2521 | 2623 | |
---|
2522 | 2624 | refreshContents(); |
---|
2523 | 2625 | } else |
---|
2524 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2626 | + if (source == detachPigmentItem) |
---|
2525 | 2627 | { |
---|
2526 | 2628 | Object3D obj; |
---|
2527 | 2629 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2532 | 2634 | |
---|
2533 | 2635 | refreshContents(); |
---|
2534 | 2636 | } else |
---|
2535 | | - if (event.getSource() == attachBumpItem) |
---|
| 2637 | + if (source == attachBumpItem) |
---|
2536 | 2638 | { |
---|
2537 | 2639 | String texture = GetFile("Attach bump"); |
---|
2538 | 2640 | Object3D obj; |
---|
.. | .. |
---|
2544 | 2646 | |
---|
2545 | 2647 | refreshContents(); |
---|
2546 | 2648 | } else |
---|
2547 | | - if (event.getSource() == detachBumpItem) |
---|
| 2649 | + if (source == detachBumpItem) |
---|
2548 | 2650 | { |
---|
2549 | 2651 | Object3D obj; |
---|
2550 | 2652 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2555 | 2657 | |
---|
2556 | 2658 | refreshContents(); |
---|
2557 | 2659 | } else |
---|
2558 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2660 | + if (source == pigmentBumpItem) |
---|
2559 | 2661 | { |
---|
2560 | 2662 | Object3D obj; |
---|
2561 | 2663 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2566 | 2668 | |
---|
2567 | 2669 | refreshContents(); |
---|
2568 | 2670 | } else |
---|
2569 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2671 | + if (source == flashSelectionButton) |
---|
2570 | 2672 | { |
---|
2571 | 2673 | CameraPane.flash = true; |
---|
2572 | 2674 | refreshContents(); |
---|
2573 | 2675 | } else |
---|
2574 | | - if (event.getSource() == oneButton) |
---|
| 2676 | + if (source == oneButton) |
---|
2575 | 2677 | { |
---|
2576 | 2678 | } else |
---|
2577 | | - if (event.getSource() == twoButton) |
---|
| 2679 | + if (source == twoButton) |
---|
2578 | 2680 | { |
---|
2579 | 2681 | radio.layout = twoButton; |
---|
2580 | 2682 | // bug |
---|
2581 | 2683 | //gridPanel.setDividerLocation(1.0); |
---|
2582 | 2684 | //bigPanel.setDividerLocation(0.0); |
---|
2583 | | - bigThree.remove(jtp); |
---|
2584 | | - bigThree.remove(cameraPanel); |
---|
2585 | | - bigThree.remove(XYZPanel); |
---|
2586 | | - aWindowConstraints.gridx = 0; |
---|
2587 | | - aWindowConstraints.gridy = 0; |
---|
2588 | | - aWindowConstraints.gridwidth = 1; |
---|
2589 | | - // aConstraints.gridheight = 3; |
---|
2590 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2591 | | - aWindowConstraints.weightx = 0; |
---|
2592 | | - aWindowConstraints.weighty = 1; |
---|
2593 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2594 | | - aWindowConstraints.weightx = 1; |
---|
2595 | | - aWindowConstraints.gridwidth = 3; |
---|
2596 | | - // aConstraints.gridheight = 3; |
---|
2597 | | - aWindowConstraints.gridx = 1; |
---|
2598 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2599 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2600 | | - aWindowConstraints.weightx = 0; |
---|
2601 | | - aWindowConstraints.gridx = 4; |
---|
2602 | | - aWindowConstraints.gridwidth = 1; |
---|
2603 | | - // aConstraints.gridheight = 3; |
---|
2604 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2605 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2606 | | - bigThree.revalidate(); |
---|
| 2685 | +// bigThree.remove(scenePanel); |
---|
| 2686 | +// bigThree.remove(centralPanel); |
---|
| 2687 | +// bigThree.remove(XYZPanel); |
---|
| 2688 | +// aWindowConstraints.gridx = 0; |
---|
| 2689 | +// aWindowConstraints.gridy = 0; |
---|
| 2690 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2691 | +// // aConstraints.gridheight = 3; |
---|
| 2692 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2693 | +// aWindowConstraints.weightx = 0; |
---|
| 2694 | +// aWindowConstraints.weighty = 1; |
---|
| 2695 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2696 | +// aWindowConstraints.weightx = 1; |
---|
| 2697 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2698 | +// // aConstraints.gridheight = 3; |
---|
| 2699 | +// aWindowConstraints.gridx = 1; |
---|
| 2700 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2701 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2702 | +// aWindowConstraints.weightx = 0; |
---|
| 2703 | +// aWindowConstraints.gridx = 4; |
---|
| 2704 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2705 | +// // aConstraints.gridheight = 3; |
---|
| 2706 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2707 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2708 | +// scenePanel.setVisible(false); |
---|
| 2709 | +// centralPanel.setVisible(true); |
---|
| 2710 | +// XYZPanel.setVisible(false); |
---|
| 2711 | + bigThree.ClearUI(); |
---|
| 2712 | + bigThree.add(centralPanel); |
---|
| 2713 | + bigThree.FlushUI(); |
---|
2607 | 2714 | } else |
---|
2608 | | - if (event.getSource() == threeButton) |
---|
| 2715 | + if (source == threeButton) |
---|
2609 | 2716 | { |
---|
2610 | 2717 | radio.layout = threeButton; |
---|
2611 | | - bigThree.remove(jtp); |
---|
2612 | | - bigThree.remove(cameraPanel); |
---|
2613 | | - bigThree.remove(XYZPanel); |
---|
2614 | | - aWindowConstraints.gridx = 0; |
---|
2615 | | - aWindowConstraints.gridy = 0; |
---|
2616 | | - aWindowConstraints.gridwidth = 1; |
---|
2617 | | - // aConstraints.gridheight = 3; |
---|
2618 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2619 | | - aWindowConstraints.weightx = 0; |
---|
2620 | | - aWindowConstraints.weighty = 1; |
---|
2621 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2622 | | - aWindowConstraints.weightx = 1; |
---|
2623 | | - aWindowConstraints.gridwidth = 3; |
---|
2624 | | - // aConstraints.gridheight = 3; |
---|
2625 | | - aWindowConstraints.gridx = 1; |
---|
2626 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2627 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2628 | | - aWindowConstraints.weightx = 0; |
---|
2629 | | - aWindowConstraints.gridx = 4; |
---|
2630 | | - aWindowConstraints.gridwidth = 1; |
---|
2631 | | - // aConstraints.gridheight = 3; |
---|
2632 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2633 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2634 | | - bigThree.revalidate(); |
---|
| 2718 | + |
---|
| 2719 | +// bigThree.remove(scenePanel); |
---|
| 2720 | +// bigThree.remove(centralPanel); |
---|
| 2721 | +// bigThree.remove(XYZPanel); |
---|
| 2722 | +// aWindowConstraints.gridx = 0; |
---|
| 2723 | +// aWindowConstraints.gridy = 0; |
---|
| 2724 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2725 | +// // aConstraints.gridheight = 3; |
---|
| 2726 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2727 | +// aWindowConstraints.weightx = 0; |
---|
| 2728 | +// aWindowConstraints.weighty = 1; |
---|
| 2729 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2730 | +// aWindowConstraints.weightx = 1; |
---|
| 2731 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2732 | +// // aConstraints.gridheight = 3; |
---|
| 2733 | +// aWindowConstraints.gridx = 1; |
---|
| 2734 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2735 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2736 | +// aWindowConstraints.weightx = 0; |
---|
| 2737 | +// aWindowConstraints.gridx = 4; |
---|
| 2738 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2739 | +// // aConstraints.gridheight = 3; |
---|
| 2740 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2741 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2742 | +// bigThree.validate(); |
---|
| 2743 | +// scenePanel.setVisible(false); |
---|
| 2744 | +// centralPanel.setVisible(true); |
---|
| 2745 | +// XYZPanel.setVisible(true); |
---|
| 2746 | + bigThree.ClearUI(); |
---|
| 2747 | + bigThree.add(centralPanel); |
---|
| 2748 | + bigThree.add(XYZPanel); |
---|
| 2749 | + bigThree.FlushUI(); |
---|
2635 | 2750 | } else |
---|
2636 | | - if (event.getSource() == fourButton) |
---|
| 2751 | + if (source == fourButton) |
---|
2637 | 2752 | { |
---|
2638 | 2753 | radio.layout = fourButton; |
---|
2639 | | - bigThree.remove(jtp); |
---|
2640 | | - bigThree.remove(cameraPanel); |
---|
2641 | | - bigThree.remove(XYZPanel); |
---|
2642 | | - aWindowConstraints.gridx = 0; |
---|
2643 | | - aWindowConstraints.gridy = 0; |
---|
2644 | | - aWindowConstraints.gridwidth = 1; |
---|
2645 | | - // aWindowConstraints.gridheight = 3; |
---|
2646 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2647 | | - aWindowConstraints.weightx = 1; |
---|
2648 | | - aWindowConstraints.weighty = 1; |
---|
2649 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2650 | | - aWindowConstraints.weightx = 1; |
---|
2651 | | - aWindowConstraints.gridwidth = 3; |
---|
2652 | | - // aConstraints.gridheight = 3; |
---|
2653 | | - aWindowConstraints.gridx = 1; |
---|
2654 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2655 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2656 | | - aWindowConstraints.weightx = 0; |
---|
2657 | | - aWindowConstraints.gridx = 4; |
---|
2658 | | - aWindowConstraints.gridwidth = 1; |
---|
2659 | | - // aWindowConstraints.gridheight = 3; |
---|
2660 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2661 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2662 | | - bigThree.revalidate(); |
---|
| 2754 | + |
---|
| 2755 | +// bigThree.remove(scenePanel); |
---|
| 2756 | +// bigThree.remove(centralPanel); |
---|
| 2757 | +// bigThree.remove(XYZPanel); |
---|
| 2758 | +// aWindowConstraints.gridx = 0; |
---|
| 2759 | +// aWindowConstraints.gridy = 0; |
---|
| 2760 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2761 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2762 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2763 | +// aWindowConstraints.weightx = 1; |
---|
| 2764 | +// aWindowConstraints.weighty = 1; |
---|
| 2765 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2766 | +// aWindowConstraints.weightx = 1; |
---|
| 2767 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2768 | +// // aConstraints.gridheight = 3; |
---|
| 2769 | +// aWindowConstraints.gridx = 1; |
---|
| 2770 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2771 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2772 | +// aWindowConstraints.weightx = 0; |
---|
| 2773 | +// aWindowConstraints.gridx = 4; |
---|
| 2774 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2775 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2776 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2777 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2778 | +// bigThree.validate(); |
---|
| 2779 | +// scenePanel.setVisible(true); |
---|
| 2780 | +// centralPanel.setVisible(false); |
---|
| 2781 | +// XYZPanel.setVisible(false); |
---|
| 2782 | + bigThree.ClearUI(); |
---|
| 2783 | + bigThree.add(scenePanel); |
---|
| 2784 | + bigThree.FlushUI(); |
---|
2663 | 2785 | } else |
---|
2664 | | - if (event.getSource() == sixButton) |
---|
| 2786 | + if (source == sixButton) |
---|
2665 | 2787 | { |
---|
2666 | 2788 | radio.layout = sixButton; |
---|
2667 | | - bigThree.remove(jtp); |
---|
2668 | | - bigThree.remove(cameraPanel); |
---|
2669 | | - bigThree.remove(XYZPanel); |
---|
2670 | | - aWindowConstraints.gridx = 0; |
---|
2671 | | - aWindowConstraints.gridy = 0; |
---|
2672 | | - aWindowConstraints.gridwidth = 1; |
---|
2673 | | - // aConstraints.gridheight = 3; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2675 | | - aWindowConstraints.weightx = 0; |
---|
2676 | | - aWindowConstraints.weighty = 1; |
---|
2677 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2678 | | - aWindowConstraints.weightx = 1; |
---|
2679 | | - aWindowConstraints.gridwidth = 3; |
---|
2680 | | - // aWindowConstraints.gridheight = 3; |
---|
2681 | | - aWindowConstraints.gridx = 1; |
---|
2682 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2683 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2684 | | - aWindowConstraints.weightx = 0; |
---|
2685 | | - aWindowConstraints.gridx = 4; |
---|
2686 | | - aWindowConstraints.gridwidth = 1; |
---|
2687 | | - // aWindowConstraints.gridheight = 3; |
---|
2688 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2689 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2690 | | - bigThree.revalidate(); |
---|
| 2789 | + |
---|
| 2790 | +// bigThree.remove(scenePanel); |
---|
| 2791 | +// bigThree.remove(centralPanel); |
---|
| 2792 | +// bigThree.remove(XYZPanel); |
---|
| 2793 | +// aWindowConstraints.gridx = 0; |
---|
| 2794 | +// aWindowConstraints.gridy = 0; |
---|
| 2795 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2796 | +// // aConstraints.gridheight = 3; |
---|
| 2797 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2798 | +// aWindowConstraints.weightx = 0; |
---|
| 2799 | +// aWindowConstraints.weighty = 1; |
---|
| 2800 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2801 | +// aWindowConstraints.weightx = 1; |
---|
| 2802 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2803 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2804 | +// aWindowConstraints.gridx = 1; |
---|
| 2805 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2806 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2807 | +// aWindowConstraints.weightx = 0; |
---|
| 2808 | +// aWindowConstraints.gridx = 4; |
---|
| 2809 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2810 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2811 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2812 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2813 | +// bigThree.validate(); |
---|
| 2814 | +// scenePanel.setVisible(true); |
---|
| 2815 | +// centralPanel.setVisible(true); |
---|
| 2816 | +// XYZPanel.setVisible(false); |
---|
| 2817 | + bigThree.ClearUI(); |
---|
| 2818 | + bigThree.add(scenePanel); |
---|
| 2819 | + bigThree.add(centralPanel); |
---|
| 2820 | + bigThree.FlushUI(); |
---|
2691 | 2821 | } else |
---|
2692 | | - if (event.getSource() == sevenButton) |
---|
| 2822 | + if (source == sevenButton) |
---|
2693 | 2823 | { |
---|
2694 | 2824 | radio.layout = sevenButton; |
---|
2695 | | - bigThree.remove(jtp); |
---|
2696 | | - bigThree.remove(cameraPanel); |
---|
2697 | | - bigThree.remove(XYZPanel); |
---|
2698 | | - aWindowConstraints.gridx = 0; |
---|
2699 | | - aWindowConstraints.gridy = 0; |
---|
2700 | | - aWindowConstraints.gridwidth = 1; |
---|
2701 | | - // aWindowConstraints.gridheight = 3; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2703 | | - aWindowConstraints.weightx = 0; |
---|
2704 | | - aWindowConstraints.weighty = 1; |
---|
2705 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2706 | | - aWindowConstraints.weightx = 1; |
---|
2707 | | - aWindowConstraints.gridwidth = 3; |
---|
2708 | | - // aWindowConstraints.gridheight = 3; |
---|
2709 | | - aWindowConstraints.gridx = 1; |
---|
2710 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2711 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2712 | | - aWindowConstraints.weightx = 0; |
---|
2713 | | - aWindowConstraints.gridx = 4; |
---|
2714 | | - aWindowConstraints.gridwidth = 1; |
---|
2715 | | - // aConstraints.gridheight = 3; |
---|
2716 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2717 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2718 | | - bigThree.revalidate(); |
---|
| 2825 | + |
---|
| 2826 | +// bigThree.remove(scenePanel); |
---|
| 2827 | +// bigThree.remove(centralPanel); |
---|
| 2828 | +// bigThree.remove(XYZPanel); |
---|
| 2829 | +// aWindowConstraints.gridx = 0; |
---|
| 2830 | +// aWindowConstraints.gridy = 0; |
---|
| 2831 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2832 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2833 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2834 | +// aWindowConstraints.weightx = 0; |
---|
| 2835 | +// aWindowConstraints.weighty = 1; |
---|
| 2836 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2837 | +// aWindowConstraints.weightx = 1; |
---|
| 2838 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2839 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2840 | +// aWindowConstraints.gridx = 1; |
---|
| 2841 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2842 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2843 | +// aWindowConstraints.weightx = 0; |
---|
| 2844 | +// aWindowConstraints.gridx = 4; |
---|
| 2845 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2846 | +// // aConstraints.gridheight = 3; |
---|
| 2847 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2848 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2849 | +// bigThree.validate(); |
---|
| 2850 | +// scenePanel.setVisible(true); |
---|
| 2851 | +// centralPanel.setVisible(true); |
---|
| 2852 | +// XYZPanel.setVisible(true); |
---|
| 2853 | + bigThree.ClearUI(); |
---|
| 2854 | + bigThree.add(scenePanel); |
---|
| 2855 | + bigThree.add(centralPanel); |
---|
| 2856 | + bigThree.add(XYZPanel); |
---|
| 2857 | + bigThree.FlushUI(); |
---|
2719 | 2858 | } else |
---|
2720 | | - if (event.getSource() == rootButton) |
---|
| 2859 | + if (source == rootButton) |
---|
2721 | 2860 | { |
---|
2722 | 2861 | Object3D obj; |
---|
2723 | 2862 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2729 | 2868 | |
---|
2730 | 2869 | refreshContents(true); |
---|
2731 | 2870 | } else |
---|
2732 | | - if (event.getSource() == closeButton) |
---|
| 2871 | + if (source == closeButton) |
---|
2733 | 2872 | { |
---|
2734 | 2873 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2735 | 2874 | cRadio ab; |
---|
.. | .. |
---|
2750 | 2889 | } |
---|
2751 | 2890 | refreshContents(true); |
---|
2752 | 2891 | } else |
---|
2753 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 2892 | + if (source == editItem || source == editButton) |
---|
2754 | 2893 | { |
---|
2755 | 2894 | EditSelection(false); |
---|
2756 | 2895 | } else |
---|
2757 | | - if (event.getSource() == uneditButton) |
---|
| 2896 | + if (source == uneditButton) |
---|
2758 | 2897 | { |
---|
2759 | 2898 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2760 | 2899 | { |
---|
.. | .. |
---|
2766 | 2905 | |
---|
2767 | 2906 | child.editWindow = null; // ??????????? |
---|
2768 | 2907 | } |
---|
2769 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2908 | + objEditor.ctrlPanel.validate(); |
---|
2770 | 2909 | //objEditor.jTree.clearSelection(); |
---|
2771 | 2910 | //objEditor.ResetSliders(); |
---|
2772 | 2911 | refreshContents(true); |
---|
2773 | 2912 | } else |
---|
2774 | | - if (event.getSource() == clearPanelButton) |
---|
| 2913 | + if (source == clearPanelButton) |
---|
2775 | 2914 | { |
---|
2776 | 2915 | assert(copy == group); |
---|
2777 | 2916 | //copy.ClearUI(); |
---|
.. | .. |
---|
2782 | 2921 | listUI.clear(); |
---|
2783 | 2922 | refreshContents(true); |
---|
2784 | 2923 | } else |
---|
2785 | | - if (event.getSource() == allParamsButton) |
---|
| 2924 | + if (source == allParamsButton) |
---|
2786 | 2925 | { |
---|
2787 | 2926 | assert(copy == group); |
---|
2788 | 2927 | |
---|
.. | .. |
---|
2803 | 2942 | |
---|
2804 | 2943 | refreshContents(true); |
---|
2805 | 2944 | } else |
---|
2806 | | - if (event.getSource() == unselectButton) |
---|
| 2945 | + if (source == unselectButton) |
---|
2807 | 2946 | { |
---|
2808 | 2947 | objEditor.jTree.clearSelection(); |
---|
2809 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 2948 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2810 | 2949 | objEditor.ResetSliders(); |
---|
2811 | 2950 | refreshContents(true); |
---|
2812 | 2951 | } else |
---|
2813 | | - if(event.getSource() instanceof cRadio) |
---|
| 2952 | + if(source instanceof cRadio) |
---|
2814 | 2953 | { |
---|
2815 | 2954 | group.parent = keepparent; |
---|
2816 | 2955 | group.attributes = 0; |
---|
2817 | 2956 | //group.editWindow = null; |
---|
2818 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 2957 | + /*cRadio*/ radio = (cRadio)source; |
---|
2819 | 2958 | Object3D obj = radio.GetObject(); |
---|
2820 | 2959 | System.out.println("Edit " + obj); |
---|
2821 | 2960 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2835 | 2974 | } |
---|
2836 | 2975 | |
---|
2837 | 2976 | copy = group; |
---|
2838 | | - //CameraPane.theRenderer.object = group; |
---|
| 2977 | + //Globals.theRenderer.object = group; |
---|
2839 | 2978 | if(!useclient) |
---|
2840 | 2979 | { |
---|
2841 | 2980 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2844 | 2983 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2845 | 2984 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2846 | 2985 | cameraView.object = group; |
---|
2847 | | - cameraView.lighttouched = true; |
---|
| 2986 | + //cameraView.lighttouched = true; |
---|
| 2987 | + Globals.lighttouched = true; |
---|
2848 | 2988 | topView.object = group; |
---|
2849 | 2989 | frontView.object = group; |
---|
2850 | 2990 | sideView.object = group; |
---|
.. | .. |
---|
2880 | 3020 | if (useclient) |
---|
2881 | 3021 | { |
---|
2882 | 3022 | cameraView.object = client; |
---|
2883 | | - cameraView.lighttouched = true; |
---|
| 3023 | + Globals.lighttouched = true; |
---|
2884 | 3024 | //topView.object = client; |
---|
2885 | 3025 | //frontView.object = client; |
---|
2886 | 3026 | //sideView.object = client; |
---|
.. | .. |
---|
2888 | 3028 | else |
---|
2889 | 3029 | { |
---|
2890 | 3030 | cameraView.object = group; |
---|
2891 | | - cameraView.lighttouched = true; |
---|
| 3031 | + Globals.lighttouched = true; |
---|
2892 | 3032 | //topView.object = group; |
---|
2893 | 3033 | //frontView.object = group; |
---|
2894 | 3034 | //sideView.object = group; |
---|
.. | .. |
---|
3121 | 3261 | obj = (Object3D)e.nextElement(); |
---|
3122 | 3262 | |
---|
3123 | 3263 | System.out.println("Object is: " + obj); |
---|
3124 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3264 | + GrafreeD.AnalyzeObject(obj); |
---|
3125 | 3265 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3126 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3266 | + GrafreeD.AnalyzeObject(obj.bRep); |
---|
3127 | 3267 | |
---|
3128 | 3268 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3129 | 3269 | } |
---|
.. | .. |
---|
3165 | 3305 | void GenNormals(boolean crease) |
---|
3166 | 3306 | { |
---|
3167 | 3307 | group.GenNormalsS(crease); |
---|
| 3308 | + |
---|
| 3309 | + refreshContents(); |
---|
| 3310 | + } |
---|
| 3311 | + |
---|
| 3312 | + void GenNormalsMINE() |
---|
| 3313 | + { |
---|
| 3314 | + group.selection.GenNormalsMINE(); |
---|
3168 | 3315 | |
---|
3169 | 3316 | refreshContents(); |
---|
3170 | 3317 | } |
---|
.. | .. |
---|
3250 | 3397 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3251 | 3398 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3252 | 3399 | // |
---|
3253 | | -// g.add(GraphreeD.clipboard); |
---|
| 3400 | +// g.add(GrafreeD.clipboard); |
---|
3254 | 3401 | // |
---|
3255 | 3402 | // buffer.add(g); |
---|
3256 | 3403 | // } |
---|
.. | .. |
---|
3269 | 3416 | // nodes = new Object3D(); |
---|
3270 | 3417 | // vertices = new Vector<Vertex>(); |
---|
3271 | 3418 | // |
---|
3272 | | -// boolean epsequal = GraphreeD.epsequal; |
---|
3273 | | -// GraphreeD.epsequal = true; |
---|
| 3419 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3420 | +// GrafreeD.epsequal = true; |
---|
3274 | 3421 | // |
---|
3275 | 3422 | // for (int i=0; i<group.selection.size(); i++) |
---|
3276 | 3423 | // { |
---|
.. | .. |
---|
3311 | 3458 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3312 | 3459 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3313 | 3460 | // |
---|
3314 | | -// g.add(GraphreeD.clipboard); |
---|
| 3461 | +// g.add(GrafreeD.clipboard); |
---|
3315 | 3462 | // |
---|
3316 | 3463 | // buffer.add(g); |
---|
3317 | 3464 | // } |
---|
.. | .. |
---|
3319 | 3466 | // makeSomething(buffer, i==group.selection.size()-1); |
---|
3320 | 3467 | // } |
---|
3321 | 3468 | // |
---|
3322 | | -// GraphreeD.epsequal = epsequal; |
---|
| 3469 | +// GrafreeD.epsequal = epsequal; |
---|
3323 | 3470 | // |
---|
3324 | 3471 | // //buffer = null; |
---|
3325 | 3472 | // temprep = null; |
---|
.. | .. |
---|
3330 | 3477 | |
---|
3331 | 3478 | void ParseVertices() |
---|
3332 | 3479 | { |
---|
3333 | | - boolean epsequal = GraphreeD.epsequal; |
---|
3334 | | - GraphreeD.epsequal = true; |
---|
| 3480 | + boolean epsequal = GrafreeD.epsequal; |
---|
| 3481 | + GrafreeD.epsequal = true; |
---|
3335 | 3482 | |
---|
3336 | 3483 | for (int i=0; i<group.selection.size(); i++) |
---|
3337 | 3484 | { |
---|
.. | .. |
---|
3356 | 3503 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3357 | 3504 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3358 | 3505 | |
---|
3359 | | - g.add(GraphreeD.clipboard); |
---|
| 3506 | + g.add(GrafreeD.clipboard); |
---|
3360 | 3507 | |
---|
3361 | 3508 | buffer.add(g); |
---|
3362 | 3509 | } |
---|
.. | .. |
---|
3371 | 3518 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3372 | 3519 | } |
---|
3373 | 3520 | |
---|
3374 | | - GraphreeD.epsequal = epsequal; |
---|
| 3521 | + GrafreeD.epsequal = epsequal; |
---|
3375 | 3522 | |
---|
3376 | 3523 | refreshContents(); |
---|
3377 | 3524 | } |
---|
.. | .. |
---|
3389 | 3536 | String pigment = Object3D.GetPigment(tex); |
---|
3390 | 3537 | //String bump = Object3D.GetBump(tex); |
---|
3391 | 3538 | |
---|
3392 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3539 | + com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
3393 | 3540 | |
---|
3394 | 3541 | double s = v.s; |
---|
3395 | 3542 | |
---|
.. | .. |
---|
3416 | 3563 | scale /= 3; |
---|
3417 | 3564 | |
---|
3418 | 3565 | scale /= 0xFF; |
---|
3419 | | - scale /= 4; |
---|
| 3566 | + // c'est quoi ca? scale /= 4; |
---|
3420 | 3567 | |
---|
3421 | 3568 | //v.AO = scale; |
---|
3422 | 3569 | |
---|
.. | .. |
---|
3437 | 3584 | |
---|
3438 | 3585 | void Align() |
---|
3439 | 3586 | { |
---|
| 3587 | + if (group.selection.size() == 0) |
---|
| 3588 | + return; |
---|
| 3589 | + |
---|
| 3590 | + cVector bbmin = new cVector(); |
---|
| 3591 | + cVector bbmax = new cVector(); |
---|
| 3592 | + |
---|
| 3593 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3594 | + |
---|
| 3595 | + double dx = bbmax.x - bbmin.x; |
---|
| 3596 | + double dy = bbmax.y - bbmin.y; |
---|
| 3597 | + double dz = bbmax.z - bbmin.z; |
---|
| 3598 | + |
---|
| 3599 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3600 | + |
---|
3440 | 3601 | for (int i=0; i<group.selection.size(); i++) |
---|
3441 | 3602 | { |
---|
3442 | 3603 | Object3D obj = group.selection.get(i); |
---|
3443 | 3604 | |
---|
3444 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3445 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3605 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3606 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3446 | 3607 | } |
---|
3447 | 3608 | |
---|
3448 | 3609 | refreshContents(); |
---|
.. | .. |
---|
3455 | 3616 | // ref.SaveSupports(); |
---|
3456 | 3617 | // Object3D par = ref.parent; |
---|
3457 | 3618 | // ref.parent = null; |
---|
3458 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3619 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3459 | 3620 | // ref.parent = par; |
---|
3460 | 3621 | // ref.RestoreSupports(); |
---|
3461 | 3622 | |
---|
.. | .. |
---|
3485 | 3646 | // lowres.SaveSupports(); |
---|
3486 | 3647 | // par = lowres.parent; |
---|
3487 | 3648 | // lowres.parent = null; |
---|
3488 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3649 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3489 | 3650 | Object3D newlow = CloneObject(lowres, false); |
---|
3490 | 3651 | newlow.name = sn.switchobject.get(i).name; |
---|
3491 | 3652 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3507 | 3668 | return; |
---|
3508 | 3669 | |
---|
3509 | 3670 | Object3D poses = group.selection.get(0); |
---|
3510 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3671 | + Object3D ref = GrafreeD.clipboard.get(0); |
---|
3511 | 3672 | |
---|
3512 | 3673 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3513 | 3674 | |
---|
.. | .. |
---|
3676 | 3837 | group.selection.RelinkToSupport(); // july 2014 |
---|
3677 | 3838 | System.out.println("DONE."); |
---|
3678 | 3839 | refreshContents(); |
---|
3679 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3840 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3680 | 3841 | } |
---|
3681 | 3842 | |
---|
3682 | 3843 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3701 | 3862 | |
---|
3702 | 3863 | void ClipMesh() |
---|
3703 | 3864 | { |
---|
3704 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 3865 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
3705 | 3866 | { |
---|
3706 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 3867 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
3707 | 3868 | |
---|
3708 | 3869 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3709 | 3870 | content = ((cGroup)content).get(0); |
---|
3710 | 3871 | |
---|
3711 | 3872 | // for (int i=0; i<group.selection.size(); i++) |
---|
3712 | 3873 | // { |
---|
3713 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 3874 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3714 | 3875 | // } |
---|
3715 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3876 | + group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3716 | 3877 | } |
---|
3717 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3878 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3718 | 3879 | System.out.println("DONE."); |
---|
3719 | 3880 | refreshContents(); |
---|
3720 | 3881 | } |
---|
.. | .. |
---|
3961 | 4122 | |
---|
3962 | 4123 | objEditor.SetText(); // jan 2014 |
---|
3963 | 4124 | |
---|
3964 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4125 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
3965 | 4126 | CameraPane.flash = true; |
---|
3966 | 4127 | |
---|
3967 | 4128 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
3968 | 4129 | // a camera |
---|
3969 | 4130 | { |
---|
3970 | 4131 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3971 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3972 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3973 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4132 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4133 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4134 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3974 | 4135 | } |
---|
3975 | 4136 | |
---|
3976 | 4137 | refreshContents(); |
---|
.. | .. |
---|
4052 | 4213 | { |
---|
4053 | 4214 | if (group.selection.isEmpty()) |
---|
4054 | 4215 | return; |
---|
4055 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4216 | + GrafreeD.clipboardIsTempGroup = false; |
---|
4056 | 4217 | Composite tGroup = null; |
---|
4057 | 4218 | if (group.selection.size() > 0) // 1) |
---|
4058 | 4219 | { |
---|
4059 | 4220 | tGroup = new cGroup(); |
---|
4060 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4221 | + GrafreeD.clipboardIsTempGroup = true; |
---|
4061 | 4222 | } |
---|
4062 | 4223 | |
---|
4063 | 4224 | if (cut) |
---|
.. | .. |
---|
4097 | 4258 | //System.out.println("cut " + child); |
---|
4098 | 4259 | //System.out.println("parent = " + child.parent); |
---|
4099 | 4260 | // tmp.addChild(child); |
---|
4100 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4261 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4101 | 4262 | tGroup.add/*Child*/(tmp); |
---|
4102 | 4263 | else |
---|
4103 | | - GraphreeD.clipboard = tmp; |
---|
| 4264 | + GrafreeD.clipboard = tmp; |
---|
4104 | 4265 | } |
---|
4105 | 4266 | else |
---|
4106 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4267 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4107 | 4268 | tGroup.add/*Child*/(child); |
---|
4108 | 4269 | else |
---|
4109 | | - GraphreeD.clipboard = child; |
---|
| 4270 | + GrafreeD.clipboard = child; |
---|
4110 | 4271 | } |
---|
4111 | 4272 | |
---|
4112 | 4273 | //ResetModel(); |
---|
.. | .. |
---|
4138 | 4299 | //System.out.println("cut " + elem); |
---|
4139 | 4300 | //System.out.println("parent = " + elem.parent); |
---|
4140 | 4301 | // tmp.addChild(elem); |
---|
4141 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4302 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4142 | 4303 | tGroup.add/*Child*/(tmp); |
---|
4143 | 4304 | else |
---|
4144 | | - GraphreeD.clipboard = tmp; |
---|
| 4305 | + GrafreeD.clipboard = tmp; |
---|
4145 | 4306 | } |
---|
4146 | 4307 | else |
---|
4147 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4308 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4148 | 4309 | tGroup.add/*Child*/(child); |
---|
4149 | 4310 | else |
---|
4150 | | - GraphreeD.clipboard = child; |
---|
| 4311 | + GrafreeD.clipboard = child; |
---|
4151 | 4312 | } |
---|
4152 | 4313 | |
---|
4153 | 4314 | } |
---|
4154 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
4155 | | - GraphreeD.clipboard = tGroup; |
---|
| 4315 | + if (GrafreeD.clipboardIsTempGroup) |
---|
| 4316 | + GrafreeD.clipboard = tGroup; |
---|
4156 | 4317 | if (cut) |
---|
4157 | 4318 | { |
---|
4158 | 4319 | ResetModel(); |
---|
.. | .. |
---|
4162 | 4323 | |
---|
4163 | 4324 | void paste(boolean expand) |
---|
4164 | 4325 | { |
---|
4165 | | - // if (GraphreeD.clipboard == null) |
---|
| 4326 | + // if (GrafreeD.clipboard == null) |
---|
4166 | 4327 | // return; |
---|
4167 | 4328 | boolean first = true; |
---|
4168 | 4329 | |
---|
4169 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4330 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4170 | 4331 | { |
---|
4171 | 4332 | Composite temp; |
---|
4172 | 4333 | |
---|
.. | .. |
---|
4177 | 4338 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4178 | 4339 | */ |
---|
4179 | 4340 | Object3D elem; |
---|
4180 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4341 | + for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4181 | 4342 | { |
---|
4182 | 4343 | Object3D child = (Object3D)e.nextElement(); |
---|
4183 | 4344 | |
---|
.. | .. |
---|
4191 | 4352 | else |
---|
4192 | 4353 | elem = child.deepCopy(); // ? |
---|
4193 | 4354 | child.parent = keepparent; |
---|
4194 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4355 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4195 | 4356 | // elem = elem.get(0); |
---|
4196 | 4357 | makeSomething(elem, true); // ?? first); |
---|
4197 | 4358 | //group.addChild(elem); |
---|
.. | .. |
---|
4211 | 4372 | //Object3D cb = Applet3D.clipboard; |
---|
4212 | 4373 | //temp.addChild(cb); |
---|
4213 | 4374 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4214 | | - assert(GraphreeD.clipboard.parent == null); |
---|
4215 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
4216 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4217 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
4218 | | - makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy()); |
---|
| 4375 | + assert(GrafreeD.clipboard.parent == null); |
---|
| 4376 | + Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
| 4377 | + GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4378 | + if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
| 4379 | + makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
4219 | 4380 | else |
---|
4220 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4221 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4381 | + makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
| 4382 | + GrafreeD.clipboard.get(0).parent = keepparent; |
---|
4222 | 4383 | } |
---|
4223 | 4384 | |
---|
4224 | 4385 | ResetModel(); |
---|
.. | .. |
---|
4227 | 4388 | |
---|
4228 | 4389 | void pasteInto(boolean copyit) |
---|
4229 | 4390 | { |
---|
4230 | | -// if (GraphreeD.clipboard == null) |
---|
| 4391 | +// if (GrafreeD.clipboard == null) |
---|
4231 | 4392 | // return; |
---|
4232 | 4393 | |
---|
4233 | 4394 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4260 | 4421 | { |
---|
4261 | 4422 | boolean first = true; |
---|
4262 | 4423 | |
---|
4263 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4424 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4264 | 4425 | { |
---|
4265 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4426 | + Composite temp = (Composite)GrafreeD.clipboard; |
---|
4266 | 4427 | Object3D copy; |
---|
4267 | 4428 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4268 | 4429 | { |
---|
.. | .. |
---|
4272 | 4433 | } |
---|
4273 | 4434 | } else |
---|
4274 | 4435 | { |
---|
4275 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4436 | + linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
4276 | 4437 | } |
---|
4277 | 4438 | } |
---|
4278 | 4439 | } |
---|
.. | .. |
---|
4464 | 4625 | makeSomething(csg); |
---|
4465 | 4626 | } |
---|
4466 | 4627 | |
---|
| 4628 | + void Ungroup(Object3D g) |
---|
| 4629 | + { |
---|
| 4630 | + if (g instanceof HiddenObject) |
---|
| 4631 | + { |
---|
| 4632 | + HiddenObject h = (HiddenObject) g; |
---|
| 4633 | + |
---|
| 4634 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4635 | + { |
---|
| 4636 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4637 | + } |
---|
| 4638 | + } |
---|
| 4639 | + else |
---|
| 4640 | + { |
---|
| 4641 | + for (int i=0; i<g.Size(); i++) |
---|
| 4642 | + { |
---|
| 4643 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4644 | + } |
---|
| 4645 | + } |
---|
| 4646 | + } |
---|
| 4647 | + |
---|
4467 | 4648 | void ungroup() |
---|
4468 | 4649 | { |
---|
4469 | 4650 | /* |
---|
.. | .. |
---|
4659 | 4840 | |
---|
4660 | 4841 | void ImportGFD() |
---|
4661 | 4842 | { |
---|
4662 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
| 4843 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4663 | 4844 | browser.show(); |
---|
4664 | 4845 | String filename = browser.getFile(); |
---|
4665 | 4846 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4697 | 4878 | |
---|
4698 | 4879 | void ImportVRMLX3D() |
---|
4699 | 4880 | { |
---|
4700 | | - if (GraphreeD.standAlone) |
---|
| 4881 | + if (GrafreeD.standAlone) |
---|
4701 | 4882 | { |
---|
4702 | 4883 | /**/ |
---|
4703 | 4884 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4714 | 4895 | |
---|
4715 | 4896 | String GetFile(String dialogName) |
---|
4716 | 4897 | { |
---|
4717 | | - if (GraphreeD.standAlone) |
---|
| 4898 | + if (GrafreeD.standAlone) |
---|
4718 | 4899 | { |
---|
4719 | 4900 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4720 | 4901 | browser.show(); |
---|
.. | .. |
---|
4823 | 5004 | private MenuItem resetsupportItem; |
---|
4824 | 5005 | private MenuItem resetreferencesItem; |
---|
4825 | 5006 | private MenuItem linkverticesItem; |
---|
| 5007 | + private MenuItem relinkverticesItem; |
---|
4826 | 5008 | private MenuItem setMasterItem; |
---|
4827 | 5009 | private MenuItem resetMeshItem; |
---|
4828 | 5010 | private MenuItem stepAllItem; |
---|
.. | .. |
---|
4841 | 5023 | private MenuItem clearItem; |
---|
4842 | 5024 | private MenuItem clearAllItem; |
---|
4843 | 5025 | private MenuItem genUVItem; |
---|
| 5026 | + private MenuItem genNormalsMESHItem; |
---|
4844 | 5027 | private MenuItem genNormalsCADItem; |
---|
4845 | 5028 | private MenuItem genNormalsORGANItem; |
---|
| 5029 | + private MenuItem genNormalsMINEItem; |
---|
4846 | 5030 | private MenuItem stripifyItem; |
---|
4847 | 5031 | private MenuItem unstripifyItem; |
---|
4848 | 5032 | private MenuItem trimItem; |
---|
.. | .. |
---|
4884 | 5068 | private MenuItem resetCentroidItem; |
---|
4885 | 5069 | private MenuItem transformgeometryItem; |
---|
4886 | 5070 | private MenuItem resetTransformItem; |
---|
| 5071 | + private MenuItem hideItem; |
---|
4887 | 5072 | private MenuItem grabItem; |
---|
4888 | 5073 | private MenuItem backItem; |
---|
4889 | 5074 | private MenuItem frontItem; |
---|
.. | .. |
---|
4904 | 5089 | |
---|
4905 | 5090 | private MenuItem resetParentItem; |
---|
4906 | 5091 | private MenuItem repairParentItem; |
---|
| 5092 | + private MenuItem repairShadowItem; |
---|
4907 | 5093 | private MenuItem sortbysizeItem; |
---|
4908 | 5094 | private MenuItem sortbynameItem; |
---|
4909 | 5095 | |
---|
.. | .. |
---|
4924 | 5110 | private MenuItem coneItem; |
---|
4925 | 5111 | private MenuItem torusItem; |
---|
4926 | 5112 | private MenuItem superItem; |
---|
| 5113 | + private MenuItem kleinItem; |
---|
4927 | 5114 | private MenuItem blobItem; |
---|
4928 | 5115 | private MenuItem latheItem; |
---|
4929 | 5116 | private MenuItem bezierItem; |
---|
.. | .. |
---|
4936 | 5123 | private MenuItem csgItem; |
---|
4937 | 5124 | private MenuItem templateItem; |
---|
4938 | 5125 | private MenuItem textureItem; |
---|
| 5126 | + private MenuItem billboardItem; |
---|
4939 | 5127 | private MenuItem shadowXItem; |
---|
4940 | 5128 | private MenuItem shadowYItem; |
---|
4941 | 5129 | private MenuItem shadowZItem; |
---|