.. | .. |
---|
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(CameraPane.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
| 275 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 276 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 277 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 278 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 279 | + oe.cameraMenu.add("-"); |
---|
| 280 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 281 | + openWindowItem.addActionListener(this); |
---|
| 282 | + editLeafItem.addActionListener(this); |
---|
| 283 | + lookAtItem.addActionListener(this); |
---|
| 284 | + //lookFromItem.addActinoListener(this); |
---|
| 285 | + //switchItem.addActionListener(this); |
---|
| 286 | + } |
---|
| 287 | + |
---|
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); |
---|
.. | .. |
---|
415 | 504 | sortbysizeItem.addActionListener(this); |
---|
416 | 505 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
417 | 506 | sortbynameItem.addActionListener(this); |
---|
| 507 | + menu.add("-"); |
---|
| 508 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 509 | + shareGeometriesItem.addActionListener(this); |
---|
| 510 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 511 | + mergeGeometriesItem.addActionListener(this); |
---|
418 | 512 | if (Globals.ADVANCED) |
---|
419 | 513 | { |
---|
420 | | - menu.add("-"); |
---|
| 514 | + // Pretty much the same as duplicate and clone. |
---|
421 | 515 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
422 | 516 | extractGeometriesItem.addActionListener(this); |
---|
423 | 517 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
424 | 518 | 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 | 519 | } |
---|
430 | 520 | |
---|
431 | 521 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
432 | 522 | buildCreateMenu(menu); |
---|
433 | 523 | |
---|
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 | 524 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
445 | 525 | buildToolsMenu(menu); |
---|
446 | 526 | } |
---|
.. | .. |
---|
477 | 557 | */ |
---|
478 | 558 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
479 | 559 | |
---|
| 560 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + undoButton.setToolTipText("Undo changes"); |
---|
| 562 | + undoButton.addActionListener(this); |
---|
| 563 | + |
---|
| 564 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + redoButton.setToolTipText("Redo changes"); |
---|
| 566 | + redoButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + saveButton.setToolTipText("Save changes"); |
---|
| 570 | + saveButton.addActionListener(this); |
---|
| 571 | + |
---|
480 | 572 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
481 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 573 | + liveCB.setToolTipText("Enable animation"); |
---|
482 | 574 | liveCB.addItemListener(this); |
---|
483 | 575 | |
---|
484 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 576 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 577 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
486 | 578 | oneStepButton.addActionListener(this); |
---|
487 | 579 | |
---|
.. | .. |
---|
493 | 585 | trackCB.setToolTipText("Enable tracking"); |
---|
494 | 586 | trackCB.addItemListener(this); |
---|
495 | 587 | |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
497 | 589 | screenfitButton.setToolTipText("Screen fit"); |
---|
498 | 590 | screenfitButton.addActionListener(this); |
---|
499 | 591 | |
---|
.. | .. |
---|
502 | 594 | |
---|
503 | 595 | if (Globals.ADVANCED) |
---|
504 | 596 | { |
---|
505 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
506 | 598 | snapobjectButton.addActionListener(this); |
---|
507 | 599 | snapobjectButton.setToolTipText("Snap Object"); |
---|
508 | 600 | } |
---|
509 | 601 | |
---|
510 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
511 | 603 | flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | 604 | flashSelectionButton.addActionListener(this); |
---|
513 | 605 | |
---|
514 | 606 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
515 | 607 | |
---|
516 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
517 | 609 | twoButton.setToolTipText("Show center view only"); |
---|
518 | 610 | twoButton.addActionListener(this); |
---|
519 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 612 | fourButton.addActionListener(this); |
---|
521 | 613 | fourButton.setToolTipText("Show left panel only"); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 614 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
523 | 615 | sixButton.setToolTipText("2-column layout left"); |
---|
524 | 616 | sixButton.addActionListener(this); |
---|
525 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | 618 | threeButton.setToolTipText("2-column layout right"); |
---|
527 | 619 | threeButton.addActionListener(this); |
---|
528 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
529 | 621 | sevenButton.setToolTipText("3-column layout"); |
---|
530 | 622 | sevenButton.addActionListener(this); |
---|
531 | 623 | // |
---|
532 | 624 | |
---|
533 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 625 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 626 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
535 | 627 | rootButton.addActionListener(this); |
---|
536 | 628 | |
---|
537 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 630 | closeButton.setToolTipText("Close tab"); |
---|
539 | 631 | closeButton.addActionListener(this); |
---|
540 | 632 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
542 | 634 | |
---|
543 | 635 | cGridBag commandsPanel = new cGridBag(); |
---|
544 | 636 | |
---|
545 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
546 | 638 | editButton.setToolTipText("Edit selection"); |
---|
547 | 639 | editButton.addActionListener(this); |
---|
548 | 640 | |
---|
549 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 641 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
550 | 642 | uneditButton.setToolTipText("Unedit selection"); |
---|
551 | 643 | uneditButton.addActionListener(this); |
---|
552 | 644 | |
---|
.. | .. |
---|
554 | 646 | allParamsButton.setToolTipText("Edit all params"); |
---|
555 | 647 | allParamsButton.addActionListener(this); |
---|
556 | 648 | |
---|
557 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
558 | 650 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
559 | 651 | clearPanelButton.addActionListener(this); |
---|
560 | 652 | |
---|
561 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 653 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
562 | 654 | unselectButton.setToolTipText("Unselect"); |
---|
563 | 655 | unselectButton.addActionListener(this); |
---|
564 | 656 | |
---|
.. | .. |
---|
641 | 733 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
642 | 734 | zoomBoxCB.addItemListener(this); |
---|
643 | 735 | |
---|
644 | | - if (Globals.ADVANCED) |
---|
| 736 | + if (true) // Globals.ADVANCED) |
---|
645 | 737 | { |
---|
646 | 738 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
647 | 739 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
714 | 806 | buttonGroup.add(radioButton); |
---|
715 | 807 | radioButton.doClick(); |
---|
716 | 808 | } |
---|
| 809 | + |
---|
717 | 810 | void SetupViews(ObjEditor oe) |
---|
718 | 811 | { |
---|
719 | 812 | oe.SetupViews(); |
---|
.. | .. |
---|
778 | 871 | } else if(e.getSource() == liveCB) |
---|
779 | 872 | { |
---|
780 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
781 | 875 | } |
---|
782 | 876 | else if(e.getSource() == supportCB) |
---|
783 | 877 | { |
---|
.. | .. |
---|
930 | 1024 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
931 | 1025 | // return; |
---|
932 | 1026 | // } |
---|
933 | | - if (string.charAt(0) == '/') |
---|
| 1027 | + |
---|
| 1028 | + // File path for Mac and Windows |
---|
| 1029 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
934 | 1030 | { |
---|
935 | 1031 | // file(s) |
---|
936 | 1032 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
957 | 1053 | |
---|
958 | 1054 | flashIt = false; |
---|
959 | 1055 | CameraPane pane = (CameraPane) target; |
---|
960 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1056 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
961 | 1057 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
962 | 1058 | |
---|
963 | 1059 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1164 | 1260 | parseverticesItem.addActionListener(this); |
---|
1165 | 1261 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1166 | 1262 | textureFieldItem.addActionListener(this); |
---|
1167 | | - alignItem = menu.add(new MenuItem("Align Object")); |
---|
| 1263 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1168 | 1264 | alignItem.addActionListener(this); |
---|
1169 | 1265 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1170 | 1266 | reduceMorphItem.addActionListener(this); |
---|
1171 | 1267 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1172 | 1268 | reduce34MorphItem.addActionListener(this); |
---|
1173 | | - |
---|
| 1269 | + menu.add("-"); |
---|
1174 | 1270 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1175 | 1271 | computeAOItem.addActionListener(this); |
---|
1176 | 1272 | |
---|
.. | .. |
---|
1183 | 1279 | memoryItem.addActionListener(this); |
---|
1184 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1185 | 1281 | analyzeItem.addActionListener(this); |
---|
1186 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1187 | 1283 | dumpItem.addActionListener(this); |
---|
1188 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1189 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1530 | 1626 | |
---|
1531 | 1627 | void Overwrite(int mask) |
---|
1532 | 1628 | { |
---|
1533 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1629 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1534 | 1630 | { |
---|
1535 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1631 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1536 | 1632 | |
---|
1537 | 1633 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1538 | 1634 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1837 | 1933 | csg.addChild(child); |
---|
1838 | 1934 | child.addChild(csg); |
---|
1839 | 1935 | } 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 | 1936 | if (source == computeAOItem) |
---|
1858 | 1937 | { |
---|
1859 | 1938 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1872 | 1951 | if (source == invariantsItem) |
---|
1873 | 1952 | { |
---|
1874 | 1953 | System.out.println("Invariants:"); |
---|
1875 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1954 | + Grafreed.grafreeD.universe.invariants(); |
---|
1876 | 1955 | } else |
---|
1877 | 1956 | if (source == memoryItem) |
---|
1878 | 1957 | { |
---|
.. | .. |
---|
1890 | 1969 | if (source == dumpItem) |
---|
1891 | 1970 | { |
---|
1892 | 1971 | DumpObject(); |
---|
| 1972 | + } else |
---|
| 1973 | + if (source == undoButton) |
---|
| 1974 | + { |
---|
| 1975 | + Undo(); |
---|
| 1976 | + } else |
---|
| 1977 | + if (source == redoButton) |
---|
| 1978 | + { |
---|
| 1979 | + Redo(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == saveButton) |
---|
| 1982 | + { |
---|
| 1983 | + Save(); |
---|
1893 | 1984 | } else |
---|
1894 | 1985 | if (source == oneStepButton) |
---|
1895 | 1986 | { |
---|
.. | .. |
---|
1945 | 2036 | { |
---|
1946 | 2037 | loadClipboard(true); |
---|
1947 | 2038 | } else |
---|
| 2039 | + if (source == undoItem) |
---|
| 2040 | + { |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoItem) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
1948 | 2047 | if (source == duplicateItem) |
---|
1949 | 2048 | { |
---|
1950 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2049 | + Object3D keep = Grafreed.clipboard; |
---|
1951 | 2050 | loadClipboard(false); |
---|
1952 | 2051 | paste(false); |
---|
1953 | | - GrafreeD.clipboard = keep; |
---|
| 2052 | + Grafreed.clipboard = keep; |
---|
1954 | 2053 | } else |
---|
1955 | 2054 | if (source == cloneItem) |
---|
1956 | 2055 | { |
---|
.. | .. |
---|
2170 | 2269 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2171 | 2270 | // refreshContents(); |
---|
2172 | 2271 | // } |
---|
2173 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2272 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2174 | 2273 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2274 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2275 | |
---|
2177 | 2276 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2277 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2222 | 2321 | } else |
---|
2223 | 2322 | if (source == setMasterItem) |
---|
2224 | 2323 | { |
---|
2225 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2324 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2226 | 2325 | { |
---|
2227 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2326 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2228 | 2327 | |
---|
2229 | 2328 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2230 | 2329 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2237 | 2336 | { |
---|
2238 | 2337 | if (group.selection.size() == 1) |
---|
2239 | 2338 | { |
---|
2240 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2339 | + if (Grafreed.clipboard.size() == 1) |
---|
2241 | 2340 | { |
---|
2242 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2341 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2243 | 2342 | |
---|
2244 | 2343 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2245 | 2344 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2256 | 2355 | { |
---|
2257 | 2356 | RevertMeshes(); |
---|
2258 | 2357 | } else |
---|
2259 | | - if (source == resetMeshItem) |
---|
| 2358 | + if (source == resetAllItem) |
---|
2260 | 2359 | { |
---|
2261 | 2360 | ResetAll(); |
---|
2262 | 2361 | } else |
---|
.. | .. |
---|
2444 | 2543 | } else |
---|
2445 | 2544 | if (source == genNormalsMESHItem) |
---|
2446 | 2545 | { |
---|
2447 | | - GenNormals(true); // TODO |
---|
| 2546 | + GenNormalsMESH(); |
---|
2448 | 2547 | } else |
---|
2449 | 2548 | if (source == genNormalsORGANItem) |
---|
2450 | 2549 | { |
---|
.. | .. |
---|
2594 | 2693 | { |
---|
2595 | 2694 | SmoothMesh(); |
---|
2596 | 2695 | } else |
---|
2597 | | - if (source == transformgeometryItem) |
---|
| 2696 | + if (source == transformGeometryItem) |
---|
2598 | 2697 | { |
---|
2599 | 2698 | TransformGeometry(); |
---|
| 2699 | + } else |
---|
| 2700 | + if (source == transformChildrenItem) |
---|
| 2701 | + { |
---|
| 2702 | + TransformChildren(); |
---|
2600 | 2703 | } else |
---|
2601 | 2704 | if (source == resetTransformItem) |
---|
2602 | 2705 | { |
---|
.. | .. |
---|
2604 | 2707 | } else |
---|
2605 | 2708 | if (source == resetCentroidItem) |
---|
2606 | 2709 | { |
---|
2607 | | - ResetCentroid(); |
---|
| 2710 | + ResetCentroid(true); |
---|
| 2711 | + } else |
---|
| 2712 | + if (source == resetCentroidXZItem) |
---|
| 2713 | + { |
---|
| 2714 | + ResetCentroid(false); |
---|
2608 | 2715 | } else |
---|
2609 | 2716 | if (source == resetParentItem) |
---|
2610 | 2717 | { |
---|
.. | .. |
---|
2960 | 3067 | child.CloseUI(); |
---|
2961 | 3068 | listUI.remove(child); |
---|
2962 | 3069 | |
---|
2963 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
2964 | 3071 | } |
---|
2965 | 3072 | objEditor.ctrlPanel.FlushUI(); |
---|
2966 | 3073 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3046 | 3153 | frontView.object = group; |
---|
3047 | 3154 | sideView.object = group; |
---|
3048 | 3155 | } |
---|
| 3156 | + |
---|
| 3157 | +// fix "+" issue |
---|
3049 | 3158 | group.editWindow = this; |
---|
| 3159 | + |
---|
3050 | 3160 | /* |
---|
3051 | 3161 | currentLayout = radio.layout; |
---|
3052 | 3162 | if (currentLayout == null) |
---|
.. | .. |
---|
3059 | 3169 | //group.attributes = -1; |
---|
3060 | 3170 | ResetModel(); |
---|
3061 | 3171 | refreshContents(true); |
---|
3062 | | - } |
---|
| 3172 | + } else if (event.getSource() == editCameraItem) |
---|
| 3173 | + { |
---|
| 3174 | + cameraView.ProtectCamera(); |
---|
| 3175 | + cameraView.repaint(); |
---|
| 3176 | + return; |
---|
| 3177 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3178 | + { |
---|
| 3179 | + cameraView.RevertCamera(); |
---|
| 3180 | + cameraView.repaint(); |
---|
| 3181 | + return; |
---|
| 3182 | + // } else if (event.getSource() == textureButton) |
---|
| 3183 | + // { |
---|
| 3184 | + // return; // true; |
---|
| 3185 | + } |
---|
3063 | 3186 | else |
---|
3064 | 3187 | { |
---|
3065 | 3188 | //return super.action(event, arg); |
---|
.. | .. |
---|
3120 | 3243 | refreshContents(); |
---|
3121 | 3244 | } |
---|
3122 | 3245 | |
---|
| 3246 | + void TransformChildren() |
---|
| 3247 | + { |
---|
| 3248 | + Object3D obj; |
---|
| 3249 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3250 | + { |
---|
| 3251 | + obj = (Object3D)e.nextElement(); |
---|
| 3252 | + obj.KeepTextureMatrices(); |
---|
| 3253 | + obj.TransformChildren(); |
---|
| 3254 | + obj.RestoreTextureMatrices(); |
---|
| 3255 | + |
---|
| 3256 | +// if (obj.parent == null) |
---|
| 3257 | +// { |
---|
| 3258 | +// System.out.println("NULL PARENT!"); |
---|
| 3259 | +// new Exception().printStackTrace(); |
---|
| 3260 | +// } |
---|
| 3261 | +// else |
---|
| 3262 | +// TouchTransform(obj); |
---|
| 3263 | +// //obj.parent.Touch(); |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + refreshContents(); |
---|
| 3267 | + } |
---|
3123 | 3268 | |
---|
3124 | 3269 | void ResetTransform() |
---|
3125 | 3270 | { |
---|
.. | .. |
---|
3232 | 3377 | refreshContents(); |
---|
3233 | 3378 | } |
---|
3234 | 3379 | |
---|
3235 | | - void ResetCentroid() |
---|
| 3380 | + void ResetCentroid(boolean full) |
---|
3236 | 3381 | { |
---|
3237 | 3382 | Object3D obj; |
---|
3238 | 3383 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3247 | 3392 | LA.matIdentity(Object3D.mat); |
---|
3248 | 3393 | obj.getBounds(minima, maxima, false); |
---|
3249 | 3394 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3250 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3395 | + if (full) |
---|
| 3396 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3251 | 3397 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3252 | 3398 | obj.TransformMesh(Object3D.mat); |
---|
| 3399 | + |
---|
3253 | 3400 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3254 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3401 | + if (full) |
---|
| 3402 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3255 | 3403 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3404 | + |
---|
3256 | 3405 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3257 | 3406 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3258 | 3407 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3281 | 3430 | |
---|
3282 | 3431 | int size = obj.MemorySize(); |
---|
3283 | 3432 | |
---|
3284 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3434 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3285 | 3435 | } |
---|
3286 | 3436 | } |
---|
3287 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3318 | 3468 | obj = (Object3D)e.nextElement(); |
---|
3319 | 3469 | |
---|
3320 | 3470 | System.out.println("Object is: " + obj); |
---|
3321 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3471 | + Grafreed.AnalyzeObject(obj); |
---|
3322 | 3472 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3323 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3473 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3324 | 3474 | |
---|
3325 | 3475 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3326 | 3476 | } |
---|
.. | .. |
---|
3362 | 3512 | void GenNormals(boolean crease) |
---|
3363 | 3513 | { |
---|
3364 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
3365 | 3522 | |
---|
3366 | 3523 | refreshContents(); |
---|
3367 | 3524 | } |
---|
.. | .. |
---|
3534 | 3691 | |
---|
3535 | 3692 | void ParseVertices() |
---|
3536 | 3693 | { |
---|
3537 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3538 | | - GrafreeD.epsequal = true; |
---|
| 3694 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3695 | + Grafreed.epsequal = true; |
---|
3539 | 3696 | |
---|
3540 | 3697 | for (int i=0; i<group.selection.size(); i++) |
---|
3541 | 3698 | { |
---|
.. | .. |
---|
3560 | 3717 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3561 | 3718 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3562 | 3719 | |
---|
3563 | | - g.add(GrafreeD.clipboard); |
---|
| 3720 | + g.add(Grafreed.clipboard); |
---|
3564 | 3721 | |
---|
3565 | 3722 | buffer.add(g); |
---|
3566 | 3723 | } |
---|
.. | .. |
---|
3575 | 3732 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3576 | 3733 | } |
---|
3577 | 3734 | |
---|
3578 | | - GrafreeD.epsequal = epsequal; |
---|
| 3735 | + Grafreed.epsequal = epsequal; |
---|
3579 | 3736 | |
---|
3580 | 3737 | refreshContents(); |
---|
3581 | 3738 | } |
---|
.. | .. |
---|
3593 | 3750 | String pigment = Object3D.GetPigment(tex); |
---|
3594 | 3751 | //String bump = Object3D.GetBump(tex); |
---|
3595 | 3752 | |
---|
3596 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3753 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3754 | + |
---|
| 3755 | + try |
---|
| 3756 | + { |
---|
| 3757 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3758 | + } |
---|
| 3759 | + catch (Exception e) |
---|
| 3760 | + { |
---|
| 3761 | + System.err.println("FAIL: " + node); |
---|
| 3762 | + } |
---|
3597 | 3763 | |
---|
3598 | 3764 | double s = v.s; |
---|
3599 | 3765 | |
---|
.. | .. |
---|
3725 | 3891 | return; |
---|
3726 | 3892 | |
---|
3727 | 3893 | Object3D poses = group.selection.get(0); |
---|
3728 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3894 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3729 | 3895 | |
---|
3730 | 3896 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3731 | 3897 | |
---|
.. | .. |
---|
3919 | 4085 | |
---|
3920 | 4086 | void ClipMesh() |
---|
3921 | 4087 | { |
---|
3922 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4088 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3923 | 4089 | { |
---|
3924 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4090 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3925 | 4091 | |
---|
3926 | 4092 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3927 | 4093 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3930 | 4096 | // { |
---|
3931 | 4097 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3932 | 4098 | // } |
---|
3933 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4099 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3934 | 4100 | } |
---|
3935 | 4101 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3936 | 4102 | System.out.println("DONE."); |
---|
.. | .. |
---|
4065 | 4231 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4066 | 4232 | |
---|
4067 | 4233 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4068 | | - if(elem != group) |
---|
| 4234 | + if(elem != group || !newWindow) |
---|
4069 | 4235 | { |
---|
4070 | 4236 | // if (!(elem instanceof Composite)) |
---|
4071 | 4237 | // newWindow = false; |
---|
.. | .. |
---|
4155 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
4156 | 4322 | group.deselectAll(); |
---|
4157 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4158 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4159 | 4324 | if (tps != null) |
---|
4160 | 4325 | { |
---|
4161 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4164 | 4329 | |
---|
4165 | 4330 | //if (child.parent != null) |
---|
4166 | 4331 | //child.parent.addSelectee(child); |
---|
| 4332 | + objEditor.SetMaterial(child); |
---|
4167 | 4333 | group.addSelectee(child); |
---|
4168 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4169 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4170 | | - System.err.println("info : " + child.GetPath()); |
---|
4171 | 4334 | } |
---|
4172 | 4335 | } |
---|
4173 | 4336 | // else |
---|
.. | .. |
---|
4177 | 4340 | // System.err.println("info : " + group.GetPath()); |
---|
4178 | 4341 | // } |
---|
4179 | 4342 | |
---|
4180 | | - objEditor.SetText(); // jan 2014 |
---|
4181 | | - |
---|
4182 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4343 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4183 | 4344 | CameraPane.flash = true; |
---|
4184 | 4345 | |
---|
4185 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4346 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4186 | 4347 | // a camera |
---|
4187 | 4348 | { |
---|
4188 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4189 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4349 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4350 | + { |
---|
| 4351 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4352 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4353 | + } |
---|
4190 | 4354 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4191 | 4355 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4192 | 4356 | } |
---|
.. | .. |
---|
4199 | 4363 | |
---|
4200 | 4364 | freezemodel = false; |
---|
4201 | 4365 | } |
---|
| 4366 | + |
---|
| 4367 | + void refreshContents(boolean cp) |
---|
| 4368 | + { |
---|
| 4369 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4370 | + { |
---|
| 4371 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4372 | + |
---|
| 4373 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4374 | + { |
---|
| 4375 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4376 | + |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + } |
---|
| 4380 | + |
---|
| 4381 | + objEditor.SetText(); // jan 2014 |
---|
| 4382 | + } |
---|
| 4383 | + |
---|
| 4384 | + super.refreshContents(cp); |
---|
| 4385 | + } |
---|
4202 | 4386 | |
---|
4203 | 4387 | void linkSomething(Object3D thing) |
---|
4204 | 4388 | { |
---|
.. | .. |
---|
4270 | 4454 | { |
---|
4271 | 4455 | if (group.selection.isEmpty()) |
---|
4272 | 4456 | return; |
---|
4273 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4457 | + |
---|
| 4458 | + Grafreed.clipboardIsTempGroup = false; |
---|
4274 | 4459 | Composite tGroup = null; |
---|
4275 | 4460 | if (group.selection.size() > 0) // 1) |
---|
4276 | 4461 | { |
---|
4277 | 4462 | tGroup = new cGroup(); |
---|
4278 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4463 | + Grafreed.clipboardIsTempGroup = true; |
---|
4279 | 4464 | } |
---|
4280 | 4465 | |
---|
4281 | 4466 | if (cut) |
---|
4282 | 4467 | { |
---|
| 4468 | + Save(); |
---|
4283 | 4469 | //int indices[] = jList.getSelectedIndices(); |
---|
4284 | 4470 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4285 | 4471 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4315 | 4501 | //System.out.println("cut " + child); |
---|
4316 | 4502 | //System.out.println("parent = " + child.parent); |
---|
4317 | 4503 | // tmp.addChild(child); |
---|
4318 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4504 | + if (Grafreed.clipboardIsTempGroup) |
---|
4319 | 4505 | tGroup.add/*Child*/(tmp); |
---|
4320 | 4506 | else |
---|
4321 | | - GrafreeD.clipboard = tmp; |
---|
| 4507 | + Grafreed.clipboard = tmp; |
---|
4322 | 4508 | } |
---|
4323 | 4509 | else |
---|
4324 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4510 | + if (Grafreed.clipboardIsTempGroup) |
---|
4325 | 4511 | tGroup.add/*Child*/(child); |
---|
4326 | 4512 | else |
---|
4327 | | - GrafreeD.clipboard = child; |
---|
| 4513 | + Grafreed.clipboard = child; |
---|
4328 | 4514 | } |
---|
4329 | 4515 | |
---|
4330 | 4516 | //ResetModel(); |
---|
.. | .. |
---|
4356 | 4542 | //System.out.println("cut " + elem); |
---|
4357 | 4543 | //System.out.println("parent = " + elem.parent); |
---|
4358 | 4544 | // tmp.addChild(elem); |
---|
4359 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4545 | + if (Grafreed.clipboardIsTempGroup) |
---|
4360 | 4546 | tGroup.add/*Child*/(tmp); |
---|
4361 | 4547 | else |
---|
4362 | | - GrafreeD.clipboard = tmp; |
---|
| 4548 | + Grafreed.clipboard = tmp; |
---|
4363 | 4549 | } |
---|
4364 | 4550 | else |
---|
4365 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4551 | + if (Grafreed.clipboardIsTempGroup) |
---|
4366 | 4552 | tGroup.add/*Child*/(child); |
---|
4367 | 4553 | else |
---|
4368 | | - GrafreeD.clipboard = child; |
---|
| 4554 | + Grafreed.clipboard = child; |
---|
4369 | 4555 | } |
---|
4370 | 4556 | |
---|
4371 | 4557 | } |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4373 | | - GrafreeD.clipboard = tGroup; |
---|
| 4558 | + |
---|
| 4559 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4560 | + Grafreed.clipboard = tGroup; |
---|
| 4561 | + |
---|
4374 | 4562 | if (cut) |
---|
4375 | 4563 | { |
---|
4376 | 4564 | ResetModel(); |
---|
.. | .. |
---|
4384 | 4572 | // return; |
---|
4385 | 4573 | boolean first = true; |
---|
4386 | 4574 | |
---|
4387 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4575 | + if (Grafreed.clipboardIsTempGroup) |
---|
4388 | 4576 | { |
---|
4389 | 4577 | Composite temp; |
---|
4390 | 4578 | |
---|
.. | .. |
---|
4395 | 4583 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4396 | 4584 | */ |
---|
4397 | 4585 | Object3D elem; |
---|
4398 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4586 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4399 | 4587 | { |
---|
4400 | 4588 | Object3D child = (Object3D)e.nextElement(); |
---|
4401 | 4589 | |
---|
.. | .. |
---|
4429 | 4617 | //Object3D cb = Applet3D.clipboard; |
---|
4430 | 4618 | //temp.addChild(cb); |
---|
4431 | 4619 | //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()); |
---|
| 4620 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4621 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4622 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4623 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4624 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4437 | 4625 | else |
---|
4438 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4439 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4626 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4627 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4440 | 4628 | } |
---|
4441 | 4629 | |
---|
4442 | 4630 | ResetModel(); |
---|
.. | .. |
---|
4485 | 4673 | { |
---|
4486 | 4674 | boolean first = true; |
---|
4487 | 4675 | |
---|
4488 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4676 | + if (Grafreed.clipboardIsTempGroup) |
---|
4489 | 4677 | { |
---|
4490 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4678 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4491 | 4679 | Object3D copy; |
---|
4492 | 4680 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4493 | 4681 | { |
---|
.. | .. |
---|
4497 | 4685 | } |
---|
4498 | 4686 | } else |
---|
4499 | 4687 | { |
---|
4500 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4688 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4501 | 4689 | } |
---|
4502 | 4690 | } |
---|
4503 | 4691 | } |
---|
.. | .. |
---|
4902 | 5090 | } |
---|
4903 | 5091 | */ |
---|
4904 | 5092 | |
---|
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 | 5093 | /* |
---|
4921 | 5094 | public void Callback(Object obj) |
---|
4922 | 5095 | { |
---|
.. | .. |
---|
4940 | 5113 | } |
---|
4941 | 5114 | */ |
---|
4942 | 5115 | |
---|
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 | 5116 | String GetFile(String dialogName) |
---|
4961 | 5117 | { |
---|
4962 | | - if (GrafreeD.standAlone) |
---|
| 5118 | + if (Grafreed.standAlone) |
---|
4963 | 5119 | { |
---|
4964 | 5120 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4965 | 5121 | browser.show(); |
---|
.. | .. |
---|
5027 | 5183 | cButton clearpanelButton; |
---|
5028 | 5184 | cButton unselectButton; |
---|
5029 | 5185 | |
---|
| 5186 | + cButton saveButton; |
---|
| 5187 | + cButton undoButton; |
---|
| 5188 | + cButton redoButton; |
---|
5030 | 5189 | cButton oneStepButton; |
---|
5031 | 5190 | |
---|
5032 | 5191 | cButton screenfitButton; |
---|
.. | .. |
---|
5059 | 5218 | private MenuItem lookFromItem; |
---|
5060 | 5219 | private MenuItem switchItem; |
---|
5061 | 5220 | private MenuItem cutItem; |
---|
| 5221 | + private MenuItem undoItem; |
---|
| 5222 | + private MenuItem redoItem; |
---|
5062 | 5223 | private MenuItem duplicateItem; |
---|
5063 | 5224 | private MenuItem cloneItem; |
---|
5064 | 5225 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5072 | 5233 | private MenuItem linkverticesItem; |
---|
5073 | 5234 | private MenuItem relinkverticesItem; |
---|
5074 | 5235 | private MenuItem setMasterItem; |
---|
5075 | | - private MenuItem resetMeshItem; |
---|
| 5236 | + private MenuItem resetAllItem; |
---|
5076 | 5237 | private MenuItem stepAllItem; |
---|
5077 | 5238 | private MenuItem revertMeshItem; |
---|
5078 | 5239 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5133 | 5294 | private MenuItem panoTexturesItem; |
---|
5134 | 5295 | |
---|
5135 | 5296 | private MenuItem resetCentroidItem; |
---|
5136 | | - private MenuItem transformgeometryItem; |
---|
| 5297 | + private MenuItem resetCentroidXZItem; |
---|
5137 | 5298 | private MenuItem resetTransformItem; |
---|
| 5299 | + private MenuItem transformGeometryItem; |
---|
| 5300 | + private MenuItem transformChildrenItem; |
---|
5138 | 5301 | private MenuItem hideItem; |
---|
5139 | 5302 | private MenuItem grabItem; |
---|
5140 | 5303 | private MenuItem backItem; |
---|
.. | .. |
---|
5203 | 5366 | private MenuItem doubleItem; |
---|
5204 | 5367 | private MenuItem tripleItem; |
---|
5205 | 5368 | |
---|
5206 | | - private MenuItem importGFDItem; |
---|
5207 | | - private MenuItem importVRMLX3DItem; |
---|
5208 | | - private MenuItem import3DSItem; |
---|
5209 | | - private MenuItem importOBJItem; |
---|
5210 | | - |
---|
5211 | 5369 | private MenuItem computeAOItem; |
---|
5212 | 5370 | private MenuItem recompileItem; |
---|
5213 | 5371 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5217 | 5375 | private MenuItem analyzeItem; |
---|
5218 | 5376 | private MenuItem dumpItem; |
---|
5219 | 5377 | //boolean freezemodel = false; |
---|
| 5378 | + |
---|
| 5379 | + Menu cameraMenu; |
---|
| 5380 | + MenuItem editCameraItem; |
---|
| 5381 | + MenuItem revertCameraItem; |
---|
5220 | 5382 | } |
---|