.. | .. |
---|
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")); |
---|
171 | 156 | //editItem.addActionListener(this); |
---|
| 157 | + undoItem = menu.add(new MenuItem("Undo")); |
---|
| 158 | + undoItem.addActionListener(this); |
---|
| 159 | + redoItem = menu.add(new MenuItem("Redo")); |
---|
| 160 | + redoItem.addActionListener(this); |
---|
| 161 | + menu.add("-"); |
---|
172 | 162 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
173 | 163 | duplicateItem.addActionListener(this); |
---|
174 | 164 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
206 | 196 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 197 | clearAllItem.addActionListener(this); |
---|
208 | 198 | } |
---|
| 199 | + |
---|
| 200 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 201 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 202 | + //zBufferItem.addActionListener(this); |
---|
| 203 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 204 | + //normalLensItem.addActionListener(this); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
| 206 | + revertCameraItem.addActionListener(this); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 209 | + toggleFullScreenItem.addItemListener(this); |
---|
| 210 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 211 | + cameraMenu.add("-"); |
---|
| 212 | + |
---|
| 213 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 214 | + toggleTextureItem.addItemListener(this); |
---|
| 215 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 216 | + |
---|
| 217 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 218 | + toggleSwitchItem.addItemListener(this); |
---|
| 219 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 220 | + |
---|
| 221 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 222 | + toggleHandleItem.addItemListener(this); |
---|
| 223 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 224 | + |
---|
| 225 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 226 | + togglePaintItem.addItemListener(this); |
---|
| 227 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 228 | + |
---|
| 229 | + if (Globals.ADVANCED) |
---|
| 230 | + { |
---|
| 231 | + cameraMenu.add("-"); |
---|
| 232 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 233 | + toggleLiveItem.addItemListener(this); |
---|
| 234 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 235 | |
---|
| 236 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 237 | + stepItem.addActionListener(this); |
---|
| 238 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 239 | + // toggleDLItem.addItemListener(this); |
---|
| 240 | + // toggleDLItem.setState(false); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 243 | + toggleRenderItem.addItemListener(this); |
---|
| 244 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 247 | + toggleDebugItem.addItemListener(this); |
---|
| 248 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 249 | + |
---|
| 250 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 251 | + toggleFrustumItem.addItemListener(this); |
---|
| 252 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 253 | + |
---|
| 254 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 255 | + toggleFootContactItem.addItemListener(this); |
---|
| 256 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 257 | + |
---|
| 258 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 259 | + toggleTimelineItem.addItemListener(this); |
---|
| 260 | + } |
---|
| 261 | + |
---|
| 262 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 263 | +// toggleRootItem.addItemListener(this); |
---|
| 264 | +// toggleRootItem.setState(false); |
---|
| 265 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 266 | +// animationItem.addItemListener(this); |
---|
| 267 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 268 | + cameraMenu.add("-"); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 270 | + editCameraItem.addActionListener(this); |
---|
| 271 | + |
---|
| 272 | + if (Globals.ADVANCED) |
---|
| 273 | + { |
---|
| 274 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 275 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 276 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 277 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 278 | + oe.cameraMenu.add("-"); |
---|
| 279 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 280 | + openWindowItem.addActionListener(this); |
---|
| 281 | + editLeafItem.addActionListener(this); |
---|
| 282 | + lookAtItem.addActionListener(this); |
---|
| 283 | + //lookFromItem.addActinoListener(this); |
---|
| 284 | + //switchItem.addActionListener(this); |
---|
| 285 | + } |
---|
| 286 | + |
---|
210 | 287 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 288 | if (Globals.ADVANCED) |
---|
212 | 289 | { |
---|
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 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 291 | revertMeshItem.addActionListener(this); |
---|
219 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
318 | 391 | resetTransformItem.addActionListener(this); |
---|
319 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 393 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 394 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 395 | + resetCentroidXZItem.addActionListener(this); |
---|
| 396 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 397 | + transformGeometryItem.addActionListener(this); |
---|
| 398 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 399 | + transformChildrenItem.addActionListener(this); |
---|
323 | 400 | |
---|
324 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 447 | clearMaterialsItem.addActionListener(this); |
---|
| 448 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 449 | + resetAllItem.addActionListener(this); |
---|
| 450 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 451 | + stepAllItem.addActionListener(this); |
---|
371 | 452 | menu.add("-"); |
---|
372 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 454 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 503 | sortbysizeItem.addActionListener(this); |
---|
423 | 504 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 505 | sortbynameItem.addActionListener(this); |
---|
| 506 | + menu.add("-"); |
---|
| 507 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 508 | + shareGeometriesItem.addActionListener(this); |
---|
| 509 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 510 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 511 | if (Globals.ADVANCED) |
---|
426 | 512 | { |
---|
427 | | - menu.add("-"); |
---|
| 513 | + // Pretty much the same as duplicate and clone. |
---|
428 | 514 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 515 | extractGeometriesItem.addActionListener(this); |
---|
430 | 516 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 517 | 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 | 518 | } |
---|
437 | 519 | |
---|
438 | 520 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 521 | buildCreateMenu(menu); |
---|
440 | 522 | |
---|
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 | 523 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 524 | buildToolsMenu(menu); |
---|
456 | 525 | } |
---|
.. | .. |
---|
488 | 557 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 558 | |
---|
490 | 559 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 560 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 561 | liveCB.addItemListener(this); |
---|
493 | 562 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 563 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 564 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 565 | oneStepButton.addActionListener(this); |
---|
497 | 566 | |
---|
.. | .. |
---|
503 | 572 | trackCB.setToolTipText("Enable tracking"); |
---|
504 | 573 | trackCB.addItemListener(this); |
---|
505 | 574 | |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 575 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | 576 | screenfitButton.setToolTipText("Screen fit"); |
---|
508 | 577 | screenfitButton.addActionListener(this); |
---|
509 | 578 | |
---|
.. | .. |
---|
512 | 581 | |
---|
513 | 582 | if (Globals.ADVANCED) |
---|
514 | 583 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 585 | snapobjectButton.addActionListener(this); |
---|
517 | 586 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 587 | } |
---|
519 | 588 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 589 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 590 | flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 591 | flashSelectionButton.addActionListener(this); |
---|
523 | 592 | |
---|
524 | 593 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 594 | |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 595 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 596 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 597 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 599 | fourButton.addActionListener(this); |
---|
531 | 600 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 601 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 602 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 603 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 605 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 606 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 608 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 609 | sevenButton.addActionListener(this); |
---|
541 | 610 | // |
---|
542 | 611 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 613 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 614 | rootButton.addActionListener(this); |
---|
546 | 615 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 617 | closeButton.setToolTipText("Close tab"); |
---|
549 | 618 | closeButton.addActionListener(this); |
---|
550 | 619 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
552 | 621 | |
---|
553 | 622 | cGridBag commandsPanel = new cGridBag(); |
---|
554 | 623 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | 625 | editButton.setToolTipText("Edit selection"); |
---|
557 | 626 | editButton.addActionListener(this); |
---|
558 | 627 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | 629 | uneditButton.setToolTipText("Unedit selection"); |
---|
561 | 630 | uneditButton.addActionListener(this); |
---|
562 | 631 | |
---|
.. | .. |
---|
564 | 633 | allParamsButton.setToolTipText("Edit all params"); |
---|
565 | 634 | allParamsButton.addActionListener(this); |
---|
566 | 635 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 637 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 638 | clearPanelButton.addActionListener(this); |
---|
570 | 639 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 640 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 641 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 642 | unselectButton.addActionListener(this); |
---|
574 | 643 | |
---|
.. | .. |
---|
651 | 720 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
652 | 721 | zoomBoxCB.addItemListener(this); |
---|
653 | 722 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 723 | + if (true) // Globals.ADVANCED) |
---|
655 | 724 | { |
---|
656 | 725 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | 726 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
724 | 793 | buttonGroup.add(radioButton); |
---|
725 | 794 | radioButton.doClick(); |
---|
726 | 795 | } |
---|
| 796 | + |
---|
727 | 797 | void SetupViews(ObjEditor oe) |
---|
728 | 798 | { |
---|
729 | 799 | oe.SetupViews(); |
---|
.. | .. |
---|
969 | 1039 | |
---|
970 | 1040 | flashIt = false; |
---|
971 | 1041 | CameraPane pane = (CameraPane) target; |
---|
972 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1042 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
973 | 1043 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
974 | 1044 | |
---|
975 | 1045 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1542 | 1612 | |
---|
1543 | 1613 | void Overwrite(int mask) |
---|
1544 | 1614 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1615 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1616 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1617 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1618 | |
---|
1549 | 1619 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1620 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1849 | 1919 | csg.addChild(child); |
---|
1850 | 1920 | child.addChild(csg); |
---|
1851 | 1921 | } 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 | 1922 | if (source == computeAOItem) |
---|
1878 | 1923 | { |
---|
1879 | 1924 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1892 | 1937 | if (source == invariantsItem) |
---|
1893 | 1938 | { |
---|
1894 | 1939 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1940 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 1941 | } else |
---|
1897 | 1942 | if (source == memoryItem) |
---|
1898 | 1943 | { |
---|
.. | .. |
---|
1965 | 2010 | { |
---|
1966 | 2011 | loadClipboard(true); |
---|
1967 | 2012 | } else |
---|
| 2013 | + if (source == undoItem) |
---|
| 2014 | + { |
---|
| 2015 | + Undo(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == redoItem) |
---|
| 2018 | + { |
---|
| 2019 | + Redo(); |
---|
| 2020 | + } else |
---|
1968 | 2021 | if (source == duplicateItem) |
---|
1969 | 2022 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2023 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2024 | loadClipboard(false); |
---|
1972 | 2025 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2026 | + Grafreed.clipboard = keep; |
---|
1974 | 2027 | } else |
---|
1975 | 2028 | if (source == cloneItem) |
---|
1976 | 2029 | { |
---|
.. | .. |
---|
2190 | 2243 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2244 | // refreshContents(); |
---|
2192 | 2245 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2246 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2247 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2248 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2249 | |
---|
2197 | 2250 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2251 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2295 | } else |
---|
2243 | 2296 | if (source == setMasterItem) |
---|
2244 | 2297 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2298 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2299 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2300 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2301 | |
---|
2249 | 2302 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2303 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2310 | { |
---|
2258 | 2311 | if (group.selection.size() == 1) |
---|
2259 | 2312 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2313 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2314 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2315 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2316 | |
---|
2264 | 2317 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2318 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2329 | { |
---|
2277 | 2330 | RevertMeshes(); |
---|
2278 | 2331 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2332 | + if (source == resetAllItem) |
---|
2280 | 2333 | { |
---|
2281 | 2334 | ResetAll(); |
---|
2282 | 2335 | } else |
---|
.. | .. |
---|
2614 | 2667 | { |
---|
2615 | 2668 | SmoothMesh(); |
---|
2616 | 2669 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 2670 | + if (source == transformGeometryItem) |
---|
2618 | 2671 | { |
---|
2619 | 2672 | TransformGeometry(); |
---|
| 2673 | + } else |
---|
| 2674 | + if (source == transformChildrenItem) |
---|
| 2675 | + { |
---|
| 2676 | + TransformChildren(); |
---|
2620 | 2677 | } else |
---|
2621 | 2678 | if (source == resetTransformItem) |
---|
2622 | 2679 | { |
---|
.. | .. |
---|
2624 | 2681 | } else |
---|
2625 | 2682 | if (source == resetCentroidItem) |
---|
2626 | 2683 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 2684 | + ResetCentroid(true); |
---|
| 2685 | + } else |
---|
| 2686 | + if (source == resetCentroidXZItem) |
---|
| 2687 | + { |
---|
| 2688 | + ResetCentroid(false); |
---|
2628 | 2689 | } else |
---|
2629 | 2690 | if (source == resetParentItem) |
---|
2630 | 2691 | { |
---|
.. | .. |
---|
2980 | 3041 | child.CloseUI(); |
---|
2981 | 3042 | listUI.remove(child); |
---|
2982 | 3043 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3044 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3045 | } |
---|
2985 | 3046 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3047 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3066 | 3127 | frontView.object = group; |
---|
3067 | 3128 | sideView.object = group; |
---|
3068 | 3129 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 3130 | + |
---|
| 3131 | +// fix "+" issue group.editWindow = this; |
---|
| 3132 | + |
---|
3070 | 3133 | /* |
---|
3071 | 3134 | currentLayout = radio.layout; |
---|
3072 | 3135 | if (currentLayout == null) |
---|
.. | .. |
---|
3079 | 3142 | //group.attributes = -1; |
---|
3080 | 3143 | ResetModel(); |
---|
3081 | 3144 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3145 | + } else if (event.getSource() == editCameraItem) |
---|
| 3146 | + { |
---|
| 3147 | + cameraView.ProtectCamera(); |
---|
| 3148 | + cameraView.repaint(); |
---|
| 3149 | + return; |
---|
| 3150 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3151 | + { |
---|
| 3152 | + cameraView.RevertCamera(); |
---|
| 3153 | + cameraView.repaint(); |
---|
| 3154 | + return; |
---|
| 3155 | + // } else if (event.getSource() == textureButton) |
---|
| 3156 | + // { |
---|
| 3157 | + // return; // true; |
---|
| 3158 | + } |
---|
3083 | 3159 | else |
---|
3084 | 3160 | { |
---|
3085 | 3161 | //return super.action(event, arg); |
---|
.. | .. |
---|
3140 | 3216 | refreshContents(); |
---|
3141 | 3217 | } |
---|
3142 | 3218 | |
---|
| 3219 | + void TransformChildren() |
---|
| 3220 | + { |
---|
| 3221 | + Object3D obj; |
---|
| 3222 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3223 | + { |
---|
| 3224 | + obj = (Object3D)e.nextElement(); |
---|
| 3225 | + obj.KeepTextureMatrices(); |
---|
| 3226 | + obj.TransformChildren(); |
---|
| 3227 | + obj.RestoreTextureMatrices(); |
---|
| 3228 | + |
---|
| 3229 | +// if (obj.parent == null) |
---|
| 3230 | +// { |
---|
| 3231 | +// System.out.println("NULL PARENT!"); |
---|
| 3232 | +// new Exception().printStackTrace(); |
---|
| 3233 | +// } |
---|
| 3234 | +// else |
---|
| 3235 | +// TouchTransform(obj); |
---|
| 3236 | +// //obj.parent.Touch(); |
---|
| 3237 | + } |
---|
| 3238 | + |
---|
| 3239 | + refreshContents(); |
---|
| 3240 | + } |
---|
3143 | 3241 | |
---|
3144 | 3242 | void ResetTransform() |
---|
3145 | 3243 | { |
---|
.. | .. |
---|
3252 | 3350 | refreshContents(); |
---|
3253 | 3351 | } |
---|
3254 | 3352 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3353 | + void ResetCentroid(boolean full) |
---|
3256 | 3354 | { |
---|
3257 | 3355 | Object3D obj; |
---|
3258 | 3356 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3365 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3366 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3367 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3368 | + if (full) |
---|
| 3369 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3370 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3371 | obj.TransformMesh(Object3D.mat); |
---|
| 3372 | + |
---|
3273 | 3373 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3374 | + if (full) |
---|
| 3375 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3376 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3377 | + |
---|
3276 | 3378 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3379 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3380 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3338 | 3440 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3441 | |
---|
3340 | 3442 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3443 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3444 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3445 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3446 | |
---|
3345 | 3447 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3448 | } |
---|
.. | .. |
---|
3554 | 3656 | |
---|
3555 | 3657 | void ParseVertices() |
---|
3556 | 3658 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 3659 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3660 | + Grafreed.epsequal = true; |
---|
3559 | 3661 | |
---|
3560 | 3662 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 3663 | { |
---|
.. | .. |
---|
3580 | 3682 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 3683 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 3684 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 3685 | + g.add(Grafreed.clipboard); |
---|
3584 | 3686 | |
---|
3585 | 3687 | buffer.add(g); |
---|
3586 | 3688 | } |
---|
.. | .. |
---|
3595 | 3697 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 3698 | } |
---|
3597 | 3699 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 3700 | + Grafreed.epsequal = epsequal; |
---|
3599 | 3701 | |
---|
3600 | 3702 | refreshContents(); |
---|
3601 | 3703 | } |
---|
.. | .. |
---|
3613 | 3715 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 3716 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 3717 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3718 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3719 | + |
---|
| 3720 | + try |
---|
| 3721 | + { |
---|
| 3722 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3723 | + } |
---|
| 3724 | + catch (Exception e) |
---|
| 3725 | + { |
---|
| 3726 | + System.err.println("FAIL: " + node); |
---|
| 3727 | + } |
---|
3617 | 3728 | |
---|
3618 | 3729 | double s = v.s; |
---|
3619 | 3730 | |
---|
.. | .. |
---|
3745 | 3856 | return; |
---|
3746 | 3857 | |
---|
3747 | 3858 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3859 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 3860 | |
---|
3750 | 3861 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 3862 | |
---|
.. | .. |
---|
3939 | 4050 | |
---|
3940 | 4051 | void ClipMesh() |
---|
3941 | 4052 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4053 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4054 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4055 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4056 | |
---|
3946 | 4057 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4058 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4061 | // { |
---|
3951 | 4062 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4063 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4064 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4065 | } |
---|
3955 | 4066 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4067 | System.out.println("DONE."); |
---|
.. | .. |
---|
4085 | 4196 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 4197 | |
---|
4087 | 4198 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 4199 | + if(elem != group || !newWindow) |
---|
4089 | 4200 | { |
---|
4090 | 4201 | // if (!(elem instanceof Composite)) |
---|
4091 | 4202 | // newWindow = false; |
---|
.. | .. |
---|
4199 | 4310 | |
---|
4200 | 4311 | objEditor.SetText(); // jan 2014 |
---|
4201 | 4312 | |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4313 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 4314 | CameraPane.flash = true; |
---|
4204 | 4315 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4316 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 4317 | // a camera |
---|
4207 | 4318 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4319 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4320 | + { |
---|
| 4321 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4322 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4323 | + } |
---|
4210 | 4324 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 4325 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 4326 | } |
---|
.. | .. |
---|
4290 | 4404 | { |
---|
4291 | 4405 | if (group.selection.isEmpty()) |
---|
4292 | 4406 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4407 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4408 | Composite tGroup = null; |
---|
4295 | 4409 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4410 | { |
---|
4297 | 4411 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4412 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4413 | } |
---|
4300 | 4414 | |
---|
4301 | 4415 | if (cut) |
---|
.. | .. |
---|
4335 | 4449 | //System.out.println("cut " + child); |
---|
4336 | 4450 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4451 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4452 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4453 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4454 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4455 | + Grafreed.clipboard = tmp; |
---|
4342 | 4456 | } |
---|
4343 | 4457 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4458 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4459 | tGroup.add/*Child*/(child); |
---|
4346 | 4460 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4461 | + Grafreed.clipboard = child; |
---|
4348 | 4462 | } |
---|
4349 | 4463 | |
---|
4350 | 4464 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4490 | //System.out.println("cut " + elem); |
---|
4377 | 4491 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4492 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4493 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4494 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4495 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4496 | + Grafreed.clipboard = tmp; |
---|
4383 | 4497 | } |
---|
4384 | 4498 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4499 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4500 | tGroup.add/*Child*/(child); |
---|
4387 | 4501 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4502 | + Grafreed.clipboard = child; |
---|
4389 | 4503 | } |
---|
4390 | 4504 | |
---|
4391 | 4505 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4506 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4507 | + Grafreed.clipboard = tGroup; |
---|
4394 | 4508 | if (cut) |
---|
4395 | 4509 | { |
---|
4396 | 4510 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4518 | // return; |
---|
4405 | 4519 | boolean first = true; |
---|
4406 | 4520 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4521 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4522 | { |
---|
4409 | 4523 | Composite temp; |
---|
4410 | 4524 | |
---|
.. | .. |
---|
4415 | 4529 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4530 | */ |
---|
4417 | 4531 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4532 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4533 | { |
---|
4420 | 4534 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4535 | |
---|
.. | .. |
---|
4449 | 4563 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4564 | //temp.addChild(cb); |
---|
4451 | 4565 | //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()); |
---|
| 4566 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4567 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4568 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4569 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4570 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4571 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4572 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4573 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4574 | } |
---|
4461 | 4575 | |
---|
4462 | 4576 | ResetModel(); |
---|
.. | .. |
---|
4505 | 4619 | { |
---|
4506 | 4620 | boolean first = true; |
---|
4507 | 4621 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4622 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4623 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4624 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 4625 | Object3D copy; |
---|
4512 | 4626 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 4627 | { |
---|
.. | .. |
---|
4517 | 4631 | } |
---|
4518 | 4632 | } else |
---|
4519 | 4633 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4634 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 4635 | } |
---|
4522 | 4636 | } |
---|
4523 | 4637 | } |
---|
.. | .. |
---|
4922 | 5036 | } |
---|
4923 | 5037 | */ |
---|
4924 | 5038 | |
---|
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 | 5039 | /* |
---|
4941 | 5040 | public void Callback(Object obj) |
---|
4942 | 5041 | { |
---|
.. | .. |
---|
4960 | 5059 | } |
---|
4961 | 5060 | */ |
---|
4962 | 5061 | |
---|
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 | 5062 | String GetFile(String dialogName) |
---|
4981 | 5063 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5064 | + if (Grafreed.standAlone) |
---|
4983 | 5065 | { |
---|
4984 | 5066 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5067 | browser.show(); |
---|
.. | .. |
---|
5079 | 5161 | private MenuItem lookFromItem; |
---|
5080 | 5162 | private MenuItem switchItem; |
---|
5081 | 5163 | private MenuItem cutItem; |
---|
| 5164 | + private MenuItem undoItem; |
---|
| 5165 | + private MenuItem redoItem; |
---|
5082 | 5166 | private MenuItem duplicateItem; |
---|
5083 | 5167 | private MenuItem cloneItem; |
---|
5084 | 5168 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5092 | 5176 | private MenuItem linkverticesItem; |
---|
5093 | 5177 | private MenuItem relinkverticesItem; |
---|
5094 | 5178 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5179 | + private MenuItem resetAllItem; |
---|
5096 | 5180 | private MenuItem stepAllItem; |
---|
5097 | 5181 | private MenuItem revertMeshItem; |
---|
5098 | 5182 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5153 | 5237 | private MenuItem panoTexturesItem; |
---|
5154 | 5238 | |
---|
5155 | 5239 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5240 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5241 | private MenuItem resetTransformItem; |
---|
| 5242 | + private MenuItem transformGeometryItem; |
---|
| 5243 | + private MenuItem transformChildrenItem; |
---|
5158 | 5244 | private MenuItem hideItem; |
---|
5159 | 5245 | private MenuItem grabItem; |
---|
5160 | 5246 | private MenuItem backItem; |
---|
.. | .. |
---|
5223 | 5309 | private MenuItem doubleItem; |
---|
5224 | 5310 | private MenuItem tripleItem; |
---|
5225 | 5311 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 5312 | private MenuItem computeAOItem; |
---|
5232 | 5313 | private MenuItem recompileItem; |
---|
5233 | 5314 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 5318 | private MenuItem analyzeItem; |
---|
5238 | 5319 | private MenuItem dumpItem; |
---|
5239 | 5320 | //boolean freezemodel = false; |
---|
| 5321 | + |
---|
| 5322 | + Menu cameraMenu; |
---|
| 5323 | + MenuItem editCameraItem; |
---|
| 5324 | + MenuItem revertCameraItem; |
---|
5240 | 5325 | } |
---|