.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 83 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
80 | 92 | SetupViews(objEditor); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
100 | 117 | { |
---|
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)); |
---|
| 118 | + assert(Grafreed.clipboard.parent == null); |
---|
| 119 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 120 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 121 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 122 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 123 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 124 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 125 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 126 | } |
---|
110 | 127 | |
---|
111 | 128 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 136 | // obj.support = null; |
---|
120 | 137 | if (!supports) |
---|
121 | 138 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 139 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 140 | obj.parent = parent; |
---|
124 | 141 | // obj.support = support; |
---|
125 | 142 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 165 | |
---|
149 | 166 | //JTextField nameField; |
---|
150 | 167 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 168 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
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 | | - |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
168 | 172 | Menu menu; |
---|
169 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 175 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 176 | + |
---|
| 177 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 178 | +// undoItem.addActionListener(this); |
---|
| 179 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 180 | +// redoItem.addActionListener(this); |
---|
| 181 | +// menu.add("-"); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 183 | duplicateItem.addActionListener(this); |
---|
174 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 185 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 195 | copyItem.addActionListener(this); |
---|
186 | 196 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 197 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 198 | |
---|
190 | 199 | menu.add("-"); |
---|
191 | 200 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 215 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 216 | clearAllItem.addActionListener(this); |
---|
208 | 217 | } |
---|
| 218 | + |
---|
| 219 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 220 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 221 | + //zBufferItem.addActionListener(this); |
---|
| 222 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 223 | + //normalLensItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
| 226 | + |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 239 | + |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 241 | + toggleHandleItem.addItemListener(this); |
---|
| 242 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 245 | + togglePaintItem.addItemListener(this); |
---|
| 246 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 247 | + |
---|
| 248 | + if (Globals.ADVANCED) |
---|
| 249 | + { |
---|
| 250 | + cameraMenu.add("-"); |
---|
| 251 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 252 | + toggleLiveItem.addItemListener(this); |
---|
| 253 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 254 | |
---|
| 255 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 256 | + stepItem.addActionListener(this); |
---|
| 257 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 258 | + // toggleDLItem.addItemListener(this); |
---|
| 259 | + // toggleDLItem.setState(false); |
---|
| 260 | + |
---|
| 261 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 262 | + toggleRenderItem.addItemListener(this); |
---|
| 263 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 264 | + |
---|
| 265 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 266 | + toggleDebugItem.addItemListener(this); |
---|
| 267 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 268 | + |
---|
| 269 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 270 | + toggleFrustumItem.addItemListener(this); |
---|
| 271 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 272 | + |
---|
| 273 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 274 | + toggleFootContactItem.addItemListener(this); |
---|
| 275 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 276 | + |
---|
| 277 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 278 | + toggleTimelineItem.addItemListener(this); |
---|
| 279 | + } |
---|
| 280 | + |
---|
| 281 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 282 | +// toggleRootItem.addItemListener(this); |
---|
| 283 | +// toggleRootItem.setState(false); |
---|
| 284 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 285 | +// animationItem.addItemListener(this); |
---|
| 286 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 287 | + cameraMenu.add("-"); |
---|
| 288 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 289 | + editCameraItem.addActionListener(this); |
---|
| 290 | + |
---|
| 291 | + if (Globals.ADVANCED) |
---|
| 292 | + { |
---|
| 293 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 294 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 296 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 297 | + oe.cameraMenu.add("-"); |
---|
| 298 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 299 | + openWindowItem.addActionListener(this); |
---|
| 300 | + editLeafItem.addActionListener(this); |
---|
| 301 | + lookAtItem.addActionListener(this); |
---|
| 302 | + //lookFromItem.addActinoListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
| 304 | + } |
---|
| 305 | + |
---|
210 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 307 | if (Globals.ADVANCED) |
---|
212 | 308 | { |
---|
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 | 309 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 310 | revertMeshItem.addActionListener(this); |
---|
219 | 311 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
253 | 345 | } |
---|
254 | 346 | |
---|
255 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
256 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
257 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
258 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
259 | 351 | backItem.addActionListener(this); |
---|
260 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
261 | 353 | frontItem.addActionListener(this); |
---|
262 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
263 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
264 | 359 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
265 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
266 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
267 | 363 | ungroupItem.addActionListener(this); |
---|
268 | | - menu.add("-"); |
---|
269 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
270 | | - randomItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
271 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
272 | 372 | switchGeoItem.addActionListener(this); |
---|
273 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
275 | 375 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
276 | 376 | morphItem.addActionListener(this); |
---|
277 | 377 | |
---|
278 | | - if (Globals.ADVANCED) |
---|
279 | | - { |
---|
280 | 378 | menu.add("-"); |
---|
281 | 379 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
282 | 380 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
284 | 382 | frameselectorItem.addActionListener(this); |
---|
285 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
286 | 384 | scriptNodeItem.addActionListener(this); |
---|
287 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
288 | | - cameraItem.addActionListener(this); |
---|
289 | 385 | } |
---|
290 | 386 | |
---|
291 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
292 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
293 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
294 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
295 | 391 | billboardItem.addActionListener(this); |
---|
296 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 393 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 394 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 395 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 396 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 397 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 398 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
304 | 403 | if (Globals.ADVANCED) |
---|
305 | 404 | { |
---|
306 | 405 | menu.add("-"); |
---|
307 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
308 | 407 | linkerItem.addActionListener(this); |
---|
309 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
310 | | - attributeItem.addActionListener(this); |
---|
311 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
312 | 409 | templateItem.addActionListener(this); |
---|
313 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
318 | 415 | resetTransformItem.addActionListener(this); |
---|
319 | 416 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 417 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 418 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 419 | + resetCentroidXZItem.addActionListener(this); |
---|
| 420 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 421 | + transformGeometryItem.addActionListener(this); |
---|
| 422 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 423 | + transformChildrenItem.addActionListener(this); |
---|
323 | 424 | |
---|
324 | 425 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 426 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 469 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 470 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 471 | clearMaterialsItem.addActionListener(this); |
---|
| 472 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 473 | + resetAllItem.addActionListener(this); |
---|
| 474 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 475 | + stepAllItem.addActionListener(this); |
---|
371 | 476 | menu.add("-"); |
---|
372 | 477 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 478 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 493 | markleavesItem.addActionListener(this); |
---|
389 | 494 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 495 | unmarkleavesItem.addActionListener(this); |
---|
| 496 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 497 | + rewindleavesItem.addActionListener(this); |
---|
| 498 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 499 | + unrewindleavesItem.addActionListener(this); |
---|
| 500 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 501 | + randomleavesItem.addActionListener(this); |
---|
| 502 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 503 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 504 | menu.add("-"); |
---|
392 | 505 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 506 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 535 | sortbysizeItem.addActionListener(this); |
---|
423 | 536 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 537 | sortbynameItem.addActionListener(this); |
---|
| 538 | + menu.add("-"); |
---|
| 539 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 540 | + shareGeometriesItem.addActionListener(this); |
---|
| 541 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 542 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 543 | if (Globals.ADVANCED) |
---|
426 | 544 | { |
---|
427 | | - menu.add("-"); |
---|
| 545 | + // Pretty much the same as duplicate and clone. |
---|
428 | 546 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 547 | extractGeometriesItem.addActionListener(this); |
---|
430 | 548 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 549 | 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 | 550 | } |
---|
437 | 551 | |
---|
438 | 552 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 553 | buildCreateMenu(menu); |
---|
440 | 554 | |
---|
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 | 555 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 556 | buildToolsMenu(menu); |
---|
456 | 557 | } |
---|
457 | 558 | |
---|
| 559 | + |
---|
458 | 560 | void SetupUI2(ObjEditor oe) |
---|
459 | 561 | { |
---|
| 562 | + // June 2019 |
---|
| 563 | + if (oe == null) |
---|
| 564 | + { |
---|
| 565 | + //super.SetupUI2(this); |
---|
| 566 | + //return; |
---|
| 567 | + } |
---|
| 568 | + |
---|
| 569 | + if (copy != group) |
---|
| 570 | + { |
---|
| 571 | + //super.SetupUI2(this); |
---|
| 572 | + } |
---|
| 573 | + |
---|
460 | 574 | //new Exception().printStackTrace(); |
---|
461 | 575 | |
---|
462 | 576 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
485 | 599 | oe.radioPanel.add(dummyButton); |
---|
486 | 600 | oe.buttonGroup.add(dummyButton); |
---|
487 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
488 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 607 | |
---|
490 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 608 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + //minButton.setToolTipText("Minimize window"); |
---|
| 610 | + //minButton.addActionListener(this); |
---|
| 611 | + |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
| 618 | + |
---|
| 619 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 621 | + fullButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
| 630 | + |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
| 633 | + saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
| 639 | + |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 659 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 660 | liveCB.addItemListener(this); |
---|
493 | 661 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 664 | oneStepButton.addActionListener(this); |
---|
497 | 665 | |
---|
498 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
499 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
500 | 668 | fastCB.addItemListener(this); |
---|
501 | 669 | |
---|
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); |
---|
507 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
508 | | - screenfitButton.addActionListener(this); |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
509 | 675 | |
---|
510 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
511 | 677 | // screenfitpointButton.addActionListener(this); |
---|
512 | 678 | |
---|
513 | 679 | if (Globals.ADVANCED) |
---|
514 | 680 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 681 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 682 | snapobjectButton.addActionListener(this); |
---|
517 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
518 | 684 | } |
---|
519 | 685 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
523 | 687 | |
---|
524 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | | - |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 689 | twoButton.setToolTipText("Show center view only"); |
---|
528 | 690 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 691 | + this.fullscreenLayout = twoButton; |
---|
| 692 | + |
---|
| 693 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 694 | fourButton.addActionListener(this); |
---|
531 | 695 | fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 696 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 697 | sixButton.setToolTipText("2-column layout left"); |
---|
534 | 698 | sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 700 | threeButton.setToolTipText("2-column layout right"); |
---|
537 | 701 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | 703 | sevenButton.setToolTipText("3-column layout"); |
---|
540 | 704 | sevenButton.addActionListener(this); |
---|
541 | 705 | // |
---|
542 | 706 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 708 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
545 | 709 | rootButton.addActionListener(this); |
---|
546 | 710 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 712 | closeButton.setToolTipText("Close tab"); |
---|
549 | 713 | closeButton.addActionListener(this); |
---|
550 | 714 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
551 | 715 | //clearButton.addActionListener(this); |
---|
552 | | - |
---|
553 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 716 | + |
---|
| 717 | + // INSERT |
---|
| 718 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + gridButton.setToolTipText("Create grid"); |
---|
| 720 | + gridButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + boxButton.setToolTipText("Create box"); |
---|
| 724 | + boxButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 728 | + sphereButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + coneButton.setToolTipText("Create cone"); |
---|
| 732 | + coneButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + torusButton.setToolTipText("Create torus"); |
---|
| 736 | + torusButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 740 | + superButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + if (Globals.ADVANCED) |
---|
| 743 | + { |
---|
| 744 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 745 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 746 | + kleinButton.addActionListener(this); |
---|
| 747 | + } |
---|
554 | 748 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | | - editButton.setToolTipText("Edit selection"); |
---|
| 749 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 751 | + particlesButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + groupButton.setToolTipText("Create group"); |
---|
| 757 | + groupButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + compositeButton.setToolTipText("Create composite"); |
---|
| 761 | + compositeButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 765 | + switchButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + loopButton.setToolTipText("Create loop"); |
---|
| 769 | + loopButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + textureButton.setToolTipText("Create texture"); |
---|
| 773 | + textureButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 777 | + overlayButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + lightButton.setToolTipText("Create light"); |
---|
| 781 | + lightButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + for (int i=6; --i>=0;) |
---|
| 784 | + { |
---|
| 785 | + oe.toolboxPanel.Return(); |
---|
| 786 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + } |
---|
| 794 | + |
---|
| 795 | + // EDIT panel |
---|
| 796 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + editButton.setToolTipText("Pin selection controls"); |
---|
557 | 798 | editButton.addActionListener(this); |
---|
558 | 799 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 800 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
561 | 802 | uneditButton.addActionListener(this); |
---|
562 | 803 | |
---|
563 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
564 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 804 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 805 | + allParamsButton.setToolTipText("Show all controle"); |
---|
565 | 806 | allParamsButton.addActionListener(this); |
---|
566 | 807 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 808 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 809 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 810 | clearPanelButton.addActionListener(this); |
---|
570 | 811 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 812 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 813 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 814 | unselectButton.addActionListener(this); |
---|
574 | 815 | |
---|
575 | | - commandsPanel.preferredHeight = 1; |
---|
| 816 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 818 | + flashSelectionButton.addActionListener(this); |
---|
576 | 819 | |
---|
577 | | - oe.treePanel.add(commandsPanel); |
---|
578 | | - oe.treePanel.Return(); |
---|
| 820 | + editCommandsPanel.preferredHeight = 1; |
---|
| 821 | + |
---|
| 822 | + SetPinStates(false); |
---|
| 823 | +// oe.treePanel.add(commandsPanel); |
---|
| 824 | +// oe.treePanel.Return(); |
---|
579 | 825 | |
---|
580 | 826 | // oe.aConstraints.gridx += 1; |
---|
581 | 827 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
592 | 838 | |
---|
593 | 839 | JScrollPane jSP; |
---|
594 | 840 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
595 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 841 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
596 | 842 | ResetModel(); |
---|
597 | 843 | |
---|
598 | 844 | oe.treePanel.add(jSPPanel); |
---|
599 | 845 | oe.treePanel.Return(); |
---|
600 | 846 | |
---|
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 | 847 | oe.treePanel.add(copyOptionsPanel); |
---|
617 | 848 | oe.treePanel.Return(); |
---|
| 849 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 850 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 851 | + sliderPane.preferredHeight = 1; |
---|
618 | 852 | |
---|
619 | 853 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
620 | 854 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
643 | 877 | |
---|
644 | 878 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
645 | 879 | { |
---|
| 880 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 881 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 882 | + colorCB.addItemListener(this); |
---|
| 883 | + |
---|
| 884 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 885 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 886 | + materialCB.addItemListener(this); |
---|
| 887 | + |
---|
| 888 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 889 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 890 | + textureCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.Return(); |
---|
| 893 | + |
---|
646 | 894 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
647 | 895 | boxCB.setToolTipText("Display bounding boxes"); |
---|
648 | 896 | boxCB.addItemListener(this); |
---|
649 | 897 | |
---|
650 | 898 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
651 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 899 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
652 | 900 | zoomBoxCB.addItemListener(this); |
---|
653 | 901 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 902 | + if (true) // Globals.ADVANCED) |
---|
655 | 903 | { |
---|
656 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | | - supportCB.setToolTipText("Enable rigging"); |
---|
658 | | - supportCB.addItemListener(this); |
---|
| 904 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 905 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 906 | +// supportCB.addItemListener(this); |
---|
| 907 | + |
---|
| 908 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 909 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 910 | + freezeCB.addItemListener(this); |
---|
659 | 911 | |
---|
660 | 912 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
661 | 913 | // localCB.addItemListener(this); |
---|
662 | 914 | |
---|
| 915 | + panel.Return(); |
---|
| 916 | + |
---|
663 | 917 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
664 | 918 | crowdCB.setToolTipText("Used for crowds"); |
---|
665 | 919 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
676 | 930 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
677 | 931 | // speakerMocapCB.addItemListener(this); |
---|
678 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + |
---|
679 | 935 | if (false) |
---|
680 | 936 | { |
---|
681 | 937 | // handled in scripts |
---|
.. | .. |
---|
690 | 946 | //constraints.gridy += 1; |
---|
691 | 947 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
692 | 948 | smoothfocusCB.addItemListener(this); |
---|
| 949 | + panel.Return(); |
---|
693 | 950 | } |
---|
694 | 951 | |
---|
695 | 952 | //constraints.gridx += 1; |
---|
696 | 953 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
697 | 954 | // debugCB.addItemListener(this); |
---|
698 | 955 | |
---|
| 956 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 957 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 958 | + trackCB.addItemListener(this); |
---|
| 959 | + |
---|
699 | 960 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 961 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
700 | 962 | oeilCB.addItemListener(this); |
---|
701 | 963 | |
---|
| 964 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 965 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 966 | + shadowCB.addItemListener(this); |
---|
| 967 | + |
---|
| 968 | + panel.Return(); |
---|
| 969 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 970 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 971 | + toggleTextureCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 974 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 975 | + toggleSwitchCB.addItemListener(this); |
---|
| 976 | + |
---|
| 977 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 978 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 979 | + autokeepCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.Return(); |
---|
| 982 | + if (Globals.ADVANCED) |
---|
| 983 | + { |
---|
702 | 984 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
703 | 985 | lookAtCB.setToolTipText("Look-at target"); |
---|
704 | 986 | lookAtCB.addItemListener(this); |
---|
| 987 | + } |
---|
705 | 988 | |
---|
706 | 989 | } |
---|
707 | 990 | |
---|
708 | 991 | cGridBag fill = new cGridBag(); |
---|
709 | | - |
---|
710 | 992 | fill.preferredHeight = 200; |
---|
| 993 | + cGridBag fill2 = new cGridBag(); |
---|
| 994 | + fill2.preferredHeight = 200; |
---|
| 995 | + cGridBag fill3 = new cGridBag(); |
---|
| 996 | + fill3.preferredHeight = 200; |
---|
711 | 997 | |
---|
712 | 998 | panel.add(fill); |
---|
| 999 | + panel.add(fill2); |
---|
| 1000 | + panel.add(fill3); |
---|
713 | 1001 | |
---|
714 | 1002 | } |
---|
715 | 1003 | |
---|
716 | 1004 | void EditObject(Object3D obj) |
---|
717 | 1005 | { |
---|
718 | 1006 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1007 | + |
---|
| 1008 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1009 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1010 | + if (!radioButton.hadMaterial) |
---|
| 1011 | + { |
---|
| 1012 | + obj.material = new cMaterial(); |
---|
| 1013 | + } |
---|
| 1014 | + |
---|
719 | 1015 | radioButton.SetObject(obj); |
---|
720 | 1016 | radioButton.layout = sevenButton; |
---|
721 | 1017 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
724 | 1020 | buttonGroup.add(radioButton); |
---|
725 | 1021 | radioButton.doClick(); |
---|
726 | 1022 | } |
---|
| 1023 | + |
---|
727 | 1024 | void SetupViews(ObjEditor oe) |
---|
728 | 1025 | { |
---|
| 1026 | + theFrame = this; |
---|
| 1027 | + |
---|
729 | 1028 | oe.SetupViews(); |
---|
730 | 1029 | |
---|
731 | 1030 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
734 | 1033 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
735 | 1034 | } |
---|
736 | 1035 | |
---|
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; |
---|
| 1036 | + cToggleButton liveCB; |
---|
| 1037 | + cCheckBox supportCB; |
---|
| 1038 | + cCheckBox localCB; |
---|
| 1039 | + cCheckBox crowdCB; |
---|
| 1040 | + cCheckBox smoothCB; |
---|
| 1041 | + cToggleButton fastCB; |
---|
| 1042 | + cCheckBox slowCB; |
---|
| 1043 | + cCheckBox boxCB; |
---|
| 1044 | + cCheckBox zoomBoxCB; |
---|
| 1045 | + cCheckBox freezeCB; |
---|
| 1046 | + //cToggleButton trackCB; |
---|
| 1047 | + cCheckBox trackCB; |
---|
| 1048 | + cCheckBox smoothfocusCB; |
---|
748 | 1049 | // JCheckBox speakerMocapCB; |
---|
749 | | - JCheckBox speakerCameraCB; |
---|
750 | | - JCheckBox speakerFocusCB; |
---|
751 | | - JCheckBox debugCB; |
---|
752 | | - JCheckBox oeilCB; |
---|
753 | | - JCheckBox lookAtCB; |
---|
| 1050 | + cCheckBox speakerCameraCB; |
---|
| 1051 | + cCheckBox speakerFocusCB; |
---|
| 1052 | + cCheckBox debugCB; |
---|
| 1053 | + |
---|
| 1054 | + cCheckBox oeilCB; |
---|
| 1055 | + cCheckBox shadowCB; |
---|
| 1056 | + cCheckBox autokeepCB; |
---|
| 1057 | + cCheckBox lookAtCB; |
---|
754 | 1058 | |
---|
755 | 1059 | // static int COLOR = 1; |
---|
756 | 1060 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
758 | 1062 | |
---|
759 | 1063 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
760 | 1064 | |
---|
761 | | - JCheckBox colorCB; |
---|
762 | | - JCheckBox materialCB; |
---|
763 | | - JCheckBox textureCB; |
---|
| 1065 | + cCheckBox colorCB; |
---|
| 1066 | + cCheckBox materialCB; |
---|
| 1067 | + cCheckBox textureCB; |
---|
764 | 1068 | |
---|
765 | 1069 | public void itemStateChanged(ItemEvent e) |
---|
766 | 1070 | { |
---|
.. | .. |
---|
788 | 1092 | } else if(e.getSource() == liveCB) |
---|
789 | 1093 | { |
---|
790 | 1094 | cameraView.ToggleLive(); |
---|
| 1095 | + refreshContents(false); |
---|
791 | 1096 | } |
---|
792 | 1097 | else if(e.getSource() == supportCB) |
---|
793 | 1098 | { |
---|
.. | .. |
---|
852 | 1157 | { |
---|
853 | 1158 | cameraView.ToggleOeil(); |
---|
854 | 1159 | } |
---|
| 1160 | + else if(e.getSource() == shadowCB) |
---|
| 1161 | + { |
---|
| 1162 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1163 | + } |
---|
| 1164 | + else if(e.getSource() == freezeCB) |
---|
| 1165 | + { |
---|
| 1166 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1167 | + } |
---|
| 1168 | + else if(e.getSource() == autokeepCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1171 | + } |
---|
855 | 1172 | else if(e.getSource() == lookAtCB) |
---|
856 | 1173 | { |
---|
857 | 1174 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
868 | 1185 | |
---|
869 | 1186 | /**/ |
---|
870 | 1187 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
871 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1188 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
872 | 1190 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
873 | 1191 | // We can't move the root node or an empty selection |
---|
874 | 1192 | return; |
---|
.. | .. |
---|
931 | 1249 | } |
---|
932 | 1250 | } |
---|
933 | 1251 | |
---|
934 | | - String string = (String) object; |
---|
935 | | - |
---|
936 | 1252 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
937 | 1253 | // if( object instanceof java.io.File[]) |
---|
938 | 1254 | // { |
---|
.. | .. |
---|
940 | 1256 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
941 | 1257 | // return; |
---|
942 | 1258 | // } |
---|
| 1259 | + |
---|
| 1260 | + String string = object.toString(); |
---|
943 | 1261 | |
---|
944 | 1262 | // File path for Mac and Windows |
---|
945 | 1263 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
985 | 1303 | |
---|
986 | 1304 | assert target == objEditor.jTree; |
---|
987 | 1305 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1306 | + Object3D destinationLeaf; |
---|
988 | 1307 | try { |
---|
989 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1308 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
990 | 1309 | } catch (Exception e) { |
---|
991 | 1310 | System.out.println("destinationPath : " + destinationPath); |
---|
992 | 1311 | return; |
---|
993 | 1312 | } |
---|
994 | 1313 | |
---|
995 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1314 | + for (int i=group.selection.size(); --i>=0;) |
---|
996 | 1315 | { |
---|
| 1316 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1317 | + |
---|
| 1318 | + // Cannot move into itself |
---|
| 1319 | + if (child == destinationLeaf) |
---|
| 1320 | + return; |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
| 1323 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1324 | +// { |
---|
997 | 1325 | loadClipboard(true); |
---|
998 | 1326 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
999 | 1327 | pasteInto(false, false); |
---|
1000 | | - } else { |
---|
1001 | | - loadClipboard(false); |
---|
1002 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1003 | | - pasteInto(false, false); // true); // ??? |
---|
1004 | | - } |
---|
| 1328 | +// } else { |
---|
| 1329 | +// loadClipboard(false); |
---|
| 1330 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1331 | +// pasteInto(false, false); // true); // ??? |
---|
| 1332 | +// } |
---|
1005 | 1333 | } |
---|
1006 | 1334 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1007 | 1335 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1106 | 1434 | { |
---|
1107 | 1435 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1108 | 1436 | //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); |
---|
| 1437 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1438 | +// gridItem.addActionListener(this); |
---|
| 1439 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1440 | +// rectoidItem.addActionListener(this); |
---|
| 1441 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1442 | +// ellipsoidItem.addActionListener(this); |
---|
| 1443 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1444 | +// coneItem.addActionListener(this); |
---|
| 1445 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1446 | +// torusItem.addActionListener(this); |
---|
| 1447 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1448 | +// superItem.addActionListener(this); |
---|
| 1449 | + |
---|
| 1450 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1451 | + cameraItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + if (!Globals.ADVANCED) |
---|
| 1454 | + { |
---|
1121 | 1455 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1122 | 1456 | kleinItem.addActionListener(this); |
---|
1123 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1124 | | - particleItem.addActionListener(this); |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
| 1459 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1460 | +// particleItem.addActionListener(this); |
---|
1125 | 1461 | if (Globals.ADVANCED) |
---|
1126 | 1462 | { |
---|
1127 | 1463 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1147 | 1483 | } |
---|
1148 | 1484 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1149 | 1485 | 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); |
---|
| 1486 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1487 | +// overlayItem.addActionListener(this); |
---|
| 1488 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1489 | +// lightItem.addActionListener(this); |
---|
1154 | 1490 | menu.add("-"); |
---|
1155 | 1491 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1156 | 1492 | //superLoopItem.addActionListener(this); |
---|
1157 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1158 | | - loopItem.addActionListener(this); |
---|
| 1493 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1494 | +// loopItem.addActionListener(this); |
---|
1159 | 1495 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1160 | 1496 | doubleItem.addActionListener(this); |
---|
1161 | 1497 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1171 | 1507 | animationItem.addItemListener(this); |
---|
1172 | 1508 | animationItem.setState(Globals.ANIMATION); |
---|
1173 | 1509 | |
---|
| 1510 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1511 | + archiveItem.addActionListener(this); |
---|
| 1512 | + |
---|
1174 | 1513 | menu.add("-"); |
---|
1175 | 1514 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1176 | 1515 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1183 | 1522 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1184 | 1523 | reduce34MorphItem.addActionListener(this); |
---|
1185 | 1524 | menu.add("-"); |
---|
| 1525 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1526 | + memoryItem.addActionListener(this); |
---|
1186 | 1527 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1187 | 1528 | computeAOItem.addActionListener(this); |
---|
1188 | 1529 | |
---|
.. | .. |
---|
1191 | 1532 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1192 | 1533 | mirrorItem.addActionListener(this); |
---|
1193 | 1534 | menu.add("-"); |
---|
1194 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1195 | | - memoryItem.addActionListener(this); |
---|
1196 | 1535 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1197 | 1536 | analyzeItem.addActionListener(this); |
---|
1198 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1537 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1199 | 1538 | dumpItem.addActionListener(this); |
---|
1200 | 1539 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1201 | 1540 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1336 | 1675 | shadow.material = new cMaterial(obj.material); |
---|
1337 | 1676 | shadow.material.diffuse = 0.0001f; |
---|
1338 | 1677 | shadow.material.specular = 0.0001f; |
---|
| 1678 | + //shadow.projectedVertices[1].x = 300; |
---|
1339 | 1679 | |
---|
1340 | 1680 | makeSomething(shadow); |
---|
1341 | 1681 | } |
---|
| 1682 | + |
---|
| 1683 | + private void ClearUnpinned() |
---|
| 1684 | + { |
---|
| 1685 | + //for (Object3D obj : listUI) |
---|
| 1686 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1687 | + { |
---|
| 1688 | + Object3D obj = listUI.elementAt(i); |
---|
| 1689 | + if (!obj.pinned) |
---|
| 1690 | + { |
---|
| 1691 | + obj.CloseUI(); |
---|
| 1692 | + listUI.remove(i); |
---|
| 1693 | + } |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
1342 | 1696 | |
---|
1343 | 1697 | /** |
---|
1344 | 1698 | * applyExample |
---|
.. | .. |
---|
1542 | 1896 | |
---|
1543 | 1897 | void Overwrite(int mask) |
---|
1544 | 1898 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1899 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 1900 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1901 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 1902 | |
---|
1549 | 1903 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 1904 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1583 | 1937 | { |
---|
1584 | 1938 | ScreenFit(); |
---|
1585 | 1939 | } else |
---|
1586 | | - if (source == switchItem) |
---|
| 1940 | + if (source == switchViewItem) |
---|
1587 | 1941 | { |
---|
1588 | 1942 | cVector v1 = new cVector(); |
---|
1589 | 1943 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1592 | 1946 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1593 | 1947 | objEditor.cameraView.repaint(); |
---|
1594 | 1948 | } else |
---|
1595 | | - if (source == rectoidItem) |
---|
| 1949 | + if (source == rectoidItem || source == boxButton) |
---|
1596 | 1950 | { |
---|
1597 | 1951 | makeSomething(new Box()); |
---|
1598 | 1952 | } else |
---|
1599 | | - if (source == particleItem) |
---|
| 1953 | + if (source == particleItem || source == particlesButton) |
---|
1600 | 1954 | { |
---|
1601 | 1955 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1602 | 1956 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1675 | 2029 | |
---|
1676 | 2030 | makeSomething(obj); |
---|
1677 | 2031 | } else |
---|
1678 | | - if (source == gridItem) |
---|
| 2032 | + if (source == gridItem || source == gridButton) |
---|
1679 | 2033 | { |
---|
1680 | 2034 | makeSomething(new Grid()); |
---|
1681 | 2035 | } else |
---|
1682 | | - if (source == ellipsoidItem) |
---|
| 2036 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1683 | 2037 | { |
---|
1684 | 2038 | makeSomething(new Sphere()); |
---|
1685 | 2039 | } else |
---|
1686 | | - if (source == coneItem) |
---|
| 2040 | + if (source == coneItem || source == coneButton) |
---|
1687 | 2041 | { |
---|
1688 | 2042 | makeSomething(new Cone()); |
---|
1689 | 2043 | } else |
---|
1690 | | - if (source == torusItem) |
---|
| 2044 | + if (source == torusItem || source == torusButton) |
---|
1691 | 2045 | { |
---|
1692 | 2046 | makeSomething(new Torus()); |
---|
1693 | 2047 | } else |
---|
1694 | | - if (source == superItem) |
---|
| 2048 | + if (source == superItem || source == superButton) |
---|
1695 | 2049 | { |
---|
1696 | 2050 | makeSomething(new Superellipsoid()); |
---|
1697 | 2051 | } else |
---|
1698 | | - if (source == kleinItem) |
---|
| 2052 | + if (source == kleinItem || source == kleinButton) |
---|
1699 | 2053 | { |
---|
1700 | 2054 | makeSomething(new Klein()); |
---|
1701 | 2055 | } else |
---|
.. | .. |
---|
1715 | 2069 | { |
---|
1716 | 2070 | makeSomething(new BezierSurface()); |
---|
1717 | 2071 | } else |
---|
1718 | | - if (source == overlayItem) |
---|
| 2072 | + if (source == overlayItem || source == overlayButton) |
---|
1719 | 2073 | { |
---|
1720 | 2074 | /* |
---|
1721 | 2075 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1763 | 2117 | s.setup(); |
---|
1764 | 2118 | makeSomething(s); |
---|
1765 | 2119 | } else |
---|
1766 | | - if (source == lightItem) |
---|
| 2120 | + if (source == lightItem || source == lightButton) |
---|
1767 | 2121 | { |
---|
1768 | 2122 | makeSomething(new Light()); |
---|
1769 | 2123 | } else |
---|
.. | .. |
---|
1813 | 2167 | |
---|
1814 | 2168 | group(g); |
---|
1815 | 2169 | } else |
---|
1816 | | - if (source == loopItem) |
---|
| 2170 | + if (source == loopItem || source == loopButton) |
---|
1817 | 2171 | { |
---|
1818 | 2172 | Composite csg = new GroupLeaf(); |
---|
1819 | 2173 | csg.count = 5; |
---|
1820 | 2174 | group(csg); |
---|
1821 | | - Composite child = new cGroup(); |
---|
| 2175 | + Composite child = new cGroup("Branch"); |
---|
1822 | 2176 | csg.addChild(child); |
---|
1823 | 2177 | child.addChild(csg); |
---|
1824 | 2178 | } else |
---|
1825 | 2179 | if (source == doubleItem) |
---|
1826 | 2180 | { |
---|
1827 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Fork"); |
---|
1828 | 2182 | csg.count = 5; |
---|
1829 | 2183 | group(csg); |
---|
1830 | | - Composite child = new cGroup(); |
---|
| 2184 | + Composite child = new cGroup("Branch A"); |
---|
1831 | 2185 | csg.addChild(child); |
---|
1832 | 2186 | child.addChild(csg); |
---|
1833 | | - child = new cGroup(); |
---|
| 2187 | + child = new cGroup("Branch B"); |
---|
1834 | 2188 | csg.addChild(child); |
---|
1835 | 2189 | child.addChild(csg); |
---|
1836 | 2190 | } else |
---|
1837 | 2191 | if (source == tripleItem) |
---|
1838 | 2192 | { |
---|
1839 | | - Composite csg = new GroupLeaf(); |
---|
| 2193 | + Composite csg = new GroupLeaf("Trident"); |
---|
1840 | 2194 | csg.count = 4; |
---|
1841 | 2195 | group(csg); |
---|
1842 | 2196 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1848 | 2202 | child = new cGroup(); |
---|
1849 | 2203 | csg.addChild(child); |
---|
1850 | 2204 | 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 | 2205 | } else |
---|
1877 | 2206 | if (source == computeAOItem) |
---|
1878 | 2207 | { |
---|
.. | .. |
---|
1892 | 2221 | if (source == invariantsItem) |
---|
1893 | 2222 | { |
---|
1894 | 2223 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2224 | + Grafreed.grafreeD.universe.invariants(); |
---|
1896 | 2225 | } else |
---|
1897 | 2226 | if (source == memoryItem) |
---|
1898 | 2227 | { |
---|
.. | .. |
---|
1911 | 2240 | { |
---|
1912 | 2241 | DumpObject(); |
---|
1913 | 2242 | } else |
---|
| 2243 | + if (source == minButton) |
---|
| 2244 | + { |
---|
| 2245 | + Minimize(); |
---|
| 2246 | + } else |
---|
| 2247 | + if (source == maxButton) |
---|
| 2248 | + { |
---|
| 2249 | + Maximize(); |
---|
| 2250 | + } else |
---|
| 2251 | + if (source == fullButton) |
---|
| 2252 | + { |
---|
| 2253 | + ToggleFullScreen(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == undoButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Go to previous version |
---|
| 2258 | + //if (!Undo()) |
---|
| 2259 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2260 | + Undo(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == restoreButton) |
---|
| 2263 | + { |
---|
| 2264 | + // Restore current version |
---|
| 2265 | + Restore(); |
---|
| 2266 | + } else |
---|
| 2267 | + if (source == replaceButton) |
---|
| 2268 | + { |
---|
| 2269 | + // Overwrite current version |
---|
| 2270 | + Replace(); |
---|
| 2271 | + } else |
---|
| 2272 | + if (source == redoButton) |
---|
| 2273 | + { |
---|
| 2274 | + // Go to next version |
---|
| 2275 | + Redo(); |
---|
| 2276 | + } else |
---|
| 2277 | + if (source == saveButton) |
---|
| 2278 | + { |
---|
| 2279 | + // Save a new version |
---|
| 2280 | + if (!Save(true)) |
---|
| 2281 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2282 | + } else |
---|
1914 | 2283 | if (source == oneStepButton) |
---|
1915 | 2284 | { |
---|
1916 | 2285 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1918 | 2287 | } else |
---|
1919 | 2288 | if (source == screenfitButton) |
---|
1920 | 2289 | { |
---|
1921 | | - //Reload(lastConverter, lastFilename, true); |
---|
1922 | 2290 | ScreenFit(); |
---|
1923 | 2291 | } else |
---|
1924 | 2292 | if (source == screenfitpointButton) |
---|
1925 | 2293 | { |
---|
1926 | | - //Reload(lastConverter, lastFilename, true); |
---|
1927 | 2294 | ScreenFitPoint(); |
---|
1928 | 2295 | } else |
---|
1929 | 2296 | if (source == snapobjectButton) |
---|
1930 | 2297 | { |
---|
1931 | | - //Reload(lastConverter, lastFilename, true); |
---|
1932 | 2298 | SnapObject(); |
---|
1933 | 2299 | } else |
---|
1934 | 2300 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1965 | 2331 | { |
---|
1966 | 2332 | loadClipboard(true); |
---|
1967 | 2333 | } else |
---|
| 2334 | + if (source == undoItem) |
---|
| 2335 | + { |
---|
| 2336 | + Undo(); |
---|
| 2337 | + } else |
---|
| 2338 | + if (source == redoItem) |
---|
| 2339 | + { |
---|
| 2340 | + Redo(); |
---|
| 2341 | + } else |
---|
1968 | 2342 | if (source == duplicateItem) |
---|
1969 | 2343 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2344 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2345 | loadClipboard(false); |
---|
1972 | 2346 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2347 | + Grafreed.clipboard = keep; |
---|
1974 | 2348 | } else |
---|
1975 | 2349 | if (source == cloneItem) |
---|
1976 | 2350 | { |
---|
.. | .. |
---|
2190 | 2564 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2565 | // refreshContents(); |
---|
2192 | 2566 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2567 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2568 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2569 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2570 | |
---|
2197 | 2571 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2572 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2616 | } else |
---|
2243 | 2617 | if (source == setMasterItem) |
---|
2244 | 2618 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2619 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2620 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2621 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2622 | |
---|
2249 | 2623 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2624 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2631 | { |
---|
2258 | 2632 | if (group.selection.size() == 1) |
---|
2259 | 2633 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2634 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2635 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2636 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2637 | |
---|
2264 | 2638 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 2639 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 2650 | { |
---|
2277 | 2651 | RevertMeshes(); |
---|
2278 | 2652 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 2653 | + if (source == resetAllItem) |
---|
2280 | 2654 | { |
---|
2281 | 2655 | ResetAll(); |
---|
2282 | 2656 | } else |
---|
.. | .. |
---|
2296 | 2670 | { |
---|
2297 | 2671 | ClearSelection(true); |
---|
2298 | 2672 | } else |
---|
2299 | | - if (source == grabItem) |
---|
| 2673 | + if (source == grabItem || source == groupButton) |
---|
2300 | 2674 | { |
---|
2301 | | - group(new cGroup(), true); |
---|
| 2675 | + group(new cGroup(), false); // true); |
---|
2302 | 2676 | } else |
---|
2303 | 2677 | if (source == hideItem) |
---|
2304 | 2678 | { |
---|
.. | .. |
---|
2316 | 2690 | { |
---|
2317 | 2691 | makeSomething(new Camera()); |
---|
2318 | 2692 | } else |
---|
2319 | | - if (source == compositeItem) |
---|
| 2693 | + if (source == compositeItem || source == compositeButton) |
---|
2320 | 2694 | { |
---|
2321 | 2695 | group(new Composite()); |
---|
2322 | 2696 | } else |
---|
2323 | | - if (source == randomItem) |
---|
| 2697 | + if (source == switchItem || source == switchButton) |
---|
2324 | 2698 | { |
---|
2325 | 2699 | RandomNode random = new RandomNode(); |
---|
2326 | 2700 | group(random); |
---|
.. | .. |
---|
2422 | 2796 | { |
---|
2423 | 2797 | group(new cLinker()); |
---|
2424 | 2798 | } else |
---|
2425 | | - if (source == textureItem) |
---|
| 2799 | + if (source == textureItem || source == textureButton) |
---|
2426 | 2800 | { |
---|
2427 | 2801 | group(new TextureNode()); |
---|
2428 | 2802 | } else |
---|
.. | .. |
---|
2442 | 2816 | { |
---|
2443 | 2817 | CastShadow(2); |
---|
2444 | 2818 | } else |
---|
2445 | | - if (source == ungroupItem) |
---|
| 2819 | + if (source == ungroupItem || source == ungroupButton) |
---|
2446 | 2820 | { |
---|
2447 | | - //ungroup(); |
---|
| 2821 | + boolean hasRoot = false; |
---|
| 2822 | + |
---|
2448 | 2823 | for (int i=0; i<group.selection.size(); i++) |
---|
2449 | 2824 | { |
---|
2450 | | - Ungroup(group.selection.get(i)); |
---|
| 2825 | + if (group.selection.get(i) == group) |
---|
| 2826 | + { |
---|
| 2827 | + hasRoot = true; |
---|
| 2828 | + break; |
---|
| 2829 | + } |
---|
2451 | 2830 | } |
---|
2452 | 2831 | |
---|
2453 | | - ClearSelection(false); |
---|
2454 | | - |
---|
2455 | | - refreshContents(); |
---|
| 2832 | + if (!hasRoot) |
---|
| 2833 | + { |
---|
| 2834 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2835 | + { |
---|
| 2836 | + Ungroup(group.selection.get(i)); |
---|
| 2837 | + } |
---|
| 2838 | + |
---|
| 2839 | + ClearSelection(false); |
---|
| 2840 | + |
---|
| 2841 | + refreshContents(); |
---|
| 2842 | + } |
---|
2456 | 2843 | } else |
---|
2457 | 2844 | if (source == genUVItem) |
---|
2458 | 2845 | { |
---|
.. | .. |
---|
2464 | 2851 | } else |
---|
2465 | 2852 | if (source == genNormalsMESHItem) |
---|
2466 | 2853 | { |
---|
2467 | | - GenNormals(true); // TODO |
---|
| 2854 | + GenNormalsMESH(); |
---|
2468 | 2855 | } else |
---|
2469 | 2856 | if (source == genNormalsORGANItem) |
---|
2470 | 2857 | { |
---|
.. | .. |
---|
2529 | 2916 | if (source == unmarkleavesItem) |
---|
2530 | 2917 | { |
---|
2531 | 2918 | MarkLeaves(false); |
---|
| 2919 | + } else |
---|
| 2920 | + if (source == rewindleavesItem) |
---|
| 2921 | + { |
---|
| 2922 | + RewindLeaves(true); |
---|
| 2923 | + } else |
---|
| 2924 | + if (source == unrewindleavesItem) |
---|
| 2925 | + { |
---|
| 2926 | + RewindLeaves(false); |
---|
| 2927 | + } else |
---|
| 2928 | + if (source == randomleavesItem) |
---|
| 2929 | + { |
---|
| 2930 | + RandomLeaves(true); |
---|
| 2931 | + } else |
---|
| 2932 | + if (source == unrandomleavesItem) |
---|
| 2933 | + { |
---|
| 2934 | + RandomLeaves(false); |
---|
2532 | 2935 | } else |
---|
2533 | 2936 | if (source == flipVItem) |
---|
2534 | 2937 | { |
---|
.. | .. |
---|
2614 | 3017 | { |
---|
2615 | 3018 | SmoothMesh(); |
---|
2616 | 3019 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 3020 | + if (source == transformGeometryItem) |
---|
2618 | 3021 | { |
---|
2619 | 3022 | TransformGeometry(); |
---|
| 3023 | + } else |
---|
| 3024 | + if (source == transformChildrenItem) |
---|
| 3025 | + { |
---|
| 3026 | + TransformChildren(); |
---|
2620 | 3027 | } else |
---|
2621 | 3028 | if (source == resetTransformItem) |
---|
2622 | 3029 | { |
---|
.. | .. |
---|
2624 | 3031 | } else |
---|
2625 | 3032 | if (source == resetCentroidItem) |
---|
2626 | 3033 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 3034 | + ResetCentroid(true); |
---|
| 3035 | + } else |
---|
| 3036 | + if (source == resetCentroidXZItem) |
---|
| 3037 | + { |
---|
| 3038 | + ResetCentroid(false); |
---|
2628 | 3039 | } else |
---|
2629 | 3040 | if (source == resetParentItem) |
---|
2630 | 3041 | { |
---|
.. | .. |
---|
2756 | 3167 | if (source == twoButton) |
---|
2757 | 3168 | { |
---|
2758 | 3169 | radio.layout = twoButton; |
---|
| 3170 | + |
---|
| 3171 | + if (CameraPane.FULLSCREEN) |
---|
| 3172 | + fullscreenLayout = radio.layout; |
---|
| 3173 | + |
---|
2759 | 3174 | // bug |
---|
2760 | 3175 | //gridPanel.setDividerLocation(1.0); |
---|
2761 | 3176 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2788 | 3203 | bigThree.ClearUI(); |
---|
2789 | 3204 | bigThree.add(centralPanel); |
---|
2790 | 3205 | bigThree.FlushUI(); |
---|
| 3206 | + |
---|
| 3207 | + cameraView.requestFocusInWindow(); |
---|
| 3208 | + |
---|
| 3209 | +// refreshContents(true); |
---|
| 3210 | +// |
---|
| 3211 | +// try |
---|
| 3212 | +// { |
---|
| 3213 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3214 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3215 | +// bot.mouseMove(100, 100); |
---|
| 3216 | +// bot.mousePress(mask); |
---|
| 3217 | +// bot.mouseRelease(mask); |
---|
| 3218 | +// } |
---|
| 3219 | +// catch (Exception e) |
---|
| 3220 | +// { |
---|
| 3221 | +// |
---|
| 3222 | +// } |
---|
| 3223 | + |
---|
2791 | 3224 | } else |
---|
2792 | 3225 | if (source == threeButton) |
---|
2793 | 3226 | { |
---|
2794 | 3227 | radio.layout = threeButton; |
---|
| 3228 | + |
---|
| 3229 | + if (CameraPane.FULLSCREEN) |
---|
| 3230 | + fullscreenLayout = radio.layout; |
---|
2795 | 3231 | |
---|
2796 | 3232 | // bigThree.remove(scenePanel); |
---|
2797 | 3233 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2824 | 3260 | bigThree.add(centralPanel); |
---|
2825 | 3261 | bigThree.add(XYZPanel); |
---|
2826 | 3262 | bigThree.FlushUI(); |
---|
| 3263 | + |
---|
| 3264 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3265 | } else |
---|
2828 | 3266 | if (source == fourButton) |
---|
2829 | 3267 | { |
---|
2830 | 3268 | radio.layout = fourButton; |
---|
| 3269 | + |
---|
| 3270 | + if (CameraPane.FULLSCREEN) |
---|
| 3271 | + fullscreenLayout = radio.layout; |
---|
2831 | 3272 | |
---|
2832 | 3273 | // bigThree.remove(scenePanel); |
---|
2833 | 3274 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2859 | 3300 | bigThree.ClearUI(); |
---|
2860 | 3301 | bigThree.add(scenePanel); |
---|
2861 | 3302 | bigThree.FlushUI(); |
---|
| 3303 | + |
---|
| 3304 | + cameraView.requestFocusInWindow(); |
---|
2862 | 3305 | } else |
---|
2863 | 3306 | if (source == sixButton) |
---|
2864 | 3307 | { |
---|
2865 | 3308 | radio.layout = sixButton; |
---|
| 3309 | + |
---|
| 3310 | + if (CameraPane.FULLSCREEN) |
---|
| 3311 | + fullscreenLayout = radio.layout; |
---|
2866 | 3312 | |
---|
2867 | 3313 | // bigThree.remove(scenePanel); |
---|
2868 | 3314 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2895 | 3341 | bigThree.add(scenePanel); |
---|
2896 | 3342 | bigThree.add(centralPanel); |
---|
2897 | 3343 | bigThree.FlushUI(); |
---|
| 3344 | + |
---|
| 3345 | + cameraView.requestFocusInWindow(); |
---|
2898 | 3346 | } else |
---|
2899 | 3347 | if (source == sevenButton) |
---|
2900 | 3348 | { |
---|
2901 | 3349 | radio.layout = sevenButton; |
---|
| 3350 | + |
---|
| 3351 | + if (CameraPane.FULLSCREEN) |
---|
| 3352 | + fullscreenLayout = radio.layout; |
---|
2902 | 3353 | |
---|
2903 | 3354 | // bigThree.remove(scenePanel); |
---|
2904 | 3355 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2932 | 3383 | bigThree.add(centralPanel); |
---|
2933 | 3384 | bigThree.add(XYZPanel); |
---|
2934 | 3385 | bigThree.FlushUI(); |
---|
| 3386 | + |
---|
| 3387 | + cameraView.requestFocusInWindow(); |
---|
2935 | 3388 | } else |
---|
2936 | 3389 | if (source == rootButton) |
---|
2937 | 3390 | { |
---|
.. | .. |
---|
2943 | 3396 | EditObject(obj); |
---|
2944 | 3397 | } |
---|
2945 | 3398 | |
---|
| 3399 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3400 | refreshContents(true); |
---|
2947 | 3401 | } else |
---|
2948 | 3402 | if (source == closeButton) |
---|
.. | .. |
---|
2952 | 3406 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2953 | 3407 | { |
---|
2954 | 3408 | ab = (cRadio)e.nextElement(); |
---|
2955 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3409 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2956 | 3410 | { |
---|
| 3411 | + // Patch to avoid bug with transparency. |
---|
| 3412 | + if (!ab.hadMaterial) |
---|
| 3413 | + { |
---|
| 3414 | + ab.object.material = null; |
---|
| 3415 | + } |
---|
| 3416 | + |
---|
2957 | 3417 | buttonGroup.remove(ab); |
---|
2958 | 3418 | radioPanel.remove(ab); |
---|
2959 | 3419 | |
---|
2960 | | - ab.GetObject().editWindow = null; |
---|
| 3420 | + //ab.GetObject().editWindow = null; |
---|
| 3421 | + ab.GetObject().manipWindow = null; |
---|
2961 | 3422 | // ab.GetObject().objectUI = null; // ????????? |
---|
2962 | 3423 | |
---|
2963 | 3424 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2964 | 3425 | break; |
---|
2965 | 3426 | } |
---|
2966 | 3427 | } |
---|
| 3428 | + |
---|
| 3429 | + cameraView.requestFocusInWindow(); |
---|
2967 | 3430 | refreshContents(true); |
---|
2968 | 3431 | } else |
---|
2969 | 3432 | if (source == editItem || source == editButton) |
---|
2970 | 3433 | { |
---|
| 3434 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3435 | + { |
---|
| 3436 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3437 | + child.pinned = true; |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
2971 | 3440 | EditSelection(false); |
---|
2972 | 3441 | } else |
---|
2973 | 3442 | if (source == uneditButton) |
---|
.. | .. |
---|
2977 | 3446 | Object3D child = (Object3D)e.nextElement(); |
---|
2978 | 3447 | if(child.editWindow != null) |
---|
2979 | 3448 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3449 | + child.pinned = false; |
---|
2980 | 3450 | child.CloseUI(); |
---|
2981 | 3451 | listUI.remove(child); |
---|
2982 | 3452 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3453 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3454 | } |
---|
2985 | 3455 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3456 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2993 | 3463 | //copy.ClearUI(); |
---|
2994 | 3464 | for (Object3D obj : listUI) |
---|
2995 | 3465 | { |
---|
| 3466 | + obj.pinned = false; |
---|
2996 | 3467 | obj.CloseUI(); |
---|
2997 | 3468 | } |
---|
2998 | 3469 | listUI.clear(); |
---|
.. | .. |
---|
3002 | 3473 | { |
---|
3003 | 3474 | assert(copy == group); |
---|
3004 | 3475 | |
---|
3005 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3476 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3006 | 3477 | |
---|
3007 | 3478 | for (Object3D obj : listUI) |
---|
3008 | 3479 | { |
---|
.. | .. |
---|
3051 | 3522 | } |
---|
3052 | 3523 | |
---|
3053 | 3524 | copy = group; |
---|
| 3525 | + |
---|
| 3526 | + SetUndoStates(); |
---|
| 3527 | + |
---|
3054 | 3528 | //Globals.theRenderer.object = group; |
---|
3055 | 3529 | if(!useclient) |
---|
3056 | 3530 | { |
---|
.. | .. |
---|
3066 | 3540 | frontView.object = group; |
---|
3067 | 3541 | sideView.object = group; |
---|
3068 | 3542 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 3543 | + |
---|
| 3544 | +// fix "+" issue |
---|
| 3545 | + //group.editWindow = this; |
---|
| 3546 | + group.manipWindow = this; |
---|
| 3547 | + |
---|
3070 | 3548 | /* |
---|
3071 | 3549 | currentLayout = radio.layout; |
---|
3072 | 3550 | if (currentLayout == null) |
---|
3073 | 3551 | currentLayout = sevenButton; |
---|
3074 | 3552 | */ |
---|
3075 | 3553 | radio.layout.doClick(); |
---|
| 3554 | + |
---|
| 3555 | + ClearUnpinned(); |
---|
| 3556 | + Grafreed.Assert(group != null); |
---|
| 3557 | + Grafreed.Assert(group.selection != null); |
---|
| 3558 | + SetPinStates(group.selection.size() > 0); |
---|
| 3559 | + if (group.selection.size() == 1) |
---|
| 3560 | + EditSelection(false); |
---|
3076 | 3561 | keepparent = group.parent; |
---|
3077 | 3562 | // PARENT = NULL or not??? |
---|
3078 | 3563 | //group.parent = null; // ROOT |
---|
3079 | 3564 | //group.attributes = -1; |
---|
3080 | 3565 | ResetModel(); |
---|
| 3566 | + |
---|
| 3567 | + cameraView.requestFocusInWindow(); |
---|
3081 | 3568 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3569 | + } else if (event.getSource() == editCameraItem) |
---|
| 3570 | + { |
---|
| 3571 | + cameraView.ProtectCamera(); |
---|
| 3572 | + cameraView.repaint(); |
---|
| 3573 | + return; |
---|
| 3574 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3575 | + { |
---|
| 3576 | + cameraView.RevertCamera(); |
---|
| 3577 | + cameraView.repaint(); |
---|
| 3578 | + return; |
---|
| 3579 | + // } else if (event.getSource() == textureButton) |
---|
| 3580 | + // { |
---|
| 3581 | + // return; // true; |
---|
| 3582 | + } |
---|
3083 | 3583 | else |
---|
3084 | 3584 | { |
---|
3085 | 3585 | //return super.action(event, arg); |
---|
.. | .. |
---|
3088 | 3588 | } |
---|
3089 | 3589 | |
---|
3090 | 3590 | boolean useclient = false; |
---|
3091 | | - cRadio radio; |
---|
3092 | 3591 | |
---|
3093 | 3592 | void ToggleRoot() |
---|
3094 | 3593 | { |
---|
.. | .. |
---|
3140 | 3639 | refreshContents(); |
---|
3141 | 3640 | } |
---|
3142 | 3641 | |
---|
| 3642 | + void TransformChildren() |
---|
| 3643 | + { |
---|
| 3644 | + Object3D obj; |
---|
| 3645 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3646 | + { |
---|
| 3647 | + obj = (Object3D)e.nextElement(); |
---|
| 3648 | + obj.KeepTextureMatrices(); |
---|
| 3649 | + obj.TransformChildren(); |
---|
| 3650 | + obj.RestoreTextureMatrices(); |
---|
| 3651 | + |
---|
| 3652 | +// if (obj.parent == null) |
---|
| 3653 | +// { |
---|
| 3654 | +// System.out.println("NULL PARENT!"); |
---|
| 3655 | +// new Exception().printStackTrace(); |
---|
| 3656 | +// } |
---|
| 3657 | +// else |
---|
| 3658 | +// TouchTransform(obj); |
---|
| 3659 | +// //obj.parent.Touch(); |
---|
| 3660 | + } |
---|
| 3661 | + |
---|
| 3662 | + refreshContents(); |
---|
| 3663 | + } |
---|
3143 | 3664 | |
---|
3144 | 3665 | void ResetTransform() |
---|
3145 | 3666 | { |
---|
.. | .. |
---|
3252 | 3773 | refreshContents(); |
---|
3253 | 3774 | } |
---|
3254 | 3775 | |
---|
3255 | | - void ResetCentroid() |
---|
| 3776 | + void ResetCentroid(boolean full) |
---|
3256 | 3777 | { |
---|
3257 | 3778 | Object3D obj; |
---|
3258 | 3779 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 3788 | LA.matIdentity(Object3D.mat); |
---|
3268 | 3789 | obj.getBounds(minima, maxima, false); |
---|
3269 | 3790 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3791 | + if (full) |
---|
| 3792 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 3793 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 3794 | obj.TransformMesh(Object3D.mat); |
---|
| 3795 | + |
---|
3273 | 3796 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3797 | + if (full) |
---|
| 3798 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 3799 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3800 | + |
---|
3276 | 3801 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 3802 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 3803 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3301 | 3826 | |
---|
3302 | 3827 | int size = obj.MemorySize(); |
---|
3303 | 3828 | |
---|
3304 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3829 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3830 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3305 | 3831 | } |
---|
3306 | 3832 | } |
---|
3307 | 3833 | catch (Exception e) |
---|
.. | .. |
---|
3338 | 3864 | obj = (Object3D)e.nextElement(); |
---|
3339 | 3865 | |
---|
3340 | 3866 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3867 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 3868 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3869 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 3870 | |
---|
3345 | 3871 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 3872 | } |
---|
.. | .. |
---|
3382 | 3908 | void GenNormals(boolean crease) |
---|
3383 | 3909 | { |
---|
3384 | 3910 | group.GenNormalsS(crease); |
---|
| 3911 | + |
---|
| 3912 | + refreshContents(); |
---|
| 3913 | + } |
---|
| 3914 | + |
---|
| 3915 | + void GenNormalsMESH() |
---|
| 3916 | + { |
---|
| 3917 | + group.GenNormalsMeshS(); |
---|
3385 | 3918 | |
---|
3386 | 3919 | refreshContents(); |
---|
3387 | 3920 | } |
---|
.. | .. |
---|
3554 | 4087 | |
---|
3555 | 4088 | void ParseVertices() |
---|
3556 | 4089 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 4090 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4091 | + Grafreed.epsequal = true; |
---|
3559 | 4092 | |
---|
3560 | 4093 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 4094 | { |
---|
.. | .. |
---|
3580 | 4113 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 4114 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 4115 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 4116 | + g.add(Grafreed.clipboard); |
---|
3584 | 4117 | |
---|
3585 | 4118 | buffer.add(g); |
---|
3586 | 4119 | } |
---|
.. | .. |
---|
3595 | 4128 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 4129 | } |
---|
3597 | 4130 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 4131 | + Grafreed.epsequal = epsequal; |
---|
3599 | 4132 | |
---|
3600 | 4133 | refreshContents(); |
---|
3601 | 4134 | } |
---|
.. | .. |
---|
3613 | 4146 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 4147 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 4148 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4149 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4150 | + |
---|
| 4151 | + try |
---|
| 4152 | + { |
---|
| 4153 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4154 | + } |
---|
| 4155 | + catch (Exception e) |
---|
| 4156 | + { |
---|
| 4157 | + System.err.println("FAIL: " + node); |
---|
| 4158 | + } |
---|
3617 | 4159 | |
---|
3618 | 4160 | double s = v.s; |
---|
3619 | 4161 | |
---|
.. | .. |
---|
3745 | 4287 | return; |
---|
3746 | 4288 | |
---|
3747 | 4289 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4290 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 4291 | |
---|
3750 | 4292 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 4293 | |
---|
.. | .. |
---|
3939 | 4481 | |
---|
3940 | 4482 | void ClipMesh() |
---|
3941 | 4483 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4484 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4485 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4486 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4487 | |
---|
3946 | 4488 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4489 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4492 | // { |
---|
3951 | 4493 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4494 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4495 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4496 | } |
---|
3955 | 4497 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4498 | System.out.println("DONE."); |
---|
.. | .. |
---|
3997 | 4539 | void MarkLeaves(boolean hide) |
---|
3998 | 4540 | { |
---|
3999 | 4541 | group.selection.MarkLeaves(hide); |
---|
| 4542 | + refreshContents(); |
---|
| 4543 | + } |
---|
| 4544 | + |
---|
| 4545 | + void RewindLeaves(boolean hide) |
---|
| 4546 | + { |
---|
| 4547 | + group.selection.RewindLeaves(hide); |
---|
| 4548 | + refreshContents(); |
---|
| 4549 | + } |
---|
| 4550 | + |
---|
| 4551 | + void RandomLeaves(boolean hide) |
---|
| 4552 | + { |
---|
| 4553 | + group.selection.RandomLeaves(hide); |
---|
4000 | 4554 | refreshContents(); |
---|
4001 | 4555 | } |
---|
4002 | 4556 | |
---|
.. | .. |
---|
4071 | 4625 | // } |
---|
4072 | 4626 | // } |
---|
4073 | 4627 | |
---|
4074 | | - static boolean allparams = true; |
---|
4075 | | - |
---|
4076 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4077 | | - |
---|
4078 | 4628 | void EditSelection(boolean newWindow) |
---|
4079 | 4629 | { |
---|
4080 | 4630 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4082 | 4632 | { |
---|
4083 | 4633 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4084 | 4634 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4085 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4635 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 4636 | |
---|
4087 | 4637 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 4638 | + if(elem != group || !newWindow) |
---|
4089 | 4639 | { |
---|
4090 | 4640 | // if (!(elem instanceof Composite)) |
---|
4091 | 4641 | // newWindow = false; |
---|
.. | .. |
---|
4167 | 4717 | //new Exception().printStackTrace(); |
---|
4168 | 4718 | |
---|
4169 | 4719 | freezemodel = true; |
---|
4170 | | - |
---|
| 4720 | + ClearUnpinned(); |
---|
| 4721 | + |
---|
4171 | 4722 | /**/ |
---|
4172 | 4723 | //switch (event.id) |
---|
4173 | 4724 | { |
---|
.. | .. |
---|
4175 | 4726 | //case 702: // Event.LIST_DESELECT |
---|
4176 | 4727 | group.deselectAll(); |
---|
4177 | 4728 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4178 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4179 | 4729 | if (tps != null) |
---|
4180 | 4730 | { |
---|
4181 | 4731 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4184 | 4734 | |
---|
4185 | 4735 | //if (child.parent != null) |
---|
4186 | 4736 | //child.parent.addSelectee(child); |
---|
| 4737 | + objEditor.SetMaterial(child); |
---|
4187 | 4738 | group.addSelectee(child); |
---|
4188 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4189 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4190 | | - System.err.println("info : " + child.GetPath()); |
---|
4191 | 4739 | } |
---|
4192 | 4740 | } |
---|
4193 | 4741 | // else |
---|
.. | .. |
---|
4197 | 4745 | // System.err.println("info : " + group.GetPath()); |
---|
4198 | 4746 | // } |
---|
4199 | 4747 | |
---|
4200 | | - objEditor.SetText(); // jan 2014 |
---|
4201 | | - |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4748 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 4749 | CameraPane.flash = true; |
---|
4204 | 4750 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4751 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 4752 | // a camera |
---|
4207 | 4753 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4754 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4755 | + { |
---|
| 4756 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4757 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4758 | + } |
---|
4210 | 4759 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 4760 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 4761 | } |
---|
4213 | 4762 | |
---|
| 4763 | + if (tps != null && tps.length == 1) |
---|
| 4764 | + { |
---|
| 4765 | + EditSelection(false); |
---|
| 4766 | + } |
---|
| 4767 | + |
---|
| 4768 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4769 | + |
---|
4214 | 4770 | refreshContents(); |
---|
4215 | 4771 | //return true; |
---|
4216 | 4772 | } |
---|
.. | .. |
---|
4219 | 4775 | |
---|
4220 | 4776 | freezemodel = false; |
---|
4221 | 4777 | } |
---|
| 4778 | + |
---|
| 4779 | + void SetPinStates(boolean enabled) |
---|
| 4780 | + { |
---|
| 4781 | + editButton.setEnabled(enabled); |
---|
| 4782 | + uneditButton.setEnabled(enabled); |
---|
| 4783 | + unselectButton.setEnabled(enabled); |
---|
| 4784 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4785 | + } |
---|
| 4786 | + |
---|
| 4787 | + void refreshContents(boolean cp) |
---|
| 4788 | + { |
---|
| 4789 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4790 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4791 | + { |
---|
| 4792 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4793 | + |
---|
| 4794 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4795 | + { |
---|
| 4796 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4797 | + |
---|
| 4798 | + objEditor.AddInfo(child, this, true); |
---|
| 4799 | + System.err.println("info : " + child.GetPath()); |
---|
| 4800 | + } |
---|
| 4801 | + |
---|
| 4802 | + objEditor.SetText(); // jan 2014 |
---|
| 4803 | + } |
---|
| 4804 | + |
---|
| 4805 | + super.refreshContents(cp); |
---|
| 4806 | + } |
---|
4222 | 4807 | |
---|
4223 | 4808 | void linkSomething(Object3D thing) |
---|
4224 | 4809 | { |
---|
.. | .. |
---|
4290 | 4875 | { |
---|
4291 | 4876 | if (group.selection.isEmpty()) |
---|
4292 | 4877 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4878 | + |
---|
| 4879 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 4880 | Composite tGroup = null; |
---|
4295 | 4881 | if (group.selection.size() > 0) // 1) |
---|
4296 | 4882 | { |
---|
4297 | 4883 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4884 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 4885 | } |
---|
4300 | 4886 | |
---|
4301 | 4887 | if (cut) |
---|
4302 | 4888 | { |
---|
| 4889 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4890 | +// Save(); |
---|
4303 | 4891 | //int indices[] = jList.getSelectedIndices(); |
---|
4304 | 4892 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4305 | 4893 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4335 | 4923 | //System.out.println("cut " + child); |
---|
4336 | 4924 | //System.out.println("parent = " + child.parent); |
---|
4337 | 4925 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4926 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 4927 | tGroup.add/*Child*/(tmp); |
---|
4340 | 4928 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 4929 | + Grafreed.clipboard = tmp; |
---|
4342 | 4930 | } |
---|
4343 | 4931 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4932 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4933 | tGroup.add/*Child*/(child); |
---|
4346 | 4934 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 4935 | + Grafreed.clipboard = child; |
---|
4348 | 4936 | } |
---|
4349 | 4937 | |
---|
4350 | 4938 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 4964 | //System.out.println("cut " + elem); |
---|
4377 | 4965 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 4966 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4967 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 4968 | tGroup.add/*Child*/(tmp); |
---|
4381 | 4969 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 4970 | + Grafreed.clipboard = tmp; |
---|
4383 | 4971 | } |
---|
4384 | 4972 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4973 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 4974 | tGroup.add/*Child*/(child); |
---|
4387 | 4975 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 4976 | + Grafreed.clipboard = child; |
---|
4389 | 4977 | } |
---|
4390 | 4978 | |
---|
4391 | 4979 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 4980 | + |
---|
| 4981 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4982 | + Grafreed.clipboard = tGroup; |
---|
| 4983 | + |
---|
4394 | 4984 | if (cut) |
---|
4395 | 4985 | { |
---|
4396 | 4986 | ResetModel(); |
---|
.. | .. |
---|
4400 | 4990 | |
---|
4401 | 4991 | void paste(boolean expand) |
---|
4402 | 4992 | { |
---|
| 4993 | + if (Globals.REPLACEONMAKE) |
---|
| 4994 | + Save(); |
---|
| 4995 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4996 | + Globals.REPLACEONMAKE = false; |
---|
4403 | 4997 | // if (GrafreeD.clipboard == null) |
---|
4404 | 4998 | // return; |
---|
4405 | 4999 | boolean first = true; |
---|
4406 | 5000 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5001 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 5002 | { |
---|
4409 | 5003 | Composite temp; |
---|
4410 | 5004 | |
---|
.. | .. |
---|
4415 | 5009 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 5010 | */ |
---|
4417 | 5011 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5012 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 5013 | { |
---|
4420 | 5014 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 5015 | |
---|
.. | .. |
---|
4449 | 5043 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 5044 | //temp.addChild(cb); |
---|
4451 | 5045 | //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()); |
---|
| 5046 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5047 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5048 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5049 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5050 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 5051 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5052 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5053 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 5054 | } |
---|
4461 | 5055 | |
---|
| 5056 | + Globals.REPLACEONMAKE = keep; |
---|
4462 | 5057 | ResetModel(); |
---|
4463 | 5058 | refreshContents(); |
---|
4464 | 5059 | } |
---|
.. | .. |
---|
4505 | 5100 | { |
---|
4506 | 5101 | boolean first = true; |
---|
4507 | 5102 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5103 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 5104 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5105 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 5106 | Object3D copy; |
---|
4512 | 5107 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 5108 | { |
---|
.. | .. |
---|
4517 | 5112 | } |
---|
4518 | 5113 | } else |
---|
4519 | 5114 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5115 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 5116 | } |
---|
4522 | 5117 | } |
---|
4523 | 5118 | } |
---|
.. | .. |
---|
4594 | 5189 | |
---|
4595 | 5190 | void group(Object3D csg, boolean grab) |
---|
4596 | 5191 | { |
---|
| 5192 | + if (Globals.REPLACEONMAKE) |
---|
| 5193 | + Save(); |
---|
| 5194 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5195 | + Globals.REPLACEONMAKE = false; |
---|
4597 | 5196 | if (//false) // why?? |
---|
4598 | 5197 | !group.selection.isEmpty()) |
---|
4599 | 5198 | { |
---|
.. | .. |
---|
4707 | 5306 | //node.add(csg); |
---|
4708 | 5307 | //makeSomething(node); |
---|
4709 | 5308 | makeSomething(csg); |
---|
| 5309 | + Globals.REPLACEONMAKE = keep; |
---|
4710 | 5310 | } |
---|
4711 | 5311 | |
---|
4712 | 5312 | void Ungroup(Object3D g) |
---|
4713 | 5313 | { |
---|
| 5314 | + if (Globals.REPLACEONMAKE) |
---|
| 5315 | + Save(); |
---|
| 5316 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5317 | + Globals.REPLACEONMAKE = false; |
---|
4714 | 5318 | if (g instanceof HiddenObject) |
---|
4715 | 5319 | { |
---|
4716 | 5320 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4727 | 5331 | objEditor.makeSomething(g.get(i), false); |
---|
4728 | 5332 | } |
---|
4729 | 5333 | } |
---|
| 5334 | + Globals.REPLACEONMAKE = keep; |
---|
4730 | 5335 | } |
---|
4731 | 5336 | |
---|
4732 | 5337 | void ungroup() |
---|
.. | .. |
---|
4922 | 5527 | } |
---|
4923 | 5528 | */ |
---|
4924 | 5529 | |
---|
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 | 5530 | /* |
---|
4941 | 5531 | public void Callback(Object obj) |
---|
4942 | 5532 | { |
---|
.. | .. |
---|
4960 | 5550 | } |
---|
4961 | 5551 | */ |
---|
4962 | 5552 | |
---|
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 | 5553 | String GetFile(String dialogName) |
---|
4981 | 5554 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5555 | + if (Grafreed.standAlone) |
---|
4983 | 5556 | { |
---|
4984 | 5557 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5558 | browser.show(); |
---|
.. | .. |
---|
5047 | 5620 | cButton clearpanelButton; |
---|
5048 | 5621 | cButton unselectButton; |
---|
5049 | 5622 | |
---|
| 5623 | + cButton restoreCameraButton; |
---|
| 5624 | + |
---|
| 5625 | + cButton saveButton; |
---|
5050 | 5626 | cButton oneStepButton; |
---|
| 5627 | + |
---|
| 5628 | + cButton groupButton; |
---|
| 5629 | + cButton ungroupButton; |
---|
| 5630 | + cButton compositeButton; |
---|
| 5631 | + cButton switchButton; |
---|
| 5632 | + cButton loopButton; |
---|
| 5633 | + cButton textureButton; |
---|
| 5634 | + |
---|
| 5635 | + cButton gridButton; |
---|
| 5636 | + cButton boxButton; |
---|
| 5637 | + cButton sphereButton; |
---|
| 5638 | + cButton coneButton; |
---|
| 5639 | + cButton torusButton; |
---|
| 5640 | + cButton superButton; |
---|
| 5641 | + cButton kleinButton; |
---|
| 5642 | + cButton particlesButton; |
---|
| 5643 | + cButton overlayButton; |
---|
| 5644 | + cButton lightButton; |
---|
5051 | 5645 | |
---|
5052 | 5646 | cButton screenfitButton; |
---|
5053 | 5647 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5060 | 5654 | |
---|
5061 | 5655 | cButton setsupportButton; |
---|
5062 | 5656 | |
---|
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 | 5657 | // |
---|
5072 | 5658 | //Composite |
---|
5073 | 5659 | Object3D // to do !! |
---|
.. | .. |
---|
5077 | 5663 | //JTree jTree; |
---|
5078 | 5664 | private MenuItem lookAtItem; |
---|
5079 | 5665 | private MenuItem lookFromItem; |
---|
5080 | | - private MenuItem switchItem; |
---|
| 5666 | + private MenuItem switchViewItem; |
---|
5081 | 5667 | private MenuItem cutItem; |
---|
5082 | | - private MenuItem duplicateItem; |
---|
| 5668 | + private MenuItem undoItem; |
---|
| 5669 | + private MenuItem redoItem; |
---|
| 5670 | + private JMenuItem duplicateItem; |
---|
5083 | 5671 | private MenuItem cloneItem; |
---|
5084 | 5672 | private MenuItem cloneSupportItem; |
---|
5085 | 5673 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5092 | 5680 | private MenuItem linkverticesItem; |
---|
5093 | 5681 | private MenuItem relinkverticesItem; |
---|
5094 | 5682 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 5683 | + private MenuItem resetAllItem; |
---|
5096 | 5684 | private MenuItem stepAllItem; |
---|
5097 | 5685 | private MenuItem revertMeshItem; |
---|
5098 | 5686 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5142 | 5730 | private MenuItem showleavesItem; |
---|
5143 | 5731 | private MenuItem markleavesItem; |
---|
5144 | 5732 | private MenuItem unmarkleavesItem; |
---|
| 5733 | + private MenuItem rewindleavesItem; |
---|
| 5734 | + private MenuItem unrewindleavesItem; |
---|
| 5735 | + private MenuItem randomleavesItem; |
---|
| 5736 | + private MenuItem unrandomleavesItem; |
---|
5145 | 5737 | |
---|
5146 | 5738 | private MenuItem flipVItem; |
---|
5147 | 5739 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5153 | 5745 | private MenuItem panoTexturesItem; |
---|
5154 | 5746 | |
---|
5155 | 5747 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 5748 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 5749 | private MenuItem resetTransformItem; |
---|
| 5750 | + private MenuItem transformGeometryItem; |
---|
| 5751 | + private MenuItem transformChildrenItem; |
---|
5158 | 5752 | private MenuItem hideItem; |
---|
5159 | 5753 | private MenuItem grabItem; |
---|
5160 | 5754 | private MenuItem backItem; |
---|
5161 | 5755 | private MenuItem frontItem; |
---|
5162 | 5756 | private MenuItem cameraItem; |
---|
5163 | 5757 | private MenuItem compositeItem; |
---|
5164 | | - private MenuItem randomItem; |
---|
| 5758 | + private MenuItem switchItem; |
---|
5165 | 5759 | private MenuItem physicsItem; |
---|
5166 | 5760 | private MenuItem frameselectorItem; |
---|
5167 | 5761 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5223 | 5817 | private MenuItem doubleItem; |
---|
5224 | 5818 | private MenuItem tripleItem; |
---|
5225 | 5819 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 5820 | private MenuItem computeAOItem; |
---|
5232 | 5821 | private MenuItem recompileItem; |
---|
5233 | 5822 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 5826 | private MenuItem analyzeItem; |
---|
5238 | 5827 | private MenuItem dumpItem; |
---|
5239 | 5828 | //boolean freezemodel = false; |
---|
| 5829 | + |
---|
| 5830 | + Menu cameraMenu; |
---|
| 5831 | + MenuItem editCameraItem; |
---|
| 5832 | + MenuItem restoreCameraItem; |
---|
5240 | 5833 | } |
---|