.. | .. |
---|
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); |
---|
| 165 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 166 | + cloneItem.addActionListener(this); |
---|
| 167 | + if (Globals.ADVANCED) |
---|
| 168 | + { |
---|
| 169 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 170 | + cloneSupportItem.addActionListener(this); |
---|
| 171 | + } |
---|
| 172 | + menu.add("-"); |
---|
174 | 173 | cutItem = menu.add(new MenuItem("Cut")); |
---|
175 | 174 | cutItem.addActionListener(this); |
---|
176 | 175 | copyItem = menu.add(new MenuItem("Copy")); |
---|
.. | .. |
---|
178 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
179 | 178 | pasteItem.addActionListener(this); |
---|
180 | 179 | menu.add("-"); |
---|
181 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
182 | | - cloneItem.addActionListener(this); |
---|
183 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
184 | | - cloneSupportItem.addActionListener(this); |
---|
| 180 | + |
---|
185 | 181 | menu.add("-"); |
---|
186 | 182 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
187 | 183 | pasteIntoItem.addActionListener(this); |
---|
.. | .. |
---|
201 | 197 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
202 | 198 | clearAllItem.addActionListener(this); |
---|
203 | 199 | } |
---|
| 200 | + |
---|
| 201 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 202 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 203 | + //zBufferItem.addActionListener(this); |
---|
| 204 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 205 | + //normalLensItem.addActionListener(this); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 207 | + revertCameraItem.addActionListener(this); |
---|
| 208 | + |
---|
| 209 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 210 | + toggleFullScreenItem.addItemListener(this); |
---|
| 211 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 212 | + cameraMenu.add("-"); |
---|
| 213 | + |
---|
| 214 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 215 | + toggleTextureItem.addItemListener(this); |
---|
| 216 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 217 | + |
---|
| 218 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 219 | + toggleSwitchItem.addItemListener(this); |
---|
| 220 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 221 | + |
---|
| 222 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + toggleHandleItem.addItemListener(this); |
---|
| 224 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 225 | + |
---|
| 226 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 227 | + togglePaintItem.addItemListener(this); |
---|
| 228 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 229 | + |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
| 232 | + cameraMenu.add("-"); |
---|
| 233 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 234 | + toggleLiveItem.addItemListener(this); |
---|
| 235 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
204 | 236 | |
---|
| 237 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 238 | + stepItem.addActionListener(this); |
---|
| 239 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 240 | + // toggleDLItem.addItemListener(this); |
---|
| 241 | + // toggleDLItem.setState(false); |
---|
| 242 | + |
---|
| 243 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 244 | + toggleRenderItem.addItemListener(this); |
---|
| 245 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 246 | + |
---|
| 247 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 248 | + toggleDebugItem.addItemListener(this); |
---|
| 249 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
| 275 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 276 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 277 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 278 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 279 | + oe.cameraMenu.add("-"); |
---|
| 280 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 281 | + openWindowItem.addActionListener(this); |
---|
| 282 | + editLeafItem.addActionListener(this); |
---|
| 283 | + lookAtItem.addActionListener(this); |
---|
| 284 | + //lookFromItem.addActinoListener(this); |
---|
| 285 | + //switchItem.addActionListener(this); |
---|
| 286 | + } |
---|
| 287 | + |
---|
205 | 288 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
206 | 289 | if (Globals.ADVANCED) |
---|
207 | 290 | { |
---|
208 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
209 | | - resetMeshItem.addActionListener(this); |
---|
210 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
211 | | - stepAllItem.addActionListener(this); |
---|
212 | 291 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
213 | 292 | revertMeshItem.addActionListener(this); |
---|
214 | 293 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
272 | 351 | |
---|
273 | 352 | if (Globals.ADVANCED) |
---|
274 | 353 | { |
---|
| 354 | + menu.add("-"); |
---|
275 | 355 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
276 | 356 | physicsItem.addActionListener(this); |
---|
277 | 357 | frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
.. | .. |
---|
297 | 377 | shadowZItem.addActionListener(this); |
---|
298 | 378 | if (Globals.ADVANCED) |
---|
299 | 379 | { |
---|
| 380 | + menu.add("-"); |
---|
300 | 381 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
301 | 382 | linkerItem.addActionListener(this); |
---|
302 | 383 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
.. | .. |
---|
305 | 386 | templateItem.addActionListener(this); |
---|
306 | 387 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
307 | 388 | pointflowItem.addActionListener(this); |
---|
308 | | - menu.add("-"); |
---|
309 | 389 | } |
---|
| 390 | + menu.add("-"); |
---|
310 | 391 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
311 | 392 | resetTransformItem.addActionListener(this); |
---|
312 | 393 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
313 | 394 | resetCentroidItem.addActionListener(this); |
---|
314 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
315 | | - transformgeometryItem.addActionListener(this); |
---|
| 395 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 396 | + resetCentroidXZItem.addActionListener(this); |
---|
| 397 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 398 | + transformGeometryItem.addActionListener(this); |
---|
| 399 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 400 | + transformChildrenItem.addActionListener(this); |
---|
316 | 401 | |
---|
317 | 402 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
318 | 403 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
361 | 446 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
362 | 447 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
363 | 448 | clearMaterialsItem.addActionListener(this); |
---|
| 449 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 450 | + resetAllItem.addActionListener(this); |
---|
| 451 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 452 | + stepAllItem.addActionListener(this); |
---|
364 | 453 | menu.add("-"); |
---|
365 | 454 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
366 | 455 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
381 | 470 | markleavesItem.addActionListener(this); |
---|
382 | 471 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
383 | 472 | unmarkleavesItem.addActionListener(this); |
---|
| 473 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 474 | + rewindleavesItem.addActionListener(this); |
---|
| 475 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 476 | + unrewindleavesItem.addActionListener(this); |
---|
| 477 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 478 | + randomleavesItem.addActionListener(this); |
---|
| 479 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 480 | + unrandomleavesItem.addActionListener(this); |
---|
384 | 481 | menu.add("-"); |
---|
385 | 482 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
386 | 483 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
415 | 512 | sortbysizeItem.addActionListener(this); |
---|
416 | 513 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
417 | 514 | sortbynameItem.addActionListener(this); |
---|
| 515 | + menu.add("-"); |
---|
| 516 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 517 | + shareGeometriesItem.addActionListener(this); |
---|
| 518 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 519 | + mergeGeometriesItem.addActionListener(this); |
---|
418 | 520 | if (Globals.ADVANCED) |
---|
419 | 521 | { |
---|
420 | | - menu.add("-"); |
---|
| 522 | + // Pretty much the same as duplicate and clone. |
---|
421 | 523 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
422 | 524 | extractGeometriesItem.addActionListener(this); |
---|
423 | 525 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
424 | 526 | cloneGeometriesItem.addActionListener(this); |
---|
425 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
426 | | - shareGeometriesItem.addActionListener(this); |
---|
427 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
428 | | - mergeGeometriesItem.addActionListener(this); |
---|
429 | 527 | } |
---|
430 | 528 | |
---|
431 | 529 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
432 | 530 | buildCreateMenu(menu); |
---|
433 | 531 | |
---|
434 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
435 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
436 | | - importGFDItem.addActionListener(this); |
---|
437 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
438 | | - importVRMLX3DItem.addActionListener(this); |
---|
439 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
440 | | - importOBJItem.addActionListener(this); |
---|
441 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
442 | | - import3DSItem.addActionListener(this); |
---|
443 | | - |
---|
444 | 532 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
445 | 533 | buildToolsMenu(menu); |
---|
446 | 534 | } |
---|
447 | 535 | |
---|
448 | 536 | void SetupUI2(ObjEditor oe) |
---|
449 | 537 | { |
---|
| 538 | + // June 2019 |
---|
| 539 | + if (oe == null) |
---|
| 540 | + { |
---|
| 541 | + //super.SetupUI2(this); |
---|
| 542 | + //return; |
---|
| 543 | + } |
---|
| 544 | + |
---|
| 545 | + if (copy != group) |
---|
| 546 | + { |
---|
| 547 | + //super.SetupUI2(this); |
---|
| 548 | + } |
---|
| 549 | + |
---|
450 | 550 | //new Exception().printStackTrace(); |
---|
451 | 551 | |
---|
452 | 552 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
477 | 577 | */ |
---|
478 | 578 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
479 | 579 | |
---|
| 580 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 581 | + //minButton.setToolTipText("Minimize window"); |
---|
| 582 | + //minButton.addActionListener(this); |
---|
| 583 | + |
---|
| 584 | + oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 585 | + maxButton.setToolTipText("Maximize window"); |
---|
| 586 | + maxButton.addActionListener(this); |
---|
| 587 | + |
---|
| 588 | + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 589 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 590 | + fullButton.addActionListener(this); |
---|
| 591 | + |
---|
| 592 | + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 593 | + undoButton.setToolTipText("Undo changes"); |
---|
| 594 | + undoButton.addActionListener(this); |
---|
| 595 | + |
---|
| 596 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + redoButton.setToolTipText("Redo changes"); |
---|
| 598 | + redoButton.addActionListener(this); |
---|
| 599 | + |
---|
| 600 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 601 | + saveButton.setToolTipText("Save changes"); |
---|
| 602 | + saveButton.addActionListener(this); |
---|
| 603 | + |
---|
480 | 604 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
481 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 605 | + liveCB.setToolTipText("Enable animation"); |
---|
482 | 606 | liveCB.addItemListener(this); |
---|
483 | 607 | |
---|
484 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 609 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
486 | 610 | oneStepButton.addActionListener(this); |
---|
487 | 611 | |
---|
.. | .. |
---|
489 | 613 | fastCB.setToolTipText("Fast mode"); |
---|
490 | 614 | fastCB.addItemListener(this); |
---|
491 | 615 | |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 616 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
493 | 617 | trackCB.setToolTipText("Enable tracking"); |
---|
494 | 618 | trackCB.addItemListener(this); |
---|
495 | 619 | |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
497 | 621 | screenfitButton.setToolTipText("Screen fit"); |
---|
498 | 622 | screenfitButton.addActionListener(this); |
---|
499 | 623 | |
---|
.. | .. |
---|
502 | 626 | |
---|
503 | 627 | if (Globals.ADVANCED) |
---|
504 | 628 | { |
---|
505 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
506 | 630 | snapobjectButton.addActionListener(this); |
---|
507 | 631 | snapobjectButton.setToolTipText("Snap Object"); |
---|
508 | 632 | } |
---|
509 | 633 | |
---|
510 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
511 | 635 | flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | 636 | flashSelectionButton.addActionListener(this); |
---|
513 | 637 | |
---|
514 | 638 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
515 | 639 | |
---|
516 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 640 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
517 | 641 | twoButton.setToolTipText("Show center view only"); |
---|
518 | 642 | twoButton.addActionListener(this); |
---|
519 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 643 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 644 | fourButton.addActionListener(this); |
---|
521 | 645 | fourButton.setToolTipText("Show left panel only"); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 646 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
523 | 647 | sixButton.setToolTipText("2-column layout left"); |
---|
524 | 648 | sixButton.addActionListener(this); |
---|
525 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | 650 | threeButton.setToolTipText("2-column layout right"); |
---|
527 | 651 | threeButton.addActionListener(this); |
---|
528 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
529 | 653 | sevenButton.setToolTipText("3-column layout"); |
---|
530 | 654 | sevenButton.addActionListener(this); |
---|
531 | 655 | // |
---|
532 | 656 | |
---|
533 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 658 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
535 | 659 | rootButton.addActionListener(this); |
---|
536 | 660 | |
---|
537 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 662 | closeButton.setToolTipText("Close tab"); |
---|
539 | 663 | closeButton.addActionListener(this); |
---|
540 | 664 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
542 | 666 | |
---|
543 | 667 | cGridBag commandsPanel = new cGridBag(); |
---|
544 | 668 | |
---|
545 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
546 | 670 | editButton.setToolTipText("Edit selection"); |
---|
547 | 671 | editButton.addActionListener(this); |
---|
548 | 672 | |
---|
549 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 673 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
550 | 674 | uneditButton.setToolTipText("Unedit selection"); |
---|
551 | 675 | uneditButton.addActionListener(this); |
---|
552 | 676 | |
---|
.. | .. |
---|
554 | 678 | allParamsButton.setToolTipText("Edit all params"); |
---|
555 | 679 | allParamsButton.addActionListener(this); |
---|
556 | 680 | |
---|
557 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 681 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
558 | 682 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
559 | 683 | clearPanelButton.addActionListener(this); |
---|
560 | 684 | |
---|
561 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 685 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
562 | 686 | unselectButton.setToolTipText("Unselect"); |
---|
563 | 687 | unselectButton.addActionListener(this); |
---|
564 | 688 | |
---|
.. | .. |
---|
641 | 765 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
642 | 766 | zoomBoxCB.addItemListener(this); |
---|
643 | 767 | |
---|
644 | | - if (Globals.ADVANCED) |
---|
| 768 | + if (true) // Globals.ADVANCED) |
---|
645 | 769 | { |
---|
646 | 770 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
647 | 771 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
714 | 838 | buttonGroup.add(radioButton); |
---|
715 | 839 | radioButton.doClick(); |
---|
716 | 840 | } |
---|
| 841 | + |
---|
717 | 842 | void SetupViews(ObjEditor oe) |
---|
718 | 843 | { |
---|
| 844 | + theFrame = this; |
---|
| 845 | + |
---|
719 | 846 | oe.SetupViews(); |
---|
720 | 847 | |
---|
721 | 848 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
778 | 905 | } else if(e.getSource() == liveCB) |
---|
779 | 906 | { |
---|
780 | 907 | cameraView.ToggleLive(); |
---|
| 908 | + refreshContents(false); |
---|
781 | 909 | } |
---|
782 | 910 | else if(e.getSource() == supportCB) |
---|
783 | 911 | { |
---|
.. | .. |
---|
930 | 1058 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
931 | 1059 | // return; |
---|
932 | 1060 | // } |
---|
933 | | - if (string.charAt(0) == '/') |
---|
| 1061 | + |
---|
| 1062 | + // File path for Mac and Windows |
---|
| 1063 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
934 | 1064 | { |
---|
935 | 1065 | // file(s) |
---|
936 | 1066 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
957 | 1087 | |
---|
958 | 1088 | flashIt = false; |
---|
959 | 1089 | CameraPane pane = (CameraPane) target; |
---|
960 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1090 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
961 | 1091 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
962 | 1092 | |
---|
963 | 1093 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1164 | 1294 | parseverticesItem.addActionListener(this); |
---|
1165 | 1295 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1166 | 1296 | textureFieldItem.addActionListener(this); |
---|
1167 | | - alignItem = menu.add(new MenuItem("Align Object")); |
---|
| 1297 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1168 | 1298 | alignItem.addActionListener(this); |
---|
1169 | 1299 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1170 | 1300 | reduceMorphItem.addActionListener(this); |
---|
1171 | 1301 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1172 | 1302 | reduce34MorphItem.addActionListener(this); |
---|
1173 | | - |
---|
| 1303 | + menu.add("-"); |
---|
1174 | 1304 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1175 | 1305 | computeAOItem.addActionListener(this); |
---|
1176 | 1306 | |
---|
.. | .. |
---|
1183 | 1313 | memoryItem.addActionListener(this); |
---|
1184 | 1314 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1185 | 1315 | analyzeItem.addActionListener(this); |
---|
1186 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1316 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1187 | 1317 | dumpItem.addActionListener(this); |
---|
1188 | 1318 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1189 | 1319 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1530 | 1660 | |
---|
1531 | 1661 | void Overwrite(int mask) |
---|
1532 | 1662 | { |
---|
1533 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1663 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1534 | 1664 | { |
---|
1535 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1665 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1536 | 1666 | |
---|
1537 | 1667 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1538 | 1668 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1837 | 1967 | csg.addChild(child); |
---|
1838 | 1968 | child.addChild(csg); |
---|
1839 | 1969 | } else |
---|
1840 | | - |
---|
1841 | | - if (source == importGFDItem) |
---|
1842 | | - { |
---|
1843 | | - ImportGFD(); |
---|
1844 | | - } else |
---|
1845 | | - if (source == importVRMLX3DItem) |
---|
1846 | | - { |
---|
1847 | | - ImportVRMLX3D(); |
---|
1848 | | - } else |
---|
1849 | | - if (source == import3DSItem) |
---|
1850 | | - { |
---|
1851 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1852 | | - } else |
---|
1853 | | - if (source == importOBJItem) |
---|
1854 | | - { |
---|
1855 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1856 | | - } else |
---|
1857 | 1970 | if (source == computeAOItem) |
---|
1858 | 1971 | { |
---|
1859 | 1972 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1872 | 1985 | if (source == invariantsItem) |
---|
1873 | 1986 | { |
---|
1874 | 1987 | System.out.println("Invariants:"); |
---|
1875 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1988 | + Grafreed.grafreeD.universe.invariants(); |
---|
1876 | 1989 | } else |
---|
1877 | 1990 | if (source == memoryItem) |
---|
1878 | 1991 | { |
---|
.. | .. |
---|
1890 | 2003 | if (source == dumpItem) |
---|
1891 | 2004 | { |
---|
1892 | 2005 | DumpObject(); |
---|
| 2006 | + } else |
---|
| 2007 | + if (source == minButton) |
---|
| 2008 | + { |
---|
| 2009 | + Minimize(); |
---|
| 2010 | + } else |
---|
| 2011 | + if (source == maxButton) |
---|
| 2012 | + { |
---|
| 2013 | + Maximize(); |
---|
| 2014 | + } else |
---|
| 2015 | + if (source == fullButton) |
---|
| 2016 | + { |
---|
| 2017 | + ToggleFullScreen(); |
---|
| 2018 | + } else |
---|
| 2019 | + if (source == undoButton) |
---|
| 2020 | + { |
---|
| 2021 | + Undo(); |
---|
| 2022 | + } else |
---|
| 2023 | + if (source == redoButton) |
---|
| 2024 | + { |
---|
| 2025 | + Redo(); |
---|
| 2026 | + } else |
---|
| 2027 | + if (source == saveButton) |
---|
| 2028 | + { |
---|
| 2029 | + Save(); |
---|
1893 | 2030 | } else |
---|
1894 | 2031 | if (source == oneStepButton) |
---|
1895 | 2032 | { |
---|
.. | .. |
---|
1945 | 2082 | { |
---|
1946 | 2083 | loadClipboard(true); |
---|
1947 | 2084 | } else |
---|
| 2085 | + if (source == undoItem) |
---|
| 2086 | + { |
---|
| 2087 | + Undo(); |
---|
| 2088 | + } else |
---|
| 2089 | + if (source == redoItem) |
---|
| 2090 | + { |
---|
| 2091 | + Redo(); |
---|
| 2092 | + } else |
---|
1948 | 2093 | if (source == duplicateItem) |
---|
1949 | 2094 | { |
---|
1950 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2095 | + Object3D keep = Grafreed.clipboard; |
---|
1951 | 2096 | loadClipboard(false); |
---|
1952 | 2097 | paste(false); |
---|
1953 | | - GrafreeD.clipboard = keep; |
---|
| 2098 | + Grafreed.clipboard = keep; |
---|
1954 | 2099 | } else |
---|
1955 | 2100 | if (source == cloneItem) |
---|
1956 | 2101 | { |
---|
.. | .. |
---|
2170 | 2315 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2171 | 2316 | // refreshContents(); |
---|
2172 | 2317 | // } |
---|
2173 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2318 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2174 | 2319 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2320 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2321 | |
---|
2177 | 2322 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2323 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2222 | 2367 | } else |
---|
2223 | 2368 | if (source == setMasterItem) |
---|
2224 | 2369 | { |
---|
2225 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2370 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2226 | 2371 | { |
---|
2227 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2372 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2228 | 2373 | |
---|
2229 | 2374 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2230 | 2375 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2237 | 2382 | { |
---|
2238 | 2383 | if (group.selection.size() == 1) |
---|
2239 | 2384 | { |
---|
2240 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2385 | + if (Grafreed.clipboard.size() == 1) |
---|
2241 | 2386 | { |
---|
2242 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2387 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2243 | 2388 | |
---|
2244 | 2389 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2245 | 2390 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2256 | 2401 | { |
---|
2257 | 2402 | RevertMeshes(); |
---|
2258 | 2403 | } else |
---|
2259 | | - if (source == resetMeshItem) |
---|
| 2404 | + if (source == resetAllItem) |
---|
2260 | 2405 | { |
---|
2261 | 2406 | ResetAll(); |
---|
2262 | 2407 | } else |
---|
.. | .. |
---|
2444 | 2589 | } else |
---|
2445 | 2590 | if (source == genNormalsMESHItem) |
---|
2446 | 2591 | { |
---|
2447 | | - GenNormals(true); // TODO |
---|
| 2592 | + GenNormalsMESH(); |
---|
2448 | 2593 | } else |
---|
2449 | 2594 | if (source == genNormalsORGANItem) |
---|
2450 | 2595 | { |
---|
.. | .. |
---|
2509 | 2654 | if (source == unmarkleavesItem) |
---|
2510 | 2655 | { |
---|
2511 | 2656 | MarkLeaves(false); |
---|
| 2657 | + } else |
---|
| 2658 | + if (source == rewindleavesItem) |
---|
| 2659 | + { |
---|
| 2660 | + RewindLeaves(true); |
---|
| 2661 | + } else |
---|
| 2662 | + if (source == unrewindleavesItem) |
---|
| 2663 | + { |
---|
| 2664 | + RewindLeaves(false); |
---|
| 2665 | + } else |
---|
| 2666 | + if (source == randomleavesItem) |
---|
| 2667 | + { |
---|
| 2668 | + RandomLeaves(true); |
---|
| 2669 | + } else |
---|
| 2670 | + if (source == unrandomleavesItem) |
---|
| 2671 | + { |
---|
| 2672 | + RandomLeaves(false); |
---|
2512 | 2673 | } else |
---|
2513 | 2674 | if (source == flipVItem) |
---|
2514 | 2675 | { |
---|
.. | .. |
---|
2594 | 2755 | { |
---|
2595 | 2756 | SmoothMesh(); |
---|
2596 | 2757 | } else |
---|
2597 | | - if (source == transformgeometryItem) |
---|
| 2758 | + if (source == transformGeometryItem) |
---|
2598 | 2759 | { |
---|
2599 | 2760 | TransformGeometry(); |
---|
| 2761 | + } else |
---|
| 2762 | + if (source == transformChildrenItem) |
---|
| 2763 | + { |
---|
| 2764 | + TransformChildren(); |
---|
2600 | 2765 | } else |
---|
2601 | 2766 | if (source == resetTransformItem) |
---|
2602 | 2767 | { |
---|
.. | .. |
---|
2604 | 2769 | } else |
---|
2605 | 2770 | if (source == resetCentroidItem) |
---|
2606 | 2771 | { |
---|
2607 | | - ResetCentroid(); |
---|
| 2772 | + ResetCentroid(true); |
---|
| 2773 | + } else |
---|
| 2774 | + if (source == resetCentroidXZItem) |
---|
| 2775 | + { |
---|
| 2776 | + ResetCentroid(false); |
---|
2608 | 2777 | } else |
---|
2609 | 2778 | if (source == resetParentItem) |
---|
2610 | 2779 | { |
---|
.. | .. |
---|
2768 | 2937 | bigThree.ClearUI(); |
---|
2769 | 2938 | bigThree.add(centralPanel); |
---|
2770 | 2939 | bigThree.FlushUI(); |
---|
| 2940 | + |
---|
| 2941 | + cameraView.requestFocusInWindow(); |
---|
| 2942 | + |
---|
| 2943 | +// refreshContents(true); |
---|
| 2944 | +// |
---|
| 2945 | +// try |
---|
| 2946 | +// { |
---|
| 2947 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2948 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2949 | +// bot.mouseMove(100, 100); |
---|
| 2950 | +// bot.mousePress(mask); |
---|
| 2951 | +// bot.mouseRelease(mask); |
---|
| 2952 | +// } |
---|
| 2953 | +// catch (Exception e) |
---|
| 2954 | +// { |
---|
| 2955 | +// |
---|
| 2956 | +// } |
---|
| 2957 | + |
---|
2771 | 2958 | } else |
---|
2772 | 2959 | if (source == threeButton) |
---|
2773 | 2960 | { |
---|
.. | .. |
---|
2804 | 2991 | bigThree.add(centralPanel); |
---|
2805 | 2992 | bigThree.add(XYZPanel); |
---|
2806 | 2993 | bigThree.FlushUI(); |
---|
| 2994 | + |
---|
| 2995 | + cameraView.requestFocusInWindow(); |
---|
2807 | 2996 | } else |
---|
2808 | 2997 | if (source == fourButton) |
---|
2809 | 2998 | { |
---|
.. | .. |
---|
2839 | 3028 | bigThree.ClearUI(); |
---|
2840 | 3029 | bigThree.add(scenePanel); |
---|
2841 | 3030 | bigThree.FlushUI(); |
---|
| 3031 | + |
---|
| 3032 | + cameraView.requestFocusInWindow(); |
---|
2842 | 3033 | } else |
---|
2843 | 3034 | if (source == sixButton) |
---|
2844 | 3035 | { |
---|
.. | .. |
---|
2875 | 3066 | bigThree.add(scenePanel); |
---|
2876 | 3067 | bigThree.add(centralPanel); |
---|
2877 | 3068 | bigThree.FlushUI(); |
---|
| 3069 | + |
---|
| 3070 | + cameraView.requestFocusInWindow(); |
---|
2878 | 3071 | } else |
---|
2879 | 3072 | if (source == sevenButton) |
---|
2880 | 3073 | { |
---|
.. | .. |
---|
2912 | 3105 | bigThree.add(centralPanel); |
---|
2913 | 3106 | bigThree.add(XYZPanel); |
---|
2914 | 3107 | bigThree.FlushUI(); |
---|
| 3108 | + |
---|
| 3109 | + cameraView.requestFocusInWindow(); |
---|
2915 | 3110 | } else |
---|
2916 | 3111 | if (source == rootButton) |
---|
2917 | 3112 | { |
---|
.. | .. |
---|
2923 | 3118 | EditObject(obj); |
---|
2924 | 3119 | } |
---|
2925 | 3120 | |
---|
| 3121 | + cameraView.requestFocusInWindow(); |
---|
2926 | 3122 | refreshContents(true); |
---|
2927 | 3123 | } else |
---|
2928 | 3124 | if (source == closeButton) |
---|
.. | .. |
---|
2944 | 3140 | break; |
---|
2945 | 3141 | } |
---|
2946 | 3142 | } |
---|
| 3143 | + |
---|
| 3144 | + cameraView.requestFocusInWindow(); |
---|
2947 | 3145 | refreshContents(true); |
---|
2948 | 3146 | } else |
---|
2949 | 3147 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2960 | 3158 | child.CloseUI(); |
---|
2961 | 3159 | listUI.remove(child); |
---|
2962 | 3160 | |
---|
2963 | | - child.editWindow = null; // ??????????? |
---|
| 3161 | + //child.editWindow = null; // ??????????? |
---|
2964 | 3162 | } |
---|
2965 | 3163 | objEditor.ctrlPanel.FlushUI(); |
---|
2966 | 3164 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3046 | 3244 | frontView.object = group; |
---|
3047 | 3245 | sideView.object = group; |
---|
3048 | 3246 | } |
---|
3049 | | - group.editWindow = this; |
---|
| 3247 | + |
---|
| 3248 | +// fix "+" issue |
---|
| 3249 | + //group.editWindow = this; |
---|
| 3250 | + |
---|
3050 | 3251 | /* |
---|
3051 | 3252 | currentLayout = radio.layout; |
---|
3052 | 3253 | if (currentLayout == null) |
---|
.. | .. |
---|
3058 | 3259 | //group.parent = null; // ROOT |
---|
3059 | 3260 | //group.attributes = -1; |
---|
3060 | 3261 | ResetModel(); |
---|
| 3262 | + |
---|
| 3263 | + cameraView.requestFocusInWindow(); |
---|
3061 | 3264 | refreshContents(true); |
---|
3062 | | - } |
---|
| 3265 | + } else if (event.getSource() == editCameraItem) |
---|
| 3266 | + { |
---|
| 3267 | + cameraView.ProtectCamera(); |
---|
| 3268 | + cameraView.repaint(); |
---|
| 3269 | + return; |
---|
| 3270 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3271 | + { |
---|
| 3272 | + cameraView.RevertCamera(); |
---|
| 3273 | + cameraView.repaint(); |
---|
| 3274 | + return; |
---|
| 3275 | + // } else if (event.getSource() == textureButton) |
---|
| 3276 | + // { |
---|
| 3277 | + // return; // true; |
---|
| 3278 | + } |
---|
3063 | 3279 | else |
---|
3064 | 3280 | { |
---|
3065 | 3281 | //return super.action(event, arg); |
---|
.. | .. |
---|
3068 | 3284 | } |
---|
3069 | 3285 | |
---|
3070 | 3286 | boolean useclient = false; |
---|
3071 | | - cRadio radio; |
---|
3072 | 3287 | |
---|
3073 | 3288 | void ToggleRoot() |
---|
3074 | 3289 | { |
---|
.. | .. |
---|
3120 | 3335 | refreshContents(); |
---|
3121 | 3336 | } |
---|
3122 | 3337 | |
---|
| 3338 | + void TransformChildren() |
---|
| 3339 | + { |
---|
| 3340 | + Object3D obj; |
---|
| 3341 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3342 | + { |
---|
| 3343 | + obj = (Object3D)e.nextElement(); |
---|
| 3344 | + obj.KeepTextureMatrices(); |
---|
| 3345 | + obj.TransformChildren(); |
---|
| 3346 | + obj.RestoreTextureMatrices(); |
---|
| 3347 | + |
---|
| 3348 | +// if (obj.parent == null) |
---|
| 3349 | +// { |
---|
| 3350 | +// System.out.println("NULL PARENT!"); |
---|
| 3351 | +// new Exception().printStackTrace(); |
---|
| 3352 | +// } |
---|
| 3353 | +// else |
---|
| 3354 | +// TouchTransform(obj); |
---|
| 3355 | +// //obj.parent.Touch(); |
---|
| 3356 | + } |
---|
| 3357 | + |
---|
| 3358 | + refreshContents(); |
---|
| 3359 | + } |
---|
3123 | 3360 | |
---|
3124 | 3361 | void ResetTransform() |
---|
3125 | 3362 | { |
---|
.. | .. |
---|
3232 | 3469 | refreshContents(); |
---|
3233 | 3470 | } |
---|
3234 | 3471 | |
---|
3235 | | - void ResetCentroid() |
---|
| 3472 | + void ResetCentroid(boolean full) |
---|
3236 | 3473 | { |
---|
3237 | 3474 | Object3D obj; |
---|
3238 | 3475 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3247 | 3484 | LA.matIdentity(Object3D.mat); |
---|
3248 | 3485 | obj.getBounds(minima, maxima, false); |
---|
3249 | 3486 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3250 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3487 | + if (full) |
---|
| 3488 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3251 | 3489 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3252 | 3490 | obj.TransformMesh(Object3D.mat); |
---|
| 3491 | + |
---|
3253 | 3492 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3254 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3493 | + if (full) |
---|
| 3494 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3255 | 3495 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3496 | + |
---|
3256 | 3497 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3257 | 3498 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3258 | 3499 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3281 | 3522 | |
---|
3282 | 3523 | int size = obj.MemorySize(); |
---|
3283 | 3524 | |
---|
3284 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3525 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3526 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3285 | 3527 | } |
---|
3286 | 3528 | } |
---|
3287 | 3529 | catch (Exception e) |
---|
.. | .. |
---|
3318 | 3560 | obj = (Object3D)e.nextElement(); |
---|
3319 | 3561 | |
---|
3320 | 3562 | System.out.println("Object is: " + obj); |
---|
3321 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3563 | + Grafreed.AnalyzeObject(obj); |
---|
3322 | 3564 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3323 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3565 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3324 | 3566 | |
---|
3325 | 3567 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3326 | 3568 | } |
---|
.. | .. |
---|
3362 | 3604 | void GenNormals(boolean crease) |
---|
3363 | 3605 | { |
---|
3364 | 3606 | group.GenNormalsS(crease); |
---|
| 3607 | + |
---|
| 3608 | + refreshContents(); |
---|
| 3609 | + } |
---|
| 3610 | + |
---|
| 3611 | + void GenNormalsMESH() |
---|
| 3612 | + { |
---|
| 3613 | + group.GenNormalsMeshS(); |
---|
3365 | 3614 | |
---|
3366 | 3615 | refreshContents(); |
---|
3367 | 3616 | } |
---|
.. | .. |
---|
3534 | 3783 | |
---|
3535 | 3784 | void ParseVertices() |
---|
3536 | 3785 | { |
---|
3537 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3538 | | - GrafreeD.epsequal = true; |
---|
| 3786 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3787 | + Grafreed.epsequal = true; |
---|
3539 | 3788 | |
---|
3540 | 3789 | for (int i=0; i<group.selection.size(); i++) |
---|
3541 | 3790 | { |
---|
.. | .. |
---|
3560 | 3809 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3561 | 3810 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3562 | 3811 | |
---|
3563 | | - g.add(GrafreeD.clipboard); |
---|
| 3812 | + g.add(Grafreed.clipboard); |
---|
3564 | 3813 | |
---|
3565 | 3814 | buffer.add(g); |
---|
3566 | 3815 | } |
---|
.. | .. |
---|
3575 | 3824 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3576 | 3825 | } |
---|
3577 | 3826 | |
---|
3578 | | - GrafreeD.epsequal = epsequal; |
---|
| 3827 | + Grafreed.epsequal = epsequal; |
---|
3579 | 3828 | |
---|
3580 | 3829 | refreshContents(); |
---|
3581 | 3830 | } |
---|
.. | .. |
---|
3593 | 3842 | String pigment = Object3D.GetPigment(tex); |
---|
3594 | 3843 | //String bump = Object3D.GetBump(tex); |
---|
3595 | 3844 | |
---|
3596 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3845 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3846 | + |
---|
| 3847 | + try |
---|
| 3848 | + { |
---|
| 3849 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3850 | + } |
---|
| 3851 | + catch (Exception e) |
---|
| 3852 | + { |
---|
| 3853 | + System.err.println("FAIL: " + node); |
---|
| 3854 | + } |
---|
3597 | 3855 | |
---|
3598 | 3856 | double s = v.s; |
---|
3599 | 3857 | |
---|
.. | .. |
---|
3725 | 3983 | return; |
---|
3726 | 3984 | |
---|
3727 | 3985 | Object3D poses = group.selection.get(0); |
---|
3728 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3986 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3729 | 3987 | |
---|
3730 | 3988 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3731 | 3989 | |
---|
.. | .. |
---|
3919 | 4177 | |
---|
3920 | 4178 | void ClipMesh() |
---|
3921 | 4179 | { |
---|
3922 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4180 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3923 | 4181 | { |
---|
3924 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4182 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3925 | 4183 | |
---|
3926 | 4184 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3927 | 4185 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3930 | 4188 | // { |
---|
3931 | 4189 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3932 | 4190 | // } |
---|
3933 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4191 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3934 | 4192 | } |
---|
3935 | 4193 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3936 | 4194 | System.out.println("DONE."); |
---|
.. | .. |
---|
3977 | 4235 | void MarkLeaves(boolean hide) |
---|
3978 | 4236 | { |
---|
3979 | 4237 | group.selection.MarkLeaves(hide); |
---|
| 4238 | + refreshContents(); |
---|
| 4239 | + } |
---|
| 4240 | + |
---|
| 4241 | + void RewindLeaves(boolean hide) |
---|
| 4242 | + { |
---|
| 4243 | + group.selection.RewindLeaves(hide); |
---|
| 4244 | + refreshContents(); |
---|
| 4245 | + } |
---|
| 4246 | + |
---|
| 4247 | + void RandomLeaves(boolean hide) |
---|
| 4248 | + { |
---|
| 4249 | + group.selection.RandomLeaves(hide); |
---|
3980 | 4250 | refreshContents(); |
---|
3981 | 4251 | } |
---|
3982 | 4252 | |
---|
.. | .. |
---|
4065 | 4335 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4066 | 4336 | |
---|
4067 | 4337 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4068 | | - if(elem != group) |
---|
| 4338 | + if(elem != group || !newWindow) |
---|
4069 | 4339 | { |
---|
4070 | 4340 | // if (!(elem instanceof Composite)) |
---|
4071 | 4341 | // newWindow = false; |
---|
.. | .. |
---|
4155 | 4425 | //case 702: // Event.LIST_DESELECT |
---|
4156 | 4426 | group.deselectAll(); |
---|
4157 | 4427 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4158 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4159 | 4428 | if (tps != null) |
---|
4160 | 4429 | { |
---|
4161 | 4430 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4164 | 4433 | |
---|
4165 | 4434 | //if (child.parent != null) |
---|
4166 | 4435 | //child.parent.addSelectee(child); |
---|
| 4436 | + objEditor.SetMaterial(child); |
---|
4167 | 4437 | group.addSelectee(child); |
---|
4168 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4169 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4170 | | - System.err.println("info : " + child.GetPath()); |
---|
4171 | 4438 | } |
---|
4172 | 4439 | } |
---|
4173 | 4440 | // else |
---|
.. | .. |
---|
4177 | 4444 | // System.err.println("info : " + group.GetPath()); |
---|
4178 | 4445 | // } |
---|
4179 | 4446 | |
---|
4180 | | - objEditor.SetText(); // jan 2014 |
---|
4181 | | - |
---|
4182 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4447 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4183 | 4448 | CameraPane.flash = true; |
---|
4184 | 4449 | |
---|
4185 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4450 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4186 | 4451 | // a camera |
---|
4187 | 4452 | { |
---|
4188 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4189 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4453 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4454 | + { |
---|
| 4455 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4456 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4457 | + } |
---|
4190 | 4458 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4191 | 4459 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4192 | 4460 | } |
---|
.. | .. |
---|
4199 | 4467 | |
---|
4200 | 4468 | freezemodel = false; |
---|
4201 | 4469 | } |
---|
| 4470 | + |
---|
| 4471 | + void refreshContents(boolean cp) |
---|
| 4472 | + { |
---|
| 4473 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4474 | + { |
---|
| 4475 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4476 | + |
---|
| 4477 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4478 | + { |
---|
| 4479 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4480 | + |
---|
| 4481 | + objEditor.AddInfo(child, this, true); |
---|
| 4482 | + System.err.println("info : " + child.GetPath()); |
---|
| 4483 | + } |
---|
| 4484 | + |
---|
| 4485 | + objEditor.SetText(); // jan 2014 |
---|
| 4486 | + } |
---|
| 4487 | + |
---|
| 4488 | + super.refreshContents(cp); |
---|
| 4489 | + } |
---|
4202 | 4490 | |
---|
4203 | 4491 | void linkSomething(Object3D thing) |
---|
4204 | 4492 | { |
---|
.. | .. |
---|
4270 | 4558 | { |
---|
4271 | 4559 | if (group.selection.isEmpty()) |
---|
4272 | 4560 | return; |
---|
4273 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4561 | + |
---|
| 4562 | + Grafreed.clipboardIsTempGroup = false; |
---|
4274 | 4563 | Composite tGroup = null; |
---|
4275 | 4564 | if (group.selection.size() > 0) // 1) |
---|
4276 | 4565 | { |
---|
4277 | 4566 | tGroup = new cGroup(); |
---|
4278 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4567 | + Grafreed.clipboardIsTempGroup = true; |
---|
4279 | 4568 | } |
---|
4280 | 4569 | |
---|
4281 | 4570 | if (cut) |
---|
4282 | 4571 | { |
---|
| 4572 | + Save(); |
---|
4283 | 4573 | //int indices[] = jList.getSelectedIndices(); |
---|
4284 | 4574 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4285 | 4575 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4315 | 4605 | //System.out.println("cut " + child); |
---|
4316 | 4606 | //System.out.println("parent = " + child.parent); |
---|
4317 | 4607 | // tmp.addChild(child); |
---|
4318 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4608 | + if (Grafreed.clipboardIsTempGroup) |
---|
4319 | 4609 | tGroup.add/*Child*/(tmp); |
---|
4320 | 4610 | else |
---|
4321 | | - GrafreeD.clipboard = tmp; |
---|
| 4611 | + Grafreed.clipboard = tmp; |
---|
4322 | 4612 | } |
---|
4323 | 4613 | else |
---|
4324 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4614 | + if (Grafreed.clipboardIsTempGroup) |
---|
4325 | 4615 | tGroup.add/*Child*/(child); |
---|
4326 | 4616 | else |
---|
4327 | | - GrafreeD.clipboard = child; |
---|
| 4617 | + Grafreed.clipboard = child; |
---|
4328 | 4618 | } |
---|
4329 | 4619 | |
---|
4330 | 4620 | //ResetModel(); |
---|
.. | .. |
---|
4356 | 4646 | //System.out.println("cut " + elem); |
---|
4357 | 4647 | //System.out.println("parent = " + elem.parent); |
---|
4358 | 4648 | // tmp.addChild(elem); |
---|
4359 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4649 | + if (Grafreed.clipboardIsTempGroup) |
---|
4360 | 4650 | tGroup.add/*Child*/(tmp); |
---|
4361 | 4651 | else |
---|
4362 | | - GrafreeD.clipboard = tmp; |
---|
| 4652 | + Grafreed.clipboard = tmp; |
---|
4363 | 4653 | } |
---|
4364 | 4654 | else |
---|
4365 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4655 | + if (Grafreed.clipboardIsTempGroup) |
---|
4366 | 4656 | tGroup.add/*Child*/(child); |
---|
4367 | 4657 | else |
---|
4368 | | - GrafreeD.clipboard = child; |
---|
| 4658 | + Grafreed.clipboard = child; |
---|
4369 | 4659 | } |
---|
4370 | 4660 | |
---|
4371 | 4661 | } |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4373 | | - GrafreeD.clipboard = tGroup; |
---|
| 4662 | + |
---|
| 4663 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4664 | + Grafreed.clipboard = tGroup; |
---|
| 4665 | + |
---|
4374 | 4666 | if (cut) |
---|
4375 | 4667 | { |
---|
4376 | 4668 | ResetModel(); |
---|
.. | .. |
---|
4384 | 4676 | // return; |
---|
4385 | 4677 | boolean first = true; |
---|
4386 | 4678 | |
---|
4387 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4679 | + if (Grafreed.clipboardIsTempGroup) |
---|
4388 | 4680 | { |
---|
4389 | 4681 | Composite temp; |
---|
4390 | 4682 | |
---|
.. | .. |
---|
4395 | 4687 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4396 | 4688 | */ |
---|
4397 | 4689 | Object3D elem; |
---|
4398 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4690 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4399 | 4691 | { |
---|
4400 | 4692 | Object3D child = (Object3D)e.nextElement(); |
---|
4401 | 4693 | |
---|
.. | .. |
---|
4429 | 4721 | //Object3D cb = Applet3D.clipboard; |
---|
4430 | 4722 | //temp.addChild(cb); |
---|
4431 | 4723 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4432 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4433 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4434 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4435 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4436 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4724 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4725 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4726 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4727 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4728 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4437 | 4729 | else |
---|
4438 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4439 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4730 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4731 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4440 | 4732 | } |
---|
4441 | 4733 | |
---|
4442 | 4734 | ResetModel(); |
---|
.. | .. |
---|
4485 | 4777 | { |
---|
4486 | 4778 | boolean first = true; |
---|
4487 | 4779 | |
---|
4488 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4780 | + if (Grafreed.clipboardIsTempGroup) |
---|
4489 | 4781 | { |
---|
4490 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4782 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4491 | 4783 | Object3D copy; |
---|
4492 | 4784 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4493 | 4785 | { |
---|
.. | .. |
---|
4497 | 4789 | } |
---|
4498 | 4790 | } else |
---|
4499 | 4791 | { |
---|
4500 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4792 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4501 | 4793 | } |
---|
4502 | 4794 | } |
---|
4503 | 4795 | } |
---|
.. | .. |
---|
4902 | 5194 | } |
---|
4903 | 5195 | */ |
---|
4904 | 5196 | |
---|
4905 | | - void ImportGFD() |
---|
4906 | | - { |
---|
4907 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4908 | | - browser.show(); |
---|
4909 | | - String filename = browser.getFile(); |
---|
4910 | | - if (filename != null && filename.length() > 0) |
---|
4911 | | - { |
---|
4912 | | - String fullname = browser.getDirectory() + filename; |
---|
4913 | | - |
---|
4914 | | - //Object3D readobj = |
---|
4915 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4916 | | - //makeSomething(readobj); |
---|
4917 | | - } |
---|
4918 | | - } |
---|
4919 | | - |
---|
4920 | 5197 | /* |
---|
4921 | 5198 | public void Callback(Object obj) |
---|
4922 | 5199 | { |
---|
.. | .. |
---|
4940 | 5217 | } |
---|
4941 | 5218 | */ |
---|
4942 | 5219 | |
---|
4943 | | - void ImportVRMLX3D() |
---|
4944 | | - { |
---|
4945 | | - if (GrafreeD.standAlone) |
---|
4946 | | - { |
---|
4947 | | - /**/ |
---|
4948 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4949 | | - browser.show(); |
---|
4950 | | - String filename = browser.getFile(); |
---|
4951 | | - if (filename != null && filename.length() > 0) |
---|
4952 | | - { |
---|
4953 | | - String fullname = browser.getDirectory() + filename; |
---|
4954 | | - LoadVRMLX3D(fullname); |
---|
4955 | | - } |
---|
4956 | | - /**/ |
---|
4957 | | - } |
---|
4958 | | - } |
---|
4959 | | - |
---|
4960 | 5220 | String GetFile(String dialogName) |
---|
4961 | 5221 | { |
---|
4962 | | - if (GrafreeD.standAlone) |
---|
| 5222 | + if (Grafreed.standAlone) |
---|
4963 | 5223 | { |
---|
4964 | 5224 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4965 | 5225 | browser.show(); |
---|
.. | .. |
---|
5027 | 5287 | cButton clearpanelButton; |
---|
5028 | 5288 | cButton unselectButton; |
---|
5029 | 5289 | |
---|
| 5290 | + cButton minButton; |
---|
| 5291 | + cButton maxButton; |
---|
| 5292 | + cButton fullButton; |
---|
| 5293 | + cButton undoButton; |
---|
| 5294 | + cButton redoButton; |
---|
| 5295 | + cButton saveButton; |
---|
5030 | 5296 | cButton oneStepButton; |
---|
5031 | 5297 | |
---|
5032 | 5298 | cButton screenfitButton; |
---|
.. | .. |
---|
5040 | 5306 | |
---|
5041 | 5307 | cButton setsupportButton; |
---|
5042 | 5308 | |
---|
5043 | | - cButton twoButton; |
---|
5044 | | - cButton sixButton; |
---|
5045 | | - cButton threeButton; |
---|
5046 | | - cButton sevenButton; |
---|
5047 | | - cButton fourButton; // full panel |
---|
5048 | | - cButton oneButton; // full XYZ |
---|
5049 | | - //cButton currentLayout; |
---|
5050 | | - |
---|
5051 | 5309 | // |
---|
5052 | 5310 | //Composite |
---|
5053 | 5311 | Object3D // to do !! |
---|
.. | .. |
---|
5059 | 5317 | private MenuItem lookFromItem; |
---|
5060 | 5318 | private MenuItem switchItem; |
---|
5061 | 5319 | private MenuItem cutItem; |
---|
| 5320 | + private MenuItem undoItem; |
---|
| 5321 | + private MenuItem redoItem; |
---|
5062 | 5322 | private MenuItem duplicateItem; |
---|
5063 | 5323 | private MenuItem cloneItem; |
---|
5064 | 5324 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5072 | 5332 | private MenuItem linkverticesItem; |
---|
5073 | 5333 | private MenuItem relinkverticesItem; |
---|
5074 | 5334 | private MenuItem setMasterItem; |
---|
5075 | | - private MenuItem resetMeshItem; |
---|
| 5335 | + private MenuItem resetAllItem; |
---|
5076 | 5336 | private MenuItem stepAllItem; |
---|
5077 | 5337 | private MenuItem revertMeshItem; |
---|
5078 | 5338 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5122 | 5382 | private MenuItem showleavesItem; |
---|
5123 | 5383 | private MenuItem markleavesItem; |
---|
5124 | 5384 | private MenuItem unmarkleavesItem; |
---|
| 5385 | + private MenuItem rewindleavesItem; |
---|
| 5386 | + private MenuItem unrewindleavesItem; |
---|
| 5387 | + private MenuItem randomleavesItem; |
---|
| 5388 | + private MenuItem unrandomleavesItem; |
---|
5125 | 5389 | |
---|
5126 | 5390 | private MenuItem flipVItem; |
---|
5127 | 5391 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5133 | 5397 | private MenuItem panoTexturesItem; |
---|
5134 | 5398 | |
---|
5135 | 5399 | private MenuItem resetCentroidItem; |
---|
5136 | | - private MenuItem transformgeometryItem; |
---|
| 5400 | + private MenuItem resetCentroidXZItem; |
---|
5137 | 5401 | private MenuItem resetTransformItem; |
---|
| 5402 | + private MenuItem transformGeometryItem; |
---|
| 5403 | + private MenuItem transformChildrenItem; |
---|
5138 | 5404 | private MenuItem hideItem; |
---|
5139 | 5405 | private MenuItem grabItem; |
---|
5140 | 5406 | private MenuItem backItem; |
---|
.. | .. |
---|
5203 | 5469 | private MenuItem doubleItem; |
---|
5204 | 5470 | private MenuItem tripleItem; |
---|
5205 | 5471 | |
---|
5206 | | - private MenuItem importGFDItem; |
---|
5207 | | - private MenuItem importVRMLX3DItem; |
---|
5208 | | - private MenuItem import3DSItem; |
---|
5209 | | - private MenuItem importOBJItem; |
---|
5210 | | - |
---|
5211 | 5472 | private MenuItem computeAOItem; |
---|
5212 | 5473 | private MenuItem recompileItem; |
---|
5213 | 5474 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5217 | 5478 | private MenuItem analyzeItem; |
---|
5218 | 5479 | private MenuItem dumpItem; |
---|
5219 | 5480 | //boolean freezemodel = false; |
---|
| 5481 | + |
---|
| 5482 | + Menu cameraMenu; |
---|
| 5483 | + MenuItem editCameraItem; |
---|
| 5484 | + MenuItem revertCameraItem; |
---|
5220 | 5485 | } |
---|