.. | .. |
---|
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); |
---|
.. | .. |
---|
388 | 470 | markleavesItem.addActionListener(this); |
---|
389 | 471 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 472 | unmarkleavesItem.addActionListener(this); |
---|
| 473 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 474 | + rewindleavesItem.addActionListener(this); |
---|
| 475 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 476 | + unrewindleavesItem.addActionListener(this); |
---|
| 477 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 478 | + randomleavesItem.addActionListener(this); |
---|
| 479 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 480 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 481 | menu.add("-"); |
---|
392 | 482 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 483 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 512 | sortbysizeItem.addActionListener(this); |
---|
423 | 513 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 514 | sortbynameItem.addActionListener(this); |
---|
| 515 | + menu.add("-"); |
---|
| 516 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 517 | + shareGeometriesItem.addActionListener(this); |
---|
| 518 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 519 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 520 | if (Globals.ADVANCED) |
---|
426 | 521 | { |
---|
427 | | - menu.add("-"); |
---|
| 522 | + // Pretty much the same as duplicate and clone. |
---|
428 | 523 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 524 | extractGeometriesItem.addActionListener(this); |
---|
430 | 525 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 526 | 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 | 527 | } |
---|
437 | 528 | |
---|
438 | 529 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 530 | buildCreateMenu(menu); |
---|
440 | 531 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
443 | | - importGFDItem.addActionListener(this); |
---|
444 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
445 | | - importVRMLX3DItem.addActionListener(this); |
---|
446 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
447 | | - importOBJItem.addActionListener(this); |
---|
448 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
449 | | - import3DSItem.addActionListener(this); |
---|
450 | | - |
---|
451 | 532 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
452 | 533 | buildToolsMenu(menu); |
---|
453 | 534 | } |
---|
.. | .. |
---|
484 | 565 | */ |
---|
485 | 566 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
486 | 567 | |
---|
| 568 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + undoButton.setToolTipText("Undo changes"); |
---|
| 570 | + undoButton.addActionListener(this); |
---|
| 571 | + |
---|
| 572 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 573 | + redoButton.setToolTipText("Redo changes"); |
---|
| 574 | + redoButton.addActionListener(this); |
---|
| 575 | + |
---|
| 576 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + saveButton.setToolTipText("Save changes"); |
---|
| 578 | + saveButton.addActionListener(this); |
---|
| 579 | + |
---|
487 | 580 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
488 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 581 | + liveCB.setToolTipText("Enable animation"); |
---|
489 | 582 | liveCB.addItemListener(this); |
---|
490 | 583 | |
---|
491 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 585 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
493 | 586 | oneStepButton.addActionListener(this); |
---|
494 | 587 | |
---|
.. | .. |
---|
500 | 593 | trackCB.setToolTipText("Enable tracking"); |
---|
501 | 594 | trackCB.addItemListener(this); |
---|
502 | 595 | |
---|
503 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 597 | screenfitButton.setToolTipText("Screen fit"); |
---|
505 | 598 | screenfitButton.addActionListener(this); |
---|
506 | 599 | |
---|
.. | .. |
---|
509 | 602 | |
---|
510 | 603 | if (Globals.ADVANCED) |
---|
511 | 604 | { |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 605 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
513 | 606 | snapobjectButton.addActionListener(this); |
---|
514 | 607 | snapobjectButton.setToolTipText("Snap Object"); |
---|
515 | 608 | } |
---|
516 | 609 | |
---|
517 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 610 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
518 | 611 | flashSelectionButton.setToolTipText("Show selection"); |
---|
519 | 612 | flashSelectionButton.addActionListener(this); |
---|
520 | 613 | |
---|
521 | 614 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
522 | 615 | |
---|
523 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
524 | 617 | twoButton.setToolTipText("Show center view only"); |
---|
525 | 618 | twoButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 620 | fourButton.addActionListener(this); |
---|
528 | 621 | fourButton.setToolTipText("Show left panel only"); |
---|
529 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 623 | sixButton.setToolTipText("2-column layout left"); |
---|
531 | 624 | sixButton.addActionListener(this); |
---|
532 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 625 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 626 | threeButton.setToolTipText("2-column layout right"); |
---|
534 | 627 | threeButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 629 | sevenButton.setToolTipText("3-column layout"); |
---|
537 | 630 | sevenButton.addActionListener(this); |
---|
538 | 631 | // |
---|
539 | 632 | |
---|
540 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 633 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 634 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
542 | 635 | rootButton.addActionListener(this); |
---|
543 | 636 | |
---|
544 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
545 | 638 | closeButton.setToolTipText("Close tab"); |
---|
546 | 639 | closeButton.addActionListener(this); |
---|
547 | 640 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
549 | 642 | |
---|
550 | 643 | cGridBag commandsPanel = new cGridBag(); |
---|
551 | 644 | |
---|
552 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 646 | editButton.setToolTipText("Edit selection"); |
---|
554 | 647 | editButton.addActionListener(this); |
---|
555 | 648 | |
---|
556 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
557 | 650 | uneditButton.setToolTipText("Unedit selection"); |
---|
558 | 651 | uneditButton.addActionListener(this); |
---|
559 | 652 | |
---|
.. | .. |
---|
561 | 654 | allParamsButton.setToolTipText("Edit all params"); |
---|
562 | 655 | allParamsButton.addActionListener(this); |
---|
563 | 656 | |
---|
564 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 658 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
566 | 659 | clearPanelButton.addActionListener(this); |
---|
567 | 660 | |
---|
568 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | 662 | unselectButton.setToolTipText("Unselect"); |
---|
570 | 663 | unselectButton.addActionListener(this); |
---|
571 | 664 | |
---|
.. | .. |
---|
648 | 741 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
649 | 742 | zoomBoxCB.addItemListener(this); |
---|
650 | 743 | |
---|
651 | | - if (Globals.ADVANCED) |
---|
| 744 | + if (true) // Globals.ADVANCED) |
---|
652 | 745 | { |
---|
653 | 746 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
654 | 747 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
721 | 814 | buttonGroup.add(radioButton); |
---|
722 | 815 | radioButton.doClick(); |
---|
723 | 816 | } |
---|
| 817 | + |
---|
724 | 818 | void SetupViews(ObjEditor oe) |
---|
725 | 819 | { |
---|
726 | 820 | oe.SetupViews(); |
---|
.. | .. |
---|
785 | 879 | } else if(e.getSource() == liveCB) |
---|
786 | 880 | { |
---|
787 | 881 | cameraView.ToggleLive(); |
---|
| 882 | + refreshContents(false); |
---|
788 | 883 | } |
---|
789 | 884 | else if(e.getSource() == supportCB) |
---|
790 | 885 | { |
---|
.. | .. |
---|
937 | 1032 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
938 | 1033 | // return; |
---|
939 | 1034 | // } |
---|
940 | | - if (string.charAt(0) == '/') |
---|
| 1035 | + |
---|
| 1036 | + // File path for Mac and Windows |
---|
| 1037 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
941 | 1038 | { |
---|
942 | 1039 | // file(s) |
---|
943 | 1040 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
964 | 1061 | |
---|
965 | 1062 | flashIt = false; |
---|
966 | 1063 | CameraPane pane = (CameraPane) target; |
---|
967 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1064 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
968 | 1065 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
969 | 1066 | |
---|
970 | 1067 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1190 | 1287 | memoryItem.addActionListener(this); |
---|
1191 | 1288 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1192 | 1289 | analyzeItem.addActionListener(this); |
---|
1193 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1290 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1194 | 1291 | dumpItem.addActionListener(this); |
---|
1195 | 1292 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1196 | 1293 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1537 | 1634 | |
---|
1538 | 1635 | void Overwrite(int mask) |
---|
1539 | 1636 | { |
---|
1540 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1637 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1541 | 1638 | { |
---|
1542 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1639 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1543 | 1640 | |
---|
1544 | 1641 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1545 | 1642 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1844 | 1941 | csg.addChild(child); |
---|
1845 | 1942 | child.addChild(csg); |
---|
1846 | 1943 | } else |
---|
1847 | | - |
---|
1848 | | - if (source == importGFDItem) |
---|
1849 | | - { |
---|
1850 | | - ImportGFD(); |
---|
1851 | | - } else |
---|
1852 | | - if (source == importVRMLX3DItem) |
---|
1853 | | - { |
---|
1854 | | - ImportVRMLX3D(); |
---|
1855 | | - } else |
---|
1856 | | - if (source == import3DSItem) |
---|
1857 | | - { |
---|
1858 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1859 | | - } else |
---|
1860 | | - if (source == importOBJItem) |
---|
1861 | | - { |
---|
1862 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1863 | | - } else |
---|
1864 | 1944 | if (source == computeAOItem) |
---|
1865 | 1945 | { |
---|
1866 | 1946 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1879 | 1959 | if (source == invariantsItem) |
---|
1880 | 1960 | { |
---|
1881 | 1961 | System.out.println("Invariants:"); |
---|
1882 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1962 | + Grafreed.grafreeD.universe.invariants(); |
---|
1883 | 1963 | } else |
---|
1884 | 1964 | if (source == memoryItem) |
---|
1885 | 1965 | { |
---|
.. | .. |
---|
1897 | 1977 | if (source == dumpItem) |
---|
1898 | 1978 | { |
---|
1899 | 1979 | DumpObject(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == undoButton) |
---|
| 1982 | + { |
---|
| 1983 | + Undo(); |
---|
| 1984 | + } else |
---|
| 1985 | + if (source == redoButton) |
---|
| 1986 | + { |
---|
| 1987 | + Redo(); |
---|
| 1988 | + } else |
---|
| 1989 | + if (source == saveButton) |
---|
| 1990 | + { |
---|
| 1991 | + Save(); |
---|
1900 | 1992 | } else |
---|
1901 | 1993 | if (source == oneStepButton) |
---|
1902 | 1994 | { |
---|
.. | .. |
---|
1952 | 2044 | { |
---|
1953 | 2045 | loadClipboard(true); |
---|
1954 | 2046 | } else |
---|
| 2047 | + if (source == undoItem) |
---|
| 2048 | + { |
---|
| 2049 | + Undo(); |
---|
| 2050 | + } else |
---|
| 2051 | + if (source == redoItem) |
---|
| 2052 | + { |
---|
| 2053 | + Redo(); |
---|
| 2054 | + } else |
---|
1955 | 2055 | if (source == duplicateItem) |
---|
1956 | 2056 | { |
---|
1957 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2057 | + Object3D keep = Grafreed.clipboard; |
---|
1958 | 2058 | loadClipboard(false); |
---|
1959 | 2059 | paste(false); |
---|
1960 | | - GrafreeD.clipboard = keep; |
---|
| 2060 | + Grafreed.clipboard = keep; |
---|
1961 | 2061 | } else |
---|
1962 | 2062 | if (source == cloneItem) |
---|
1963 | 2063 | { |
---|
.. | .. |
---|
2177 | 2277 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2178 | 2278 | // refreshContents(); |
---|
2179 | 2279 | // } |
---|
2180 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2280 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2181 | 2281 | { |
---|
2182 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2282 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2183 | 2283 | |
---|
2184 | 2284 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2185 | 2285 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2229 | 2329 | } else |
---|
2230 | 2330 | if (source == setMasterItem) |
---|
2231 | 2331 | { |
---|
2232 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2332 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2233 | 2333 | { |
---|
2234 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2334 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2235 | 2335 | |
---|
2236 | 2336 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2237 | 2337 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2244 | 2344 | { |
---|
2245 | 2345 | if (group.selection.size() == 1) |
---|
2246 | 2346 | { |
---|
2247 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2347 | + if (Grafreed.clipboard.size() == 1) |
---|
2248 | 2348 | { |
---|
2249 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2349 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2250 | 2350 | |
---|
2251 | 2351 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2252 | 2352 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2263 | 2363 | { |
---|
2264 | 2364 | RevertMeshes(); |
---|
2265 | 2365 | } else |
---|
2266 | | - if (source == resetMeshItem) |
---|
| 2366 | + if (source == resetAllItem) |
---|
2267 | 2367 | { |
---|
2268 | 2368 | ResetAll(); |
---|
2269 | 2369 | } else |
---|
.. | .. |
---|
2451 | 2551 | } else |
---|
2452 | 2552 | if (source == genNormalsMESHItem) |
---|
2453 | 2553 | { |
---|
2454 | | - GenNormals(true); // TODO |
---|
| 2554 | + GenNormalsMESH(); |
---|
2455 | 2555 | } else |
---|
2456 | 2556 | if (source == genNormalsORGANItem) |
---|
2457 | 2557 | { |
---|
.. | .. |
---|
2516 | 2616 | if (source == unmarkleavesItem) |
---|
2517 | 2617 | { |
---|
2518 | 2618 | MarkLeaves(false); |
---|
| 2619 | + } else |
---|
| 2620 | + if (source == rewindleavesItem) |
---|
| 2621 | + { |
---|
| 2622 | + RewindLeaves(true); |
---|
| 2623 | + } else |
---|
| 2624 | + if (source == unrewindleavesItem) |
---|
| 2625 | + { |
---|
| 2626 | + RewindLeaves(false); |
---|
| 2627 | + } else |
---|
| 2628 | + if (source == randomleavesItem) |
---|
| 2629 | + { |
---|
| 2630 | + RandomLeaves(true); |
---|
| 2631 | + } else |
---|
| 2632 | + if (source == unrandomleavesItem) |
---|
| 2633 | + { |
---|
| 2634 | + RandomLeaves(false); |
---|
2519 | 2635 | } else |
---|
2520 | 2636 | if (source == flipVItem) |
---|
2521 | 2637 | { |
---|
.. | .. |
---|
2601 | 2717 | { |
---|
2602 | 2718 | SmoothMesh(); |
---|
2603 | 2719 | } else |
---|
2604 | | - if (source == transformgeometryItem) |
---|
| 2720 | + if (source == transformGeometryItem) |
---|
2605 | 2721 | { |
---|
2606 | 2722 | TransformGeometry(); |
---|
| 2723 | + } else |
---|
| 2724 | + if (source == transformChildrenItem) |
---|
| 2725 | + { |
---|
| 2726 | + TransformChildren(); |
---|
2607 | 2727 | } else |
---|
2608 | 2728 | if (source == resetTransformItem) |
---|
2609 | 2729 | { |
---|
.. | .. |
---|
2611 | 2731 | } else |
---|
2612 | 2732 | if (source == resetCentroidItem) |
---|
2613 | 2733 | { |
---|
2614 | | - ResetCentroid(); |
---|
| 2734 | + ResetCentroid(true); |
---|
| 2735 | + } else |
---|
| 2736 | + if (source == resetCentroidXZItem) |
---|
| 2737 | + { |
---|
| 2738 | + ResetCentroid(false); |
---|
2615 | 2739 | } else |
---|
2616 | 2740 | if (source == resetParentItem) |
---|
2617 | 2741 | { |
---|
.. | .. |
---|
2967 | 3091 | child.CloseUI(); |
---|
2968 | 3092 | listUI.remove(child); |
---|
2969 | 3093 | |
---|
2970 | | - child.editWindow = null; // ??????????? |
---|
| 3094 | + //child.editWindow = null; // ??????????? |
---|
2971 | 3095 | } |
---|
2972 | 3096 | objEditor.ctrlPanel.FlushUI(); |
---|
2973 | 3097 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3053 | 3177 | frontView.object = group; |
---|
3054 | 3178 | sideView.object = group; |
---|
3055 | 3179 | } |
---|
| 3180 | + |
---|
| 3181 | +// fix "+" issue |
---|
3056 | 3182 | group.editWindow = this; |
---|
| 3183 | + |
---|
3057 | 3184 | /* |
---|
3058 | 3185 | currentLayout = radio.layout; |
---|
3059 | 3186 | if (currentLayout == null) |
---|
.. | .. |
---|
3066 | 3193 | //group.attributes = -1; |
---|
3067 | 3194 | ResetModel(); |
---|
3068 | 3195 | refreshContents(true); |
---|
3069 | | - } |
---|
| 3196 | + } else if (event.getSource() == editCameraItem) |
---|
| 3197 | + { |
---|
| 3198 | + cameraView.ProtectCamera(); |
---|
| 3199 | + cameraView.repaint(); |
---|
| 3200 | + return; |
---|
| 3201 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3202 | + { |
---|
| 3203 | + cameraView.RevertCamera(); |
---|
| 3204 | + cameraView.repaint(); |
---|
| 3205 | + return; |
---|
| 3206 | + // } else if (event.getSource() == textureButton) |
---|
| 3207 | + // { |
---|
| 3208 | + // return; // true; |
---|
| 3209 | + } |
---|
3070 | 3210 | else |
---|
3071 | 3211 | { |
---|
3072 | 3212 | //return super.action(event, arg); |
---|
.. | .. |
---|
3127 | 3267 | refreshContents(); |
---|
3128 | 3268 | } |
---|
3129 | 3269 | |
---|
| 3270 | + void TransformChildren() |
---|
| 3271 | + { |
---|
| 3272 | + Object3D obj; |
---|
| 3273 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3274 | + { |
---|
| 3275 | + obj = (Object3D)e.nextElement(); |
---|
| 3276 | + obj.KeepTextureMatrices(); |
---|
| 3277 | + obj.TransformChildren(); |
---|
| 3278 | + obj.RestoreTextureMatrices(); |
---|
| 3279 | + |
---|
| 3280 | +// if (obj.parent == null) |
---|
| 3281 | +// { |
---|
| 3282 | +// System.out.println("NULL PARENT!"); |
---|
| 3283 | +// new Exception().printStackTrace(); |
---|
| 3284 | +// } |
---|
| 3285 | +// else |
---|
| 3286 | +// TouchTransform(obj); |
---|
| 3287 | +// //obj.parent.Touch(); |
---|
| 3288 | + } |
---|
| 3289 | + |
---|
| 3290 | + refreshContents(); |
---|
| 3291 | + } |
---|
3130 | 3292 | |
---|
3131 | 3293 | void ResetTransform() |
---|
3132 | 3294 | { |
---|
.. | .. |
---|
3239 | 3401 | refreshContents(); |
---|
3240 | 3402 | } |
---|
3241 | 3403 | |
---|
3242 | | - void ResetCentroid() |
---|
| 3404 | + void ResetCentroid(boolean full) |
---|
3243 | 3405 | { |
---|
3244 | 3406 | Object3D obj; |
---|
3245 | 3407 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3254 | 3416 | LA.matIdentity(Object3D.mat); |
---|
3255 | 3417 | obj.getBounds(minima, maxima, false); |
---|
3256 | 3418 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3257 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3419 | + if (full) |
---|
| 3420 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3258 | 3421 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3259 | 3422 | obj.TransformMesh(Object3D.mat); |
---|
| 3423 | + |
---|
3260 | 3424 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3261 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3425 | + if (full) |
---|
| 3426 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3262 | 3427 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3428 | + |
---|
3263 | 3429 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3264 | 3430 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3265 | 3431 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3288 | 3454 | |
---|
3289 | 3455 | int size = obj.MemorySize(); |
---|
3290 | 3456 | |
---|
3291 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3457 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3458 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3292 | 3459 | } |
---|
3293 | 3460 | } |
---|
3294 | 3461 | catch (Exception e) |
---|
.. | .. |
---|
3325 | 3492 | obj = (Object3D)e.nextElement(); |
---|
3326 | 3493 | |
---|
3327 | 3494 | System.out.println("Object is: " + obj); |
---|
3328 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3495 | + Grafreed.AnalyzeObject(obj); |
---|
3329 | 3496 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3330 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3497 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3331 | 3498 | |
---|
3332 | 3499 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3333 | 3500 | } |
---|
.. | .. |
---|
3369 | 3536 | void GenNormals(boolean crease) |
---|
3370 | 3537 | { |
---|
3371 | 3538 | group.GenNormalsS(crease); |
---|
| 3539 | + |
---|
| 3540 | + refreshContents(); |
---|
| 3541 | + } |
---|
| 3542 | + |
---|
| 3543 | + void GenNormalsMESH() |
---|
| 3544 | + { |
---|
| 3545 | + group.GenNormalsMeshS(); |
---|
3372 | 3546 | |
---|
3373 | 3547 | refreshContents(); |
---|
3374 | 3548 | } |
---|
.. | .. |
---|
3541 | 3715 | |
---|
3542 | 3716 | void ParseVertices() |
---|
3543 | 3717 | { |
---|
3544 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3545 | | - GrafreeD.epsequal = true; |
---|
| 3718 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3719 | + Grafreed.epsequal = true; |
---|
3546 | 3720 | |
---|
3547 | 3721 | for (int i=0; i<group.selection.size(); i++) |
---|
3548 | 3722 | { |
---|
.. | .. |
---|
3567 | 3741 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3568 | 3742 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3569 | 3743 | |
---|
3570 | | - g.add(GrafreeD.clipboard); |
---|
| 3744 | + g.add(Grafreed.clipboard); |
---|
3571 | 3745 | |
---|
3572 | 3746 | buffer.add(g); |
---|
3573 | 3747 | } |
---|
.. | .. |
---|
3582 | 3756 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3583 | 3757 | } |
---|
3584 | 3758 | |
---|
3585 | | - GrafreeD.epsequal = epsequal; |
---|
| 3759 | + Grafreed.epsequal = epsequal; |
---|
3586 | 3760 | |
---|
3587 | 3761 | refreshContents(); |
---|
3588 | 3762 | } |
---|
.. | .. |
---|
3600 | 3774 | String pigment = Object3D.GetPigment(tex); |
---|
3601 | 3775 | //String bump = Object3D.GetBump(tex); |
---|
3602 | 3776 | |
---|
3603 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3777 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3778 | + |
---|
| 3779 | + try |
---|
| 3780 | + { |
---|
| 3781 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3782 | + } |
---|
| 3783 | + catch (Exception e) |
---|
| 3784 | + { |
---|
| 3785 | + System.err.println("FAIL: " + node); |
---|
| 3786 | + } |
---|
3604 | 3787 | |
---|
3605 | 3788 | double s = v.s; |
---|
3606 | 3789 | |
---|
.. | .. |
---|
3732 | 3915 | return; |
---|
3733 | 3916 | |
---|
3734 | 3917 | Object3D poses = group.selection.get(0); |
---|
3735 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3918 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3736 | 3919 | |
---|
3737 | 3920 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3738 | 3921 | |
---|
.. | .. |
---|
3926 | 4109 | |
---|
3927 | 4110 | void ClipMesh() |
---|
3928 | 4111 | { |
---|
3929 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4112 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3930 | 4113 | { |
---|
3931 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4114 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3932 | 4115 | |
---|
3933 | 4116 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3934 | 4117 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3937 | 4120 | // { |
---|
3938 | 4121 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3939 | 4122 | // } |
---|
3940 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4123 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3941 | 4124 | } |
---|
3942 | 4125 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3943 | 4126 | System.out.println("DONE."); |
---|
.. | .. |
---|
3984 | 4167 | void MarkLeaves(boolean hide) |
---|
3985 | 4168 | { |
---|
3986 | 4169 | group.selection.MarkLeaves(hide); |
---|
| 4170 | + refreshContents(); |
---|
| 4171 | + } |
---|
| 4172 | + |
---|
| 4173 | + void RewindLeaves(boolean hide) |
---|
| 4174 | + { |
---|
| 4175 | + group.selection.RewindLeaves(hide); |
---|
| 4176 | + refreshContents(); |
---|
| 4177 | + } |
---|
| 4178 | + |
---|
| 4179 | + void RandomLeaves(boolean hide) |
---|
| 4180 | + { |
---|
| 4181 | + group.selection.RandomLeaves(hide); |
---|
3987 | 4182 | refreshContents(); |
---|
3988 | 4183 | } |
---|
3989 | 4184 | |
---|
.. | .. |
---|
4072 | 4267 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4073 | 4268 | |
---|
4074 | 4269 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4075 | | - if(elem != group) |
---|
| 4270 | + if(elem != group || !newWindow) |
---|
4076 | 4271 | { |
---|
4077 | 4272 | // if (!(elem instanceof Composite)) |
---|
4078 | 4273 | // newWindow = false; |
---|
.. | .. |
---|
4162 | 4357 | //case 702: // Event.LIST_DESELECT |
---|
4163 | 4358 | group.deselectAll(); |
---|
4164 | 4359 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4165 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4166 | 4360 | if (tps != null) |
---|
4167 | 4361 | { |
---|
4168 | 4362 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4171 | 4365 | |
---|
4172 | 4366 | //if (child.parent != null) |
---|
4173 | 4367 | //child.parent.addSelectee(child); |
---|
| 4368 | + objEditor.SetMaterial(child); |
---|
4174 | 4369 | group.addSelectee(child); |
---|
4175 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4176 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4177 | | - System.err.println("info : " + child.GetPath()); |
---|
4178 | 4370 | } |
---|
4179 | 4371 | } |
---|
4180 | 4372 | // else |
---|
.. | .. |
---|
4184 | 4376 | // System.err.println("info : " + group.GetPath()); |
---|
4185 | 4377 | // } |
---|
4186 | 4378 | |
---|
4187 | | - objEditor.SetText(); // jan 2014 |
---|
4188 | | - |
---|
4189 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4379 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4190 | 4380 | CameraPane.flash = true; |
---|
4191 | 4381 | |
---|
4192 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4382 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4193 | 4383 | // a camera |
---|
4194 | 4384 | { |
---|
4195 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4196 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4385 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4386 | + { |
---|
| 4387 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4388 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4389 | + } |
---|
4197 | 4390 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4198 | 4391 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4199 | 4392 | } |
---|
.. | .. |
---|
4206 | 4399 | |
---|
4207 | 4400 | freezemodel = false; |
---|
4208 | 4401 | } |
---|
| 4402 | + |
---|
| 4403 | + void refreshContents(boolean cp) |
---|
| 4404 | + { |
---|
| 4405 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4406 | + { |
---|
| 4407 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4408 | + |
---|
| 4409 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4410 | + { |
---|
| 4411 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4412 | + |
---|
| 4413 | + objEditor.AddInfo(child, this, true); |
---|
| 4414 | + System.err.println("info : " + child.GetPath()); |
---|
| 4415 | + } |
---|
| 4416 | + |
---|
| 4417 | + objEditor.SetText(); // jan 2014 |
---|
| 4418 | + } |
---|
| 4419 | + |
---|
| 4420 | + super.refreshContents(cp); |
---|
| 4421 | + } |
---|
4209 | 4422 | |
---|
4210 | 4423 | void linkSomething(Object3D thing) |
---|
4211 | 4424 | { |
---|
.. | .. |
---|
4277 | 4490 | { |
---|
4278 | 4491 | if (group.selection.isEmpty()) |
---|
4279 | 4492 | return; |
---|
4280 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4493 | + |
---|
| 4494 | + Grafreed.clipboardIsTempGroup = false; |
---|
4281 | 4495 | Composite tGroup = null; |
---|
4282 | 4496 | if (group.selection.size() > 0) // 1) |
---|
4283 | 4497 | { |
---|
4284 | 4498 | tGroup = new cGroup(); |
---|
4285 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4499 | + Grafreed.clipboardIsTempGroup = true; |
---|
4286 | 4500 | } |
---|
4287 | 4501 | |
---|
4288 | 4502 | if (cut) |
---|
4289 | 4503 | { |
---|
| 4504 | + Save(); |
---|
4290 | 4505 | //int indices[] = jList.getSelectedIndices(); |
---|
4291 | 4506 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4292 | 4507 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4322 | 4537 | //System.out.println("cut " + child); |
---|
4323 | 4538 | //System.out.println("parent = " + child.parent); |
---|
4324 | 4539 | // tmp.addChild(child); |
---|
4325 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4540 | + if (Grafreed.clipboardIsTempGroup) |
---|
4326 | 4541 | tGroup.add/*Child*/(tmp); |
---|
4327 | 4542 | else |
---|
4328 | | - GrafreeD.clipboard = tmp; |
---|
| 4543 | + Grafreed.clipboard = tmp; |
---|
4329 | 4544 | } |
---|
4330 | 4545 | else |
---|
4331 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4546 | + if (Grafreed.clipboardIsTempGroup) |
---|
4332 | 4547 | tGroup.add/*Child*/(child); |
---|
4333 | 4548 | else |
---|
4334 | | - GrafreeD.clipboard = child; |
---|
| 4549 | + Grafreed.clipboard = child; |
---|
4335 | 4550 | } |
---|
4336 | 4551 | |
---|
4337 | 4552 | //ResetModel(); |
---|
.. | .. |
---|
4363 | 4578 | //System.out.println("cut " + elem); |
---|
4364 | 4579 | //System.out.println("parent = " + elem.parent); |
---|
4365 | 4580 | // tmp.addChild(elem); |
---|
4366 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4581 | + if (Grafreed.clipboardIsTempGroup) |
---|
4367 | 4582 | tGroup.add/*Child*/(tmp); |
---|
4368 | 4583 | else |
---|
4369 | | - GrafreeD.clipboard = tmp; |
---|
| 4584 | + Grafreed.clipboard = tmp; |
---|
4370 | 4585 | } |
---|
4371 | 4586 | else |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4587 | + if (Grafreed.clipboardIsTempGroup) |
---|
4373 | 4588 | tGroup.add/*Child*/(child); |
---|
4374 | 4589 | else |
---|
4375 | | - GrafreeD.clipboard = child; |
---|
| 4590 | + Grafreed.clipboard = child; |
---|
4376 | 4591 | } |
---|
4377 | 4592 | |
---|
4378 | 4593 | } |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4380 | | - GrafreeD.clipboard = tGroup; |
---|
| 4594 | + |
---|
| 4595 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4596 | + Grafreed.clipboard = tGroup; |
---|
| 4597 | + |
---|
4381 | 4598 | if (cut) |
---|
4382 | 4599 | { |
---|
4383 | 4600 | ResetModel(); |
---|
.. | .. |
---|
4391 | 4608 | // return; |
---|
4392 | 4609 | boolean first = true; |
---|
4393 | 4610 | |
---|
4394 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4611 | + if (Grafreed.clipboardIsTempGroup) |
---|
4395 | 4612 | { |
---|
4396 | 4613 | Composite temp; |
---|
4397 | 4614 | |
---|
.. | .. |
---|
4402 | 4619 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4403 | 4620 | */ |
---|
4404 | 4621 | Object3D elem; |
---|
4405 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4622 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4406 | 4623 | { |
---|
4407 | 4624 | Object3D child = (Object3D)e.nextElement(); |
---|
4408 | 4625 | |
---|
.. | .. |
---|
4436 | 4653 | //Object3D cb = Applet3D.clipboard; |
---|
4437 | 4654 | //temp.addChild(cb); |
---|
4438 | 4655 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4439 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4440 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4441 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4442 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4443 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4656 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4657 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4658 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4659 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4660 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4444 | 4661 | else |
---|
4445 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4446 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4662 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4663 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4447 | 4664 | } |
---|
4448 | 4665 | |
---|
4449 | 4666 | ResetModel(); |
---|
.. | .. |
---|
4492 | 4709 | { |
---|
4493 | 4710 | boolean first = true; |
---|
4494 | 4711 | |
---|
4495 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4712 | + if (Grafreed.clipboardIsTempGroup) |
---|
4496 | 4713 | { |
---|
4497 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4714 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4498 | 4715 | Object3D copy; |
---|
4499 | 4716 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4500 | 4717 | { |
---|
.. | .. |
---|
4504 | 4721 | } |
---|
4505 | 4722 | } else |
---|
4506 | 4723 | { |
---|
4507 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4724 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4508 | 4725 | } |
---|
4509 | 4726 | } |
---|
4510 | 4727 | } |
---|
.. | .. |
---|
4909 | 5126 | } |
---|
4910 | 5127 | */ |
---|
4911 | 5128 | |
---|
4912 | | - void ImportGFD() |
---|
4913 | | - { |
---|
4914 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4915 | | - browser.show(); |
---|
4916 | | - String filename = browser.getFile(); |
---|
4917 | | - if (filename != null && filename.length() > 0) |
---|
4918 | | - { |
---|
4919 | | - String fullname = browser.getDirectory() + filename; |
---|
4920 | | - |
---|
4921 | | - //Object3D readobj = |
---|
4922 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4923 | | - //makeSomething(readobj); |
---|
4924 | | - } |
---|
4925 | | - } |
---|
4926 | | - |
---|
4927 | 5129 | /* |
---|
4928 | 5130 | public void Callback(Object obj) |
---|
4929 | 5131 | { |
---|
.. | .. |
---|
4947 | 5149 | } |
---|
4948 | 5150 | */ |
---|
4949 | 5151 | |
---|
4950 | | - void ImportVRMLX3D() |
---|
4951 | | - { |
---|
4952 | | - if (GrafreeD.standAlone) |
---|
4953 | | - { |
---|
4954 | | - /**/ |
---|
4955 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4956 | | - browser.show(); |
---|
4957 | | - String filename = browser.getFile(); |
---|
4958 | | - if (filename != null && filename.length() > 0) |
---|
4959 | | - { |
---|
4960 | | - String fullname = browser.getDirectory() + filename; |
---|
4961 | | - LoadVRMLX3D(fullname); |
---|
4962 | | - } |
---|
4963 | | - /**/ |
---|
4964 | | - } |
---|
4965 | | - } |
---|
4966 | | - |
---|
4967 | 5152 | String GetFile(String dialogName) |
---|
4968 | 5153 | { |
---|
4969 | | - if (GrafreeD.standAlone) |
---|
| 5154 | + if (Grafreed.standAlone) |
---|
4970 | 5155 | { |
---|
4971 | 5156 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4972 | 5157 | browser.show(); |
---|
.. | .. |
---|
5034 | 5219 | cButton clearpanelButton; |
---|
5035 | 5220 | cButton unselectButton; |
---|
5036 | 5221 | |
---|
| 5222 | + cButton saveButton; |
---|
| 5223 | + cButton undoButton; |
---|
| 5224 | + cButton redoButton; |
---|
5037 | 5225 | cButton oneStepButton; |
---|
5038 | 5226 | |
---|
5039 | 5227 | cButton screenfitButton; |
---|
.. | .. |
---|
5066 | 5254 | private MenuItem lookFromItem; |
---|
5067 | 5255 | private MenuItem switchItem; |
---|
5068 | 5256 | private MenuItem cutItem; |
---|
| 5257 | + private MenuItem undoItem; |
---|
| 5258 | + private MenuItem redoItem; |
---|
5069 | 5259 | private MenuItem duplicateItem; |
---|
5070 | 5260 | private MenuItem cloneItem; |
---|
5071 | 5261 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5079 | 5269 | private MenuItem linkverticesItem; |
---|
5080 | 5270 | private MenuItem relinkverticesItem; |
---|
5081 | 5271 | private MenuItem setMasterItem; |
---|
5082 | | - private MenuItem resetMeshItem; |
---|
| 5272 | + private MenuItem resetAllItem; |
---|
5083 | 5273 | private MenuItem stepAllItem; |
---|
5084 | 5274 | private MenuItem revertMeshItem; |
---|
5085 | 5275 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5129 | 5319 | private MenuItem showleavesItem; |
---|
5130 | 5320 | private MenuItem markleavesItem; |
---|
5131 | 5321 | private MenuItem unmarkleavesItem; |
---|
| 5322 | + private MenuItem rewindleavesItem; |
---|
| 5323 | + private MenuItem unrewindleavesItem; |
---|
| 5324 | + private MenuItem randomleavesItem; |
---|
| 5325 | + private MenuItem unrandomleavesItem; |
---|
5132 | 5326 | |
---|
5133 | 5327 | private MenuItem flipVItem; |
---|
5134 | 5328 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5140 | 5334 | private MenuItem panoTexturesItem; |
---|
5141 | 5335 | |
---|
5142 | 5336 | private MenuItem resetCentroidItem; |
---|
5143 | | - private MenuItem transformgeometryItem; |
---|
| 5337 | + private MenuItem resetCentroidXZItem; |
---|
5144 | 5338 | private MenuItem resetTransformItem; |
---|
| 5339 | + private MenuItem transformGeometryItem; |
---|
| 5340 | + private MenuItem transformChildrenItem; |
---|
5145 | 5341 | private MenuItem hideItem; |
---|
5146 | 5342 | private MenuItem grabItem; |
---|
5147 | 5343 | private MenuItem backItem; |
---|
.. | .. |
---|
5210 | 5406 | private MenuItem doubleItem; |
---|
5211 | 5407 | private MenuItem tripleItem; |
---|
5212 | 5408 | |
---|
5213 | | - private MenuItem importGFDItem; |
---|
5214 | | - private MenuItem importVRMLX3DItem; |
---|
5215 | | - private MenuItem import3DSItem; |
---|
5216 | | - private MenuItem importOBJItem; |
---|
5217 | | - |
---|
5218 | 5409 | private MenuItem computeAOItem; |
---|
5219 | 5410 | private MenuItem recompileItem; |
---|
5220 | 5411 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5224 | 5415 | private MenuItem analyzeItem; |
---|
5225 | 5416 | private MenuItem dumpItem; |
---|
5226 | 5417 | //boolean freezemodel = false; |
---|
| 5418 | + |
---|
| 5419 | + Menu cameraMenu; |
---|
| 5420 | + MenuItem editCameraItem; |
---|
| 5421 | + MenuItem revertCameraItem; |
---|
5227 | 5422 | } |
---|