.. | .. |
---|
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 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
443 | | - importOBJItem.addActionListener(this); |
---|
444 | | - menu.add("-"); |
---|
445 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
446 | | - import3DSItem.addActionListener(this); |
---|
447 | | - menu.add("-"); |
---|
448 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | | - importVRMLX3DItem.addActionListener(this); |
---|
450 | | - menu.add("-"); |
---|
451 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
452 | | - importGFDItem.addActionListener(this); |
---|
453 | | - |
---|
454 | 531 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 532 | buildToolsMenu(menu); |
---|
456 | 533 | } |
---|
457 | 534 | |
---|
458 | 535 | void SetupUI2(ObjEditor oe) |
---|
459 | 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 | + |
---|
460 | 549 | //new Exception().printStackTrace(); |
---|
461 | 550 | |
---|
462 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
487 | 576 | */ |
---|
488 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 578 | |
---|
490 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 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 = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 605 | liveCB.addItemListener(this); |
---|
493 | 606 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | | - oneStepButton.addActionListener(this); |
---|
497 | | - |
---|
498 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
499 | 608 | fastCB.setToolTipText("Fast mode"); |
---|
500 | 609 | fastCB.addItemListener(this); |
---|
501 | 610 | |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 613 | + oneStepButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
503 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
504 | 617 | trackCB.addItemListener(this); |
---|
505 | 618 | |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
508 | 621 | screenfitButton.addActionListener(this); |
---|
509 | 622 | |
---|
.. | .. |
---|
512 | 625 | |
---|
513 | 626 | if (Globals.ADVANCED) |
---|
514 | 627 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 629 | snapobjectButton.addActionListener(this); |
---|
517 | 630 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 631 | } |
---|
519 | 632 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
522 | 635 | flashSelectionButton.addActionListener(this); |
---|
523 | 636 | |
---|
524 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 638 | |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 641 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 643 | fourButton.addActionListener(this); |
---|
531 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 647 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 650 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 653 | sevenButton.addActionListener(this); |
---|
541 | 654 | // |
---|
542 | 655 | |
---|
543 | | - 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); |
---|
544 | 657 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 658 | rootButton.addActionListener(this); |
---|
546 | 659 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 661 | closeButton.setToolTipText("Close tab"); |
---|
549 | 662 | closeButton.addActionListener(this); |
---|
550 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
551 | 664 | //clearButton.addActionListener(this); |
---|
552 | 665 | |
---|
553 | | - cGridBag commandsPanel = new cGridBag(); |
---|
554 | | - |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | 667 | editButton.setToolTipText("Edit selection"); |
---|
557 | 668 | editButton.addActionListener(this); |
---|
558 | 669 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
561 | 672 | uneditButton.addActionListener(this); |
---|
562 | 673 | |
---|
563 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
564 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
565 | 676 | allParamsButton.addActionListener(this); |
---|
566 | 677 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 680 | clearPanelButton.addActionListener(this); |
---|
570 | 681 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 684 | unselectButton.addActionListener(this); |
---|
574 | 685 | |
---|
575 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
576 | 687 | |
---|
577 | | - oe.treePanel.add(commandsPanel); |
---|
578 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
579 | 690 | |
---|
580 | 691 | // oe.aConstraints.gridx += 1; |
---|
581 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
651 | 762 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
652 | 763 | zoomBoxCB.addItemListener(this); |
---|
653 | 764 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 765 | + if (true) // Globals.ADVANCED) |
---|
655 | 766 | { |
---|
656 | 767 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | 768 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
697 | 808 | // debugCB.addItemListener(this); |
---|
698 | 809 | |
---|
699 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
700 | 812 | oeilCB.addItemListener(this); |
---|
701 | 813 | |
---|
| 814 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 815 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 816 | + shadowCB.addItemListener(this); |
---|
| 817 | + |
---|
| 818 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 819 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 820 | + autosaveCB.addItemListener(this); |
---|
| 821 | + |
---|
| 822 | + if (Globals.ADVANCED) |
---|
| 823 | + { |
---|
702 | 824 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
703 | 825 | lookAtCB.setToolTipText("Look-at target"); |
---|
704 | 826 | lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
705 | 828 | |
---|
706 | 829 | } |
---|
707 | 830 | |
---|
.. | .. |
---|
716 | 839 | void EditObject(Object3D obj) |
---|
717 | 840 | { |
---|
718 | 841 | cRadio radioButton = new cRadio(obj.name); |
---|
| 842 | + |
---|
| 843 | + // Patch to avoid bug with transparency. |
---|
| 844 | + radioButton.hadMaterial = obj.material != null; |
---|
| 845 | + if (!radioButton.hadMaterial) |
---|
| 846 | + { |
---|
| 847 | + obj.material = new cMaterial(); |
---|
| 848 | + } |
---|
| 849 | + |
---|
719 | 850 | radioButton.SetObject(obj); |
---|
720 | 851 | radioButton.layout = sevenButton; |
---|
721 | 852 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
724 | 855 | buttonGroup.add(radioButton); |
---|
725 | 856 | radioButton.doClick(); |
---|
726 | 857 | } |
---|
| 858 | + |
---|
727 | 859 | void SetupViews(ObjEditor oe) |
---|
728 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
729 | 863 | oe.SetupViews(); |
---|
730 | 864 | |
---|
731 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
734 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
735 | 869 | } |
---|
736 | 870 | |
---|
737 | | - JCheckBox liveCB; |
---|
738 | | - JCheckBox supportCB; |
---|
739 | | - JCheckBox localCB; |
---|
740 | | - JCheckBox crowdCB; |
---|
741 | | - JCheckBox smoothCB; |
---|
742 | | - JCheckBox fastCB; |
---|
743 | | - JCheckBox slowCB; |
---|
744 | | - JCheckBox boxCB; |
---|
745 | | - JCheckBox zoomBoxCB; |
---|
746 | | - JCheckBox trackCB; |
---|
747 | | - JCheckBox smoothfocusCB; |
---|
| 871 | + cCheckBox liveCB; |
---|
| 872 | + cCheckBox supportCB; |
---|
| 873 | + cCheckBox localCB; |
---|
| 874 | + cCheckBox crowdCB; |
---|
| 875 | + cCheckBox smoothCB; |
---|
| 876 | + cCheckBox fastCB; |
---|
| 877 | + cCheckBox slowCB; |
---|
| 878 | + cCheckBox boxCB; |
---|
| 879 | + cCheckBox zoomBoxCB; |
---|
| 880 | + cCheckBox trackCB; |
---|
| 881 | + cCheckBox smoothfocusCB; |
---|
748 | 882 | // JCheckBox speakerMocapCB; |
---|
749 | | - JCheckBox speakerCameraCB; |
---|
750 | | - JCheckBox speakerFocusCB; |
---|
751 | | - JCheckBox debugCB; |
---|
752 | | - JCheckBox oeilCB; |
---|
753 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
754 | 891 | |
---|
755 | 892 | // static int COLOR = 1; |
---|
756 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
758 | 895 | |
---|
759 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
760 | 897 | |
---|
761 | | - JCheckBox colorCB; |
---|
762 | | - JCheckBox materialCB; |
---|
763 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
764 | 901 | |
---|
765 | 902 | public void itemStateChanged(ItemEvent e) |
---|
766 | 903 | { |
---|
.. | .. |
---|
788 | 925 | } else if(e.getSource() == liveCB) |
---|
789 | 926 | { |
---|
790 | 927 | cameraView.ToggleLive(); |
---|
| 928 | + refreshContents(false); |
---|
791 | 929 | } |
---|
792 | 930 | else if(e.getSource() == supportCB) |
---|
793 | 931 | { |
---|
.. | .. |
---|
851 | 989 | else if(e.getSource() == oeilCB) |
---|
852 | 990 | { |
---|
853 | 991 | cameraView.ToggleOeil(); |
---|
| 992 | + } |
---|
| 993 | + else if(e.getSource() == shadowCB) |
---|
| 994 | + { |
---|
| 995 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 996 | + } |
---|
| 997 | + else if(e.getSource() == autosaveCB) |
---|
| 998 | + { |
---|
| 999 | + Globals.SAVEONMAKE ^= true; |
---|
854 | 1000 | } |
---|
855 | 1001 | else if(e.getSource() == lookAtCB) |
---|
856 | 1002 | { |
---|
.. | .. |
---|
969 | 1115 | |
---|
970 | 1116 | flashIt = false; |
---|
971 | 1117 | CameraPane pane = (CameraPane) target; |
---|
972 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1118 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
973 | 1119 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
974 | 1120 | |
---|
975 | 1121 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1195 | 1341 | memoryItem.addActionListener(this); |
---|
1196 | 1342 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1197 | 1343 | analyzeItem.addActionListener(this); |
---|
1198 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1344 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1199 | 1345 | dumpItem.addActionListener(this); |
---|
1200 | 1346 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1201 | 1347 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1336 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1337 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1338 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1339 | 1486 | |
---|
1340 | 1487 | makeSomething(shadow); |
---|
1341 | 1488 | } |
---|
.. | .. |
---|
1542 | 1689 | |
---|
1543 | 1690 | void Overwrite(int mask) |
---|
1544 | 1691 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1692 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1693 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1694 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1695 | |
---|
1549 | 1696 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1697 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1849 | 1996 | csg.addChild(child); |
---|
1850 | 1997 | child.addChild(csg); |
---|
1851 | 1998 | } else |
---|
1852 | | - |
---|
1853 | | - if (source == importGFDItem) |
---|
1854 | | - { |
---|
1855 | | - ImportGFD(); |
---|
1856 | | - } else |
---|
1857 | | - if (source == importVRMLX3DItem) |
---|
1858 | | - { |
---|
1859 | | - ImportVRMLX3D(); |
---|
1860 | | - } else |
---|
1861 | | - if (source == import3DSItem) |
---|
1862 | | - { |
---|
1863 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1864 | | - } else |
---|
1865 | | - if (source == importOBJItem) |
---|
1866 | | - { |
---|
1867 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1868 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1869 | | - browser.setVisible(true); |
---|
1870 | | - String filename = browser.getFile(); |
---|
1871 | | - if (filename != null && filename.length() > 0) |
---|
1872 | | - { |
---|
1873 | | - String fullname = browser.getDirectory() + filename; |
---|
1874 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1875 | | - } |
---|
1876 | | - } else |
---|
1877 | 1999 | if (source == computeAOItem) |
---|
1878 | 2000 | { |
---|
1879 | 2001 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1892 | 2014 | if (source == invariantsItem) |
---|
1893 | 2015 | { |
---|
1894 | 2016 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2017 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 2018 | } else |
---|
1897 | 2019 | if (source == memoryItem) |
---|
1898 | 2020 | { |
---|
.. | .. |
---|
1910 | 2032 | if (source == dumpItem) |
---|
1911 | 2033 | { |
---|
1912 | 2034 | DumpObject(); |
---|
| 2035 | + } else |
---|
| 2036 | + if (source == minButton) |
---|
| 2037 | + { |
---|
| 2038 | + Minimize(); |
---|
| 2039 | + } else |
---|
| 2040 | + if (source == maxButton) |
---|
| 2041 | + { |
---|
| 2042 | + Maximize(); |
---|
| 2043 | + } else |
---|
| 2044 | + if (source == fullButton) |
---|
| 2045 | + { |
---|
| 2046 | + ToggleFullScreen(); |
---|
| 2047 | + } else |
---|
| 2048 | + if (source == undoButton) |
---|
| 2049 | + { |
---|
| 2050 | + Undo(); |
---|
| 2051 | + } else |
---|
| 2052 | + if (source == redoButton) |
---|
| 2053 | + { |
---|
| 2054 | + Redo(); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == saveButton) |
---|
| 2057 | + { |
---|
| 2058 | + Save(); |
---|
1913 | 2059 | } else |
---|
1914 | 2060 | if (source == oneStepButton) |
---|
1915 | 2061 | { |
---|
.. | .. |
---|
1965 | 2111 | { |
---|
1966 | 2112 | loadClipboard(true); |
---|
1967 | 2113 | } else |
---|
| 2114 | + if (source == undoItem) |
---|
| 2115 | + { |
---|
| 2116 | + Undo(); |
---|
| 2117 | + } else |
---|
| 2118 | + if (source == redoItem) |
---|
| 2119 | + { |
---|
| 2120 | + Redo(); |
---|
| 2121 | + } else |
---|
1968 | 2122 | if (source == duplicateItem) |
---|
1969 | 2123 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2124 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2125 | loadClipboard(false); |
---|
1972 | 2126 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2127 | + Grafreed.clipboard = keep; |
---|
1974 | 2128 | } else |
---|
1975 | 2129 | if (source == cloneItem) |
---|
1976 | 2130 | { |
---|
.. | .. |
---|
2190 | 2344 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2345 | // refreshContents(); |
---|
2192 | 2346 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2347 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2348 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2349 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2350 | |
---|
2197 | 2351 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2352 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2396 | } else |
---|
2243 | 2397 | if (source == setMasterItem) |
---|
2244 | 2398 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2399 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2400 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2401 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2402 | |
---|
2249 | 2403 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2404 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2411 | { |
---|
2258 | 2412 | if (group.selection.size() == 1) |
---|
2259 | 2413 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2414 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2415 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2416 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2417 | |
---|
2264 | 2418 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2419 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2430 | { |
---|
2277 | 2431 | RevertMeshes(); |
---|
2278 | 2432 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2433 | + if (source == resetAllItem) |
---|
2280 | 2434 | { |
---|
2281 | 2435 | ResetAll(); |
---|
2282 | 2436 | } else |
---|
.. | .. |
---|
2464 | 2618 | } else |
---|
2465 | 2619 | if (source == genNormalsMESHItem) |
---|
2466 | 2620 | { |
---|
2467 | | - GenNormals(true); // TODO |
---|
| 2621 | + GenNormalsMESH(); |
---|
2468 | 2622 | } else |
---|
2469 | 2623 | if (source == genNormalsORGANItem) |
---|
2470 | 2624 | { |
---|
.. | .. |
---|
2529 | 2683 | if (source == unmarkleavesItem) |
---|
2530 | 2684 | { |
---|
2531 | 2685 | MarkLeaves(false); |
---|
| 2686 | + } else |
---|
| 2687 | + if (source == rewindleavesItem) |
---|
| 2688 | + { |
---|
| 2689 | + RewindLeaves(true); |
---|
| 2690 | + } else |
---|
| 2691 | + if (source == unrewindleavesItem) |
---|
| 2692 | + { |
---|
| 2693 | + RewindLeaves(false); |
---|
| 2694 | + } else |
---|
| 2695 | + if (source == randomleavesItem) |
---|
| 2696 | + { |
---|
| 2697 | + RandomLeaves(true); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == unrandomleavesItem) |
---|
| 2700 | + { |
---|
| 2701 | + RandomLeaves(false); |
---|
2532 | 2702 | } else |
---|
2533 | 2703 | if (source == flipVItem) |
---|
2534 | 2704 | { |
---|
.. | .. |
---|
2614 | 2784 | { |
---|
2615 | 2785 | SmoothMesh(); |
---|
2616 | 2786 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 2787 | + if (source == transformGeometryItem) |
---|
2618 | 2788 | { |
---|
2619 | 2789 | TransformGeometry(); |
---|
| 2790 | + } else |
---|
| 2791 | + if (source == transformChildrenItem) |
---|
| 2792 | + { |
---|
| 2793 | + TransformChildren(); |
---|
2620 | 2794 | } else |
---|
2621 | 2795 | if (source == resetTransformItem) |
---|
2622 | 2796 | { |
---|
.. | .. |
---|
2624 | 2798 | } else |
---|
2625 | 2799 | if (source == resetCentroidItem) |
---|
2626 | 2800 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 2801 | + ResetCentroid(true); |
---|
| 2802 | + } else |
---|
| 2803 | + if (source == resetCentroidXZItem) |
---|
| 2804 | + { |
---|
| 2805 | + ResetCentroid(false); |
---|
2628 | 2806 | } else |
---|
2629 | 2807 | if (source == resetParentItem) |
---|
2630 | 2808 | { |
---|
.. | .. |
---|
2788 | 2966 | bigThree.ClearUI(); |
---|
2789 | 2967 | bigThree.add(centralPanel); |
---|
2790 | 2968 | bigThree.FlushUI(); |
---|
| 2969 | + |
---|
| 2970 | + cameraView.requestFocusInWindow(); |
---|
| 2971 | + |
---|
| 2972 | +// refreshContents(true); |
---|
| 2973 | +// |
---|
| 2974 | +// try |
---|
| 2975 | +// { |
---|
| 2976 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2977 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2978 | +// bot.mouseMove(100, 100); |
---|
| 2979 | +// bot.mousePress(mask); |
---|
| 2980 | +// bot.mouseRelease(mask); |
---|
| 2981 | +// } |
---|
| 2982 | +// catch (Exception e) |
---|
| 2983 | +// { |
---|
| 2984 | +// |
---|
| 2985 | +// } |
---|
| 2986 | + |
---|
2791 | 2987 | } else |
---|
2792 | 2988 | if (source == threeButton) |
---|
2793 | 2989 | { |
---|
.. | .. |
---|
2824 | 3020 | bigThree.add(centralPanel); |
---|
2825 | 3021 | bigThree.add(XYZPanel); |
---|
2826 | 3022 | bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3025 | } else |
---|
2828 | 3026 | if (source == fourButton) |
---|
2829 | 3027 | { |
---|
.. | .. |
---|
2859 | 3057 | bigThree.ClearUI(); |
---|
2860 | 3058 | bigThree.add(scenePanel); |
---|
2861 | 3059 | bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2862 | 3062 | } else |
---|
2863 | 3063 | if (source == sixButton) |
---|
2864 | 3064 | { |
---|
.. | .. |
---|
2895 | 3095 | bigThree.add(scenePanel); |
---|
2896 | 3096 | bigThree.add(centralPanel); |
---|
2897 | 3097 | bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2898 | 3100 | } else |
---|
2899 | 3101 | if (source == sevenButton) |
---|
2900 | 3102 | { |
---|
.. | .. |
---|
2932 | 3134 | bigThree.add(centralPanel); |
---|
2933 | 3135 | bigThree.add(XYZPanel); |
---|
2934 | 3136 | bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
2935 | 3139 | } else |
---|
2936 | 3140 | if (source == rootButton) |
---|
2937 | 3141 | { |
---|
.. | .. |
---|
2943 | 3147 | EditObject(obj); |
---|
2944 | 3148 | } |
---|
2945 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3151 | refreshContents(true); |
---|
2947 | 3152 | } else |
---|
2948 | 3153 | if (source == closeButton) |
---|
.. | .. |
---|
2952 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2953 | 3158 | { |
---|
2954 | 3159 | ab = (cRadio)e.nextElement(); |
---|
2955 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2956 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
2957 | 3168 | buttonGroup.remove(ab); |
---|
2958 | 3169 | radioPanel.remove(ab); |
---|
2959 | 3170 | |
---|
2960 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
2961 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
2962 | 3174 | |
---|
2963 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2964 | 3176 | break; |
---|
2965 | 3177 | } |
---|
2966 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
2967 | 3181 | refreshContents(true); |
---|
2968 | 3182 | } else |
---|
2969 | 3183 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2980 | 3194 | child.CloseUI(); |
---|
2981 | 3195 | listUI.remove(child); |
---|
2982 | 3196 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3197 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3198 | } |
---|
2985 | 3199 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3200 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3066 | 3280 | frontView.object = group; |
---|
3067 | 3281 | sideView.object = group; |
---|
3068 | 3282 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 3283 | + |
---|
| 3284 | +// fix "+" issue |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
| 3287 | + |
---|
3070 | 3288 | /* |
---|
3071 | 3289 | currentLayout = radio.layout; |
---|
3072 | 3290 | if (currentLayout == null) |
---|
.. | .. |
---|
3078 | 3296 | //group.parent = null; // ROOT |
---|
3079 | 3297 | //group.attributes = -1; |
---|
3080 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
3081 | 3301 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3302 | + } else if (event.getSource() == editCameraItem) |
---|
| 3303 | + { |
---|
| 3304 | + cameraView.ProtectCamera(); |
---|
| 3305 | + cameraView.repaint(); |
---|
| 3306 | + return; |
---|
| 3307 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3308 | + { |
---|
| 3309 | + cameraView.RevertCamera(); |
---|
| 3310 | + cameraView.repaint(); |
---|
| 3311 | + return; |
---|
| 3312 | + // } else if (event.getSource() == textureButton) |
---|
| 3313 | + // { |
---|
| 3314 | + // return; // true; |
---|
| 3315 | + } |
---|
3083 | 3316 | else |
---|
3084 | 3317 | { |
---|
3085 | 3318 | //return super.action(event, arg); |
---|
.. | .. |
---|
3088 | 3321 | } |
---|
3089 | 3322 | |
---|
3090 | 3323 | boolean useclient = false; |
---|
3091 | | - cRadio radio; |
---|
3092 | 3324 | |
---|
3093 | 3325 | void ToggleRoot() |
---|
3094 | 3326 | { |
---|
.. | .. |
---|
3140 | 3372 | refreshContents(); |
---|
3141 | 3373 | } |
---|
3142 | 3374 | |
---|
| 3375 | + void TransformChildren() |
---|
| 3376 | + { |
---|
| 3377 | + Object3D obj; |
---|
| 3378 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3379 | + { |
---|
| 3380 | + obj = (Object3D)e.nextElement(); |
---|
| 3381 | + obj.KeepTextureMatrices(); |
---|
| 3382 | + obj.TransformChildren(); |
---|
| 3383 | + obj.RestoreTextureMatrices(); |
---|
| 3384 | + |
---|
| 3385 | +// if (obj.parent == null) |
---|
| 3386 | +// { |
---|
| 3387 | +// System.out.println("NULL PARENT!"); |
---|
| 3388 | +// new Exception().printStackTrace(); |
---|
| 3389 | +// } |
---|
| 3390 | +// else |
---|
| 3391 | +// TouchTransform(obj); |
---|
| 3392 | +// //obj.parent.Touch(); |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + refreshContents(); |
---|
| 3396 | + } |
---|
3143 | 3397 | |
---|
3144 | 3398 | void ResetTransform() |
---|
3145 | 3399 | { |
---|
.. | .. |
---|
3252 | 3506 | refreshContents(); |
---|
3253 | 3507 | } |
---|
3254 | 3508 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3509 | + void ResetCentroid(boolean full) |
---|
3256 | 3510 | { |
---|
3257 | 3511 | Object3D obj; |
---|
3258 | 3512 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3521 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3522 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3523 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3524 | + if (full) |
---|
| 3525 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3526 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3527 | obj.TransformMesh(Object3D.mat); |
---|
| 3528 | + |
---|
3273 | 3529 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3530 | + if (full) |
---|
| 3531 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3532 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3533 | + |
---|
3276 | 3534 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3535 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3536 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3301 | 3559 | |
---|
3302 | 3560 | int size = obj.MemorySize(); |
---|
3303 | 3561 | |
---|
3304 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3562 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3563 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3305 | 3564 | } |
---|
3306 | 3565 | } |
---|
3307 | 3566 | catch (Exception e) |
---|
.. | .. |
---|
3338 | 3597 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3598 | |
---|
3340 | 3599 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3600 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3601 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3602 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3603 | |
---|
3345 | 3604 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3605 | } |
---|
.. | .. |
---|
3382 | 3641 | void GenNormals(boolean crease) |
---|
3383 | 3642 | { |
---|
3384 | 3643 | group.GenNormalsS(crease); |
---|
| 3644 | + |
---|
| 3645 | + refreshContents(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + void GenNormalsMESH() |
---|
| 3649 | + { |
---|
| 3650 | + group.GenNormalsMeshS(); |
---|
3385 | 3651 | |
---|
3386 | 3652 | refreshContents(); |
---|
3387 | 3653 | } |
---|
.. | .. |
---|
3554 | 3820 | |
---|
3555 | 3821 | void ParseVertices() |
---|
3556 | 3822 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 3823 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3824 | + Grafreed.epsequal = true; |
---|
3559 | 3825 | |
---|
3560 | 3826 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 3827 | { |
---|
.. | .. |
---|
3580 | 3846 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 3847 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 3848 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 3849 | + g.add(Grafreed.clipboard); |
---|
3584 | 3850 | |
---|
3585 | 3851 | buffer.add(g); |
---|
3586 | 3852 | } |
---|
.. | .. |
---|
3595 | 3861 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 3862 | } |
---|
3597 | 3863 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 3864 | + Grafreed.epsequal = epsequal; |
---|
3599 | 3865 | |
---|
3600 | 3866 | refreshContents(); |
---|
3601 | 3867 | } |
---|
.. | .. |
---|
3613 | 3879 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 3880 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 3881 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3882 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3883 | + |
---|
| 3884 | + try |
---|
| 3885 | + { |
---|
| 3886 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3887 | + } |
---|
| 3888 | + catch (Exception e) |
---|
| 3889 | + { |
---|
| 3890 | + System.err.println("FAIL: " + node); |
---|
| 3891 | + } |
---|
3617 | 3892 | |
---|
3618 | 3893 | double s = v.s; |
---|
3619 | 3894 | |
---|
.. | .. |
---|
3745 | 4020 | return; |
---|
3746 | 4021 | |
---|
3747 | 4022 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4023 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 4024 | |
---|
3750 | 4025 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 4026 | |
---|
.. | .. |
---|
3939 | 4214 | |
---|
3940 | 4215 | void ClipMesh() |
---|
3941 | 4216 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4217 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4218 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4219 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4220 | |
---|
3946 | 4221 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4222 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4225 | // { |
---|
3951 | 4226 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4227 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4228 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4229 | } |
---|
3955 | 4230 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4231 | System.out.println("DONE."); |
---|
.. | .. |
---|
3997 | 4272 | void MarkLeaves(boolean hide) |
---|
3998 | 4273 | { |
---|
3999 | 4274 | group.selection.MarkLeaves(hide); |
---|
| 4275 | + refreshContents(); |
---|
| 4276 | + } |
---|
| 4277 | + |
---|
| 4278 | + void RewindLeaves(boolean hide) |
---|
| 4279 | + { |
---|
| 4280 | + group.selection.RewindLeaves(hide); |
---|
| 4281 | + refreshContents(); |
---|
| 4282 | + } |
---|
| 4283 | + |
---|
| 4284 | + void RandomLeaves(boolean hide) |
---|
| 4285 | + { |
---|
| 4286 | + group.selection.RandomLeaves(hide); |
---|
4000 | 4287 | refreshContents(); |
---|
4001 | 4288 | } |
---|
4002 | 4289 | |
---|
.. | .. |
---|
4085 | 4372 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 4373 | |
---|
4087 | 4374 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 4375 | + if(elem != group || !newWindow) |
---|
4089 | 4376 | { |
---|
4090 | 4377 | // if (!(elem instanceof Composite)) |
---|
4091 | 4378 | // newWindow = false; |
---|
.. | .. |
---|
4175 | 4462 | //case 702: // Event.LIST_DESELECT |
---|
4176 | 4463 | group.deselectAll(); |
---|
4177 | 4464 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4178 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4179 | 4465 | if (tps != null) |
---|
4180 | 4466 | { |
---|
4181 | 4467 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4184 | 4470 | |
---|
4185 | 4471 | //if (child.parent != null) |
---|
4186 | 4472 | //child.parent.addSelectee(child); |
---|
| 4473 | + objEditor.SetMaterial(child); |
---|
4187 | 4474 | group.addSelectee(child); |
---|
4188 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4189 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4190 | | - System.err.println("info : " + child.GetPath()); |
---|
4191 | 4475 | } |
---|
4192 | 4476 | } |
---|
4193 | 4477 | // else |
---|
.. | .. |
---|
4197 | 4481 | // System.err.println("info : " + group.GetPath()); |
---|
4198 | 4482 | // } |
---|
4199 | 4483 | |
---|
4200 | | - objEditor.SetText(); // jan 2014 |
---|
4201 | | - |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4484 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 4485 | CameraPane.flash = true; |
---|
4204 | 4486 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4487 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 4488 | // a camera |
---|
4207 | 4489 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4490 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4491 | + { |
---|
| 4492 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4493 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4494 | + } |
---|
4210 | 4495 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 4496 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 4497 | } |
---|
.. | .. |
---|
4219 | 4504 | |
---|
4220 | 4505 | freezemodel = false; |
---|
4221 | 4506 | } |
---|
| 4507 | + |
---|
| 4508 | + void refreshContents(boolean cp) |
---|
| 4509 | + { |
---|
| 4510 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4511 | + { |
---|
| 4512 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4513 | + |
---|
| 4514 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4515 | + { |
---|
| 4516 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4517 | + |
---|
| 4518 | + objEditor.AddInfo(child, this, true); |
---|
| 4519 | + System.err.println("info : " + child.GetPath()); |
---|
| 4520 | + } |
---|
| 4521 | + |
---|
| 4522 | + objEditor.SetText(); // jan 2014 |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
| 4525 | + super.refreshContents(cp); |
---|
| 4526 | + } |
---|
4222 | 4527 | |
---|
4223 | 4528 | void linkSomething(Object3D thing) |
---|
4224 | 4529 | { |
---|
.. | .. |
---|
4290 | 4595 | { |
---|
4291 | 4596 | if (group.selection.isEmpty()) |
---|
4292 | 4597 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4598 | + |
---|
| 4599 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4600 | Composite tGroup = null; |
---|
4295 | 4601 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4602 | { |
---|
4297 | 4603 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4604 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4605 | } |
---|
4300 | 4606 | |
---|
4301 | 4607 | if (cut) |
---|
4302 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
| 4610 | + Save(); |
---|
4303 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
4304 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4305 | 4613 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4335 | 4643 | //System.out.println("cut " + child); |
---|
4336 | 4644 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4645 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4646 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4647 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4648 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4649 | + Grafreed.clipboard = tmp; |
---|
4342 | 4650 | } |
---|
4343 | 4651 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4652 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4653 | tGroup.add/*Child*/(child); |
---|
4346 | 4654 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4655 | + Grafreed.clipboard = child; |
---|
4348 | 4656 | } |
---|
4349 | 4657 | |
---|
4350 | 4658 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4684 | //System.out.println("cut " + elem); |
---|
4377 | 4685 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4686 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4687 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4688 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4689 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4690 | + Grafreed.clipboard = tmp; |
---|
4383 | 4691 | } |
---|
4384 | 4692 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4693 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4694 | tGroup.add/*Child*/(child); |
---|
4387 | 4695 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4696 | + Grafreed.clipboard = child; |
---|
4389 | 4697 | } |
---|
4390 | 4698 | |
---|
4391 | 4699 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4700 | + |
---|
| 4701 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4702 | + Grafreed.clipboard = tGroup; |
---|
| 4703 | + |
---|
4394 | 4704 | if (cut) |
---|
4395 | 4705 | { |
---|
4396 | 4706 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4714 | // return; |
---|
4405 | 4715 | boolean first = true; |
---|
4406 | 4716 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4717 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4718 | { |
---|
4409 | 4719 | Composite temp; |
---|
4410 | 4720 | |
---|
.. | .. |
---|
4415 | 4725 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4726 | */ |
---|
4417 | 4727 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4728 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4729 | { |
---|
4420 | 4730 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4731 | |
---|
.. | .. |
---|
4449 | 4759 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4760 | //temp.addChild(cb); |
---|
4451 | 4761 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4452 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4453 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4454 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4455 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4456 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4762 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4763 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4764 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4765 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4766 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4767 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4768 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4769 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4770 | } |
---|
4461 | 4771 | |
---|
4462 | 4772 | ResetModel(); |
---|
.. | .. |
---|
4505 | 4815 | { |
---|
4506 | 4816 | boolean first = true; |
---|
4507 | 4817 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4818 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4819 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4820 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 4821 | Object3D copy; |
---|
4512 | 4822 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 4823 | { |
---|
.. | .. |
---|
4517 | 4827 | } |
---|
4518 | 4828 | } else |
---|
4519 | 4829 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4830 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 4831 | } |
---|
4522 | 4832 | } |
---|
4523 | 4833 | } |
---|
.. | .. |
---|
4922 | 5232 | } |
---|
4923 | 5233 | */ |
---|
4924 | 5234 | |
---|
4925 | | - void ImportGFD() |
---|
4926 | | - { |
---|
4927 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4928 | | - browser.show(); |
---|
4929 | | - String filename = browser.getFile(); |
---|
4930 | | - if (filename != null && filename.length() > 0) |
---|
4931 | | - { |
---|
4932 | | - String fullname = browser.getDirectory() + filename; |
---|
4933 | | - |
---|
4934 | | - //Object3D readobj = |
---|
4935 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4936 | | - //makeSomething(readobj); |
---|
4937 | | - } |
---|
4938 | | - } |
---|
4939 | | - |
---|
4940 | 5235 | /* |
---|
4941 | 5236 | public void Callback(Object obj) |
---|
4942 | 5237 | { |
---|
.. | .. |
---|
4960 | 5255 | } |
---|
4961 | 5256 | */ |
---|
4962 | 5257 | |
---|
4963 | | - void ImportVRMLX3D() |
---|
4964 | | - { |
---|
4965 | | - if (GrafreeD.standAlone) |
---|
4966 | | - { |
---|
4967 | | - /**/ |
---|
4968 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4969 | | - browser.show(); |
---|
4970 | | - String filename = browser.getFile(); |
---|
4971 | | - if (filename != null && filename.length() > 0) |
---|
4972 | | - { |
---|
4973 | | - String fullname = browser.getDirectory() + filename; |
---|
4974 | | - LoadVRMLX3D(fullname); |
---|
4975 | | - } |
---|
4976 | | - /**/ |
---|
4977 | | - } |
---|
4978 | | - } |
---|
4979 | | - |
---|
4980 | 5258 | String GetFile(String dialogName) |
---|
4981 | 5259 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5260 | + if (Grafreed.standAlone) |
---|
4983 | 5261 | { |
---|
4984 | 5262 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5263 | browser.show(); |
---|
.. | .. |
---|
5047 | 5325 | cButton clearpanelButton; |
---|
5048 | 5326 | cButton unselectButton; |
---|
5049 | 5327 | |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
| 5331 | + cButton undoButton; |
---|
| 5332 | + cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
5050 | 5334 | cButton oneStepButton; |
---|
5051 | 5335 | |
---|
5052 | 5336 | cButton screenfitButton; |
---|
.. | .. |
---|
5060 | 5344 | |
---|
5061 | 5345 | cButton setsupportButton; |
---|
5062 | 5346 | |
---|
5063 | | - cButton twoButton; |
---|
5064 | | - cButton sixButton; |
---|
5065 | | - cButton threeButton; |
---|
5066 | | - cButton sevenButton; |
---|
5067 | | - cButton fourButton; // full panel |
---|
5068 | | - cButton oneButton; // full XYZ |
---|
5069 | | - //cButton currentLayout; |
---|
5070 | | - |
---|
5071 | 5347 | // |
---|
5072 | 5348 | //Composite |
---|
5073 | 5349 | Object3D // to do !! |
---|
.. | .. |
---|
5079 | 5355 | private MenuItem lookFromItem; |
---|
5080 | 5356 | private MenuItem switchItem; |
---|
5081 | 5357 | private MenuItem cutItem; |
---|
| 5358 | + private MenuItem undoItem; |
---|
| 5359 | + private MenuItem redoItem; |
---|
5082 | 5360 | private MenuItem duplicateItem; |
---|
5083 | 5361 | private MenuItem cloneItem; |
---|
5084 | 5362 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5092 | 5370 | private MenuItem linkverticesItem; |
---|
5093 | 5371 | private MenuItem relinkverticesItem; |
---|
5094 | 5372 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5373 | + private MenuItem resetAllItem; |
---|
5096 | 5374 | private MenuItem stepAllItem; |
---|
5097 | 5375 | private MenuItem revertMeshItem; |
---|
5098 | 5376 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5142 | 5420 | private MenuItem showleavesItem; |
---|
5143 | 5421 | private MenuItem markleavesItem; |
---|
5144 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
5145 | 5427 | |
---|
5146 | 5428 | private MenuItem flipVItem; |
---|
5147 | 5429 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5153 | 5435 | private MenuItem panoTexturesItem; |
---|
5154 | 5436 | |
---|
5155 | 5437 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5438 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5439 | private MenuItem resetTransformItem; |
---|
| 5440 | + private MenuItem transformGeometryItem; |
---|
| 5441 | + private MenuItem transformChildrenItem; |
---|
5158 | 5442 | private MenuItem hideItem; |
---|
5159 | 5443 | private MenuItem grabItem; |
---|
5160 | 5444 | private MenuItem backItem; |
---|
.. | .. |
---|
5223 | 5507 | private MenuItem doubleItem; |
---|
5224 | 5508 | private MenuItem tripleItem; |
---|
5225 | 5509 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 5510 | private MenuItem computeAOItem; |
---|
5232 | 5511 | private MenuItem recompileItem; |
---|
5233 | 5512 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 5516 | private MenuItem analyzeItem; |
---|
5238 | 5517 | private MenuItem dumpItem; |
---|
5239 | 5518 | //boolean freezemodel = false; |
---|
| 5519 | + |
---|
| 5520 | + Menu cameraMenu; |
---|
| 5521 | + MenuItem editCameraItem; |
---|
| 5522 | + MenuItem revertCameraItem; |
---|
5240 | 5523 | } |
---|