.. | .. |
---|
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")); |
---|
.. | .. |
---|
185 | 176 | copyItem.addActionListener(this); |
---|
186 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 178 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 179 | |
---|
190 | 180 | menu.add("-"); |
---|
191 | 181 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 196 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 197 | clearAllItem.addActionListener(this); |
---|
208 | 198 | } |
---|
| 199 | + |
---|
| 200 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 201 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 202 | + //zBufferItem.addActionListener(this); |
---|
| 203 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 204 | + //normalLensItem.addActionListener(this); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 206 | + revertCameraItem.addActionListener(this); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 209 | + toggleFullScreenItem.addItemListener(this); |
---|
| 210 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 211 | + cameraMenu.add("-"); |
---|
| 212 | + |
---|
| 213 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 214 | + toggleTextureItem.addItemListener(this); |
---|
| 215 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 216 | + |
---|
| 217 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 218 | + toggleSwitchItem.addItemListener(this); |
---|
| 219 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 220 | + |
---|
| 221 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 222 | + toggleHandleItem.addItemListener(this); |
---|
| 223 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 224 | + |
---|
| 225 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 226 | + togglePaintItem.addItemListener(this); |
---|
| 227 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 228 | + |
---|
| 229 | + if (Globals.ADVANCED) |
---|
| 230 | + { |
---|
| 231 | + cameraMenu.add("-"); |
---|
| 232 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 233 | + toggleLiveItem.addItemListener(this); |
---|
| 234 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 235 | |
---|
| 236 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 237 | + stepItem.addActionListener(this); |
---|
| 238 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 239 | + // toggleDLItem.addItemListener(this); |
---|
| 240 | + // toggleDLItem.setState(false); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 243 | + toggleRenderItem.addItemListener(this); |
---|
| 244 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 247 | + toggleDebugItem.addItemListener(this); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 249 | + |
---|
| 250 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 251 | + toggleFrustumItem.addItemListener(this); |
---|
| 252 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 253 | + |
---|
| 254 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 255 | + toggleFootContactItem.addItemListener(this); |
---|
| 256 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 257 | + |
---|
| 258 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 259 | + toggleTimelineItem.addItemListener(this); |
---|
| 260 | + } |
---|
| 261 | + |
---|
| 262 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 263 | +// toggleRootItem.addItemListener(this); |
---|
| 264 | +// toggleRootItem.setState(false); |
---|
| 265 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 266 | +// animationItem.addItemListener(this); |
---|
| 267 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 268 | + cameraMenu.add("-"); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 270 | + editCameraItem.addActionListener(this); |
---|
| 271 | + |
---|
| 272 | + if (Globals.ADVANCED) |
---|
| 273 | + { |
---|
| 274 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 275 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 276 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 277 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 278 | + oe.cameraMenu.add("-"); |
---|
| 279 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 280 | + openWindowItem.addActionListener(this); |
---|
| 281 | + editLeafItem.addActionListener(this); |
---|
| 282 | + lookAtItem.addActionListener(this); |
---|
| 283 | + //lookFromItem.addActinoListener(this); |
---|
| 284 | + //switchItem.addActionListener(this); |
---|
| 285 | + } |
---|
| 286 | + |
---|
210 | 287 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 288 | if (Globals.ADVANCED) |
---|
212 | 289 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 291 | revertMeshItem.addActionListener(this); |
---|
219 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
295 | 368 | billboardItem.addActionListener(this); |
---|
296 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 370 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 372 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 374 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 376 | shadowZItem.addActionListener(this); |
---|
304 | 377 | if (Globals.ADVANCED) |
---|
305 | 378 | { |
---|
.. | .. |
---|
318 | 391 | resetTransformItem.addActionListener(this); |
---|
319 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 393 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 394 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 395 | + resetCentroidXZItem.addActionListener(this); |
---|
| 396 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 397 | + transformGeometryItem.addActionListener(this); |
---|
| 398 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 399 | + transformChildrenItem.addActionListener(this); |
---|
323 | 400 | |
---|
324 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 447 | clearMaterialsItem.addActionListener(this); |
---|
| 448 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 449 | + resetAllItem.addActionListener(this); |
---|
| 450 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 451 | + stepAllItem.addActionListener(this); |
---|
371 | 452 | menu.add("-"); |
---|
372 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 454 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 469 | markleavesItem.addActionListener(this); |
---|
389 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 471 | unmarkleavesItem.addActionListener(this); |
---|
| 472 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 473 | + rewindleavesItem.addActionListener(this); |
---|
| 474 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 475 | + unrewindleavesItem.addActionListener(this); |
---|
| 476 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 477 | + randomleavesItem.addActionListener(this); |
---|
| 478 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 479 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 480 | menu.add("-"); |
---|
392 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 511 | sortbysizeItem.addActionListener(this); |
---|
423 | 512 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 513 | sortbynameItem.addActionListener(this); |
---|
| 514 | + menu.add("-"); |
---|
| 515 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 516 | + shareGeometriesItem.addActionListener(this); |
---|
| 517 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 518 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 519 | if (Globals.ADVANCED) |
---|
426 | 520 | { |
---|
427 | | - menu.add("-"); |
---|
| 521 | + // Pretty much the same as duplicate and clone. |
---|
428 | 522 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 523 | extractGeometriesItem.addActionListener(this); |
---|
430 | 524 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 525 | 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 | 526 | } |
---|
437 | 527 | |
---|
438 | 528 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 529 | buildCreateMenu(menu); |
---|
440 | 530 | |
---|
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 | 531 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
452 | 532 | buildToolsMenu(menu); |
---|
453 | 533 | } |
---|
454 | 534 | |
---|
455 | 535 | void SetupUI2(ObjEditor oe) |
---|
456 | 536 | { |
---|
| 537 | + // June 2019 |
---|
| 538 | + if (oe == null) |
---|
| 539 | + { |
---|
| 540 | + //super.SetupUI2(this); |
---|
| 541 | + //return; |
---|
| 542 | + } |
---|
| 543 | + |
---|
| 544 | + if (copy != group) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + } |
---|
| 548 | + |
---|
457 | 549 | //new Exception().printStackTrace(); |
---|
458 | 550 | |
---|
459 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
484 | 576 | */ |
---|
485 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
486 | 578 | |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
| 582 | + |
---|
| 583 | + oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
487 | 603 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
488 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
489 | 605 | liveCB.addItemListener(this); |
---|
490 | 606 | |
---|
491 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 608 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
493 | 609 | oneStepButton.addActionListener(this); |
---|
494 | 610 | |
---|
.. | .. |
---|
496 | 612 | fastCB.setToolTipText("Fast mode"); |
---|
497 | 613 | fastCB.addItemListener(this); |
---|
498 | 614 | |
---|
499 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
500 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
501 | 617 | trackCB.addItemListener(this); |
---|
502 | 618 | |
---|
503 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
505 | 621 | screenfitButton.addActionListener(this); |
---|
506 | 622 | |
---|
.. | .. |
---|
509 | 625 | |
---|
510 | 626 | if (Globals.ADVANCED) |
---|
511 | 627 | { |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
513 | 629 | snapobjectButton.addActionListener(this); |
---|
514 | 630 | snapobjectButton.setToolTipText("Snap Object"); |
---|
515 | 631 | } |
---|
516 | 632 | |
---|
517 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
518 | 634 | flashSelectionButton.setToolTipText("Show selection"); |
---|
519 | 635 | flashSelectionButton.addActionListener(this); |
---|
520 | 636 | |
---|
521 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
522 | 638 | |
---|
523 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
524 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
525 | 641 | twoButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 643 | fourButton.addActionListener(this); |
---|
528 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
529 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
531 | 647 | sixButton.addActionListener(this); |
---|
532 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
534 | 650 | threeButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
537 | 653 | sevenButton.addActionListener(this); |
---|
538 | 654 | // |
---|
539 | 655 | |
---|
540 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 657 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
542 | 658 | rootButton.addActionListener(this); |
---|
543 | 659 | |
---|
544 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
545 | 661 | closeButton.setToolTipText("Close tab"); |
---|
546 | 662 | closeButton.addActionListener(this); |
---|
547 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
548 | 664 | //clearButton.addActionListener(this); |
---|
549 | 665 | |
---|
550 | | - cGridBag commandsPanel = new cGridBag(); |
---|
551 | | - |
---|
552 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 667 | editButton.setToolTipText("Edit selection"); |
---|
554 | 668 | editButton.addActionListener(this); |
---|
555 | 669 | |
---|
556 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
557 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
558 | 672 | uneditButton.addActionListener(this); |
---|
559 | 673 | |
---|
560 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
561 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
562 | 676 | allParamsButton.addActionListener(this); |
---|
563 | 677 | |
---|
564 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
566 | 680 | clearPanelButton.addActionListener(this); |
---|
567 | 681 | |
---|
568 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
570 | 684 | unselectButton.addActionListener(this); |
---|
571 | 685 | |
---|
572 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
573 | 687 | |
---|
574 | | - oe.treePanel.add(commandsPanel); |
---|
575 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
576 | 690 | |
---|
577 | 691 | // oe.aConstraints.gridx += 1; |
---|
578 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
648 | 762 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
649 | 763 | zoomBoxCB.addItemListener(this); |
---|
650 | 764 | |
---|
651 | | - if (Globals.ADVANCED) |
---|
| 765 | + if (true) // Globals.ADVANCED) |
---|
652 | 766 | { |
---|
653 | 767 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
654 | 768 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
721 | 835 | buttonGroup.add(radioButton); |
---|
722 | 836 | radioButton.doClick(); |
---|
723 | 837 | } |
---|
| 838 | + |
---|
724 | 839 | void SetupViews(ObjEditor oe) |
---|
725 | 840 | { |
---|
| 841 | + theFrame = this; |
---|
| 842 | + |
---|
726 | 843 | oe.SetupViews(); |
---|
727 | 844 | |
---|
728 | 845 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
785 | 902 | } else if(e.getSource() == liveCB) |
---|
786 | 903 | { |
---|
787 | 904 | cameraView.ToggleLive(); |
---|
| 905 | + refreshContents(false); |
---|
788 | 906 | } |
---|
789 | 907 | else if(e.getSource() == supportCB) |
---|
790 | 908 | { |
---|
.. | .. |
---|
937 | 1055 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
938 | 1056 | // return; |
---|
939 | 1057 | // } |
---|
940 | | - if (string.charAt(0) == '/') |
---|
| 1058 | + |
---|
| 1059 | + // File path for Mac and Windows |
---|
| 1060 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
941 | 1061 | { |
---|
942 | 1062 | // file(s) |
---|
943 | 1063 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
964 | 1084 | |
---|
965 | 1085 | flashIt = false; |
---|
966 | 1086 | CameraPane pane = (CameraPane) target; |
---|
967 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1087 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
968 | 1088 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
969 | 1089 | |
---|
970 | 1090 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1190 | 1310 | memoryItem.addActionListener(this); |
---|
1191 | 1311 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1192 | 1312 | analyzeItem.addActionListener(this); |
---|
1193 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1313 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1194 | 1314 | dumpItem.addActionListener(this); |
---|
1195 | 1315 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1196 | 1316 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1331 | 1451 | shadow.material = new cMaterial(obj.material); |
---|
1332 | 1452 | shadow.material.diffuse = 0.0001f; |
---|
1333 | 1453 | shadow.material.specular = 0.0001f; |
---|
| 1454 | + //shadow.projectedVertices[1].x = 300; |
---|
1334 | 1455 | |
---|
1335 | 1456 | makeSomething(shadow); |
---|
1336 | 1457 | } |
---|
.. | .. |
---|
1537 | 1658 | |
---|
1538 | 1659 | void Overwrite(int mask) |
---|
1539 | 1660 | { |
---|
1540 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1661 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1541 | 1662 | { |
---|
1542 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1663 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1543 | 1664 | |
---|
1544 | 1665 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1545 | 1666 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1844 | 1965 | csg.addChild(child); |
---|
1845 | 1966 | child.addChild(csg); |
---|
1846 | 1967 | } 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 | 1968 | if (source == computeAOItem) |
---|
1865 | 1969 | { |
---|
1866 | 1970 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1879 | 1983 | if (source == invariantsItem) |
---|
1880 | 1984 | { |
---|
1881 | 1985 | System.out.println("Invariants:"); |
---|
1882 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1986 | + Grafreed.grafreeD.universe.invariants(); |
---|
1883 | 1987 | } else |
---|
1884 | 1988 | if (source == memoryItem) |
---|
1885 | 1989 | { |
---|
.. | .. |
---|
1897 | 2001 | if (source == dumpItem) |
---|
1898 | 2002 | { |
---|
1899 | 2003 | DumpObject(); |
---|
| 2004 | + } else |
---|
| 2005 | + if (source == minButton) |
---|
| 2006 | + { |
---|
| 2007 | + Minimize(); |
---|
| 2008 | + } else |
---|
| 2009 | + if (source == maxButton) |
---|
| 2010 | + { |
---|
| 2011 | + Maximize(); |
---|
| 2012 | + } else |
---|
| 2013 | + if (source == fullButton) |
---|
| 2014 | + { |
---|
| 2015 | + ToggleFullScreen(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == undoButton) |
---|
| 2018 | + { |
---|
| 2019 | + Undo(); |
---|
| 2020 | + } else |
---|
| 2021 | + if (source == redoButton) |
---|
| 2022 | + { |
---|
| 2023 | + Redo(); |
---|
| 2024 | + } else |
---|
| 2025 | + if (source == saveButton) |
---|
| 2026 | + { |
---|
| 2027 | + Save(); |
---|
1900 | 2028 | } else |
---|
1901 | 2029 | if (source == oneStepButton) |
---|
1902 | 2030 | { |
---|
.. | .. |
---|
1952 | 2080 | { |
---|
1953 | 2081 | loadClipboard(true); |
---|
1954 | 2082 | } else |
---|
| 2083 | + if (source == undoItem) |
---|
| 2084 | + { |
---|
| 2085 | + Undo(); |
---|
| 2086 | + } else |
---|
| 2087 | + if (source == redoItem) |
---|
| 2088 | + { |
---|
| 2089 | + Redo(); |
---|
| 2090 | + } else |
---|
1955 | 2091 | if (source == duplicateItem) |
---|
1956 | 2092 | { |
---|
1957 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2093 | + Object3D keep = Grafreed.clipboard; |
---|
1958 | 2094 | loadClipboard(false); |
---|
1959 | 2095 | paste(false); |
---|
1960 | | - GrafreeD.clipboard = keep; |
---|
| 2096 | + Grafreed.clipboard = keep; |
---|
1961 | 2097 | } else |
---|
1962 | 2098 | if (source == cloneItem) |
---|
1963 | 2099 | { |
---|
.. | .. |
---|
2177 | 2313 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2178 | 2314 | // refreshContents(); |
---|
2179 | 2315 | // } |
---|
2180 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2316 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2181 | 2317 | { |
---|
2182 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2318 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2183 | 2319 | |
---|
2184 | 2320 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2185 | 2321 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2229 | 2365 | } else |
---|
2230 | 2366 | if (source == setMasterItem) |
---|
2231 | 2367 | { |
---|
2232 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2368 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2233 | 2369 | { |
---|
2234 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2370 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2235 | 2371 | |
---|
2236 | 2372 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2237 | 2373 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2244 | 2380 | { |
---|
2245 | 2381 | if (group.selection.size() == 1) |
---|
2246 | 2382 | { |
---|
2247 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2383 | + if (Grafreed.clipboard.size() == 1) |
---|
2248 | 2384 | { |
---|
2249 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2385 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2250 | 2386 | |
---|
2251 | 2387 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2252 | 2388 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2263 | 2399 | { |
---|
2264 | 2400 | RevertMeshes(); |
---|
2265 | 2401 | } else |
---|
2266 | | - if (source == resetMeshItem) |
---|
| 2402 | + if (source == resetAllItem) |
---|
2267 | 2403 | { |
---|
2268 | 2404 | ResetAll(); |
---|
2269 | 2405 | } else |
---|
.. | .. |
---|
2451 | 2587 | } else |
---|
2452 | 2588 | if (source == genNormalsMESHItem) |
---|
2453 | 2589 | { |
---|
2454 | | - GenNormals(true); // TODO |
---|
| 2590 | + GenNormalsMESH(); |
---|
2455 | 2591 | } else |
---|
2456 | 2592 | if (source == genNormalsORGANItem) |
---|
2457 | 2593 | { |
---|
.. | .. |
---|
2516 | 2652 | if (source == unmarkleavesItem) |
---|
2517 | 2653 | { |
---|
2518 | 2654 | MarkLeaves(false); |
---|
| 2655 | + } else |
---|
| 2656 | + if (source == rewindleavesItem) |
---|
| 2657 | + { |
---|
| 2658 | + RewindLeaves(true); |
---|
| 2659 | + } else |
---|
| 2660 | + if (source == unrewindleavesItem) |
---|
| 2661 | + { |
---|
| 2662 | + RewindLeaves(false); |
---|
| 2663 | + } else |
---|
| 2664 | + if (source == randomleavesItem) |
---|
| 2665 | + { |
---|
| 2666 | + RandomLeaves(true); |
---|
| 2667 | + } else |
---|
| 2668 | + if (source == unrandomleavesItem) |
---|
| 2669 | + { |
---|
| 2670 | + RandomLeaves(false); |
---|
2519 | 2671 | } else |
---|
2520 | 2672 | if (source == flipVItem) |
---|
2521 | 2673 | { |
---|
.. | .. |
---|
2601 | 2753 | { |
---|
2602 | 2754 | SmoothMesh(); |
---|
2603 | 2755 | } else |
---|
2604 | | - if (source == transformgeometryItem) |
---|
| 2756 | + if (source == transformGeometryItem) |
---|
2605 | 2757 | { |
---|
2606 | 2758 | TransformGeometry(); |
---|
| 2759 | + } else |
---|
| 2760 | + if (source == transformChildrenItem) |
---|
| 2761 | + { |
---|
| 2762 | + TransformChildren(); |
---|
2607 | 2763 | } else |
---|
2608 | 2764 | if (source == resetTransformItem) |
---|
2609 | 2765 | { |
---|
.. | .. |
---|
2611 | 2767 | } else |
---|
2612 | 2768 | if (source == resetCentroidItem) |
---|
2613 | 2769 | { |
---|
2614 | | - ResetCentroid(); |
---|
| 2770 | + ResetCentroid(true); |
---|
| 2771 | + } else |
---|
| 2772 | + if (source == resetCentroidXZItem) |
---|
| 2773 | + { |
---|
| 2774 | + ResetCentroid(false); |
---|
2615 | 2775 | } else |
---|
2616 | 2776 | if (source == resetParentItem) |
---|
2617 | 2777 | { |
---|
.. | .. |
---|
2775 | 2935 | bigThree.ClearUI(); |
---|
2776 | 2936 | bigThree.add(centralPanel); |
---|
2777 | 2937 | bigThree.FlushUI(); |
---|
| 2938 | + |
---|
| 2939 | + cameraView.requestFocusInWindow(); |
---|
| 2940 | + |
---|
| 2941 | +// refreshContents(true); |
---|
| 2942 | +// |
---|
| 2943 | +// try |
---|
| 2944 | +// { |
---|
| 2945 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2946 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2947 | +// bot.mouseMove(100, 100); |
---|
| 2948 | +// bot.mousePress(mask); |
---|
| 2949 | +// bot.mouseRelease(mask); |
---|
| 2950 | +// } |
---|
| 2951 | +// catch (Exception e) |
---|
| 2952 | +// { |
---|
| 2953 | +// |
---|
| 2954 | +// } |
---|
| 2955 | + |
---|
2778 | 2956 | } else |
---|
2779 | 2957 | if (source == threeButton) |
---|
2780 | 2958 | { |
---|
.. | .. |
---|
2811 | 2989 | bigThree.add(centralPanel); |
---|
2812 | 2990 | bigThree.add(XYZPanel); |
---|
2813 | 2991 | bigThree.FlushUI(); |
---|
| 2992 | + |
---|
| 2993 | + cameraView.requestFocusInWindow(); |
---|
2814 | 2994 | } else |
---|
2815 | 2995 | if (source == fourButton) |
---|
2816 | 2996 | { |
---|
.. | .. |
---|
2846 | 3026 | bigThree.ClearUI(); |
---|
2847 | 3027 | bigThree.add(scenePanel); |
---|
2848 | 3028 | bigThree.FlushUI(); |
---|
| 3029 | + |
---|
| 3030 | + cameraView.requestFocusInWindow(); |
---|
2849 | 3031 | } else |
---|
2850 | 3032 | if (source == sixButton) |
---|
2851 | 3033 | { |
---|
.. | .. |
---|
2882 | 3064 | bigThree.add(scenePanel); |
---|
2883 | 3065 | bigThree.add(centralPanel); |
---|
2884 | 3066 | bigThree.FlushUI(); |
---|
| 3067 | + |
---|
| 3068 | + cameraView.requestFocusInWindow(); |
---|
2885 | 3069 | } else |
---|
2886 | 3070 | if (source == sevenButton) |
---|
2887 | 3071 | { |
---|
.. | .. |
---|
2919 | 3103 | bigThree.add(centralPanel); |
---|
2920 | 3104 | bigThree.add(XYZPanel); |
---|
2921 | 3105 | bigThree.FlushUI(); |
---|
| 3106 | + |
---|
| 3107 | + cameraView.requestFocusInWindow(); |
---|
2922 | 3108 | } else |
---|
2923 | 3109 | if (source == rootButton) |
---|
2924 | 3110 | { |
---|
.. | .. |
---|
2930 | 3116 | EditObject(obj); |
---|
2931 | 3117 | } |
---|
2932 | 3118 | |
---|
| 3119 | + cameraView.requestFocusInWindow(); |
---|
2933 | 3120 | refreshContents(true); |
---|
2934 | 3121 | } else |
---|
2935 | 3122 | if (source == closeButton) |
---|
.. | .. |
---|
2951 | 3138 | break; |
---|
2952 | 3139 | } |
---|
2953 | 3140 | } |
---|
| 3141 | + |
---|
| 3142 | + cameraView.requestFocusInWindow(); |
---|
2954 | 3143 | refreshContents(true); |
---|
2955 | 3144 | } else |
---|
2956 | 3145 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2967 | 3156 | child.CloseUI(); |
---|
2968 | 3157 | listUI.remove(child); |
---|
2969 | 3158 | |
---|
2970 | | - child.editWindow = null; // ??????????? |
---|
| 3159 | + //child.editWindow = null; // ??????????? |
---|
2971 | 3160 | } |
---|
2972 | 3161 | objEditor.ctrlPanel.FlushUI(); |
---|
2973 | 3162 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3053 | 3242 | frontView.object = group; |
---|
3054 | 3243 | sideView.object = group; |
---|
3055 | 3244 | } |
---|
3056 | | - group.editWindow = this; |
---|
| 3245 | + |
---|
| 3246 | +// fix "+" issue |
---|
| 3247 | + //group.editWindow = this; |
---|
| 3248 | + |
---|
3057 | 3249 | /* |
---|
3058 | 3250 | currentLayout = radio.layout; |
---|
3059 | 3251 | if (currentLayout == null) |
---|
.. | .. |
---|
3065 | 3257 | //group.parent = null; // ROOT |
---|
3066 | 3258 | //group.attributes = -1; |
---|
3067 | 3259 | ResetModel(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
3068 | 3262 | refreshContents(true); |
---|
3069 | | - } |
---|
| 3263 | + } else if (event.getSource() == editCameraItem) |
---|
| 3264 | + { |
---|
| 3265 | + cameraView.ProtectCamera(); |
---|
| 3266 | + cameraView.repaint(); |
---|
| 3267 | + return; |
---|
| 3268 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3269 | + { |
---|
| 3270 | + cameraView.RevertCamera(); |
---|
| 3271 | + cameraView.repaint(); |
---|
| 3272 | + return; |
---|
| 3273 | + // } else if (event.getSource() == textureButton) |
---|
| 3274 | + // { |
---|
| 3275 | + // return; // true; |
---|
| 3276 | + } |
---|
3070 | 3277 | else |
---|
3071 | 3278 | { |
---|
3072 | 3279 | //return super.action(event, arg); |
---|
.. | .. |
---|
3075 | 3282 | } |
---|
3076 | 3283 | |
---|
3077 | 3284 | boolean useclient = false; |
---|
3078 | | - cRadio radio; |
---|
3079 | 3285 | |
---|
3080 | 3286 | void ToggleRoot() |
---|
3081 | 3287 | { |
---|
.. | .. |
---|
3127 | 3333 | refreshContents(); |
---|
3128 | 3334 | } |
---|
3129 | 3335 | |
---|
| 3336 | + void TransformChildren() |
---|
| 3337 | + { |
---|
| 3338 | + Object3D obj; |
---|
| 3339 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3340 | + { |
---|
| 3341 | + obj = (Object3D)e.nextElement(); |
---|
| 3342 | + obj.KeepTextureMatrices(); |
---|
| 3343 | + obj.TransformChildren(); |
---|
| 3344 | + obj.RestoreTextureMatrices(); |
---|
| 3345 | + |
---|
| 3346 | +// if (obj.parent == null) |
---|
| 3347 | +// { |
---|
| 3348 | +// System.out.println("NULL PARENT!"); |
---|
| 3349 | +// new Exception().printStackTrace(); |
---|
| 3350 | +// } |
---|
| 3351 | +// else |
---|
| 3352 | +// TouchTransform(obj); |
---|
| 3353 | +// //obj.parent.Touch(); |
---|
| 3354 | + } |
---|
| 3355 | + |
---|
| 3356 | + refreshContents(); |
---|
| 3357 | + } |
---|
3130 | 3358 | |
---|
3131 | 3359 | void ResetTransform() |
---|
3132 | 3360 | { |
---|
.. | .. |
---|
3239 | 3467 | refreshContents(); |
---|
3240 | 3468 | } |
---|
3241 | 3469 | |
---|
3242 | | - void ResetCentroid() |
---|
| 3470 | + void ResetCentroid(boolean full) |
---|
3243 | 3471 | { |
---|
3244 | 3472 | Object3D obj; |
---|
3245 | 3473 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3254 | 3482 | LA.matIdentity(Object3D.mat); |
---|
3255 | 3483 | obj.getBounds(minima, maxima, false); |
---|
3256 | 3484 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3257 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3485 | + if (full) |
---|
| 3486 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3258 | 3487 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3259 | 3488 | obj.TransformMesh(Object3D.mat); |
---|
| 3489 | + |
---|
3260 | 3490 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3261 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3491 | + if (full) |
---|
| 3492 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3262 | 3493 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3494 | + |
---|
3263 | 3495 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3264 | 3496 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3265 | 3497 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3288 | 3520 | |
---|
3289 | 3521 | int size = obj.MemorySize(); |
---|
3290 | 3522 | |
---|
3291 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3523 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3524 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3292 | 3525 | } |
---|
3293 | 3526 | } |
---|
3294 | 3527 | catch (Exception e) |
---|
.. | .. |
---|
3325 | 3558 | obj = (Object3D)e.nextElement(); |
---|
3326 | 3559 | |
---|
3327 | 3560 | System.out.println("Object is: " + obj); |
---|
3328 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3561 | + Grafreed.AnalyzeObject(obj); |
---|
3329 | 3562 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3330 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3563 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3331 | 3564 | |
---|
3332 | 3565 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3333 | 3566 | } |
---|
.. | .. |
---|
3369 | 3602 | void GenNormals(boolean crease) |
---|
3370 | 3603 | { |
---|
3371 | 3604 | group.GenNormalsS(crease); |
---|
| 3605 | + |
---|
| 3606 | + refreshContents(); |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + void GenNormalsMESH() |
---|
| 3610 | + { |
---|
| 3611 | + group.GenNormalsMeshS(); |
---|
3372 | 3612 | |
---|
3373 | 3613 | refreshContents(); |
---|
3374 | 3614 | } |
---|
.. | .. |
---|
3541 | 3781 | |
---|
3542 | 3782 | void ParseVertices() |
---|
3543 | 3783 | { |
---|
3544 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3545 | | - GrafreeD.epsequal = true; |
---|
| 3784 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3785 | + Grafreed.epsequal = true; |
---|
3546 | 3786 | |
---|
3547 | 3787 | for (int i=0; i<group.selection.size(); i++) |
---|
3548 | 3788 | { |
---|
.. | .. |
---|
3567 | 3807 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3568 | 3808 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3569 | 3809 | |
---|
3570 | | - g.add(GrafreeD.clipboard); |
---|
| 3810 | + g.add(Grafreed.clipboard); |
---|
3571 | 3811 | |
---|
3572 | 3812 | buffer.add(g); |
---|
3573 | 3813 | } |
---|
.. | .. |
---|
3582 | 3822 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3583 | 3823 | } |
---|
3584 | 3824 | |
---|
3585 | | - GrafreeD.epsequal = epsequal; |
---|
| 3825 | + Grafreed.epsequal = epsequal; |
---|
3586 | 3826 | |
---|
3587 | 3827 | refreshContents(); |
---|
3588 | 3828 | } |
---|
.. | .. |
---|
3600 | 3840 | String pigment = Object3D.GetPigment(tex); |
---|
3601 | 3841 | //String bump = Object3D.GetBump(tex); |
---|
3602 | 3842 | |
---|
3603 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3843 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3844 | + |
---|
| 3845 | + try |
---|
| 3846 | + { |
---|
| 3847 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3848 | + } |
---|
| 3849 | + catch (Exception e) |
---|
| 3850 | + { |
---|
| 3851 | + System.err.println("FAIL: " + node); |
---|
| 3852 | + } |
---|
3604 | 3853 | |
---|
3605 | 3854 | double s = v.s; |
---|
3606 | 3855 | |
---|
.. | .. |
---|
3732 | 3981 | return; |
---|
3733 | 3982 | |
---|
3734 | 3983 | Object3D poses = group.selection.get(0); |
---|
3735 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3984 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3736 | 3985 | |
---|
3737 | 3986 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3738 | 3987 | |
---|
.. | .. |
---|
3926 | 4175 | |
---|
3927 | 4176 | void ClipMesh() |
---|
3928 | 4177 | { |
---|
3929 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4178 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3930 | 4179 | { |
---|
3931 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4180 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3932 | 4181 | |
---|
3933 | 4182 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3934 | 4183 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3937 | 4186 | // { |
---|
3938 | 4187 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3939 | 4188 | // } |
---|
3940 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4189 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3941 | 4190 | } |
---|
3942 | 4191 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3943 | 4192 | System.out.println("DONE."); |
---|
.. | .. |
---|
3984 | 4233 | void MarkLeaves(boolean hide) |
---|
3985 | 4234 | { |
---|
3986 | 4235 | group.selection.MarkLeaves(hide); |
---|
| 4236 | + refreshContents(); |
---|
| 4237 | + } |
---|
| 4238 | + |
---|
| 4239 | + void RewindLeaves(boolean hide) |
---|
| 4240 | + { |
---|
| 4241 | + group.selection.RewindLeaves(hide); |
---|
| 4242 | + refreshContents(); |
---|
| 4243 | + } |
---|
| 4244 | + |
---|
| 4245 | + void RandomLeaves(boolean hide) |
---|
| 4246 | + { |
---|
| 4247 | + group.selection.RandomLeaves(hide); |
---|
3987 | 4248 | refreshContents(); |
---|
3988 | 4249 | } |
---|
3989 | 4250 | |
---|
.. | .. |
---|
4072 | 4333 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4073 | 4334 | |
---|
4074 | 4335 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4075 | | - if(elem != group) |
---|
| 4336 | + if(elem != group || !newWindow) |
---|
4076 | 4337 | { |
---|
4077 | 4338 | // if (!(elem instanceof Composite)) |
---|
4078 | 4339 | // newWindow = false; |
---|
.. | .. |
---|
4162 | 4423 | //case 702: // Event.LIST_DESELECT |
---|
4163 | 4424 | group.deselectAll(); |
---|
4164 | 4425 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4165 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4166 | 4426 | if (tps != null) |
---|
4167 | 4427 | { |
---|
4168 | 4428 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4171 | 4431 | |
---|
4172 | 4432 | //if (child.parent != null) |
---|
4173 | 4433 | //child.parent.addSelectee(child); |
---|
| 4434 | + objEditor.SetMaterial(child); |
---|
4174 | 4435 | group.addSelectee(child); |
---|
4175 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4176 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4177 | | - System.err.println("info : " + child.GetPath()); |
---|
4178 | 4436 | } |
---|
4179 | 4437 | } |
---|
4180 | 4438 | // else |
---|
.. | .. |
---|
4184 | 4442 | // System.err.println("info : " + group.GetPath()); |
---|
4185 | 4443 | // } |
---|
4186 | 4444 | |
---|
4187 | | - objEditor.SetText(); // jan 2014 |
---|
4188 | | - |
---|
4189 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4445 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4190 | 4446 | CameraPane.flash = true; |
---|
4191 | 4447 | |
---|
4192 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4448 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4193 | 4449 | // a camera |
---|
4194 | 4450 | { |
---|
4195 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4196 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4451 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4452 | + { |
---|
| 4453 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4454 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4455 | + } |
---|
4197 | 4456 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4198 | 4457 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4199 | 4458 | } |
---|
.. | .. |
---|
4206 | 4465 | |
---|
4207 | 4466 | freezemodel = false; |
---|
4208 | 4467 | } |
---|
| 4468 | + |
---|
| 4469 | + void refreshContents(boolean cp) |
---|
| 4470 | + { |
---|
| 4471 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4472 | + { |
---|
| 4473 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4474 | + |
---|
| 4475 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4476 | + { |
---|
| 4477 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4478 | + |
---|
| 4479 | + objEditor.AddInfo(child, this, true); |
---|
| 4480 | + System.err.println("info : " + child.GetPath()); |
---|
| 4481 | + } |
---|
| 4482 | + |
---|
| 4483 | + objEditor.SetText(); // jan 2014 |
---|
| 4484 | + } |
---|
| 4485 | + |
---|
| 4486 | + super.refreshContents(cp); |
---|
| 4487 | + } |
---|
4209 | 4488 | |
---|
4210 | 4489 | void linkSomething(Object3D thing) |
---|
4211 | 4490 | { |
---|
.. | .. |
---|
4277 | 4556 | { |
---|
4278 | 4557 | if (group.selection.isEmpty()) |
---|
4279 | 4558 | return; |
---|
4280 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4559 | + |
---|
| 4560 | + Grafreed.clipboardIsTempGroup = false; |
---|
4281 | 4561 | Composite tGroup = null; |
---|
4282 | 4562 | if (group.selection.size() > 0) // 1) |
---|
4283 | 4563 | { |
---|
4284 | 4564 | tGroup = new cGroup(); |
---|
4285 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4565 | + Grafreed.clipboardIsTempGroup = true; |
---|
4286 | 4566 | } |
---|
4287 | 4567 | |
---|
4288 | 4568 | if (cut) |
---|
4289 | 4569 | { |
---|
| 4570 | + Save(); |
---|
4290 | 4571 | //int indices[] = jList.getSelectedIndices(); |
---|
4291 | 4572 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4292 | 4573 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4322 | 4603 | //System.out.println("cut " + child); |
---|
4323 | 4604 | //System.out.println("parent = " + child.parent); |
---|
4324 | 4605 | // tmp.addChild(child); |
---|
4325 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
4326 | 4607 | tGroup.add/*Child*/(tmp); |
---|
4327 | 4608 | else |
---|
4328 | | - GrafreeD.clipboard = tmp; |
---|
| 4609 | + Grafreed.clipboard = tmp; |
---|
4329 | 4610 | } |
---|
4330 | 4611 | else |
---|
4331 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4612 | + if (Grafreed.clipboardIsTempGroup) |
---|
4332 | 4613 | tGroup.add/*Child*/(child); |
---|
4333 | 4614 | else |
---|
4334 | | - GrafreeD.clipboard = child; |
---|
| 4615 | + Grafreed.clipboard = child; |
---|
4335 | 4616 | } |
---|
4336 | 4617 | |
---|
4337 | 4618 | //ResetModel(); |
---|
.. | .. |
---|
4363 | 4644 | //System.out.println("cut " + elem); |
---|
4364 | 4645 | //System.out.println("parent = " + elem.parent); |
---|
4365 | 4646 | // tmp.addChild(elem); |
---|
4366 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4647 | + if (Grafreed.clipboardIsTempGroup) |
---|
4367 | 4648 | tGroup.add/*Child*/(tmp); |
---|
4368 | 4649 | else |
---|
4369 | | - GrafreeD.clipboard = tmp; |
---|
| 4650 | + Grafreed.clipboard = tmp; |
---|
4370 | 4651 | } |
---|
4371 | 4652 | else |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4653 | + if (Grafreed.clipboardIsTempGroup) |
---|
4373 | 4654 | tGroup.add/*Child*/(child); |
---|
4374 | 4655 | else |
---|
4375 | | - GrafreeD.clipboard = child; |
---|
| 4656 | + Grafreed.clipboard = child; |
---|
4376 | 4657 | } |
---|
4377 | 4658 | |
---|
4378 | 4659 | } |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4380 | | - GrafreeD.clipboard = tGroup; |
---|
| 4660 | + |
---|
| 4661 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4662 | + Grafreed.clipboard = tGroup; |
---|
| 4663 | + |
---|
4381 | 4664 | if (cut) |
---|
4382 | 4665 | { |
---|
4383 | 4666 | ResetModel(); |
---|
.. | .. |
---|
4391 | 4674 | // return; |
---|
4392 | 4675 | boolean first = true; |
---|
4393 | 4676 | |
---|
4394 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4677 | + if (Grafreed.clipboardIsTempGroup) |
---|
4395 | 4678 | { |
---|
4396 | 4679 | Composite temp; |
---|
4397 | 4680 | |
---|
.. | .. |
---|
4402 | 4685 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4403 | 4686 | */ |
---|
4404 | 4687 | Object3D elem; |
---|
4405 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4688 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4406 | 4689 | { |
---|
4407 | 4690 | Object3D child = (Object3D)e.nextElement(); |
---|
4408 | 4691 | |
---|
.. | .. |
---|
4436 | 4719 | //Object3D cb = Applet3D.clipboard; |
---|
4437 | 4720 | //temp.addChild(cb); |
---|
4438 | 4721 | //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()); |
---|
| 4722 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4723 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4724 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4725 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4726 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4444 | 4727 | else |
---|
4445 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4446 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4728 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4729 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4447 | 4730 | } |
---|
4448 | 4731 | |
---|
4449 | 4732 | ResetModel(); |
---|
.. | .. |
---|
4492 | 4775 | { |
---|
4493 | 4776 | boolean first = true; |
---|
4494 | 4777 | |
---|
4495 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4778 | + if (Grafreed.clipboardIsTempGroup) |
---|
4496 | 4779 | { |
---|
4497 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4780 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4498 | 4781 | Object3D copy; |
---|
4499 | 4782 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4500 | 4783 | { |
---|
.. | .. |
---|
4504 | 4787 | } |
---|
4505 | 4788 | } else |
---|
4506 | 4789 | { |
---|
4507 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4790 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4508 | 4791 | } |
---|
4509 | 4792 | } |
---|
4510 | 4793 | } |
---|
.. | .. |
---|
4909 | 5192 | } |
---|
4910 | 5193 | */ |
---|
4911 | 5194 | |
---|
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 | 5195 | /* |
---|
4928 | 5196 | public void Callback(Object obj) |
---|
4929 | 5197 | { |
---|
.. | .. |
---|
4947 | 5215 | } |
---|
4948 | 5216 | */ |
---|
4949 | 5217 | |
---|
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 | 5218 | String GetFile(String dialogName) |
---|
4968 | 5219 | { |
---|
4969 | | - if (GrafreeD.standAlone) |
---|
| 5220 | + if (Grafreed.standAlone) |
---|
4970 | 5221 | { |
---|
4971 | 5222 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4972 | 5223 | browser.show(); |
---|
.. | .. |
---|
5034 | 5285 | cButton clearpanelButton; |
---|
5035 | 5286 | cButton unselectButton; |
---|
5036 | 5287 | |
---|
| 5288 | + cButton minButton; |
---|
| 5289 | + cButton maxButton; |
---|
| 5290 | + cButton fullButton; |
---|
| 5291 | + cButton undoButton; |
---|
| 5292 | + cButton redoButton; |
---|
| 5293 | + cButton saveButton; |
---|
5037 | 5294 | cButton oneStepButton; |
---|
5038 | 5295 | |
---|
5039 | 5296 | cButton screenfitButton; |
---|
.. | .. |
---|
5047 | 5304 | |
---|
5048 | 5305 | cButton setsupportButton; |
---|
5049 | 5306 | |
---|
5050 | | - cButton twoButton; |
---|
5051 | | - cButton sixButton; |
---|
5052 | | - cButton threeButton; |
---|
5053 | | - cButton sevenButton; |
---|
5054 | | - cButton fourButton; // full panel |
---|
5055 | | - cButton oneButton; // full XYZ |
---|
5056 | | - //cButton currentLayout; |
---|
5057 | | - |
---|
5058 | 5307 | // |
---|
5059 | 5308 | //Composite |
---|
5060 | 5309 | Object3D // to do !! |
---|
.. | .. |
---|
5066 | 5315 | private MenuItem lookFromItem; |
---|
5067 | 5316 | private MenuItem switchItem; |
---|
5068 | 5317 | private MenuItem cutItem; |
---|
| 5318 | + private MenuItem undoItem; |
---|
| 5319 | + private MenuItem redoItem; |
---|
5069 | 5320 | private MenuItem duplicateItem; |
---|
5070 | 5321 | private MenuItem cloneItem; |
---|
5071 | 5322 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5079 | 5330 | private MenuItem linkverticesItem; |
---|
5080 | 5331 | private MenuItem relinkverticesItem; |
---|
5081 | 5332 | private MenuItem setMasterItem; |
---|
5082 | | - private MenuItem resetMeshItem; |
---|
| 5333 | + private MenuItem resetAllItem; |
---|
5083 | 5334 | private MenuItem stepAllItem; |
---|
5084 | 5335 | private MenuItem revertMeshItem; |
---|
5085 | 5336 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5129 | 5380 | private MenuItem showleavesItem; |
---|
5130 | 5381 | private MenuItem markleavesItem; |
---|
5131 | 5382 | private MenuItem unmarkleavesItem; |
---|
| 5383 | + private MenuItem rewindleavesItem; |
---|
| 5384 | + private MenuItem unrewindleavesItem; |
---|
| 5385 | + private MenuItem randomleavesItem; |
---|
| 5386 | + private MenuItem unrandomleavesItem; |
---|
5132 | 5387 | |
---|
5133 | 5388 | private MenuItem flipVItem; |
---|
5134 | 5389 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5140 | 5395 | private MenuItem panoTexturesItem; |
---|
5141 | 5396 | |
---|
5142 | 5397 | private MenuItem resetCentroidItem; |
---|
5143 | | - private MenuItem transformgeometryItem; |
---|
| 5398 | + private MenuItem resetCentroidXZItem; |
---|
5144 | 5399 | private MenuItem resetTransformItem; |
---|
| 5400 | + private MenuItem transformGeometryItem; |
---|
| 5401 | + private MenuItem transformChildrenItem; |
---|
5145 | 5402 | private MenuItem hideItem; |
---|
5146 | 5403 | private MenuItem grabItem; |
---|
5147 | 5404 | private MenuItem backItem; |
---|
.. | .. |
---|
5210 | 5467 | private MenuItem doubleItem; |
---|
5211 | 5468 | private MenuItem tripleItem; |
---|
5212 | 5469 | |
---|
5213 | | - private MenuItem importGFDItem; |
---|
5214 | | - private MenuItem importVRMLX3DItem; |
---|
5215 | | - private MenuItem import3DSItem; |
---|
5216 | | - private MenuItem importOBJItem; |
---|
5217 | | - |
---|
5218 | 5470 | private MenuItem computeAOItem; |
---|
5219 | 5471 | private MenuItem recompileItem; |
---|
5220 | 5472 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5224 | 5476 | private MenuItem analyzeItem; |
---|
5225 | 5477 | private MenuItem dumpItem; |
---|
5226 | 5478 | //boolean freezemodel = false; |
---|
| 5479 | + |
---|
| 5480 | + Menu cameraMenu; |
---|
| 5481 | + MenuItem editCameraItem; |
---|
| 5482 | + MenuItem revertCameraItem; |
---|
5227 | 5483 | } |
---|