.. | .. |
---|
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 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
172 | 163 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
173 | 164 | duplicateItem.addActionListener(this); |
---|
174 | 165 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
206 | 197 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 198 | clearAllItem.addActionListener(this); |
---|
208 | 199 | } |
---|
| 200 | + |
---|
| 201 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 202 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 203 | + //zBufferItem.addActionListener(this); |
---|
| 204 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 205 | + //normalLensItem.addActionListener(this); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 207 | + revertCameraItem.addActionListener(this); |
---|
| 208 | + |
---|
| 209 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 210 | + toggleFullScreenItem.addItemListener(this); |
---|
| 211 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 212 | + cameraMenu.add("-"); |
---|
| 213 | + |
---|
| 214 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 215 | + toggleTextureItem.addItemListener(this); |
---|
| 216 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 217 | + |
---|
| 218 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 219 | + toggleSwitchItem.addItemListener(this); |
---|
| 220 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 221 | + |
---|
| 222 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + toggleHandleItem.addItemListener(this); |
---|
| 224 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 225 | + |
---|
| 226 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 227 | + togglePaintItem.addItemListener(this); |
---|
| 228 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 229 | + |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
| 232 | + cameraMenu.add("-"); |
---|
| 233 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 234 | + toggleLiveItem.addItemListener(this); |
---|
| 235 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 236 | |
---|
| 237 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 238 | + stepItem.addActionListener(this); |
---|
| 239 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 240 | + // toggleDLItem.addItemListener(this); |
---|
| 241 | + // toggleDLItem.setState(false); |
---|
| 242 | + |
---|
| 243 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 244 | + toggleRenderItem.addItemListener(this); |
---|
| 245 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 246 | + |
---|
| 247 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 248 | + toggleDebugItem.addItemListener(this); |
---|
| 249 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
| 275 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 276 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 277 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 278 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 279 | + oe.cameraMenu.add("-"); |
---|
| 280 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 281 | + openWindowItem.addActionListener(this); |
---|
| 282 | + editLeafItem.addActionListener(this); |
---|
| 283 | + lookAtItem.addActionListener(this); |
---|
| 284 | + //lookFromItem.addActinoListener(this); |
---|
| 285 | + //switchItem.addActionListener(this); |
---|
| 286 | + } |
---|
| 287 | + |
---|
210 | 288 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 289 | if (Globals.ADVANCED) |
---|
212 | 290 | { |
---|
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 | 291 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 292 | revertMeshItem.addActionListener(this); |
---|
219 | 293 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
318 | 392 | resetTransformItem.addActionListener(this); |
---|
319 | 393 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 394 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 395 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 396 | + resetCentroidXZItem.addActionListener(this); |
---|
| 397 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 398 | + transformGeometryItem.addActionListener(this); |
---|
| 399 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 400 | + transformChildrenItem.addActionListener(this); |
---|
323 | 401 | |
---|
324 | 402 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 403 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 446 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 447 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 448 | clearMaterialsItem.addActionListener(this); |
---|
| 449 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 450 | + resetAllItem.addActionListener(this); |
---|
| 451 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 452 | + stepAllItem.addActionListener(this); |
---|
371 | 453 | menu.add("-"); |
---|
372 | 454 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 455 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 504 | sortbysizeItem.addActionListener(this); |
---|
423 | 505 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 506 | sortbynameItem.addActionListener(this); |
---|
| 507 | + menu.add("-"); |
---|
| 508 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 509 | + shareGeometriesItem.addActionListener(this); |
---|
| 510 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 511 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 512 | if (Globals.ADVANCED) |
---|
426 | 513 | { |
---|
427 | | - menu.add("-"); |
---|
| 514 | + // Pretty much the same as duplicate and clone. |
---|
428 | 515 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 516 | extractGeometriesItem.addActionListener(this); |
---|
430 | 517 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 518 | 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 | 519 | } |
---|
437 | 520 | |
---|
438 | 521 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 522 | buildCreateMenu(menu); |
---|
440 | 523 | |
---|
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 | 524 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 525 | buildToolsMenu(menu); |
---|
456 | 526 | } |
---|
.. | .. |
---|
487 | 557 | */ |
---|
488 | 558 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 559 | |
---|
| 560 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + undoButton.setToolTipText("Undo changes"); |
---|
| 562 | + undoButton.addActionListener(this); |
---|
| 563 | + |
---|
| 564 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + redoButton.setToolTipText("Redo changes"); |
---|
| 566 | + redoButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + saveButton.setToolTipText("Save changes"); |
---|
| 570 | + saveButton.addActionListener(this); |
---|
| 571 | + |
---|
490 | 572 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 573 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 574 | liveCB.addItemListener(this); |
---|
493 | 575 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 576 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 577 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 578 | oneStepButton.addActionListener(this); |
---|
497 | 579 | |
---|
.. | .. |
---|
503 | 585 | trackCB.setToolTipText("Enable tracking"); |
---|
504 | 586 | trackCB.addItemListener(this); |
---|
505 | 587 | |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | 589 | screenfitButton.setToolTipText("Screen fit"); |
---|
508 | 590 | screenfitButton.addActionListener(this); |
---|
509 | 591 | |
---|
.. | .. |
---|
512 | 594 | |
---|
513 | 595 | if (Globals.ADVANCED) |
---|
514 | 596 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 598 | snapobjectButton.addActionListener(this); |
---|
517 | 599 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 600 | } |
---|
519 | 601 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 603 | flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 604 | flashSelectionButton.addActionListener(this); |
---|
523 | 605 | |
---|
524 | 606 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 607 | |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 609 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 610 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 612 | fourButton.addActionListener(this); |
---|
531 | 613 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 614 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 615 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 616 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 618 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 619 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 621 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 622 | sevenButton.addActionListener(this); |
---|
541 | 623 | // |
---|
542 | 624 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 625 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 626 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 627 | rootButton.addActionListener(this); |
---|
546 | 628 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 630 | closeButton.setToolTipText("Close tab"); |
---|
549 | 631 | closeButton.addActionListener(this); |
---|
550 | 632 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
552 | 634 | |
---|
553 | 635 | cGridBag commandsPanel = new cGridBag(); |
---|
554 | 636 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | 638 | editButton.setToolTipText("Edit selection"); |
---|
557 | 639 | editButton.addActionListener(this); |
---|
558 | 640 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 641 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | 642 | uneditButton.setToolTipText("Unedit selection"); |
---|
561 | 643 | uneditButton.addActionListener(this); |
---|
562 | 644 | |
---|
.. | .. |
---|
564 | 646 | allParamsButton.setToolTipText("Edit all params"); |
---|
565 | 647 | allParamsButton.addActionListener(this); |
---|
566 | 648 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 650 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 651 | clearPanelButton.addActionListener(this); |
---|
570 | 652 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 653 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 654 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 655 | unselectButton.addActionListener(this); |
---|
574 | 656 | |
---|
.. | .. |
---|
651 | 733 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
652 | 734 | zoomBoxCB.addItemListener(this); |
---|
653 | 735 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 736 | + if (true) // Globals.ADVANCED) |
---|
655 | 737 | { |
---|
656 | 738 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | 739 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
724 | 806 | buttonGroup.add(radioButton); |
---|
725 | 807 | radioButton.doClick(); |
---|
726 | 808 | } |
---|
| 809 | + |
---|
727 | 810 | void SetupViews(ObjEditor oe) |
---|
728 | 811 | { |
---|
729 | 812 | oe.SetupViews(); |
---|
.. | .. |
---|
969 | 1052 | |
---|
970 | 1053 | flashIt = false; |
---|
971 | 1054 | CameraPane pane = (CameraPane) target; |
---|
972 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1055 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
973 | 1056 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
974 | 1057 | |
---|
975 | 1058 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1542 | 1625 | |
---|
1543 | 1626 | void Overwrite(int mask) |
---|
1544 | 1627 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1628 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1629 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1630 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1631 | |
---|
1549 | 1632 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1633 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1849 | 1932 | csg.addChild(child); |
---|
1850 | 1933 | child.addChild(csg); |
---|
1851 | 1934 | } 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 | 1935 | if (source == computeAOItem) |
---|
1878 | 1936 | { |
---|
1879 | 1937 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1892 | 1950 | if (source == invariantsItem) |
---|
1893 | 1951 | { |
---|
1894 | 1952 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1953 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 1954 | } else |
---|
1897 | 1955 | if (source == memoryItem) |
---|
1898 | 1956 | { |
---|
.. | .. |
---|
1910 | 1968 | if (source == dumpItem) |
---|
1911 | 1969 | { |
---|
1912 | 1970 | DumpObject(); |
---|
| 1971 | + } else |
---|
| 1972 | + if (source == undoButton) |
---|
| 1973 | + { |
---|
| 1974 | + Undo(); |
---|
| 1975 | + } else |
---|
| 1976 | + if (source == redoButton) |
---|
| 1977 | + { |
---|
| 1978 | + Redo(); |
---|
| 1979 | + } else |
---|
| 1980 | + if (source == saveButton) |
---|
| 1981 | + { |
---|
| 1982 | + Save(); |
---|
1913 | 1983 | } else |
---|
1914 | 1984 | if (source == oneStepButton) |
---|
1915 | 1985 | { |
---|
.. | .. |
---|
1965 | 2035 | { |
---|
1966 | 2036 | loadClipboard(true); |
---|
1967 | 2037 | } else |
---|
| 2038 | + if (source == undoItem) |
---|
| 2039 | + { |
---|
| 2040 | + Undo(); |
---|
| 2041 | + } else |
---|
| 2042 | + if (source == redoItem) |
---|
| 2043 | + { |
---|
| 2044 | + Redo(); |
---|
| 2045 | + } else |
---|
1968 | 2046 | if (source == duplicateItem) |
---|
1969 | 2047 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2048 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2049 | loadClipboard(false); |
---|
1972 | 2050 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2051 | + Grafreed.clipboard = keep; |
---|
1974 | 2052 | } else |
---|
1975 | 2053 | if (source == cloneItem) |
---|
1976 | 2054 | { |
---|
.. | .. |
---|
2190 | 2268 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2269 | // refreshContents(); |
---|
2192 | 2270 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2271 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2272 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2273 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2274 | |
---|
2197 | 2275 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2276 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2320 | } else |
---|
2243 | 2321 | if (source == setMasterItem) |
---|
2244 | 2322 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2323 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2324 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2325 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2326 | |
---|
2249 | 2327 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2328 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2335 | { |
---|
2258 | 2336 | if (group.selection.size() == 1) |
---|
2259 | 2337 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2338 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2339 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2340 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2341 | |
---|
2264 | 2342 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2343 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2354 | { |
---|
2277 | 2355 | RevertMeshes(); |
---|
2278 | 2356 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2357 | + if (source == resetAllItem) |
---|
2280 | 2358 | { |
---|
2281 | 2359 | ResetAll(); |
---|
2282 | 2360 | } else |
---|
.. | .. |
---|
2614 | 2692 | { |
---|
2615 | 2693 | SmoothMesh(); |
---|
2616 | 2694 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 2695 | + if (source == transformGeometryItem) |
---|
2618 | 2696 | { |
---|
2619 | 2697 | TransformGeometry(); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == transformChildrenItem) |
---|
| 2700 | + { |
---|
| 2701 | + TransformChildren(); |
---|
2620 | 2702 | } else |
---|
2621 | 2703 | if (source == resetTransformItem) |
---|
2622 | 2704 | { |
---|
.. | .. |
---|
2624 | 2706 | } else |
---|
2625 | 2707 | if (source == resetCentroidItem) |
---|
2626 | 2708 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 2709 | + ResetCentroid(true); |
---|
| 2710 | + } else |
---|
| 2711 | + if (source == resetCentroidXZItem) |
---|
| 2712 | + { |
---|
| 2713 | + ResetCentroid(false); |
---|
2628 | 2714 | } else |
---|
2629 | 2715 | if (source == resetParentItem) |
---|
2630 | 2716 | { |
---|
.. | .. |
---|
2980 | 3066 | child.CloseUI(); |
---|
2981 | 3067 | listUI.remove(child); |
---|
2982 | 3068 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3069 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3070 | } |
---|
2985 | 3071 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3072 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3066 | 3152 | frontView.object = group; |
---|
3067 | 3153 | sideView.object = group; |
---|
3068 | 3154 | } |
---|
| 3155 | + |
---|
| 3156 | +// fix "+" issue |
---|
3069 | 3157 | group.editWindow = this; |
---|
| 3158 | + |
---|
3070 | 3159 | /* |
---|
3071 | 3160 | currentLayout = radio.layout; |
---|
3072 | 3161 | if (currentLayout == null) |
---|
.. | .. |
---|
3079 | 3168 | //group.attributes = -1; |
---|
3080 | 3169 | ResetModel(); |
---|
3081 | 3170 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3171 | + } else if (event.getSource() == editCameraItem) |
---|
| 3172 | + { |
---|
| 3173 | + cameraView.ProtectCamera(); |
---|
| 3174 | + cameraView.repaint(); |
---|
| 3175 | + return; |
---|
| 3176 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3177 | + { |
---|
| 3178 | + cameraView.RevertCamera(); |
---|
| 3179 | + cameraView.repaint(); |
---|
| 3180 | + return; |
---|
| 3181 | + // } else if (event.getSource() == textureButton) |
---|
| 3182 | + // { |
---|
| 3183 | + // return; // true; |
---|
| 3184 | + } |
---|
3083 | 3185 | else |
---|
3084 | 3186 | { |
---|
3085 | 3187 | //return super.action(event, arg); |
---|
.. | .. |
---|
3140 | 3242 | refreshContents(); |
---|
3141 | 3243 | } |
---|
3142 | 3244 | |
---|
| 3245 | + void TransformChildren() |
---|
| 3246 | + { |
---|
| 3247 | + Object3D obj; |
---|
| 3248 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3249 | + { |
---|
| 3250 | + obj = (Object3D)e.nextElement(); |
---|
| 3251 | + obj.KeepTextureMatrices(); |
---|
| 3252 | + obj.TransformChildren(); |
---|
| 3253 | + obj.RestoreTextureMatrices(); |
---|
| 3254 | + |
---|
| 3255 | +// if (obj.parent == null) |
---|
| 3256 | +// { |
---|
| 3257 | +// System.out.println("NULL PARENT!"); |
---|
| 3258 | +// new Exception().printStackTrace(); |
---|
| 3259 | +// } |
---|
| 3260 | +// else |
---|
| 3261 | +// TouchTransform(obj); |
---|
| 3262 | +// //obj.parent.Touch(); |
---|
| 3263 | + } |
---|
| 3264 | + |
---|
| 3265 | + refreshContents(); |
---|
| 3266 | + } |
---|
3143 | 3267 | |
---|
3144 | 3268 | void ResetTransform() |
---|
3145 | 3269 | { |
---|
.. | .. |
---|
3252 | 3376 | refreshContents(); |
---|
3253 | 3377 | } |
---|
3254 | 3378 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3379 | + void ResetCentroid(boolean full) |
---|
3256 | 3380 | { |
---|
3257 | 3381 | Object3D obj; |
---|
3258 | 3382 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3391 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3392 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3393 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3394 | + if (full) |
---|
| 3395 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3396 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3397 | obj.TransformMesh(Object3D.mat); |
---|
| 3398 | + |
---|
3273 | 3399 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3400 | + if (full) |
---|
| 3401 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3402 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3403 | + |
---|
3276 | 3404 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3405 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3406 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3301 | 3429 | |
---|
3302 | 3430 | int size = obj.MemorySize(); |
---|
3303 | 3431 | |
---|
3304 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3432 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3305 | 3434 | } |
---|
3306 | 3435 | } |
---|
3307 | 3436 | catch (Exception e) |
---|
.. | .. |
---|
3338 | 3467 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3468 | |
---|
3340 | 3469 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3470 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3471 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3472 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3473 | |
---|
3345 | 3474 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3475 | } |
---|
.. | .. |
---|
3554 | 3683 | |
---|
3555 | 3684 | void ParseVertices() |
---|
3556 | 3685 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 3686 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3687 | + Grafreed.epsequal = true; |
---|
3559 | 3688 | |
---|
3560 | 3689 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 3690 | { |
---|
.. | .. |
---|
3580 | 3709 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 3710 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 3711 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 3712 | + g.add(Grafreed.clipboard); |
---|
3584 | 3713 | |
---|
3585 | 3714 | buffer.add(g); |
---|
3586 | 3715 | } |
---|
.. | .. |
---|
3595 | 3724 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 3725 | } |
---|
3597 | 3726 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 3727 | + Grafreed.epsequal = epsequal; |
---|
3599 | 3728 | |
---|
3600 | 3729 | refreshContents(); |
---|
3601 | 3730 | } |
---|
.. | .. |
---|
3613 | 3742 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 3743 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 3744 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3745 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3746 | + |
---|
| 3747 | + try |
---|
| 3748 | + { |
---|
| 3749 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3750 | + } |
---|
| 3751 | + catch (Exception e) |
---|
| 3752 | + { |
---|
| 3753 | + System.err.println("FAIL: " + node); |
---|
| 3754 | + } |
---|
3617 | 3755 | |
---|
3618 | 3756 | double s = v.s; |
---|
3619 | 3757 | |
---|
.. | .. |
---|
3745 | 3883 | return; |
---|
3746 | 3884 | |
---|
3747 | 3885 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3886 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 3887 | |
---|
3750 | 3888 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 3889 | |
---|
.. | .. |
---|
3939 | 4077 | |
---|
3940 | 4078 | void ClipMesh() |
---|
3941 | 4079 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4080 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4081 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4082 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4083 | |
---|
3946 | 4084 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4085 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4088 | // { |
---|
3951 | 4089 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4090 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4091 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4092 | } |
---|
3955 | 4093 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4094 | System.out.println("DONE."); |
---|
.. | .. |
---|
4085 | 4223 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 4224 | |
---|
4087 | 4225 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 4226 | + if(elem != group || !newWindow) |
---|
4089 | 4227 | { |
---|
4090 | 4228 | // if (!(elem instanceof Composite)) |
---|
4091 | 4229 | // newWindow = false; |
---|
.. | .. |
---|
4199 | 4337 | |
---|
4200 | 4338 | objEditor.SetText(); // jan 2014 |
---|
4201 | 4339 | |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4340 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 4341 | CameraPane.flash = true; |
---|
4204 | 4342 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4343 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 4344 | // a camera |
---|
4207 | 4345 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4346 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4347 | + { |
---|
| 4348 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4349 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4350 | + } |
---|
4210 | 4351 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 4352 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 4353 | } |
---|
.. | .. |
---|
4290 | 4431 | { |
---|
4291 | 4432 | if (group.selection.isEmpty()) |
---|
4292 | 4433 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4434 | + |
---|
| 4435 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4436 | Composite tGroup = null; |
---|
4295 | 4437 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4438 | { |
---|
4297 | 4439 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4440 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4441 | } |
---|
4300 | 4442 | |
---|
4301 | 4443 | if (cut) |
---|
4302 | 4444 | { |
---|
| 4445 | + Save(); |
---|
4303 | 4446 | //int indices[] = jList.getSelectedIndices(); |
---|
4304 | 4447 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4305 | 4448 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4335 | 4478 | //System.out.println("cut " + child); |
---|
4336 | 4479 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4480 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4481 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4482 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4483 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4484 | + Grafreed.clipboard = tmp; |
---|
4342 | 4485 | } |
---|
4343 | 4486 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4487 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4488 | tGroup.add/*Child*/(child); |
---|
4346 | 4489 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4490 | + Grafreed.clipboard = child; |
---|
4348 | 4491 | } |
---|
4349 | 4492 | |
---|
4350 | 4493 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4519 | //System.out.println("cut " + elem); |
---|
4377 | 4520 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4521 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4522 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4523 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4524 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4525 | + Grafreed.clipboard = tmp; |
---|
4383 | 4526 | } |
---|
4384 | 4527 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4528 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4529 | tGroup.add/*Child*/(child); |
---|
4387 | 4530 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4531 | + Grafreed.clipboard = child; |
---|
4389 | 4532 | } |
---|
4390 | 4533 | |
---|
4391 | 4534 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4535 | + |
---|
| 4536 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4537 | + Grafreed.clipboard = tGroup; |
---|
| 4538 | + |
---|
4394 | 4539 | if (cut) |
---|
4395 | 4540 | { |
---|
4396 | 4541 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4549 | // return; |
---|
4405 | 4550 | boolean first = true; |
---|
4406 | 4551 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4552 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4553 | { |
---|
4409 | 4554 | Composite temp; |
---|
4410 | 4555 | |
---|
.. | .. |
---|
4415 | 4560 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4561 | */ |
---|
4417 | 4562 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4563 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4564 | { |
---|
4420 | 4565 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4566 | |
---|
.. | .. |
---|
4449 | 4594 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4595 | //temp.addChild(cb); |
---|
4451 | 4596 | //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()); |
---|
| 4597 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4598 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4599 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4600 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4601 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4602 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4603 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4604 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4605 | } |
---|
4461 | 4606 | |
---|
4462 | 4607 | ResetModel(); |
---|
.. | .. |
---|
4505 | 4650 | { |
---|
4506 | 4651 | boolean first = true; |
---|
4507 | 4652 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4653 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4654 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4655 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 4656 | Object3D copy; |
---|
4512 | 4657 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 4658 | { |
---|
.. | .. |
---|
4517 | 4662 | } |
---|
4518 | 4663 | } else |
---|
4519 | 4664 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4665 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 4666 | } |
---|
4522 | 4667 | } |
---|
4523 | 4668 | } |
---|
.. | .. |
---|
4922 | 5067 | } |
---|
4923 | 5068 | */ |
---|
4924 | 5069 | |
---|
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 | 5070 | /* |
---|
4941 | 5071 | public void Callback(Object obj) |
---|
4942 | 5072 | { |
---|
.. | .. |
---|
4960 | 5090 | } |
---|
4961 | 5091 | */ |
---|
4962 | 5092 | |
---|
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 | 5093 | String GetFile(String dialogName) |
---|
4981 | 5094 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5095 | + if (Grafreed.standAlone) |
---|
4983 | 5096 | { |
---|
4984 | 5097 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5098 | browser.show(); |
---|
.. | .. |
---|
5047 | 5160 | cButton clearpanelButton; |
---|
5048 | 5161 | cButton unselectButton; |
---|
5049 | 5162 | |
---|
| 5163 | + cButton saveButton; |
---|
| 5164 | + cButton undoButton; |
---|
| 5165 | + cButton redoButton; |
---|
5050 | 5166 | cButton oneStepButton; |
---|
5051 | 5167 | |
---|
5052 | 5168 | cButton screenfitButton; |
---|
.. | .. |
---|
5079 | 5195 | private MenuItem lookFromItem; |
---|
5080 | 5196 | private MenuItem switchItem; |
---|
5081 | 5197 | private MenuItem cutItem; |
---|
| 5198 | + private MenuItem undoItem; |
---|
| 5199 | + private MenuItem redoItem; |
---|
5082 | 5200 | private MenuItem duplicateItem; |
---|
5083 | 5201 | private MenuItem cloneItem; |
---|
5084 | 5202 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5092 | 5210 | private MenuItem linkverticesItem; |
---|
5093 | 5211 | private MenuItem relinkverticesItem; |
---|
5094 | 5212 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5213 | + private MenuItem resetAllItem; |
---|
5096 | 5214 | private MenuItem stepAllItem; |
---|
5097 | 5215 | private MenuItem revertMeshItem; |
---|
5098 | 5216 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5153 | 5271 | private MenuItem panoTexturesItem; |
---|
5154 | 5272 | |
---|
5155 | 5273 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5274 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5275 | private MenuItem resetTransformItem; |
---|
| 5276 | + private MenuItem transformGeometryItem; |
---|
| 5277 | + private MenuItem transformChildrenItem; |
---|
5158 | 5278 | private MenuItem hideItem; |
---|
5159 | 5279 | private MenuItem grabItem; |
---|
5160 | 5280 | private MenuItem backItem; |
---|
.. | .. |
---|
5223 | 5343 | private MenuItem doubleItem; |
---|
5224 | 5344 | private MenuItem tripleItem; |
---|
5225 | 5345 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 5346 | private MenuItem computeAOItem; |
---|
5232 | 5347 | private MenuItem recompileItem; |
---|
5233 | 5348 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 5352 | private MenuItem analyzeItem; |
---|
5238 | 5353 | private MenuItem dumpItem; |
---|
5239 | 5354 | //boolean freezemodel = false; |
---|
| 5355 | + |
---|
| 5356 | + Menu cameraMenu; |
---|
| 5357 | + MenuItem editCameraItem; |
---|
| 5358 | + MenuItem revertCameraItem; |
---|
5240 | 5359 | } |
---|