.. | .. |
---|
74 | 74 | this.copy = this.group = copy; |
---|
75 | 75 | //selectees = this.group.selectees; |
---|
76 | 76 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
78 | 78 | SetupUI2(objEditor); |
---|
79 | 79 | objEditor.SetupUI(true); |
---|
80 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
98 | 98 | |
---|
99 | 99 | void CloneClipboard(boolean supports) |
---|
100 | 100 | { |
---|
101 | | - assert(GrafreeD.clipboard.parent == null); |
---|
102 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
103 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
104 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
105 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 106 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 109 | } |
---|
110 | 110 | |
---|
111 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 119 | // obj.support = null; |
---|
120 | 120 | if (!supports) |
---|
121 | 121 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 123 | obj.parent = parent; |
---|
124 | 124 | // obj.support = support; |
---|
125 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 148 | |
---|
149 | 149 | //JTextField nameField; |
---|
150 | 150 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
168 | 153 | Menu menu; |
---|
169 | 154 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 155 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
206 | 191 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 192 | clearAllItem.addActionListener(this); |
---|
208 | 193 | } |
---|
| 194 | + |
---|
| 195 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 196 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 197 | + //zBufferItem.addActionListener(this); |
---|
| 198 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 199 | + //normalLensItem.addActionListener(this); |
---|
| 200 | + cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
| 201 | + revertCameraItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 204 | + toggleFullScreenItem.addItemListener(this); |
---|
| 205 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 206 | + cameraMenu.add("-"); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 209 | + toggleTextureItem.addItemListener(this); |
---|
| 210 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 211 | + |
---|
| 212 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 213 | + toggleSwitchItem.addItemListener(this); |
---|
| 214 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 215 | + |
---|
| 216 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 217 | + toggleHandleItem.addItemListener(this); |
---|
| 218 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 219 | + |
---|
| 220 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 221 | + togglePaintItem.addItemListener(this); |
---|
| 222 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 223 | + |
---|
| 224 | + if (Globals.ADVANCED) |
---|
| 225 | + { |
---|
| 226 | + cameraMenu.add("-"); |
---|
| 227 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 228 | + toggleLiveItem.addItemListener(this); |
---|
| 229 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 230 | |
---|
| 231 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 232 | + stepItem.addActionListener(this); |
---|
| 233 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 234 | + // toggleDLItem.addItemListener(this); |
---|
| 235 | + // toggleDLItem.setState(false); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 238 | + toggleRenderItem.addItemListener(this); |
---|
| 239 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 240 | + |
---|
| 241 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 242 | + toggleDebugItem.addItemListener(this); |
---|
| 243 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 244 | + |
---|
| 245 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 246 | + toggleFrustumItem.addItemListener(this); |
---|
| 247 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 248 | + |
---|
| 249 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 250 | + toggleFootContactItem.addItemListener(this); |
---|
| 251 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 252 | + |
---|
| 253 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 254 | + toggleTimelineItem.addItemListener(this); |
---|
| 255 | + } |
---|
| 256 | + |
---|
| 257 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 258 | +// toggleRootItem.addItemListener(this); |
---|
| 259 | +// toggleRootItem.setState(false); |
---|
| 260 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 261 | +// animationItem.addItemListener(this); |
---|
| 262 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 263 | + cameraMenu.add("-"); |
---|
| 264 | + cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 265 | + editCameraItem.addActionListener(this); |
---|
| 266 | + |
---|
| 267 | + if (Globals.ADVANCED) |
---|
| 268 | + { |
---|
| 269 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 270 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 271 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 272 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 273 | + oe.cameraMenu.add("-"); |
---|
| 274 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 275 | + openWindowItem.addActionListener(this); |
---|
| 276 | + editLeafItem.addActionListener(this); |
---|
| 277 | + lookAtItem.addActionListener(this); |
---|
| 278 | + //lookFromItem.addActinoListener(this); |
---|
| 279 | + //switchItem.addActionListener(this); |
---|
| 280 | + } |
---|
| 281 | + |
---|
210 | 282 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 283 | if (Globals.ADVANCED) |
---|
212 | 284 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 285 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 286 | revertMeshItem.addActionListener(this); |
---|
219 | 287 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
318 | 386 | resetTransformItem.addActionListener(this); |
---|
319 | 387 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 388 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 389 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 390 | + resetCentroidXZItem.addActionListener(this); |
---|
| 391 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 392 | + transformGeometryItem.addActionListener(this); |
---|
| 393 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 394 | + transformChildrenItem.addActionListener(this); |
---|
323 | 395 | |
---|
324 | 396 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 397 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 440 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 441 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 442 | clearMaterialsItem.addActionListener(this); |
---|
| 443 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 444 | + resetAllItem.addActionListener(this); |
---|
| 445 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 446 | + stepAllItem.addActionListener(this); |
---|
371 | 447 | menu.add("-"); |
---|
372 | 448 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 449 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 498 | sortbysizeItem.addActionListener(this); |
---|
423 | 499 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 500 | sortbynameItem.addActionListener(this); |
---|
| 501 | + menu.add("-"); |
---|
| 502 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 503 | + shareGeometriesItem.addActionListener(this); |
---|
| 504 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 505 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 506 | if (Globals.ADVANCED) |
---|
426 | 507 | { |
---|
427 | | - menu.add("-"); |
---|
| 508 | + // Pretty much the same as duplicate and clone. |
---|
428 | 509 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 510 | extractGeometriesItem.addActionListener(this); |
---|
430 | 511 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 512 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 513 | } |
---|
437 | 514 | |
---|
438 | 515 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 516 | buildCreateMenu(menu); |
---|
440 | 517 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
443 | | - importOBJItem.addActionListener(this); |
---|
444 | | - menu.add("-"); |
---|
445 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
446 | | - import3DSItem.addActionListener(this); |
---|
447 | | - menu.add("-"); |
---|
448 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | | - importVRMLX3DItem.addActionListener(this); |
---|
450 | | - menu.add("-"); |
---|
451 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
452 | | - importGFDItem.addActionListener(this); |
---|
453 | | - |
---|
454 | 518 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 519 | buildToolsMenu(menu); |
---|
456 | 520 | } |
---|
.. | .. |
---|
488 | 552 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 553 | |
---|
490 | 554 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 555 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 556 | liveCB.addItemListener(this); |
---|
493 | 557 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 558 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 559 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 560 | oneStepButton.addActionListener(this); |
---|
497 | 561 | |
---|
.. | .. |
---|
503 | 567 | trackCB.setToolTipText("Enable tracking"); |
---|
504 | 568 | trackCB.addItemListener(this); |
---|
505 | 569 | |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 570 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | 571 | screenfitButton.setToolTipText("Screen fit"); |
---|
508 | 572 | screenfitButton.addActionListener(this); |
---|
509 | 573 | |
---|
.. | .. |
---|
512 | 576 | |
---|
513 | 577 | if (Globals.ADVANCED) |
---|
514 | 578 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 579 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 580 | snapobjectButton.addActionListener(this); |
---|
517 | 581 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 582 | } |
---|
519 | 583 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 585 | flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 586 | flashSelectionButton.addActionListener(this); |
---|
523 | 587 | |
---|
524 | 588 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 589 | |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 590 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 591 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 592 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 593 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 594 | fourButton.addActionListener(this); |
---|
531 | 595 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 597 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 598 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 599 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 600 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 601 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 603 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 604 | sevenButton.addActionListener(this); |
---|
541 | 605 | // |
---|
542 | 606 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 608 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 609 | rootButton.addActionListener(this); |
---|
546 | 610 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 612 | closeButton.setToolTipText("Close tab"); |
---|
549 | 613 | closeButton.addActionListener(this); |
---|
550 | 614 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
552 | 616 | |
---|
553 | 617 | cGridBag commandsPanel = new cGridBag(); |
---|
554 | 618 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | 620 | editButton.setToolTipText("Edit selection"); |
---|
557 | 621 | editButton.addActionListener(this); |
---|
558 | 622 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 623 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | 624 | uneditButton.setToolTipText("Unedit selection"); |
---|
561 | 625 | uneditButton.addActionListener(this); |
---|
562 | 626 | |
---|
.. | .. |
---|
564 | 628 | allParamsButton.setToolTipText("Edit all params"); |
---|
565 | 629 | allParamsButton.addActionListener(this); |
---|
566 | 630 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 631 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 632 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 633 | clearPanelButton.addActionListener(this); |
---|
570 | 634 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 636 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 637 | unselectButton.addActionListener(this); |
---|
574 | 638 | |
---|
.. | .. |
---|
651 | 715 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
652 | 716 | zoomBoxCB.addItemListener(this); |
---|
653 | 717 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 718 | + if (true) // Globals.ADVANCED) |
---|
655 | 719 | { |
---|
656 | 720 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | 721 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
724 | 788 | buttonGroup.add(radioButton); |
---|
725 | 789 | radioButton.doClick(); |
---|
726 | 790 | } |
---|
| 791 | + |
---|
727 | 792 | void SetupViews(ObjEditor oe) |
---|
728 | 793 | { |
---|
729 | 794 | oe.SetupViews(); |
---|
.. | .. |
---|
969 | 1034 | |
---|
970 | 1035 | flashIt = false; |
---|
971 | 1036 | CameraPane pane = (CameraPane) target; |
---|
972 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1037 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
973 | 1038 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
974 | 1039 | |
---|
975 | 1040 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1542 | 1607 | |
---|
1543 | 1608 | void Overwrite(int mask) |
---|
1544 | 1609 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1610 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1611 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1612 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1613 | |
---|
1549 | 1614 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1615 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1849 | 1914 | csg.addChild(child); |
---|
1850 | 1915 | child.addChild(csg); |
---|
1851 | 1916 | } else |
---|
1852 | | - |
---|
1853 | | - if (source == importGFDItem) |
---|
1854 | | - { |
---|
1855 | | - ImportGFD(); |
---|
1856 | | - } else |
---|
1857 | | - if (source == importVRMLX3DItem) |
---|
1858 | | - { |
---|
1859 | | - ImportVRMLX3D(); |
---|
1860 | | - } else |
---|
1861 | | - if (source == import3DSItem) |
---|
1862 | | - { |
---|
1863 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1864 | | - } else |
---|
1865 | | - if (source == importOBJItem) |
---|
1866 | | - { |
---|
1867 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1868 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1869 | | - browser.setVisible(true); |
---|
1870 | | - String filename = browser.getFile(); |
---|
1871 | | - if (filename != null && filename.length() > 0) |
---|
1872 | | - { |
---|
1873 | | - String fullname = browser.getDirectory() + filename; |
---|
1874 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1875 | | - } |
---|
1876 | | - } else |
---|
1877 | 1917 | if (source == computeAOItem) |
---|
1878 | 1918 | { |
---|
1879 | 1919 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1892 | 1932 | if (source == invariantsItem) |
---|
1893 | 1933 | { |
---|
1894 | 1934 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1935 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 1936 | } else |
---|
1897 | 1937 | if (source == memoryItem) |
---|
1898 | 1938 | { |
---|
.. | .. |
---|
1967 | 2007 | } else |
---|
1968 | 2008 | if (source == duplicateItem) |
---|
1969 | 2009 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2010 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2011 | loadClipboard(false); |
---|
1972 | 2012 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2013 | + Grafreed.clipboard = keep; |
---|
1974 | 2014 | } else |
---|
1975 | 2015 | if (source == cloneItem) |
---|
1976 | 2016 | { |
---|
.. | .. |
---|
2190 | 2230 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2231 | // refreshContents(); |
---|
2192 | 2232 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2233 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2234 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2235 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2236 | |
---|
2197 | 2237 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2238 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2282 | } else |
---|
2243 | 2283 | if (source == setMasterItem) |
---|
2244 | 2284 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2285 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2286 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2287 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2288 | |
---|
2249 | 2289 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2290 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2297 | { |
---|
2258 | 2298 | if (group.selection.size() == 1) |
---|
2259 | 2299 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2300 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2301 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2302 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2303 | |
---|
2264 | 2304 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2305 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2316 | { |
---|
2277 | 2317 | RevertMeshes(); |
---|
2278 | 2318 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2319 | + if (source == resetAllItem) |
---|
2280 | 2320 | { |
---|
2281 | 2321 | ResetAll(); |
---|
2282 | 2322 | } else |
---|
.. | .. |
---|
2614 | 2654 | { |
---|
2615 | 2655 | SmoothMesh(); |
---|
2616 | 2656 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 2657 | + if (source == transformGeometryItem) |
---|
2618 | 2658 | { |
---|
2619 | 2659 | TransformGeometry(); |
---|
| 2660 | + } else |
---|
| 2661 | + if (source == transformChildrenItem) |
---|
| 2662 | + { |
---|
| 2663 | + TransformChildren(); |
---|
2620 | 2664 | } else |
---|
2621 | 2665 | if (source == resetTransformItem) |
---|
2622 | 2666 | { |
---|
.. | .. |
---|
2624 | 2668 | } else |
---|
2625 | 2669 | if (source == resetCentroidItem) |
---|
2626 | 2670 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 2671 | + ResetCentroid(true); |
---|
| 2672 | + } else |
---|
| 2673 | + if (source == resetCentroidXZItem) |
---|
| 2674 | + { |
---|
| 2675 | + ResetCentroid(false); |
---|
2628 | 2676 | } else |
---|
2629 | 2677 | if (source == resetParentItem) |
---|
2630 | 2678 | { |
---|
.. | .. |
---|
3066 | 3114 | frontView.object = group; |
---|
3067 | 3115 | sideView.object = group; |
---|
3068 | 3116 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 3117 | + |
---|
| 3118 | +// fix "+" issue group.editWindow = this; |
---|
| 3119 | + |
---|
3070 | 3120 | /* |
---|
3071 | 3121 | currentLayout = radio.layout; |
---|
3072 | 3122 | if (currentLayout == null) |
---|
.. | .. |
---|
3079 | 3129 | //group.attributes = -1; |
---|
3080 | 3130 | ResetModel(); |
---|
3081 | 3131 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3132 | + } else if (event.getSource() == editCameraItem) |
---|
| 3133 | + { |
---|
| 3134 | + cameraView.ProtectCamera(); |
---|
| 3135 | + cameraView.repaint(); |
---|
| 3136 | + return; |
---|
| 3137 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3138 | + { |
---|
| 3139 | + cameraView.RevertCamera(); |
---|
| 3140 | + cameraView.repaint(); |
---|
| 3141 | + return; |
---|
| 3142 | + // } else if (event.getSource() == textureButton) |
---|
| 3143 | + // { |
---|
| 3144 | + // return; // true; |
---|
| 3145 | + } |
---|
3083 | 3146 | else |
---|
3084 | 3147 | { |
---|
3085 | 3148 | //return super.action(event, arg); |
---|
.. | .. |
---|
3140 | 3203 | refreshContents(); |
---|
3141 | 3204 | } |
---|
3142 | 3205 | |
---|
| 3206 | + void TransformChildren() |
---|
| 3207 | + { |
---|
| 3208 | + Object3D obj; |
---|
| 3209 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3210 | + { |
---|
| 3211 | + obj = (Object3D)e.nextElement(); |
---|
| 3212 | + obj.KeepTextureMatrices(); |
---|
| 3213 | + obj.TransformChildren(); |
---|
| 3214 | + obj.RestoreTextureMatrices(); |
---|
| 3215 | + |
---|
| 3216 | +// if (obj.parent == null) |
---|
| 3217 | +// { |
---|
| 3218 | +// System.out.println("NULL PARENT!"); |
---|
| 3219 | +// new Exception().printStackTrace(); |
---|
| 3220 | +// } |
---|
| 3221 | +// else |
---|
| 3222 | +// TouchTransform(obj); |
---|
| 3223 | +// //obj.parent.Touch(); |
---|
| 3224 | + } |
---|
| 3225 | + |
---|
| 3226 | + refreshContents(); |
---|
| 3227 | + } |
---|
3143 | 3228 | |
---|
3144 | 3229 | void ResetTransform() |
---|
3145 | 3230 | { |
---|
.. | .. |
---|
3252 | 3337 | refreshContents(); |
---|
3253 | 3338 | } |
---|
3254 | 3339 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3340 | + void ResetCentroid(boolean full) |
---|
3256 | 3341 | { |
---|
3257 | 3342 | Object3D obj; |
---|
3258 | 3343 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3352 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3353 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3354 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3355 | + if (full) |
---|
| 3356 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3357 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3358 | obj.TransformMesh(Object3D.mat); |
---|
| 3359 | + |
---|
3273 | 3360 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3361 | + if (full) |
---|
| 3362 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3363 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3364 | + |
---|
3276 | 3365 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3366 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3367 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3338 | 3427 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3428 | |
---|
3340 | 3429 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3430 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3431 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3432 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3433 | |
---|
3345 | 3434 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3435 | } |
---|
.. | .. |
---|
3554 | 3643 | |
---|
3555 | 3644 | void ParseVertices() |
---|
3556 | 3645 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 3646 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3647 | + Grafreed.epsequal = true; |
---|
3559 | 3648 | |
---|
3560 | 3649 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 3650 | { |
---|
.. | .. |
---|
3580 | 3669 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 3670 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 3671 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 3672 | + g.add(Grafreed.clipboard); |
---|
3584 | 3673 | |
---|
3585 | 3674 | buffer.add(g); |
---|
3586 | 3675 | } |
---|
.. | .. |
---|
3595 | 3684 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 3685 | } |
---|
3597 | 3686 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 3687 | + Grafreed.epsequal = epsequal; |
---|
3599 | 3688 | |
---|
3600 | 3689 | refreshContents(); |
---|
3601 | 3690 | } |
---|
.. | .. |
---|
3613 | 3702 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 3703 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 3704 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3705 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3706 | + |
---|
| 3707 | + try |
---|
| 3708 | + { |
---|
| 3709 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3710 | + } |
---|
| 3711 | + catch (Exception e) |
---|
| 3712 | + { |
---|
| 3713 | + System.err.println("FAIL: " + node); |
---|
| 3714 | + } |
---|
3617 | 3715 | |
---|
3618 | 3716 | double s = v.s; |
---|
3619 | 3717 | |
---|
.. | .. |
---|
3745 | 3843 | return; |
---|
3746 | 3844 | |
---|
3747 | 3845 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3846 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 3847 | |
---|
3750 | 3848 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 3849 | |
---|
.. | .. |
---|
3939 | 4037 | |
---|
3940 | 4038 | void ClipMesh() |
---|
3941 | 4039 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4040 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4041 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4042 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4043 | |
---|
3946 | 4044 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4045 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4048 | // { |
---|
3951 | 4049 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4050 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4051 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4052 | } |
---|
3955 | 4053 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4054 | System.out.println("DONE."); |
---|
.. | .. |
---|
4085 | 4183 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 4184 | |
---|
4087 | 4185 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 4186 | + if(elem != group || !newWindow) |
---|
4089 | 4187 | { |
---|
4090 | 4188 | // if (!(elem instanceof Composite)) |
---|
4091 | 4189 | // newWindow = false; |
---|
.. | .. |
---|
4290 | 4388 | { |
---|
4291 | 4389 | if (group.selection.isEmpty()) |
---|
4292 | 4390 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4391 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4392 | Composite tGroup = null; |
---|
4295 | 4393 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4394 | { |
---|
4297 | 4395 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4396 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4397 | } |
---|
4300 | 4398 | |
---|
4301 | 4399 | if (cut) |
---|
.. | .. |
---|
4335 | 4433 | //System.out.println("cut " + child); |
---|
4336 | 4434 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4435 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4436 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4437 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4438 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4439 | + Grafreed.clipboard = tmp; |
---|
4342 | 4440 | } |
---|
4343 | 4441 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4442 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4443 | tGroup.add/*Child*/(child); |
---|
4346 | 4444 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4445 | + Grafreed.clipboard = child; |
---|
4348 | 4446 | } |
---|
4349 | 4447 | |
---|
4350 | 4448 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4474 | //System.out.println("cut " + elem); |
---|
4377 | 4475 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4476 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4477 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4478 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4479 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4480 | + Grafreed.clipboard = tmp; |
---|
4383 | 4481 | } |
---|
4384 | 4482 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4483 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4484 | tGroup.add/*Child*/(child); |
---|
4387 | 4485 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4486 | + Grafreed.clipboard = child; |
---|
4389 | 4487 | } |
---|
4390 | 4488 | |
---|
4391 | 4489 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4490 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4491 | + Grafreed.clipboard = tGroup; |
---|
4394 | 4492 | if (cut) |
---|
4395 | 4493 | { |
---|
4396 | 4494 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4502 | // return; |
---|
4405 | 4503 | boolean first = true; |
---|
4406 | 4504 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4505 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4506 | { |
---|
4409 | 4507 | Composite temp; |
---|
4410 | 4508 | |
---|
.. | .. |
---|
4415 | 4513 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4514 | */ |
---|
4417 | 4515 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4516 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4517 | { |
---|
4420 | 4518 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4519 | |
---|
.. | .. |
---|
4449 | 4547 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4548 | //temp.addChild(cb); |
---|
4451 | 4549 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4452 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4453 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4454 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4455 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4456 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4550 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4551 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4552 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4553 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4554 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4555 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4556 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4557 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4558 | } |
---|
4461 | 4559 | |
---|
4462 | 4560 | ResetModel(); |
---|
.. | .. |
---|
4505 | 4603 | { |
---|
4506 | 4604 | boolean first = true; |
---|
4507 | 4605 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4607 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4608 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 4609 | Object3D copy; |
---|
4512 | 4610 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 4611 | { |
---|
.. | .. |
---|
4517 | 4615 | } |
---|
4518 | 4616 | } else |
---|
4519 | 4617 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4618 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 4619 | } |
---|
4522 | 4620 | } |
---|
4523 | 4621 | } |
---|
.. | .. |
---|
4922 | 5020 | } |
---|
4923 | 5021 | */ |
---|
4924 | 5022 | |
---|
4925 | | - void ImportGFD() |
---|
4926 | | - { |
---|
4927 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4928 | | - browser.show(); |
---|
4929 | | - String filename = browser.getFile(); |
---|
4930 | | - if (filename != null && filename.length() > 0) |
---|
4931 | | - { |
---|
4932 | | - String fullname = browser.getDirectory() + filename; |
---|
4933 | | - |
---|
4934 | | - //Object3D readobj = |
---|
4935 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4936 | | - //makeSomething(readobj); |
---|
4937 | | - } |
---|
4938 | | - } |
---|
4939 | | - |
---|
4940 | 5023 | /* |
---|
4941 | 5024 | public void Callback(Object obj) |
---|
4942 | 5025 | { |
---|
.. | .. |
---|
4960 | 5043 | } |
---|
4961 | 5044 | */ |
---|
4962 | 5045 | |
---|
4963 | | - void ImportVRMLX3D() |
---|
4964 | | - { |
---|
4965 | | - if (GrafreeD.standAlone) |
---|
4966 | | - { |
---|
4967 | | - /**/ |
---|
4968 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4969 | | - browser.show(); |
---|
4970 | | - String filename = browser.getFile(); |
---|
4971 | | - if (filename != null && filename.length() > 0) |
---|
4972 | | - { |
---|
4973 | | - String fullname = browser.getDirectory() + filename; |
---|
4974 | | - LoadVRMLX3D(fullname); |
---|
4975 | | - } |
---|
4976 | | - /**/ |
---|
4977 | | - } |
---|
4978 | | - } |
---|
4979 | | - |
---|
4980 | 5046 | String GetFile(String dialogName) |
---|
4981 | 5047 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5048 | + if (Grafreed.standAlone) |
---|
4983 | 5049 | { |
---|
4984 | 5050 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5051 | browser.show(); |
---|
.. | .. |
---|
5092 | 5158 | private MenuItem linkverticesItem; |
---|
5093 | 5159 | private MenuItem relinkverticesItem; |
---|
5094 | 5160 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5161 | + private MenuItem resetAllItem; |
---|
5096 | 5162 | private MenuItem stepAllItem; |
---|
5097 | 5163 | private MenuItem revertMeshItem; |
---|
5098 | 5164 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5153 | 5219 | private MenuItem panoTexturesItem; |
---|
5154 | 5220 | |
---|
5155 | 5221 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5222 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5223 | private MenuItem resetTransformItem; |
---|
| 5224 | + private MenuItem transformGeometryItem; |
---|
| 5225 | + private MenuItem transformChildrenItem; |
---|
5158 | 5226 | private MenuItem hideItem; |
---|
5159 | 5227 | private MenuItem grabItem; |
---|
5160 | 5228 | private MenuItem backItem; |
---|
.. | .. |
---|
5223 | 5291 | private MenuItem doubleItem; |
---|
5224 | 5292 | private MenuItem tripleItem; |
---|
5225 | 5293 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 5294 | private MenuItem computeAOItem; |
---|
5232 | 5295 | private MenuItem recompileItem; |
---|
5233 | 5296 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 5300 | private MenuItem analyzeItem; |
---|
5238 | 5301 | private MenuItem dumpItem; |
---|
5239 | 5302 | //boolean freezemodel = false; |
---|
| 5303 | + |
---|
| 5304 | + Menu cameraMenu; |
---|
| 5305 | + MenuItem editCameraItem; |
---|
| 5306 | + MenuItem revertCameraItem; |
---|
5240 | 5307 | } |
---|