.. | .. |
---|
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 | | - |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
168 | 155 | Menu menu; |
---|
169 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 158 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 166 | duplicateItem.addActionListener(this); |
---|
174 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 168 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 178 | copyItem.addActionListener(this); |
---|
186 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 180 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 181 | |
---|
190 | 182 | menu.add("-"); |
---|
191 | 183 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 198 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 199 | clearAllItem.addActionListener(this); |
---|
208 | 200 | } |
---|
| 201 | + |
---|
| 202 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 203 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 204 | + //zBufferItem.addActionListener(this); |
---|
| 205 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 206 | + //normalLensItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + restoreCameraItem.addActionListener(this); |
---|
| 209 | + |
---|
| 210 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 212 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | +// cameraMenu.add("-"); |
---|
| 214 | +// |
---|
| 215 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | +// toggleTextureItem.addItemListener(this); |
---|
| 217 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | +// |
---|
| 219 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | +// toggleSwitchItem.addItemListener(this); |
---|
| 221 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 222 | + |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 224 | + toggleHandleItem.addItemListener(this); |
---|
| 225 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 226 | + |
---|
| 227 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 228 | + togglePaintItem.addItemListener(this); |
---|
| 229 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 230 | + |
---|
| 231 | + if (Globals.ADVANCED) |
---|
| 232 | + { |
---|
| 233 | + cameraMenu.add("-"); |
---|
| 234 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 235 | + toggleLiveItem.addItemListener(this); |
---|
| 236 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 237 | |
---|
| 238 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 239 | + stepItem.addActionListener(this); |
---|
| 240 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 241 | + // toggleDLItem.addItemListener(this); |
---|
| 242 | + // toggleDLItem.setState(false); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 245 | + toggleRenderItem.addItemListener(this); |
---|
| 246 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 247 | + |
---|
| 248 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 249 | + toggleDebugItem.addItemListener(this); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 251 | + |
---|
| 252 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 253 | + toggleFrustumItem.addItemListener(this); |
---|
| 254 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 255 | + |
---|
| 256 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 257 | + toggleFootContactItem.addItemListener(this); |
---|
| 258 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 259 | + |
---|
| 260 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 261 | + toggleTimelineItem.addItemListener(this); |
---|
| 262 | + } |
---|
| 263 | + |
---|
| 264 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 265 | +// toggleRootItem.addItemListener(this); |
---|
| 266 | +// toggleRootItem.setState(false); |
---|
| 267 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 268 | +// animationItem.addItemListener(this); |
---|
| 269 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 270 | + cameraMenu.add("-"); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 272 | + editCameraItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 277 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 278 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 279 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 280 | + oe.cameraMenu.add("-"); |
---|
| 281 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 282 | + openWindowItem.addActionListener(this); |
---|
| 283 | + editLeafItem.addActionListener(this); |
---|
| 284 | + lookAtItem.addActionListener(this); |
---|
| 285 | + //lookFromItem.addActinoListener(this); |
---|
| 286 | + //switchViewItem.addActionListener(this); |
---|
| 287 | + } |
---|
| 288 | + |
---|
210 | 289 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 290 | if (Globals.ADVANCED) |
---|
212 | 291 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 292 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 293 | revertMeshItem.addActionListener(this); |
---|
219 | 294 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
253 | 328 | } |
---|
254 | 329 | |
---|
255 | 330 | oe.menuBar.add(menu = new Menu("Group")); |
---|
256 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
257 | | - grabItem.addActionListener(this); |
---|
| 331 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 332 | +// grabItem.addActionListener(this); |
---|
258 | 333 | backItem = menu.add(new MenuItem("Back")); |
---|
259 | 334 | backItem.addActionListener(this); |
---|
260 | 335 | frontItem = menu.add(new MenuItem("Front")); |
---|
261 | 336 | frontItem.addActionListener(this); |
---|
262 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
263 | | - compositeItem.addActionListener(this); |
---|
| 337 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 338 | +// compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
264 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
265 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
266 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
267 | 346 | ungroupItem.addActionListener(this); |
---|
268 | | - menu.add("-"); |
---|
269 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
270 | | - randomItem.addActionListener(this); |
---|
| 347 | + |
---|
| 348 | +// menu.add("-"); |
---|
| 349 | +// |
---|
| 350 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 351 | +// switchItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
271 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
272 | 355 | switchGeoItem.addActionListener(this); |
---|
273 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
275 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
276 | 359 | morphItem.addActionListener(this); |
---|
277 | 360 | |
---|
278 | | - if (Globals.ADVANCED) |
---|
279 | | - { |
---|
280 | 361 | menu.add("-"); |
---|
281 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
282 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
284 | 365 | frameselectorItem.addActionListener(this); |
---|
285 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
286 | 367 | scriptNodeItem.addActionListener(this); |
---|
287 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
288 | | - cameraItem.addActionListener(this); |
---|
289 | 368 | } |
---|
290 | 369 | |
---|
291 | 370 | oe.menuBar.add(menu = new Menu("Object")); |
---|
292 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
293 | | - textureItem.addActionListener(this); |
---|
| 371 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 372 | +// textureItem.addActionListener(this); |
---|
294 | 373 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
295 | 374 | billboardItem.addActionListener(this); |
---|
296 | 375 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 376 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 377 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 378 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 379 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 380 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 381 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 382 | shadowZItem.addActionListener(this); |
---|
304 | 383 | if (Globals.ADVANCED) |
---|
305 | 384 | { |
---|
.. | .. |
---|
318 | 397 | resetTransformItem.addActionListener(this); |
---|
319 | 398 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 399 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 400 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 401 | + resetCentroidXZItem.addActionListener(this); |
---|
| 402 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 403 | + transformGeometryItem.addActionListener(this); |
---|
| 404 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 405 | + transformChildrenItem.addActionListener(this); |
---|
323 | 406 | |
---|
324 | 407 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 408 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 451 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 452 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 453 | clearMaterialsItem.addActionListener(this); |
---|
| 454 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 455 | + resetAllItem.addActionListener(this); |
---|
| 456 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 457 | + stepAllItem.addActionListener(this); |
---|
371 | 458 | menu.add("-"); |
---|
372 | 459 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 460 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 475 | markleavesItem.addActionListener(this); |
---|
389 | 476 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 477 | unmarkleavesItem.addActionListener(this); |
---|
| 478 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 479 | + rewindleavesItem.addActionListener(this); |
---|
| 480 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 481 | + unrewindleavesItem.addActionListener(this); |
---|
| 482 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 483 | + randomleavesItem.addActionListener(this); |
---|
| 484 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 485 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 486 | menu.add("-"); |
---|
392 | 487 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 488 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 517 | sortbysizeItem.addActionListener(this); |
---|
423 | 518 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 519 | sortbynameItem.addActionListener(this); |
---|
| 520 | + menu.add("-"); |
---|
| 521 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 522 | + shareGeometriesItem.addActionListener(this); |
---|
| 523 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 524 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 525 | if (Globals.ADVANCED) |
---|
426 | 526 | { |
---|
427 | | - menu.add("-"); |
---|
| 527 | + // Pretty much the same as duplicate and clone. |
---|
428 | 528 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 529 | extractGeometriesItem.addActionListener(this); |
---|
430 | 530 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 531 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 532 | } |
---|
437 | 533 | |
---|
438 | 534 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 535 | buildCreateMenu(menu); |
---|
440 | 536 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
443 | | - importOBJItem.addActionListener(this); |
---|
444 | | - menu.add("-"); |
---|
445 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
446 | | - import3DSItem.addActionListener(this); |
---|
447 | | - menu.add("-"); |
---|
448 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | | - importVRMLX3DItem.addActionListener(this); |
---|
450 | | - menu.add("-"); |
---|
451 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
452 | | - importGFDItem.addActionListener(this); |
---|
453 | | - |
---|
454 | 537 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 538 | buildToolsMenu(menu); |
---|
456 | 539 | } |
---|
457 | 540 | |
---|
458 | 541 | void SetupUI2(ObjEditor oe) |
---|
459 | 542 | { |
---|
| 543 | + // June 2019 |
---|
| 544 | + if (oe == null) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + //return; |
---|
| 548 | + } |
---|
| 549 | + |
---|
| 550 | + if (copy != group) |
---|
| 551 | + { |
---|
| 552 | + //super.SetupUI2(this); |
---|
| 553 | + } |
---|
| 554 | + |
---|
460 | 555 | //new Exception().printStackTrace(); |
---|
461 | 556 | |
---|
462 | 557 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
485 | 580 | oe.radioPanel.add(dummyButton); |
---|
486 | 581 | oe.buttonGroup.add(dummyButton); |
---|
487 | 582 | */ |
---|
| 583 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 584 | + |
---|
| 585 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 586 | + |
---|
488 | 587 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 588 | |
---|
490 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 589 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 590 | + //minButton.setToolTipText("Minimize window"); |
---|
| 591 | + //minButton.addActionListener(this); |
---|
| 592 | + |
---|
| 593 | + if (Globals.ADVANCED) |
---|
| 594 | + { |
---|
| 595 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + maxButton.setToolTipText("Maximize window"); |
---|
| 597 | + maxButton.addActionListener(this); |
---|
| 598 | + } |
---|
| 599 | + |
---|
| 600 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 601 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 602 | + fullButton.addActionListener(this); |
---|
| 603 | + |
---|
| 604 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 605 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 606 | + restoreCameraButton.addActionListener(this); |
---|
| 607 | + |
---|
| 608 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + undoButton.setToolTipText("Undo changes"); |
---|
| 610 | + undoButton.addActionListener(this); |
---|
| 611 | + undoButton.setEnabled(false); |
---|
| 612 | + |
---|
| 613 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 614 | + redoButton.setToolTipText("Redo changes"); |
---|
| 615 | + redoButton.addActionListener(this); |
---|
| 616 | + redoButton.setEnabled(false); |
---|
| 617 | + |
---|
| 618 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + saveButton.setToolTipText("Save changes"); |
---|
| 620 | + saveButton.addActionListener(this); |
---|
| 621 | + |
---|
| 622 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 623 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 624 | liveCB.addItemListener(this); |
---|
493 | 625 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 627 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 628 | oneStepButton.addActionListener(this); |
---|
497 | 629 | |
---|
498 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 630 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
499 | 631 | fastCB.setToolTipText("Fast mode"); |
---|
500 | 632 | fastCB.addItemListener(this); |
---|
501 | 633 | |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
503 | | - trackCB.setToolTipText("Enable tracking"); |
---|
504 | | - trackCB.addItemListener(this); |
---|
505 | | - |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + //oe.toolboxPanel.Return(); |
---|
| 635 | + |
---|
| 636 | + copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | 637 | screenfitButton.setToolTipText("Screen fit"); |
---|
508 | 638 | screenfitButton.addActionListener(this); |
---|
| 639 | + |
---|
| 640 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 641 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 642 | +// trackCB.addItemListener(this); |
---|
509 | 643 | |
---|
510 | 644 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
511 | 645 | // screenfitpointButton.addActionListener(this); |
---|
512 | 646 | |
---|
513 | 647 | if (Globals.ADVANCED) |
---|
514 | 648 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 650 | snapobjectButton.addActionListener(this); |
---|
517 | 651 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 652 | } |
---|
519 | 653 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
| 654 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
523 | 655 | |
---|
524 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | | - |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 657 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 658 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 659 | + this.fullscreenLayout = twoButton; |
---|
| 660 | + |
---|
| 661 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 662 | fourButton.addActionListener(this); |
---|
531 | 663 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 665 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 666 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 667 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 668 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 669 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 671 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 672 | sevenButton.addActionListener(this); |
---|
541 | 673 | // |
---|
542 | 674 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 675 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 676 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 677 | rootButton.addActionListener(this); |
---|
546 | 678 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 680 | closeButton.setToolTipText("Close tab"); |
---|
549 | 681 | closeButton.addActionListener(this); |
---|
550 | 682 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
551 | 683 | //clearButton.addActionListener(this); |
---|
552 | | - |
---|
553 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 684 | + |
---|
| 685 | + // INSERT |
---|
| 686 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 687 | + gridButton.setToolTipText("Create grid"); |
---|
| 688 | + gridButton.addActionListener(this); |
---|
| 689 | + |
---|
| 690 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 691 | + boxButton.setToolTipText("Create box"); |
---|
| 692 | + boxButton.addActionListener(this); |
---|
| 693 | + |
---|
| 694 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 696 | + sphereButton.addActionListener(this); |
---|
| 697 | + |
---|
| 698 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + coneButton.setToolTipText("Create cone"); |
---|
| 700 | + coneButton.addActionListener(this); |
---|
| 701 | + |
---|
| 702 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | + torusButton.setToolTipText("Create torus"); |
---|
| 704 | + torusButton.addActionListener(this); |
---|
| 705 | + |
---|
| 706 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 708 | + superButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + if (Globals.ADVANCED) |
---|
| 711 | + { |
---|
| 712 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 714 | + kleinButton.addActionListener(this); |
---|
| 715 | + } |
---|
554 | 716 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | | - editButton.setToolTipText("Edit selection"); |
---|
| 717 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 718 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 719 | + particlesButton.addActionListener(this); |
---|
| 720 | + |
---|
| 721 | + oe.toolboxPanel.Return(); |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + groupButton.setToolTipText("Create group"); |
---|
| 725 | + groupButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 728 | + compositeButton.setToolTipText("Create composite"); |
---|
| 729 | + compositeButton.addActionListener(this); |
---|
| 730 | + |
---|
| 731 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 732 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 733 | + switchButton.addActionListener(this); |
---|
| 734 | + |
---|
| 735 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | + loopButton.setToolTipText("Create loop"); |
---|
| 737 | + loopButton.addActionListener(this); |
---|
| 738 | + |
---|
| 739 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 740 | + textureButton.setToolTipText("Create texture"); |
---|
| 741 | + textureButton.addActionListener(this); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 745 | + overlayButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + lightButton.setToolTipText("Create light"); |
---|
| 749 | + lightButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + for (int i=6; --i>=0;) |
---|
| 752 | + { |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 755 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 756 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 757 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 758 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 759 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + } |
---|
| 762 | + |
---|
| 763 | + // EDIT panel |
---|
| 764 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + editButton.setToolTipText("Pin selection controls"); |
---|
557 | 766 | editButton.addActionListener(this); |
---|
558 | 767 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 768 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
561 | 770 | uneditButton.addActionListener(this); |
---|
562 | 771 | |
---|
563 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
564 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 772 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 773 | + allParamsButton.setToolTipText("Show all controle"); |
---|
565 | 774 | allParamsButton.addActionListener(this); |
---|
566 | 775 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 777 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 778 | clearPanelButton.addActionListener(this); |
---|
570 | 779 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 781 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 782 | unselectButton.addActionListener(this); |
---|
574 | 783 | |
---|
575 | | - commandsPanel.preferredHeight = 1; |
---|
| 784 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 786 | + flashSelectionButton.addActionListener(this); |
---|
576 | 787 | |
---|
577 | | - oe.treePanel.add(commandsPanel); |
---|
578 | | - oe.treePanel.Return(); |
---|
| 788 | + editCommandsPanel.preferredHeight = 1; |
---|
| 789 | + |
---|
| 790 | + SetPinStates(false); |
---|
| 791 | +// oe.treePanel.add(commandsPanel); |
---|
| 792 | +// oe.treePanel.Return(); |
---|
579 | 793 | |
---|
580 | 794 | // oe.aConstraints.gridx += 1; |
---|
581 | 795 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
592 | 806 | |
---|
593 | 807 | JScrollPane jSP; |
---|
594 | 808 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
595 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 809 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
596 | 810 | ResetModel(); |
---|
597 | 811 | |
---|
598 | 812 | oe.treePanel.add(jSPPanel); |
---|
599 | 813 | oe.treePanel.Return(); |
---|
600 | 814 | |
---|
601 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
602 | | - |
---|
603 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
604 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
605 | | - colorCB.addItemListener(this); |
---|
606 | | - |
---|
607 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
608 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
609 | | - materialCB.addItemListener(this); |
---|
610 | | - |
---|
611 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
612 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
613 | | - textureCB.addItemListener(this); |
---|
614 | | - |
---|
615 | | - copyOptionsPanel.preferredHeight = 1; |
---|
616 | 815 | oe.treePanel.add(copyOptionsPanel); |
---|
617 | 816 | oe.treePanel.Return(); |
---|
618 | 817 | |
---|
.. | .. |
---|
643 | 842 | |
---|
644 | 843 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
645 | 844 | { |
---|
| 845 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 846 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 847 | + colorCB.addItemListener(this); |
---|
| 848 | + |
---|
| 849 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 850 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 851 | + materialCB.addItemListener(this); |
---|
| 852 | + |
---|
| 853 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 854 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 855 | + textureCB.addItemListener(this); |
---|
| 856 | + |
---|
| 857 | + panel.Return(); |
---|
| 858 | + |
---|
646 | 859 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
647 | 860 | boxCB.setToolTipText("Display bounding boxes"); |
---|
648 | 861 | boxCB.addItemListener(this); |
---|
649 | 862 | |
---|
650 | 863 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
651 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 864 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
652 | 865 | zoomBoxCB.addItemListener(this); |
---|
653 | 866 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 867 | + if (true) // Globals.ADVANCED) |
---|
655 | 868 | { |
---|
656 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | | - supportCB.setToolTipText("Enable rigging"); |
---|
658 | | - supportCB.addItemListener(this); |
---|
| 869 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 870 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 871 | +// supportCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 874 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 875 | + freezeCB.addItemListener(this); |
---|
659 | 876 | |
---|
660 | 877 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
661 | 878 | // localCB.addItemListener(this); |
---|
662 | 879 | |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
663 | 882 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
664 | 883 | crowdCB.setToolTipText("Used for crowds"); |
---|
665 | 884 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
676 | 895 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
677 | 896 | // speakerMocapCB.addItemListener(this); |
---|
678 | 897 | |
---|
| 898 | + panel.Return(); |
---|
| 899 | + |
---|
679 | 900 | if (false) |
---|
680 | 901 | { |
---|
681 | 902 | // handled in scripts |
---|
.. | .. |
---|
690 | 911 | //constraints.gridy += 1; |
---|
691 | 912 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
692 | 913 | smoothfocusCB.addItemListener(this); |
---|
| 914 | + panel.Return(); |
---|
693 | 915 | } |
---|
694 | 916 | |
---|
695 | 917 | //constraints.gridx += 1; |
---|
696 | 918 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
697 | 919 | // debugCB.addItemListener(this); |
---|
698 | 920 | |
---|
| 921 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 922 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 923 | + trackCB.addItemListener(this); |
---|
| 924 | + |
---|
699 | 925 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 926 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
700 | 927 | oeilCB.addItemListener(this); |
---|
701 | 928 | |
---|
| 929 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 930 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 931 | + shadowCB.addItemListener(this); |
---|
| 932 | + |
---|
| 933 | + panel.Return(); |
---|
| 934 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 935 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 936 | + toggleTextureCB.addItemListener(this); |
---|
| 937 | + |
---|
| 938 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 939 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 940 | + toggleSwitchCB.addItemListener(this); |
---|
| 941 | + |
---|
| 942 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 943 | + autosaveCB.setToolTipText("On structure change"); |
---|
| 944 | + autosaveCB.addItemListener(this); |
---|
| 945 | + |
---|
| 946 | + panel.Return(); |
---|
| 947 | + if (Globals.ADVANCED) |
---|
| 948 | + { |
---|
702 | 949 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
703 | 950 | lookAtCB.setToolTipText("Look-at target"); |
---|
704 | 951 | lookAtCB.addItemListener(this); |
---|
| 952 | + } |
---|
705 | 953 | |
---|
706 | 954 | } |
---|
707 | 955 | |
---|
708 | 956 | cGridBag fill = new cGridBag(); |
---|
709 | | - |
---|
710 | 957 | fill.preferredHeight = 200; |
---|
| 958 | + cGridBag fill2 = new cGridBag(); |
---|
| 959 | + fill2.preferredHeight = 200; |
---|
| 960 | + cGridBag fill3 = new cGridBag(); |
---|
| 961 | + fill3.preferredHeight = 200; |
---|
711 | 962 | |
---|
712 | 963 | panel.add(fill); |
---|
| 964 | + panel.add(fill2); |
---|
| 965 | + panel.add(fill3); |
---|
713 | 966 | |
---|
714 | 967 | } |
---|
715 | 968 | |
---|
716 | 969 | void EditObject(Object3D obj) |
---|
717 | 970 | { |
---|
718 | 971 | cRadio radioButton = new cRadio(obj.name); |
---|
| 972 | + |
---|
| 973 | + // Patch to avoid bug with transparency. |
---|
| 974 | + radioButton.hadMaterial = obj.material != null; |
---|
| 975 | + if (!radioButton.hadMaterial) |
---|
| 976 | + { |
---|
| 977 | + obj.material = new cMaterial(); |
---|
| 978 | + } |
---|
| 979 | + |
---|
719 | 980 | radioButton.SetObject(obj); |
---|
720 | 981 | radioButton.layout = sevenButton; |
---|
721 | 982 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
724 | 985 | buttonGroup.add(radioButton); |
---|
725 | 986 | radioButton.doClick(); |
---|
726 | 987 | } |
---|
| 988 | + |
---|
727 | 989 | void SetupViews(ObjEditor oe) |
---|
728 | 990 | { |
---|
| 991 | + theFrame = this; |
---|
| 992 | + |
---|
729 | 993 | oe.SetupViews(); |
---|
730 | 994 | |
---|
731 | 995 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
734 | 998 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
735 | 999 | } |
---|
736 | 1000 | |
---|
737 | | - JCheckBox liveCB; |
---|
738 | | - JCheckBox supportCB; |
---|
739 | | - JCheckBox localCB; |
---|
740 | | - JCheckBox crowdCB; |
---|
741 | | - JCheckBox smoothCB; |
---|
742 | | - JCheckBox fastCB; |
---|
743 | | - JCheckBox slowCB; |
---|
744 | | - JCheckBox boxCB; |
---|
745 | | - JCheckBox zoomBoxCB; |
---|
746 | | - JCheckBox trackCB; |
---|
747 | | - JCheckBox smoothfocusCB; |
---|
| 1001 | + cToggleButton liveCB; |
---|
| 1002 | + cCheckBox supportCB; |
---|
| 1003 | + cCheckBox localCB; |
---|
| 1004 | + cCheckBox crowdCB; |
---|
| 1005 | + cCheckBox smoothCB; |
---|
| 1006 | + cToggleButton fastCB; |
---|
| 1007 | + cCheckBox slowCB; |
---|
| 1008 | + cCheckBox boxCB; |
---|
| 1009 | + cCheckBox zoomBoxCB; |
---|
| 1010 | + cCheckBox freezeCB; |
---|
| 1011 | + //cToggleButton trackCB; |
---|
| 1012 | + cCheckBox trackCB; |
---|
| 1013 | + cCheckBox smoothfocusCB; |
---|
748 | 1014 | // JCheckBox speakerMocapCB; |
---|
749 | | - JCheckBox speakerCameraCB; |
---|
750 | | - JCheckBox speakerFocusCB; |
---|
751 | | - JCheckBox debugCB; |
---|
752 | | - JCheckBox oeilCB; |
---|
753 | | - JCheckBox lookAtCB; |
---|
| 1015 | + cCheckBox speakerCameraCB; |
---|
| 1016 | + cCheckBox speakerFocusCB; |
---|
| 1017 | + cCheckBox debugCB; |
---|
| 1018 | + |
---|
| 1019 | + cCheckBox oeilCB; |
---|
| 1020 | + cCheckBox shadowCB; |
---|
| 1021 | + cCheckBox autosaveCB; |
---|
| 1022 | + cCheckBox lookAtCB; |
---|
754 | 1023 | |
---|
755 | 1024 | // static int COLOR = 1; |
---|
756 | 1025 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
758 | 1027 | |
---|
759 | 1028 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
760 | 1029 | |
---|
761 | | - JCheckBox colorCB; |
---|
762 | | - JCheckBox materialCB; |
---|
763 | | - JCheckBox textureCB; |
---|
| 1030 | + cCheckBox colorCB; |
---|
| 1031 | + cCheckBox materialCB; |
---|
| 1032 | + cCheckBox textureCB; |
---|
764 | 1033 | |
---|
765 | 1034 | public void itemStateChanged(ItemEvent e) |
---|
766 | 1035 | { |
---|
.. | .. |
---|
788 | 1057 | } else if(e.getSource() == liveCB) |
---|
789 | 1058 | { |
---|
790 | 1059 | cameraView.ToggleLive(); |
---|
| 1060 | + refreshContents(false); |
---|
791 | 1061 | } |
---|
792 | 1062 | else if(e.getSource() == supportCB) |
---|
793 | 1063 | { |
---|
.. | .. |
---|
852 | 1122 | { |
---|
853 | 1123 | cameraView.ToggleOeil(); |
---|
854 | 1124 | } |
---|
| 1125 | + else if(e.getSource() == shadowCB) |
---|
| 1126 | + { |
---|
| 1127 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1128 | + } |
---|
| 1129 | + else if(e.getSource() == freezeCB) |
---|
| 1130 | + { |
---|
| 1131 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1132 | + } |
---|
| 1133 | + else if(e.getSource() == autosaveCB) |
---|
| 1134 | + { |
---|
| 1135 | + Globals.SAVEONMAKE ^= true; |
---|
| 1136 | + } |
---|
855 | 1137 | else if(e.getSource() == lookAtCB) |
---|
856 | 1138 | { |
---|
857 | 1139 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
868 | 1150 | |
---|
869 | 1151 | /**/ |
---|
870 | 1152 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
871 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1153 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1154 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
872 | 1155 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
873 | 1156 | // We can't move the root node or an empty selection |
---|
874 | 1157 | return; |
---|
.. | .. |
---|
985 | 1268 | |
---|
986 | 1269 | assert target == objEditor.jTree; |
---|
987 | 1270 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1271 | + Object3D destinationLeaf; |
---|
988 | 1272 | try { |
---|
989 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1273 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
990 | 1274 | } catch (Exception e) { |
---|
991 | 1275 | System.out.println("destinationPath : " + destinationPath); |
---|
992 | 1276 | return; |
---|
993 | 1277 | } |
---|
994 | 1278 | |
---|
995 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1279 | + for (int i=group.selection.size(); --i>=0;) |
---|
996 | 1280 | { |
---|
| 1281 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1282 | + |
---|
| 1283 | + // Cannot move into itself |
---|
| 1284 | + if (child == destinationLeaf) |
---|
| 1285 | + return; |
---|
| 1286 | + } |
---|
| 1287 | + |
---|
| 1288 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1289 | +// { |
---|
997 | 1290 | loadClipboard(true); |
---|
998 | 1291 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
999 | 1292 | pasteInto(false, false); |
---|
1000 | | - } else { |
---|
1001 | | - loadClipboard(false); |
---|
1002 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1003 | | - pasteInto(false, false); // true); // ??? |
---|
1004 | | - } |
---|
| 1293 | +// } else { |
---|
| 1294 | +// loadClipboard(false); |
---|
| 1295 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1296 | +// pasteInto(false, false); // true); // ??? |
---|
| 1297 | +// } |
---|
1005 | 1298 | } |
---|
1006 | 1299 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1007 | 1300 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1106 | 1399 | { |
---|
1107 | 1400 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1108 | 1401 | //heightFieldItem.addActionListener(this); |
---|
1109 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1110 | | - gridItem.addActionListener(this); |
---|
1111 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1112 | | - rectoidItem.addActionListener(this); |
---|
1113 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1114 | | - ellipsoidItem.addActionListener(this); |
---|
1115 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1116 | | - coneItem.addActionListener(this); |
---|
1117 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1118 | | - torusItem.addActionListener(this); |
---|
1119 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1120 | | - superItem.addActionListener(this); |
---|
| 1402 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1403 | +// gridItem.addActionListener(this); |
---|
| 1404 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1405 | +// rectoidItem.addActionListener(this); |
---|
| 1406 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1407 | +// ellipsoidItem.addActionListener(this); |
---|
| 1408 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1409 | +// coneItem.addActionListener(this); |
---|
| 1410 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1411 | +// torusItem.addActionListener(this); |
---|
| 1412 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1413 | +// superItem.addActionListener(this); |
---|
| 1414 | + |
---|
| 1415 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1416 | + cameraItem.addActionListener(this); |
---|
| 1417 | + |
---|
| 1418 | + if (!Globals.ADVANCED) |
---|
| 1419 | + { |
---|
1121 | 1420 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1122 | 1421 | kleinItem.addActionListener(this); |
---|
1123 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1124 | | - particleItem.addActionListener(this); |
---|
| 1422 | + } |
---|
| 1423 | + |
---|
| 1424 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1425 | +// particleItem.addActionListener(this); |
---|
1125 | 1426 | if (Globals.ADVANCED) |
---|
1126 | 1427 | { |
---|
1127 | 1428 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1147 | 1448 | } |
---|
1148 | 1449 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1149 | 1450 | bezierItem.addActionListener(this); |
---|
1150 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1151 | | - overlayItem.addActionListener(this); |
---|
1152 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1153 | | - lightItem.addActionListener(this); |
---|
| 1451 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1452 | +// overlayItem.addActionListener(this); |
---|
| 1453 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1454 | +// lightItem.addActionListener(this); |
---|
1154 | 1455 | menu.add("-"); |
---|
1155 | 1456 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1156 | 1457 | //superLoopItem.addActionListener(this); |
---|
1157 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1158 | | - loopItem.addActionListener(this); |
---|
| 1458 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1459 | +// loopItem.addActionListener(this); |
---|
1159 | 1460 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1160 | 1461 | doubleItem.addActionListener(this); |
---|
1161 | 1462 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1170 | 1471 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1171 | 1472 | animationItem.addItemListener(this); |
---|
1172 | 1473 | animationItem.setState(Globals.ANIMATION); |
---|
| 1474 | + |
---|
| 1475 | + menu.add(archiveItem = new CheckboxMenuItem("Archive3D...")); |
---|
| 1476 | + archiveItem.addItemListener(this); |
---|
1173 | 1477 | |
---|
1174 | 1478 | menu.add("-"); |
---|
1175 | 1479 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
.. | .. |
---|
1195 | 1499 | memoryItem.addActionListener(this); |
---|
1196 | 1500 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1197 | 1501 | analyzeItem.addActionListener(this); |
---|
1198 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1502 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1199 | 1503 | dumpItem.addActionListener(this); |
---|
1200 | 1504 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1201 | 1505 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1336 | 1640 | shadow.material = new cMaterial(obj.material); |
---|
1337 | 1641 | shadow.material.diffuse = 0.0001f; |
---|
1338 | 1642 | shadow.material.specular = 0.0001f; |
---|
| 1643 | + //shadow.projectedVertices[1].x = 300; |
---|
1339 | 1644 | |
---|
1340 | 1645 | makeSomething(shadow); |
---|
1341 | 1646 | } |
---|
| 1647 | + |
---|
| 1648 | + private void ClearUnpinned() |
---|
| 1649 | + { |
---|
| 1650 | + //for (Object3D obj : listUI) |
---|
| 1651 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1652 | + { |
---|
| 1653 | + Object3D obj = listUI.elementAt(i); |
---|
| 1654 | + if (!obj.pinned) |
---|
| 1655 | + { |
---|
| 1656 | + obj.CloseUI(); |
---|
| 1657 | + listUI.remove(i); |
---|
| 1658 | + } |
---|
| 1659 | + } |
---|
| 1660 | + } |
---|
1342 | 1661 | |
---|
1343 | 1662 | /** |
---|
1344 | 1663 | * applyExample |
---|
.. | .. |
---|
1542 | 1861 | |
---|
1543 | 1862 | void Overwrite(int mask) |
---|
1544 | 1863 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1864 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1865 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1866 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1867 | |
---|
1549 | 1868 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1869 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1583 | 1902 | { |
---|
1584 | 1903 | ScreenFit(); |
---|
1585 | 1904 | } else |
---|
1586 | | - if (source == switchItem) |
---|
| 1905 | + if (source == switchViewItem) |
---|
1587 | 1906 | { |
---|
1588 | 1907 | cVector v1 = new cVector(); |
---|
1589 | 1908 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1592 | 1911 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1593 | 1912 | objEditor.cameraView.repaint(); |
---|
1594 | 1913 | } else |
---|
1595 | | - if (source == rectoidItem) |
---|
| 1914 | + if (source == rectoidItem || source == boxButton) |
---|
1596 | 1915 | { |
---|
1597 | 1916 | makeSomething(new Box()); |
---|
1598 | 1917 | } else |
---|
1599 | | - if (source == particleItem) |
---|
| 1918 | + if (source == particleItem || source == particlesButton) |
---|
1600 | 1919 | { |
---|
1601 | 1920 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1602 | 1921 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1675 | 1994 | |
---|
1676 | 1995 | makeSomething(obj); |
---|
1677 | 1996 | } else |
---|
1678 | | - if (source == gridItem) |
---|
| 1997 | + if (source == gridItem || source == gridButton) |
---|
1679 | 1998 | { |
---|
1680 | 1999 | makeSomething(new Grid()); |
---|
1681 | 2000 | } else |
---|
1682 | | - if (source == ellipsoidItem) |
---|
| 2001 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1683 | 2002 | { |
---|
1684 | 2003 | makeSomething(new Sphere()); |
---|
1685 | 2004 | } else |
---|
1686 | | - if (source == coneItem) |
---|
| 2005 | + if (source == coneItem || source == coneButton) |
---|
1687 | 2006 | { |
---|
1688 | 2007 | makeSomething(new Cone()); |
---|
1689 | 2008 | } else |
---|
1690 | | - if (source == torusItem) |
---|
| 2009 | + if (source == torusItem || source == torusButton) |
---|
1691 | 2010 | { |
---|
1692 | 2011 | makeSomething(new Torus()); |
---|
1693 | 2012 | } else |
---|
1694 | | - if (source == superItem) |
---|
| 2013 | + if (source == superItem || source == superButton) |
---|
1695 | 2014 | { |
---|
1696 | 2015 | makeSomething(new Superellipsoid()); |
---|
1697 | 2016 | } else |
---|
1698 | | - if (source == kleinItem) |
---|
| 2017 | + if (source == kleinItem || source == kleinButton) |
---|
1699 | 2018 | { |
---|
1700 | 2019 | makeSomething(new Klein()); |
---|
1701 | 2020 | } else |
---|
.. | .. |
---|
1715 | 2034 | { |
---|
1716 | 2035 | makeSomething(new BezierSurface()); |
---|
1717 | 2036 | } else |
---|
1718 | | - if (source == overlayItem) |
---|
| 2037 | + if (source == overlayItem || source == overlayButton) |
---|
1719 | 2038 | { |
---|
1720 | 2039 | /* |
---|
1721 | 2040 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1763 | 2082 | s.setup(); |
---|
1764 | 2083 | makeSomething(s); |
---|
1765 | 2084 | } else |
---|
1766 | | - if (source == lightItem) |
---|
| 2085 | + if (source == lightItem || source == lightButton) |
---|
1767 | 2086 | { |
---|
1768 | 2087 | makeSomething(new Light()); |
---|
1769 | 2088 | } else |
---|
.. | .. |
---|
1813 | 2132 | |
---|
1814 | 2133 | group(g); |
---|
1815 | 2134 | } else |
---|
1816 | | - if (source == loopItem) |
---|
| 2135 | + if (source == loopItem || source == loopButton) |
---|
1817 | 2136 | { |
---|
1818 | 2137 | Composite csg = new GroupLeaf(); |
---|
1819 | 2138 | csg.count = 5; |
---|
1820 | 2139 | group(csg); |
---|
1821 | | - Composite child = new cGroup(); |
---|
| 2140 | + Composite child = new cGroup("Branch"); |
---|
1822 | 2141 | csg.addChild(child); |
---|
1823 | 2142 | child.addChild(csg); |
---|
1824 | 2143 | } else |
---|
1825 | 2144 | if (source == doubleItem) |
---|
1826 | 2145 | { |
---|
1827 | | - Composite csg = new GroupLeaf(); |
---|
| 2146 | + Composite csg = new GroupLeaf("Fork"); |
---|
1828 | 2147 | csg.count = 5; |
---|
1829 | 2148 | group(csg); |
---|
1830 | | - Composite child = new cGroup(); |
---|
| 2149 | + Composite child = new cGroup("Branch A"); |
---|
1831 | 2150 | csg.addChild(child); |
---|
1832 | 2151 | child.addChild(csg); |
---|
1833 | | - child = new cGroup(); |
---|
| 2152 | + child = new cGroup("Branch B"); |
---|
1834 | 2153 | csg.addChild(child); |
---|
1835 | 2154 | child.addChild(csg); |
---|
1836 | 2155 | } else |
---|
1837 | 2156 | if (source == tripleItem) |
---|
1838 | 2157 | { |
---|
1839 | | - Composite csg = new GroupLeaf(); |
---|
| 2158 | + Composite csg = new GroupLeaf("Trident"); |
---|
1840 | 2159 | csg.count = 4; |
---|
1841 | 2160 | group(csg); |
---|
1842 | 2161 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1848 | 2167 | child = new cGroup(); |
---|
1849 | 2168 | csg.addChild(child); |
---|
1850 | 2169 | child.addChild(csg); |
---|
1851 | | - } else |
---|
1852 | | - |
---|
1853 | | - if (source == importGFDItem) |
---|
1854 | | - { |
---|
1855 | | - ImportGFD(); |
---|
1856 | | - } else |
---|
1857 | | - if (source == importVRMLX3DItem) |
---|
1858 | | - { |
---|
1859 | | - ImportVRMLX3D(); |
---|
1860 | | - } else |
---|
1861 | | - if (source == import3DSItem) |
---|
1862 | | - { |
---|
1863 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1864 | | - } else |
---|
1865 | | - if (source == importOBJItem) |
---|
1866 | | - { |
---|
1867 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1868 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1869 | | - browser.setVisible(true); |
---|
1870 | | - String filename = browser.getFile(); |
---|
1871 | | - if (filename != null && filename.length() > 0) |
---|
1872 | | - { |
---|
1873 | | - String fullname = browser.getDirectory() + filename; |
---|
1874 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1875 | | - } |
---|
1876 | 2170 | } else |
---|
1877 | 2171 | if (source == computeAOItem) |
---|
1878 | 2172 | { |
---|
.. | .. |
---|
1892 | 2186 | if (source == invariantsItem) |
---|
1893 | 2187 | { |
---|
1894 | 2188 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2189 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 2190 | } else |
---|
1897 | 2191 | if (source == memoryItem) |
---|
1898 | 2192 | { |
---|
.. | .. |
---|
1910 | 2204 | if (source == dumpItem) |
---|
1911 | 2205 | { |
---|
1912 | 2206 | DumpObject(); |
---|
| 2207 | + } else |
---|
| 2208 | + if (source == minButton) |
---|
| 2209 | + { |
---|
| 2210 | + Minimize(); |
---|
| 2211 | + } else |
---|
| 2212 | + if (source == maxButton) |
---|
| 2213 | + { |
---|
| 2214 | + Maximize(); |
---|
| 2215 | + } else |
---|
| 2216 | + if (source == fullButton) |
---|
| 2217 | + { |
---|
| 2218 | + ToggleFullScreen(); |
---|
| 2219 | + } else |
---|
| 2220 | + if (source == undoButton) |
---|
| 2221 | + { |
---|
| 2222 | + Undo(); |
---|
| 2223 | + } else |
---|
| 2224 | + if (source == redoButton) |
---|
| 2225 | + { |
---|
| 2226 | + Redo(); |
---|
| 2227 | + } else |
---|
| 2228 | + if (source == saveButton) |
---|
| 2229 | + { |
---|
| 2230 | + Save(); |
---|
1913 | 2231 | } else |
---|
1914 | 2232 | if (source == oneStepButton) |
---|
1915 | 2233 | { |
---|
.. | .. |
---|
1965 | 2283 | { |
---|
1966 | 2284 | loadClipboard(true); |
---|
1967 | 2285 | } else |
---|
| 2286 | + if (source == undoItem) |
---|
| 2287 | + { |
---|
| 2288 | + Undo(); |
---|
| 2289 | + } else |
---|
| 2290 | + if (source == redoItem) |
---|
| 2291 | + { |
---|
| 2292 | + Redo(); |
---|
| 2293 | + } else |
---|
1968 | 2294 | if (source == duplicateItem) |
---|
1969 | 2295 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2296 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2297 | loadClipboard(false); |
---|
1972 | 2298 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2299 | + Grafreed.clipboard = keep; |
---|
1974 | 2300 | } else |
---|
1975 | 2301 | if (source == cloneItem) |
---|
1976 | 2302 | { |
---|
.. | .. |
---|
2190 | 2516 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2517 | // refreshContents(); |
---|
2192 | 2518 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2519 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2520 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2521 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2522 | |
---|
2197 | 2523 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2524 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2568 | } else |
---|
2243 | 2569 | if (source == setMasterItem) |
---|
2244 | 2570 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2571 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2572 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2573 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2574 | |
---|
2249 | 2575 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2576 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2583 | { |
---|
2258 | 2584 | if (group.selection.size() == 1) |
---|
2259 | 2585 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2586 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2587 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2588 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2589 | |
---|
2264 | 2590 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2591 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2602 | { |
---|
2277 | 2603 | RevertMeshes(); |
---|
2278 | 2604 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2605 | + if (source == resetAllItem) |
---|
2280 | 2606 | { |
---|
2281 | 2607 | ResetAll(); |
---|
2282 | 2608 | } else |
---|
.. | .. |
---|
2296 | 2622 | { |
---|
2297 | 2623 | ClearSelection(true); |
---|
2298 | 2624 | } else |
---|
2299 | | - if (source == grabItem) |
---|
| 2625 | + if (source == grabItem || source == groupButton) |
---|
2300 | 2626 | { |
---|
2301 | | - group(new cGroup(), true); |
---|
| 2627 | + group(new cGroup(), false); // true); |
---|
2302 | 2628 | } else |
---|
2303 | 2629 | if (source == hideItem) |
---|
2304 | 2630 | { |
---|
.. | .. |
---|
2316 | 2642 | { |
---|
2317 | 2643 | makeSomething(new Camera()); |
---|
2318 | 2644 | } else |
---|
2319 | | - if (source == compositeItem) |
---|
| 2645 | + if (source == compositeItem || source == compositeButton) |
---|
2320 | 2646 | { |
---|
2321 | 2647 | group(new Composite()); |
---|
2322 | 2648 | } else |
---|
2323 | | - if (source == randomItem) |
---|
| 2649 | + if (source == switchItem || source == switchButton) |
---|
2324 | 2650 | { |
---|
2325 | 2651 | RandomNode random = new RandomNode(); |
---|
2326 | 2652 | group(random); |
---|
.. | .. |
---|
2422 | 2748 | { |
---|
2423 | 2749 | group(new cLinker()); |
---|
2424 | 2750 | } else |
---|
2425 | | - if (source == textureItem) |
---|
| 2751 | + if (source == textureItem || source == textureButton) |
---|
2426 | 2752 | { |
---|
2427 | 2753 | group(new TextureNode()); |
---|
2428 | 2754 | } else |
---|
.. | .. |
---|
2442 | 2768 | { |
---|
2443 | 2769 | CastShadow(2); |
---|
2444 | 2770 | } else |
---|
2445 | | - if (source == ungroupItem) |
---|
| 2771 | + if (source == ungroupItem || source == ungroupButton) |
---|
2446 | 2772 | { |
---|
2447 | | - //ungroup(); |
---|
| 2773 | + boolean hasRoot = false; |
---|
| 2774 | + |
---|
2448 | 2775 | for (int i=0; i<group.selection.size(); i++) |
---|
2449 | 2776 | { |
---|
2450 | | - Ungroup(group.selection.get(i)); |
---|
| 2777 | + if (group.selection.get(i) == group) |
---|
| 2778 | + { |
---|
| 2779 | + hasRoot = true; |
---|
| 2780 | + break; |
---|
| 2781 | + } |
---|
2451 | 2782 | } |
---|
2452 | 2783 | |
---|
2453 | | - ClearSelection(false); |
---|
2454 | | - |
---|
2455 | | - refreshContents(); |
---|
| 2784 | + if (!hasRoot) |
---|
| 2785 | + { |
---|
| 2786 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2787 | + { |
---|
| 2788 | + Ungroup(group.selection.get(i)); |
---|
| 2789 | + } |
---|
| 2790 | + |
---|
| 2791 | + ClearSelection(false); |
---|
| 2792 | + |
---|
| 2793 | + refreshContents(); |
---|
| 2794 | + } |
---|
2456 | 2795 | } else |
---|
2457 | 2796 | if (source == genUVItem) |
---|
2458 | 2797 | { |
---|
.. | .. |
---|
2464 | 2803 | } else |
---|
2465 | 2804 | if (source == genNormalsMESHItem) |
---|
2466 | 2805 | { |
---|
2467 | | - GenNormals(true); // TODO |
---|
| 2806 | + GenNormalsMESH(); |
---|
2468 | 2807 | } else |
---|
2469 | 2808 | if (source == genNormalsORGANItem) |
---|
2470 | 2809 | { |
---|
.. | .. |
---|
2529 | 2868 | if (source == unmarkleavesItem) |
---|
2530 | 2869 | { |
---|
2531 | 2870 | MarkLeaves(false); |
---|
| 2871 | + } else |
---|
| 2872 | + if (source == rewindleavesItem) |
---|
| 2873 | + { |
---|
| 2874 | + RewindLeaves(true); |
---|
| 2875 | + } else |
---|
| 2876 | + if (source == unrewindleavesItem) |
---|
| 2877 | + { |
---|
| 2878 | + RewindLeaves(false); |
---|
| 2879 | + } else |
---|
| 2880 | + if (source == randomleavesItem) |
---|
| 2881 | + { |
---|
| 2882 | + RandomLeaves(true); |
---|
| 2883 | + } else |
---|
| 2884 | + if (source == unrandomleavesItem) |
---|
| 2885 | + { |
---|
| 2886 | + RandomLeaves(false); |
---|
2532 | 2887 | } else |
---|
2533 | 2888 | if (source == flipVItem) |
---|
2534 | 2889 | { |
---|
.. | .. |
---|
2614 | 2969 | { |
---|
2615 | 2970 | SmoothMesh(); |
---|
2616 | 2971 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 2972 | + if (source == transformGeometryItem) |
---|
2618 | 2973 | { |
---|
2619 | 2974 | TransformGeometry(); |
---|
| 2975 | + } else |
---|
| 2976 | + if (source == transformChildrenItem) |
---|
| 2977 | + { |
---|
| 2978 | + TransformChildren(); |
---|
2620 | 2979 | } else |
---|
2621 | 2980 | if (source == resetTransformItem) |
---|
2622 | 2981 | { |
---|
.. | .. |
---|
2624 | 2983 | } else |
---|
2625 | 2984 | if (source == resetCentroidItem) |
---|
2626 | 2985 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 2986 | + ResetCentroid(true); |
---|
| 2987 | + } else |
---|
| 2988 | + if (source == resetCentroidXZItem) |
---|
| 2989 | + { |
---|
| 2990 | + ResetCentroid(false); |
---|
2628 | 2991 | } else |
---|
2629 | 2992 | if (source == resetParentItem) |
---|
2630 | 2993 | { |
---|
.. | .. |
---|
2756 | 3119 | if (source == twoButton) |
---|
2757 | 3120 | { |
---|
2758 | 3121 | radio.layout = twoButton; |
---|
| 3122 | + |
---|
| 3123 | + if (CameraPane.FULLSCREEN) |
---|
| 3124 | + fullscreenLayout = radio.layout; |
---|
| 3125 | + |
---|
2759 | 3126 | // bug |
---|
2760 | 3127 | //gridPanel.setDividerLocation(1.0); |
---|
2761 | 3128 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2788 | 3155 | bigThree.ClearUI(); |
---|
2789 | 3156 | bigThree.add(centralPanel); |
---|
2790 | 3157 | bigThree.FlushUI(); |
---|
| 3158 | + |
---|
| 3159 | + cameraView.requestFocusInWindow(); |
---|
| 3160 | + |
---|
| 3161 | +// refreshContents(true); |
---|
| 3162 | +// |
---|
| 3163 | +// try |
---|
| 3164 | +// { |
---|
| 3165 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3166 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3167 | +// bot.mouseMove(100, 100); |
---|
| 3168 | +// bot.mousePress(mask); |
---|
| 3169 | +// bot.mouseRelease(mask); |
---|
| 3170 | +// } |
---|
| 3171 | +// catch (Exception e) |
---|
| 3172 | +// { |
---|
| 3173 | +// |
---|
| 3174 | +// } |
---|
| 3175 | + |
---|
2791 | 3176 | } else |
---|
2792 | 3177 | if (source == threeButton) |
---|
2793 | 3178 | { |
---|
2794 | 3179 | radio.layout = threeButton; |
---|
| 3180 | + |
---|
| 3181 | + if (CameraPane.FULLSCREEN) |
---|
| 3182 | + fullscreenLayout = radio.layout; |
---|
2795 | 3183 | |
---|
2796 | 3184 | // bigThree.remove(scenePanel); |
---|
2797 | 3185 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2824 | 3212 | bigThree.add(centralPanel); |
---|
2825 | 3213 | bigThree.add(XYZPanel); |
---|
2826 | 3214 | bigThree.FlushUI(); |
---|
| 3215 | + |
---|
| 3216 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3217 | } else |
---|
2828 | 3218 | if (source == fourButton) |
---|
2829 | 3219 | { |
---|
2830 | 3220 | radio.layout = fourButton; |
---|
| 3221 | + |
---|
| 3222 | + if (CameraPane.FULLSCREEN) |
---|
| 3223 | + fullscreenLayout = radio.layout; |
---|
2831 | 3224 | |
---|
2832 | 3225 | // bigThree.remove(scenePanel); |
---|
2833 | 3226 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2859 | 3252 | bigThree.ClearUI(); |
---|
2860 | 3253 | bigThree.add(scenePanel); |
---|
2861 | 3254 | bigThree.FlushUI(); |
---|
| 3255 | + |
---|
| 3256 | + cameraView.requestFocusInWindow(); |
---|
2862 | 3257 | } else |
---|
2863 | 3258 | if (source == sixButton) |
---|
2864 | 3259 | { |
---|
2865 | 3260 | radio.layout = sixButton; |
---|
| 3261 | + |
---|
| 3262 | + if (CameraPane.FULLSCREEN) |
---|
| 3263 | + fullscreenLayout = radio.layout; |
---|
2866 | 3264 | |
---|
2867 | 3265 | // bigThree.remove(scenePanel); |
---|
2868 | 3266 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2895 | 3293 | bigThree.add(scenePanel); |
---|
2896 | 3294 | bigThree.add(centralPanel); |
---|
2897 | 3295 | bigThree.FlushUI(); |
---|
| 3296 | + |
---|
| 3297 | + cameraView.requestFocusInWindow(); |
---|
2898 | 3298 | } else |
---|
2899 | 3299 | if (source == sevenButton) |
---|
2900 | 3300 | { |
---|
2901 | 3301 | radio.layout = sevenButton; |
---|
| 3302 | + |
---|
| 3303 | + if (CameraPane.FULLSCREEN) |
---|
| 3304 | + fullscreenLayout = radio.layout; |
---|
2902 | 3305 | |
---|
2903 | 3306 | // bigThree.remove(scenePanel); |
---|
2904 | 3307 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2932 | 3335 | bigThree.add(centralPanel); |
---|
2933 | 3336 | bigThree.add(XYZPanel); |
---|
2934 | 3337 | bigThree.FlushUI(); |
---|
| 3338 | + |
---|
| 3339 | + cameraView.requestFocusInWindow(); |
---|
2935 | 3340 | } else |
---|
2936 | 3341 | if (source == rootButton) |
---|
2937 | 3342 | { |
---|
.. | .. |
---|
2943 | 3348 | EditObject(obj); |
---|
2944 | 3349 | } |
---|
2945 | 3350 | |
---|
| 3351 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3352 | refreshContents(true); |
---|
2947 | 3353 | } else |
---|
2948 | 3354 | if (source == closeButton) |
---|
.. | .. |
---|
2952 | 3358 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2953 | 3359 | { |
---|
2954 | 3360 | ab = (cRadio)e.nextElement(); |
---|
2955 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3361 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2956 | 3362 | { |
---|
| 3363 | + // Patch to avoid bug with transparency. |
---|
| 3364 | + if (!ab.hadMaterial) |
---|
| 3365 | + { |
---|
| 3366 | + ab.object.material = null; |
---|
| 3367 | + } |
---|
| 3368 | + |
---|
2957 | 3369 | buttonGroup.remove(ab); |
---|
2958 | 3370 | radioPanel.remove(ab); |
---|
2959 | 3371 | |
---|
2960 | | - ab.GetObject().editWindow = null; |
---|
| 3372 | + //ab.GetObject().editWindow = null; |
---|
| 3373 | + ab.GetObject().manipWindow = null; |
---|
2961 | 3374 | // ab.GetObject().objectUI = null; // ????????? |
---|
2962 | 3375 | |
---|
2963 | 3376 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2964 | 3377 | break; |
---|
2965 | 3378 | } |
---|
2966 | 3379 | } |
---|
| 3380 | + |
---|
| 3381 | + cameraView.requestFocusInWindow(); |
---|
2967 | 3382 | refreshContents(true); |
---|
2968 | 3383 | } else |
---|
2969 | 3384 | if (source == editItem || source == editButton) |
---|
2970 | 3385 | { |
---|
| 3386 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3387 | + { |
---|
| 3388 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3389 | + child.pinned = true; |
---|
| 3390 | + } |
---|
| 3391 | + |
---|
2971 | 3392 | EditSelection(false); |
---|
2972 | 3393 | } else |
---|
2973 | 3394 | if (source == uneditButton) |
---|
.. | .. |
---|
2977 | 3398 | Object3D child = (Object3D)e.nextElement(); |
---|
2978 | 3399 | if(child.editWindow != null) |
---|
2979 | 3400 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3401 | + child.pinned = false; |
---|
2980 | 3402 | child.CloseUI(); |
---|
2981 | 3403 | listUI.remove(child); |
---|
2982 | 3404 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3405 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3406 | } |
---|
2985 | 3407 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3408 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2993 | 3415 | //copy.ClearUI(); |
---|
2994 | 3416 | for (Object3D obj : listUI) |
---|
2995 | 3417 | { |
---|
| 3418 | + obj.pinned = false; |
---|
2996 | 3419 | obj.CloseUI(); |
---|
2997 | 3420 | } |
---|
2998 | 3421 | listUI.clear(); |
---|
.. | .. |
---|
3002 | 3425 | { |
---|
3003 | 3426 | assert(copy == group); |
---|
3004 | 3427 | |
---|
3005 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3428 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3006 | 3429 | |
---|
3007 | 3430 | for (Object3D obj : listUI) |
---|
3008 | 3431 | { |
---|
.. | .. |
---|
3066 | 3489 | frontView.object = group; |
---|
3067 | 3490 | sideView.object = group; |
---|
3068 | 3491 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 3492 | + |
---|
| 3493 | +// fix "+" issue |
---|
| 3494 | + //group.editWindow = this; |
---|
| 3495 | + group.manipWindow = this; |
---|
| 3496 | + |
---|
3070 | 3497 | /* |
---|
3071 | 3498 | currentLayout = radio.layout; |
---|
3072 | 3499 | if (currentLayout == null) |
---|
3073 | 3500 | currentLayout = sevenButton; |
---|
3074 | 3501 | */ |
---|
3075 | 3502 | radio.layout.doClick(); |
---|
| 3503 | + |
---|
| 3504 | + ClearUnpinned(); |
---|
| 3505 | + SetPinStates(group.selection.size() > 0); |
---|
| 3506 | + if (group.selection.size() == 1) |
---|
| 3507 | + EditSelection(false); |
---|
3076 | 3508 | keepparent = group.parent; |
---|
3077 | 3509 | // PARENT = NULL or not??? |
---|
3078 | 3510 | //group.parent = null; // ROOT |
---|
3079 | 3511 | //group.attributes = -1; |
---|
3080 | 3512 | ResetModel(); |
---|
| 3513 | + |
---|
| 3514 | + cameraView.requestFocusInWindow(); |
---|
3081 | 3515 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3516 | + } else if (event.getSource() == editCameraItem) |
---|
| 3517 | + { |
---|
| 3518 | + cameraView.ProtectCamera(); |
---|
| 3519 | + cameraView.repaint(); |
---|
| 3520 | + return; |
---|
| 3521 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3522 | + { |
---|
| 3523 | + cameraView.RevertCamera(); |
---|
| 3524 | + cameraView.repaint(); |
---|
| 3525 | + return; |
---|
| 3526 | + // } else if (event.getSource() == textureButton) |
---|
| 3527 | + // { |
---|
| 3528 | + // return; // true; |
---|
| 3529 | + } |
---|
3083 | 3530 | else |
---|
3084 | 3531 | { |
---|
3085 | 3532 | //return super.action(event, arg); |
---|
.. | .. |
---|
3088 | 3535 | } |
---|
3089 | 3536 | |
---|
3090 | 3537 | boolean useclient = false; |
---|
3091 | | - cRadio radio; |
---|
3092 | 3538 | |
---|
3093 | 3539 | void ToggleRoot() |
---|
3094 | 3540 | { |
---|
.. | .. |
---|
3140 | 3586 | refreshContents(); |
---|
3141 | 3587 | } |
---|
3142 | 3588 | |
---|
| 3589 | + void TransformChildren() |
---|
| 3590 | + { |
---|
| 3591 | + Object3D obj; |
---|
| 3592 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3593 | + { |
---|
| 3594 | + obj = (Object3D)e.nextElement(); |
---|
| 3595 | + obj.KeepTextureMatrices(); |
---|
| 3596 | + obj.TransformChildren(); |
---|
| 3597 | + obj.RestoreTextureMatrices(); |
---|
| 3598 | + |
---|
| 3599 | +// if (obj.parent == null) |
---|
| 3600 | +// { |
---|
| 3601 | +// System.out.println("NULL PARENT!"); |
---|
| 3602 | +// new Exception().printStackTrace(); |
---|
| 3603 | +// } |
---|
| 3604 | +// else |
---|
| 3605 | +// TouchTransform(obj); |
---|
| 3606 | +// //obj.parent.Touch(); |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + refreshContents(); |
---|
| 3610 | + } |
---|
3143 | 3611 | |
---|
3144 | 3612 | void ResetTransform() |
---|
3145 | 3613 | { |
---|
.. | .. |
---|
3252 | 3720 | refreshContents(); |
---|
3253 | 3721 | } |
---|
3254 | 3722 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3723 | + void ResetCentroid(boolean full) |
---|
3256 | 3724 | { |
---|
3257 | 3725 | Object3D obj; |
---|
3258 | 3726 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3735 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3736 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3737 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3738 | + if (full) |
---|
| 3739 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3740 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3741 | obj.TransformMesh(Object3D.mat); |
---|
| 3742 | + |
---|
3273 | 3743 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3744 | + if (full) |
---|
| 3745 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3746 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3747 | + |
---|
3276 | 3748 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3749 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3750 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3301 | 3773 | |
---|
3302 | 3774 | int size = obj.MemorySize(); |
---|
3303 | 3775 | |
---|
3304 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3776 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3777 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3305 | 3778 | } |
---|
3306 | 3779 | } |
---|
3307 | 3780 | catch (Exception e) |
---|
.. | .. |
---|
3338 | 3811 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3812 | |
---|
3340 | 3813 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3814 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3815 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3816 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3817 | |
---|
3345 | 3818 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3819 | } |
---|
.. | .. |
---|
3382 | 3855 | void GenNormals(boolean crease) |
---|
3383 | 3856 | { |
---|
3384 | 3857 | group.GenNormalsS(crease); |
---|
| 3858 | + |
---|
| 3859 | + refreshContents(); |
---|
| 3860 | + } |
---|
| 3861 | + |
---|
| 3862 | + void GenNormalsMESH() |
---|
| 3863 | + { |
---|
| 3864 | + group.GenNormalsMeshS(); |
---|
3385 | 3865 | |
---|
3386 | 3866 | refreshContents(); |
---|
3387 | 3867 | } |
---|
.. | .. |
---|
3554 | 4034 | |
---|
3555 | 4035 | void ParseVertices() |
---|
3556 | 4036 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 4037 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4038 | + Grafreed.epsequal = true; |
---|
3559 | 4039 | |
---|
3560 | 4040 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 4041 | { |
---|
.. | .. |
---|
3580 | 4060 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 4061 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 4062 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 4063 | + g.add(Grafreed.clipboard); |
---|
3584 | 4064 | |
---|
3585 | 4065 | buffer.add(g); |
---|
3586 | 4066 | } |
---|
.. | .. |
---|
3595 | 4075 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 4076 | } |
---|
3597 | 4077 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 4078 | + Grafreed.epsequal = epsequal; |
---|
3599 | 4079 | |
---|
3600 | 4080 | refreshContents(); |
---|
3601 | 4081 | } |
---|
.. | .. |
---|
3613 | 4093 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 4094 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 4095 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4096 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4097 | + |
---|
| 4098 | + try |
---|
| 4099 | + { |
---|
| 4100 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4101 | + } |
---|
| 4102 | + catch (Exception e) |
---|
| 4103 | + { |
---|
| 4104 | + System.err.println("FAIL: " + node); |
---|
| 4105 | + } |
---|
3617 | 4106 | |
---|
3618 | 4107 | double s = v.s; |
---|
3619 | 4108 | |
---|
.. | .. |
---|
3745 | 4234 | return; |
---|
3746 | 4235 | |
---|
3747 | 4236 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4237 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 4238 | |
---|
3750 | 4239 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 4240 | |
---|
.. | .. |
---|
3939 | 4428 | |
---|
3940 | 4429 | void ClipMesh() |
---|
3941 | 4430 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4431 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4432 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4433 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4434 | |
---|
3946 | 4435 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4436 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4439 | // { |
---|
3951 | 4440 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4441 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4442 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4443 | } |
---|
3955 | 4444 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4445 | System.out.println("DONE."); |
---|
.. | .. |
---|
3997 | 4486 | void MarkLeaves(boolean hide) |
---|
3998 | 4487 | { |
---|
3999 | 4488 | group.selection.MarkLeaves(hide); |
---|
| 4489 | + refreshContents(); |
---|
| 4490 | + } |
---|
| 4491 | + |
---|
| 4492 | + void RewindLeaves(boolean hide) |
---|
| 4493 | + { |
---|
| 4494 | + group.selection.RewindLeaves(hide); |
---|
| 4495 | + refreshContents(); |
---|
| 4496 | + } |
---|
| 4497 | + |
---|
| 4498 | + void RandomLeaves(boolean hide) |
---|
| 4499 | + { |
---|
| 4500 | + group.selection.RandomLeaves(hide); |
---|
4000 | 4501 | refreshContents(); |
---|
4001 | 4502 | } |
---|
4002 | 4503 | |
---|
.. | .. |
---|
4071 | 4572 | // } |
---|
4072 | 4573 | // } |
---|
4073 | 4574 | |
---|
4074 | | - static boolean allparams = true; |
---|
4075 | | - |
---|
4076 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4077 | | - |
---|
4078 | 4575 | void EditSelection(boolean newWindow) |
---|
4079 | 4576 | { |
---|
4080 | 4577 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4082 | 4579 | { |
---|
4083 | 4580 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4084 | 4581 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4085 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4582 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 4583 | |
---|
4087 | 4584 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 4585 | + if(elem != group || !newWindow) |
---|
4089 | 4586 | { |
---|
4090 | 4587 | // if (!(elem instanceof Composite)) |
---|
4091 | 4588 | // newWindow = false; |
---|
.. | .. |
---|
4167 | 4664 | //new Exception().printStackTrace(); |
---|
4168 | 4665 | |
---|
4169 | 4666 | freezemodel = true; |
---|
4170 | | - |
---|
| 4667 | + ClearUnpinned(); |
---|
| 4668 | + |
---|
4171 | 4669 | /**/ |
---|
4172 | 4670 | //switch (event.id) |
---|
4173 | 4671 | { |
---|
.. | .. |
---|
4175 | 4673 | //case 702: // Event.LIST_DESELECT |
---|
4176 | 4674 | group.deselectAll(); |
---|
4177 | 4675 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4178 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4179 | 4676 | if (tps != null) |
---|
4180 | 4677 | { |
---|
4181 | 4678 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4184 | 4681 | |
---|
4185 | 4682 | //if (child.parent != null) |
---|
4186 | 4683 | //child.parent.addSelectee(child); |
---|
| 4684 | + objEditor.SetMaterial(child); |
---|
4187 | 4685 | group.addSelectee(child); |
---|
4188 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4189 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4190 | | - System.err.println("info : " + child.GetPath()); |
---|
4191 | 4686 | } |
---|
4192 | 4687 | } |
---|
4193 | 4688 | // else |
---|
.. | .. |
---|
4197 | 4692 | // System.err.println("info : " + group.GetPath()); |
---|
4198 | 4693 | // } |
---|
4199 | 4694 | |
---|
4200 | | - objEditor.SetText(); // jan 2014 |
---|
4201 | | - |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4695 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 4696 | CameraPane.flash = true; |
---|
4204 | 4697 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4698 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 4699 | // a camera |
---|
4207 | 4700 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4701 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4702 | + { |
---|
| 4703 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4704 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4705 | + } |
---|
4210 | 4706 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 4707 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 4708 | } |
---|
4213 | 4709 | |
---|
| 4710 | + if (tps != null && tps.length == 1) |
---|
| 4711 | + { |
---|
| 4712 | + EditSelection(false); |
---|
| 4713 | + } |
---|
| 4714 | + |
---|
| 4715 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4716 | + |
---|
4214 | 4717 | refreshContents(); |
---|
4215 | 4718 | //return true; |
---|
4216 | 4719 | } |
---|
.. | .. |
---|
4219 | 4722 | |
---|
4220 | 4723 | freezemodel = false; |
---|
4221 | 4724 | } |
---|
| 4725 | + |
---|
| 4726 | + void SetPinStates(boolean enabled) |
---|
| 4727 | + { |
---|
| 4728 | + editButton.setEnabled(enabled); |
---|
| 4729 | + uneditButton.setEnabled(enabled); |
---|
| 4730 | + unselectButton.setEnabled(enabled); |
---|
| 4731 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4732 | + } |
---|
| 4733 | + |
---|
| 4734 | + void refreshContents(boolean cp) |
---|
| 4735 | + { |
---|
| 4736 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4737 | + if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4738 | + { |
---|
| 4739 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4740 | + |
---|
| 4741 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4742 | + { |
---|
| 4743 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4744 | + |
---|
| 4745 | + objEditor.AddInfo(child, this, true); |
---|
| 4746 | + System.err.println("info : " + child.GetPath()); |
---|
| 4747 | + } |
---|
| 4748 | + |
---|
| 4749 | + objEditor.SetText(); // jan 2014 |
---|
| 4750 | + } |
---|
| 4751 | + |
---|
| 4752 | + super.refreshContents(cp); |
---|
| 4753 | + } |
---|
4222 | 4754 | |
---|
4223 | 4755 | void linkSomething(Object3D thing) |
---|
4224 | 4756 | { |
---|
.. | .. |
---|
4290 | 4822 | { |
---|
4291 | 4823 | if (group.selection.isEmpty()) |
---|
4292 | 4824 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4825 | + |
---|
| 4826 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4827 | Composite tGroup = null; |
---|
4295 | 4828 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4829 | { |
---|
4297 | 4830 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4831 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4832 | } |
---|
4300 | 4833 | |
---|
4301 | 4834 | if (cut) |
---|
4302 | 4835 | { |
---|
| 4836 | + if (Globals.SAVEONMAKE) |
---|
| 4837 | + Save(); |
---|
4303 | 4838 | //int indices[] = jList.getSelectedIndices(); |
---|
4304 | 4839 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4305 | 4840 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4335 | 4870 | //System.out.println("cut " + child); |
---|
4336 | 4871 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4872 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4873 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4874 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4875 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4876 | + Grafreed.clipboard = tmp; |
---|
4342 | 4877 | } |
---|
4343 | 4878 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4879 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4880 | tGroup.add/*Child*/(child); |
---|
4346 | 4881 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4882 | + Grafreed.clipboard = child; |
---|
4348 | 4883 | } |
---|
4349 | 4884 | |
---|
4350 | 4885 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4911 | //System.out.println("cut " + elem); |
---|
4377 | 4912 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4913 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4914 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4915 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4916 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4917 | + Grafreed.clipboard = tmp; |
---|
4383 | 4918 | } |
---|
4384 | 4919 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4920 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4921 | tGroup.add/*Child*/(child); |
---|
4387 | 4922 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4923 | + Grafreed.clipboard = child; |
---|
4389 | 4924 | } |
---|
4390 | 4925 | |
---|
4391 | 4926 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4927 | + |
---|
| 4928 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4929 | + Grafreed.clipboard = tGroup; |
---|
| 4930 | + |
---|
4394 | 4931 | if (cut) |
---|
4395 | 4932 | { |
---|
4396 | 4933 | ResetModel(); |
---|
.. | .. |
---|
4404 | 4941 | // return; |
---|
4405 | 4942 | boolean first = true; |
---|
4406 | 4943 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4944 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 4945 | { |
---|
4409 | 4946 | Composite temp; |
---|
4410 | 4947 | |
---|
.. | .. |
---|
4415 | 4952 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 4953 | */ |
---|
4417 | 4954 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4955 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 4956 | { |
---|
4420 | 4957 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 4958 | |
---|
.. | .. |
---|
4449 | 4986 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 4987 | //temp.addChild(cb); |
---|
4451 | 4988 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4452 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4453 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4454 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4455 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4456 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4989 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4990 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4991 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4992 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4993 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 4994 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4995 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4996 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 4997 | } |
---|
4461 | 4998 | |
---|
4462 | 4999 | ResetModel(); |
---|
.. | .. |
---|
4505 | 5042 | { |
---|
4506 | 5043 | boolean first = true; |
---|
4507 | 5044 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5045 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 5046 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5047 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 5048 | Object3D copy; |
---|
4512 | 5049 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 5050 | { |
---|
.. | .. |
---|
4517 | 5054 | } |
---|
4518 | 5055 | } else |
---|
4519 | 5056 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5057 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 5058 | } |
---|
4522 | 5059 | } |
---|
4523 | 5060 | } |
---|
.. | .. |
---|
4922 | 5459 | } |
---|
4923 | 5460 | */ |
---|
4924 | 5461 | |
---|
4925 | | - void ImportGFD() |
---|
4926 | | - { |
---|
4927 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4928 | | - browser.show(); |
---|
4929 | | - String filename = browser.getFile(); |
---|
4930 | | - if (filename != null && filename.length() > 0) |
---|
4931 | | - { |
---|
4932 | | - String fullname = browser.getDirectory() + filename; |
---|
4933 | | - |
---|
4934 | | - //Object3D readobj = |
---|
4935 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4936 | | - //makeSomething(readobj); |
---|
4937 | | - } |
---|
4938 | | - } |
---|
4939 | | - |
---|
4940 | 5462 | /* |
---|
4941 | 5463 | public void Callback(Object obj) |
---|
4942 | 5464 | { |
---|
.. | .. |
---|
4960 | 5482 | } |
---|
4961 | 5483 | */ |
---|
4962 | 5484 | |
---|
4963 | | - void ImportVRMLX3D() |
---|
4964 | | - { |
---|
4965 | | - if (GrafreeD.standAlone) |
---|
4966 | | - { |
---|
4967 | | - /**/ |
---|
4968 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4969 | | - browser.show(); |
---|
4970 | | - String filename = browser.getFile(); |
---|
4971 | | - if (filename != null && filename.length() > 0) |
---|
4972 | | - { |
---|
4973 | | - String fullname = browser.getDirectory() + filename; |
---|
4974 | | - LoadVRMLX3D(fullname); |
---|
4975 | | - } |
---|
4976 | | - /**/ |
---|
4977 | | - } |
---|
4978 | | - } |
---|
4979 | | - |
---|
4980 | 5485 | String GetFile(String dialogName) |
---|
4981 | 5486 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5487 | + if (Grafreed.standAlone) |
---|
4983 | 5488 | { |
---|
4984 | 5489 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5490 | browser.show(); |
---|
.. | .. |
---|
5047 | 5552 | cButton clearpanelButton; |
---|
5048 | 5553 | cButton unselectButton; |
---|
5049 | 5554 | |
---|
| 5555 | + cButton restoreCameraButton; |
---|
| 5556 | + |
---|
| 5557 | + cButton saveButton; |
---|
5050 | 5558 | cButton oneStepButton; |
---|
| 5559 | + |
---|
| 5560 | + cButton groupButton; |
---|
| 5561 | + cButton ungroupButton; |
---|
| 5562 | + cButton compositeButton; |
---|
| 5563 | + cButton switchButton; |
---|
| 5564 | + cButton loopButton; |
---|
| 5565 | + cButton textureButton; |
---|
| 5566 | + |
---|
| 5567 | + cButton gridButton; |
---|
| 5568 | + cButton boxButton; |
---|
| 5569 | + cButton sphereButton; |
---|
| 5570 | + cButton coneButton; |
---|
| 5571 | + cButton torusButton; |
---|
| 5572 | + cButton superButton; |
---|
| 5573 | + cButton kleinButton; |
---|
| 5574 | + cButton particlesButton; |
---|
| 5575 | + cButton overlayButton; |
---|
| 5576 | + cButton lightButton; |
---|
5051 | 5577 | |
---|
5052 | 5578 | cButton screenfitButton; |
---|
5053 | 5579 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5060 | 5586 | |
---|
5061 | 5587 | cButton setsupportButton; |
---|
5062 | 5588 | |
---|
5063 | | - cButton twoButton; |
---|
5064 | | - cButton sixButton; |
---|
5065 | | - cButton threeButton; |
---|
5066 | | - cButton sevenButton; |
---|
5067 | | - cButton fourButton; // full panel |
---|
5068 | | - cButton oneButton; // full XYZ |
---|
5069 | | - //cButton currentLayout; |
---|
5070 | | - |
---|
5071 | 5589 | // |
---|
5072 | 5590 | //Composite |
---|
5073 | 5591 | Object3D // to do !! |
---|
.. | .. |
---|
5077 | 5595 | //JTree jTree; |
---|
5078 | 5596 | private MenuItem lookAtItem; |
---|
5079 | 5597 | private MenuItem lookFromItem; |
---|
5080 | | - private MenuItem switchItem; |
---|
| 5598 | + private MenuItem switchViewItem; |
---|
5081 | 5599 | private MenuItem cutItem; |
---|
5082 | | - private MenuItem duplicateItem; |
---|
| 5600 | + private MenuItem undoItem; |
---|
| 5601 | + private MenuItem redoItem; |
---|
| 5602 | + private JMenuItem duplicateItem; |
---|
5083 | 5603 | private MenuItem cloneItem; |
---|
5084 | 5604 | private MenuItem cloneSupportItem; |
---|
5085 | 5605 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5092 | 5612 | private MenuItem linkverticesItem; |
---|
5093 | 5613 | private MenuItem relinkverticesItem; |
---|
5094 | 5614 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5615 | + private MenuItem resetAllItem; |
---|
5096 | 5616 | private MenuItem stepAllItem; |
---|
5097 | 5617 | private MenuItem revertMeshItem; |
---|
5098 | 5618 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5142 | 5662 | private MenuItem showleavesItem; |
---|
5143 | 5663 | private MenuItem markleavesItem; |
---|
5144 | 5664 | private MenuItem unmarkleavesItem; |
---|
| 5665 | + private MenuItem rewindleavesItem; |
---|
| 5666 | + private MenuItem unrewindleavesItem; |
---|
| 5667 | + private MenuItem randomleavesItem; |
---|
| 5668 | + private MenuItem unrandomleavesItem; |
---|
5145 | 5669 | |
---|
5146 | 5670 | private MenuItem flipVItem; |
---|
5147 | 5671 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5153 | 5677 | private MenuItem panoTexturesItem; |
---|
5154 | 5678 | |
---|
5155 | 5679 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5680 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5681 | private MenuItem resetTransformItem; |
---|
| 5682 | + private MenuItem transformGeometryItem; |
---|
| 5683 | + private MenuItem transformChildrenItem; |
---|
5158 | 5684 | private MenuItem hideItem; |
---|
5159 | 5685 | private MenuItem grabItem; |
---|
5160 | 5686 | private MenuItem backItem; |
---|
5161 | 5687 | private MenuItem frontItem; |
---|
5162 | 5688 | private MenuItem cameraItem; |
---|
5163 | 5689 | private MenuItem compositeItem; |
---|
5164 | | - private MenuItem randomItem; |
---|
| 5690 | + private MenuItem switchItem; |
---|
5165 | 5691 | private MenuItem physicsItem; |
---|
5166 | 5692 | private MenuItem frameselectorItem; |
---|
5167 | 5693 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5223 | 5749 | private MenuItem doubleItem; |
---|
5224 | 5750 | private MenuItem tripleItem; |
---|
5225 | 5751 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 5752 | private MenuItem computeAOItem; |
---|
5232 | 5753 | private MenuItem recompileItem; |
---|
5233 | 5754 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 5758 | private MenuItem analyzeItem; |
---|
5238 | 5759 | private MenuItem dumpItem; |
---|
5239 | 5760 | //boolean freezemodel = false; |
---|
| 5761 | + |
---|
| 5762 | + Menu cameraMenu; |
---|
| 5763 | + MenuItem editCameraItem; |
---|
| 5764 | + MenuItem restoreCameraItem; |
---|
5240 | 5765 | } |
---|