.. | .. |
---|
98 | 98 | |
---|
99 | 99 | void CloneClipboard(boolean supports) |
---|
100 | 100 | { |
---|
101 | | - assert(GrafreeD.clipboard.parent == null); |
---|
102 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
103 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
104 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
105 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 106 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 109 | } |
---|
110 | 110 | |
---|
111 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 119 | // obj.support = null; |
---|
120 | 120 | if (!supports) |
---|
121 | 121 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 123 | obj.parent = parent; |
---|
124 | 124 | // obj.support = support; |
---|
125 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
150 | 150 | |
---|
151 | 151 | void SetupMenu2(ObjEditor oe) |
---|
152 | 152 | { |
---|
| 153 | + if (Globals.ADVANCED) |
---|
| 154 | + { |
---|
153 | 155 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
154 | 156 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
155 | 157 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
161 | 163 | lookAtItem.addActionListener(this); |
---|
162 | 164 | //lookFromItem.addActinoListener(this); |
---|
163 | 165 | //switchItem.addActionListener(this); |
---|
| 166 | + } |
---|
| 167 | + |
---|
164 | 168 | Menu menu; |
---|
165 | 169 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
166 | 170 | //editItem = menu.add(new MenuItem("Edit")); |
---|
167 | 171 | //editItem.addActionListener(this); |
---|
168 | 172 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
169 | 173 | duplicateItem.addActionListener(this); |
---|
170 | | - menu.add("-"); |
---|
171 | 174 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
172 | 175 | cloneItem.addActionListener(this); |
---|
| 176 | + if (Globals.ADVANCED) |
---|
| 177 | + { |
---|
173 | 178 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
174 | 179 | cloneSupportItem.addActionListener(this); |
---|
| 180 | + } |
---|
175 | 181 | menu.add("-"); |
---|
176 | 182 | cutItem = menu.add(new MenuItem("Cut")); |
---|
177 | 183 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
179 | 185 | copyItem.addActionListener(this); |
---|
180 | 186 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
181 | 187 | pasteItem.addActionListener(this); |
---|
| 188 | + menu.add("-"); |
---|
| 189 | + |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 192 | + pasteIntoItem.addActionListener(this); |
---|
182 | 193 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
183 | 194 | pasteLinkItem.addActionListener(this); |
---|
184 | 195 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
185 | 196 | pasteCloneItem.addActionListener(this); |
---|
186 | 197 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
187 | 198 | // pasteExpandItem.addActionListener(this); |
---|
| 199 | + menu.add("-"); |
---|
188 | 200 | clearItem = menu.add(new MenuItem("Clear")); |
---|
189 | 201 | clearItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + if (Globals.ADVANCED) |
---|
| 204 | + { |
---|
| 205 | + // Deletes the cameras... |
---|
190 | 206 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
191 | 207 | clearAllItem.addActionListener(this); |
---|
| 208 | + } |
---|
192 | 209 | |
---|
193 | 210 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
194 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
195 | | - resetMeshItem.addActionListener(this); |
---|
196 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
197 | | - stepAllItem.addActionListener(this); |
---|
| 211 | + if (Globals.ADVANCED) |
---|
| 212 | + { |
---|
198 | 213 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
199 | 214 | revertMeshItem.addActionListener(this); |
---|
200 | 215 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
201 | 216 | resetreferencesItem.addActionListener(this); |
---|
202 | 217 | menu.add("-"); |
---|
| 218 | + } |
---|
203 | 219 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
204 | 220 | overwriteGeoItem.addActionListener(this); |
---|
205 | 221 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
211 | 227 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
212 | 228 | overwriteUVItem.addActionListener(this); |
---|
213 | 229 | menu.add("-"); |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
214 | 232 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
215 | 233 | generateMeshItem.addActionListener(this); |
---|
216 | 234 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
217 | 235 | poseMeshItem.addActionListener(this); |
---|
218 | 236 | menu.add("-"); |
---|
| 237 | + } |
---|
219 | 238 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
220 | 239 | resetsupportItem.addActionListener(this); |
---|
221 | 240 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
222 | 241 | linkverticesItem.addActionListener(this); |
---|
223 | 242 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
224 | 243 | relinkverticesItem.addActionListener(this); |
---|
| 244 | + |
---|
| 245 | + if (Globals.ADVANCED) |
---|
| 246 | + { |
---|
225 | 247 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
226 | 248 | setMasterItem.addActionListener(this); |
---|
| 249 | + } |
---|
227 | 250 | |
---|
228 | 251 | oe.menuBar.add(menu = new Menu("Group")); |
---|
229 | 252 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
234 | 257 | frontItem.addActionListener(this); |
---|
235 | 258 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
236 | 259 | compositeItem.addActionListener(this); |
---|
237 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 260 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
238 | 261 | hideItem.addActionListener(this); |
---|
239 | 262 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
240 | 263 | ungroupItem.addActionListener(this); |
---|
.. | .. |
---|
245 | 268 | switchGeoItem.addActionListener(this); |
---|
246 | 269 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
247 | 270 | switchTransfoItem.addActionListener(this); |
---|
| 271 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
| 272 | + morphItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + menu.add("-"); |
---|
248 | 277 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
249 | 278 | physicsItem.addActionListener(this); |
---|
250 | 279 | frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
251 | 280 | frameselectorItem.addActionListener(this); |
---|
252 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
253 | | - morphItem.addActionListener(this); |
---|
254 | 281 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
255 | 282 | scriptNodeItem.addActionListener(this); |
---|
256 | 283 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
257 | 284 | cameraItem.addActionListener(this); |
---|
| 285 | + } |
---|
258 | 286 | |
---|
259 | 287 | oe.menuBar.add(menu = new Menu("Object")); |
---|
260 | 288 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
269 | 297 | shadowYItem.addActionListener(this); |
---|
270 | 298 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
271 | 299 | shadowZItem.addActionListener(this); |
---|
| 300 | + if (Globals.ADVANCED) |
---|
| 301 | + { |
---|
| 302 | + menu.add("-"); |
---|
272 | 303 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
273 | 304 | linkerItem.addActionListener(this); |
---|
274 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
275 | | - templateItem.addActionListener(this); |
---|
276 | 305 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
277 | 306 | attributeItem.addActionListener(this); |
---|
| 307 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 308 | + templateItem.addActionListener(this); |
---|
278 | 309 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
279 | 310 | pointflowItem.addActionListener(this); |
---|
| 311 | + } |
---|
280 | 312 | menu.add("-"); |
---|
281 | 313 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
282 | 314 | resetTransformItem.addActionListener(this); |
---|
283 | 315 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
284 | 316 | resetCentroidItem.addActionListener(this); |
---|
285 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
286 | | - transformgeometryItem.addActionListener(this); |
---|
| 317 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 318 | + resetCentroidXZItem.addActionListener(this); |
---|
| 319 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 320 | + transformGeometryItem.addActionListener(this); |
---|
| 321 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 322 | + transformChildrenItem.addActionListener(this); |
---|
287 | 323 | |
---|
288 | 324 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
289 | 325 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
294 | 330 | genNormalsCADItem.addActionListener(this); |
---|
295 | 331 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
296 | 332 | genNormalsMESHItem.addActionListener(this); |
---|
| 333 | + if (Globals.ADVANCED) |
---|
| 334 | + { |
---|
297 | 335 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
298 | 336 | genNormalsMINEItem.addActionListener(this); |
---|
| 337 | + } |
---|
299 | 338 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
300 | 339 | stripifyItem.addActionListener(this); |
---|
301 | 340 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
317 | 356 | reduce34MeshItem.addActionListener(this); |
---|
318 | 357 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
319 | 358 | increaseMeshItem.addActionListener(this); |
---|
320 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
321 | | - smoothMeshItem.addActionListener(this); |
---|
322 | 359 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
323 | 360 | clipMeshItem.addActionListener(this); |
---|
| 361 | + |
---|
| 362 | + if (Globals.ADVANCED) |
---|
| 363 | + { |
---|
| 364 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 365 | + smoothMeshItem.addActionListener(this); |
---|
| 366 | + } |
---|
324 | 367 | |
---|
325 | 368 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
326 | 369 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
327 | 370 | clearMaterialsItem.addActionListener(this); |
---|
| 371 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 372 | + resetAllItem.addActionListener(this); |
---|
| 373 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 374 | + stepAllItem.addActionListener(this); |
---|
328 | 375 | menu.add("-"); |
---|
329 | 376 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
330 | 377 | liveleavesItem.addActionListener(this); |
---|
331 | 378 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
332 | 379 | unliveleavesItem.addActionListener(this); |
---|
| 380 | + if (Globals.ADVANCED) |
---|
| 381 | + { |
---|
333 | 382 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
334 | 383 | supportleavesItem.addActionListener(this); |
---|
335 | 384 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
336 | 385 | unsupportleavesItem.addActionListener(this); |
---|
| 386 | + } |
---|
337 | 387 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
338 | 388 | hideleavesItem.addActionListener(this); |
---|
339 | 389 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
377 | 427 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 428 | sortbynameItem.addActionListener(this); |
---|
379 | 429 | menu.add("-"); |
---|
| 430 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 431 | + shareGeometriesItem.addActionListener(this); |
---|
| 432 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 433 | + mergeGeometriesItem.addActionListener(this); |
---|
| 434 | + if (Globals.ADVANCED) |
---|
| 435 | + { |
---|
| 436 | + // Pretty much the same as duplicate and clone. |
---|
380 | 437 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 438 | extractGeometriesItem.addActionListener(this); |
---|
382 | 439 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 440 | cloneGeometriesItem.addActionListener(this); |
---|
384 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
385 | | - shareGeometriesItem.addActionListener(this); |
---|
386 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
387 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 441 | + } |
---|
388 | 442 | |
---|
389 | 443 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 444 | buildCreateMenu(menu); |
---|
391 | 445 | |
---|
392 | | - |
---|
393 | 446 | oe.menuBar.add(menu = new Menu("Include")); |
---|
394 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
395 | | - importGFDItem.addActionListener(this); |
---|
396 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
397 | | - importVRMLX3DItem.addActionListener(this); |
---|
398 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
| 447 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
399 | 448 | importOBJItem.addActionListener(this); |
---|
400 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
| 449 | + menu.add("-"); |
---|
| 450 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
401 | 451 | import3DSItem.addActionListener(this); |
---|
| 452 | + menu.add("-"); |
---|
| 453 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 454 | + importVRMLX3DItem.addActionListener(this); |
---|
| 455 | + menu.add("-"); |
---|
| 456 | + importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
| 457 | + importGFDItem.addActionListener(this); |
---|
402 | 458 | |
---|
403 | 459 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 460 | buildToolsMenu(menu); |
---|
.. | .. |
---|
437 | 493 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
438 | 494 | |
---|
439 | 495 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
440 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 496 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 497 | liveCB.addItemListener(this); |
---|
442 | 498 | |
---|
| 499 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 500 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 501 | + oneStepButton.addActionListener(this); |
---|
| 502 | + |
---|
443 | 503 | oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
444 | 504 | fastCB.setToolTipText("Fast mode"); |
---|
445 | 505 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
448 | 508 | trackCB.setToolTipText("Enable tracking"); |
---|
449 | 509 | trackCB.addItemListener(this); |
---|
450 | 510 | |
---|
451 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 511 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
452 | 512 | screenfitButton.setToolTipText("Screen fit"); |
---|
453 | 513 | screenfitButton.addActionListener(this); |
---|
454 | 514 | |
---|
.. | .. |
---|
457 | 517 | |
---|
458 | 518 | if (Globals.ADVANCED) |
---|
459 | 519 | { |
---|
460 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 520 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
461 | 521 | snapobjectButton.addActionListener(this); |
---|
462 | 522 | snapobjectButton.setToolTipText("Snap Object"); |
---|
463 | 523 | } |
---|
464 | 524 | |
---|
465 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 525 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
466 | 526 | flashSelectionButton.setToolTipText("Show selection"); |
---|
467 | 527 | flashSelectionButton.addActionListener(this); |
---|
468 | 528 | |
---|
469 | 529 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
470 | 530 | |
---|
471 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 531 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
472 | 532 | twoButton.setToolTipText("Show center view only"); |
---|
473 | 533 | twoButton.addActionListener(this); |
---|
474 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 534 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
475 | 535 | fourButton.addActionListener(this); |
---|
476 | 536 | fourButton.setToolTipText("Show left panel only"); |
---|
477 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 537 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
478 | 538 | sixButton.setToolTipText("2-column layout left"); |
---|
479 | 539 | sixButton.addActionListener(this); |
---|
480 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 540 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
481 | 541 | threeButton.setToolTipText("2-column layout right"); |
---|
482 | 542 | threeButton.addActionListener(this); |
---|
483 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 543 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
484 | 544 | sevenButton.setToolTipText("3-column layout"); |
---|
485 | 545 | sevenButton.addActionListener(this); |
---|
486 | 546 | // |
---|
487 | 547 | |
---|
488 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 548 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
489 | 549 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
490 | 550 | rootButton.addActionListener(this); |
---|
491 | 551 | |
---|
492 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 552 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
493 | 553 | closeButton.setToolTipText("Close tab"); |
---|
494 | 554 | closeButton.addActionListener(this); |
---|
495 | 555 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
497 | 557 | |
---|
498 | 558 | cGridBag commandsPanel = new cGridBag(); |
---|
499 | 559 | |
---|
500 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 560 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
501 | 561 | editButton.setToolTipText("Edit selection"); |
---|
502 | 562 | editButton.addActionListener(this); |
---|
503 | 563 | |
---|
504 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 564 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
505 | 565 | uneditButton.setToolTipText("Unedit selection"); |
---|
506 | 566 | uneditButton.addActionListener(this); |
---|
507 | 567 | |
---|
.. | .. |
---|
509 | 569 | allParamsButton.setToolTipText("Edit all params"); |
---|
510 | 570 | allParamsButton.addActionListener(this); |
---|
511 | 571 | |
---|
512 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 572 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
513 | 573 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
514 | 574 | clearPanelButton.addActionListener(this); |
---|
515 | 575 | |
---|
516 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 576 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
517 | 577 | unselectButton.setToolTipText("Unselect"); |
---|
518 | 578 | unselectButton.addActionListener(this); |
---|
519 | 579 | |
---|
.. | .. |
---|
588 | 648 | |
---|
589 | 649 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
590 | 650 | { |
---|
| 651 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 652 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 653 | + boxCB.addItemListener(this); |
---|
| 654 | + |
---|
| 655 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 656 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 657 | + zoomBoxCB.addItemListener(this); |
---|
| 658 | + |
---|
| 659 | + if (true) // Globals.ADVANCED) |
---|
| 660 | + { |
---|
591 | 661 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
592 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
| 662 | + supportCB.setToolTipText("Enable rigging"); |
---|
593 | 663 | supportCB.addItemListener(this); |
---|
594 | 664 | |
---|
595 | 665 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
.. | .. |
---|
607 | 677 | slowCB.setToolTipText("Smooth interpolation"); |
---|
608 | 678 | slowCB.addItemListener(this); |
---|
609 | 679 | |
---|
610 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
611 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
612 | | - boxCB.addItemListener(this); |
---|
613 | | - |
---|
614 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
615 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
616 | | - zoomBoxCB.addItemListener(this); |
---|
617 | | - |
---|
618 | 680 | // constraints.gridy += 1; |
---|
619 | 681 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
620 | 682 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
645 | 707 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
646 | 708 | lookAtCB.setToolTipText("Look-at target"); |
---|
647 | 709 | lookAtCB.addItemListener(this); |
---|
| 710 | + |
---|
| 711 | + } |
---|
648 | 712 | |
---|
649 | 713 | cGridBag fill = new cGridBag(); |
---|
650 | 714 | |
---|
.. | .. |
---|
881 | 945 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
882 | 946 | // return; |
---|
883 | 947 | // } |
---|
884 | | - if (string.charAt(0) == '/') |
---|
| 948 | + |
---|
| 949 | + // File path for Mac and Windows |
---|
| 950 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
885 | 951 | { |
---|
886 | 952 | // file(s) |
---|
887 | 953 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
908 | 974 | |
---|
909 | 975 | flashIt = false; |
---|
910 | 976 | CameraPane pane = (CameraPane) target; |
---|
911 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 977 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
912 | 978 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
913 | 979 | |
---|
914 | 980 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
935 | 1001 | { |
---|
936 | 1002 | loadClipboard(true); |
---|
937 | 1003 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
938 | | - pasteInto(false); |
---|
| 1004 | + pasteInto(false, false); |
---|
939 | 1005 | } else { |
---|
940 | 1006 | loadClipboard(false); |
---|
941 | 1007 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
942 | | - pasteInto(false); // true); // ??? |
---|
| 1008 | + pasteInto(false, false); // true); // ??? |
---|
943 | 1009 | } |
---|
944 | 1010 | } |
---|
945 | 1011 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1061 | 1127 | kleinItem.addActionListener(this); |
---|
1062 | 1128 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1063 | 1129 | particleItem.addActionListener(this); |
---|
| 1130 | + if (Globals.ADVANCED) |
---|
| 1131 | + { |
---|
1064 | 1132 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1065 | 1133 | ragdollItem.addActionListener(this); |
---|
1066 | 1134 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1067 | 1135 | ragdoll2Item.addActionListener(this); |
---|
| 1136 | + } |
---|
1068 | 1137 | menu.add("-"); |
---|
1069 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1138 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1070 | 1139 | meshItem.addActionListener(this); |
---|
1071 | 1140 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1072 | 1141 | // meshGroupItem.addActionListener(this); |
---|
| 1142 | + if (Globals.ADVANCED) |
---|
| 1143 | + { |
---|
1073 | 1144 | springItem = menu.add(new MenuItem("Spring")); |
---|
1074 | 1145 | springItem.addActionListener(this); |
---|
1075 | 1146 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1076 | 1147 | flagItem.addActionListener(this); |
---|
1077 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1078 | | - bezierItem.addActionListener(this); |
---|
1079 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1080 | | - checkerItem.addActionListener(this); |
---|
1081 | 1148 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1082 | 1149 | blobItem.addActionListener(this); |
---|
1083 | 1150 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1084 | 1151 | latheItem.addActionListener(this); |
---|
| 1152 | + } |
---|
| 1153 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1154 | + bezierItem.addActionListener(this); |
---|
| 1155 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1156 | + overlayItem.addActionListener(this); |
---|
1085 | 1157 | lightItem = menu.add(new MenuItem("Light")); |
---|
1086 | 1158 | lightItem.addActionListener(this); |
---|
1087 | 1159 | menu.add("-"); |
---|
.. | .. |
---|
1091 | 1163 | loopItem.addActionListener(this); |
---|
1092 | 1164 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1093 | 1165 | doubleItem.addActionListener(this); |
---|
| 1166 | + if (Globals.ADVANCED) |
---|
| 1167 | + { |
---|
1094 | 1168 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1095 | 1169 | tripleItem.addActionListener(this); |
---|
| 1170 | + } |
---|
1096 | 1171 | } |
---|
1097 | 1172 | |
---|
1098 | 1173 | void buildToolsMenu(Menu menu) |
---|
.. | .. |
---|
1106 | 1181 | parseverticesItem.addActionListener(this); |
---|
1107 | 1182 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1108 | 1183 | textureFieldItem.addActionListener(this); |
---|
1109 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1184 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1110 | 1185 | alignItem.addActionListener(this); |
---|
1111 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1112 | | - mirrorItem.addActionListener(this); |
---|
1113 | 1186 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1114 | 1187 | reduceMorphItem.addActionListener(this); |
---|
1115 | 1188 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1116 | 1189 | reduce34MorphItem.addActionListener(this); |
---|
1117 | | - |
---|
| 1190 | + menu.add("-"); |
---|
1118 | 1191 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1119 | 1192 | computeAOItem.addActionListener(this); |
---|
1120 | | - menu.add("-"); |
---|
1121 | 1193 | |
---|
| 1194 | + if (Globals.ADVANCED) |
---|
| 1195 | + { |
---|
| 1196 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1197 | + mirrorItem.addActionListener(this); |
---|
| 1198 | + menu.add("-"); |
---|
1122 | 1199 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1123 | 1200 | memoryItem.addActionListener(this); |
---|
1124 | 1201 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1141 | 1218 | menu.add("-"); |
---|
1142 | 1219 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1143 | 1220 | editScriptItem.addActionListener(this); |
---|
| 1221 | + } |
---|
1144 | 1222 | } |
---|
1145 | 1223 | |
---|
1146 | 1224 | void ScreenFit() |
---|
.. | .. |
---|
1469 | 1547 | |
---|
1470 | 1548 | void Overwrite(int mask) |
---|
1471 | 1549 | { |
---|
1472 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1550 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1473 | 1551 | { |
---|
1474 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1552 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1475 | 1553 | |
---|
1476 | 1554 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1477 | 1555 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1642 | 1720 | { |
---|
1643 | 1721 | makeSomething(new BezierSurface()); |
---|
1644 | 1722 | } else |
---|
1645 | | - if (source == checkerItem) |
---|
| 1723 | + if (source == overlayItem) |
---|
1646 | 1724 | { |
---|
1647 | 1725 | /* |
---|
1648 | 1726 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1791 | 1869 | } else |
---|
1792 | 1870 | if (source == importOBJItem) |
---|
1793 | 1871 | { |
---|
1794 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1872 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1873 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 1874 | + browser.setVisible(true); |
---|
| 1875 | + String filename = browser.getFile(); |
---|
| 1876 | + if (filename != null && filename.length() > 0) |
---|
| 1877 | + { |
---|
| 1878 | + String fullname = browser.getDirectory() + filename; |
---|
| 1879 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 1880 | + } |
---|
1795 | 1881 | } else |
---|
1796 | 1882 | if (source == computeAOItem) |
---|
1797 | 1883 | { |
---|
.. | .. |
---|
1811 | 1897 | if (source == invariantsItem) |
---|
1812 | 1898 | { |
---|
1813 | 1899 | System.out.println("Invariants:"); |
---|
1814 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1900 | + Grafreed.grafreeD.universe.invariants(); |
---|
1815 | 1901 | } else |
---|
1816 | 1902 | if (source == memoryItem) |
---|
1817 | 1903 | { |
---|
.. | .. |
---|
1829 | 1915 | if (source == dumpItem) |
---|
1830 | 1916 | { |
---|
1831 | 1917 | DumpObject(); |
---|
| 1918 | + } else |
---|
| 1919 | + if (source == oneStepButton) |
---|
| 1920 | + { |
---|
| 1921 | + Globals.ONESTEP = true; |
---|
| 1922 | + cameraView.repaint(); |
---|
1832 | 1923 | } else |
---|
1833 | 1924 | if (source == screenfitButton) |
---|
1834 | 1925 | { |
---|
.. | .. |
---|
1881 | 1972 | } else |
---|
1882 | 1973 | if (source == duplicateItem) |
---|
1883 | 1974 | { |
---|
1884 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 1975 | + Object3D keep = Grafreed.clipboard; |
---|
1885 | 1976 | loadClipboard(false); |
---|
1886 | 1977 | paste(false); |
---|
1887 | | - GrafreeD.clipboard = keep; |
---|
| 1978 | + Grafreed.clipboard = keep; |
---|
1888 | 1979 | } else |
---|
1889 | 1980 | if (source == cloneItem) |
---|
1890 | 1981 | { |
---|
.. | .. |
---|
1902 | 1993 | { |
---|
1903 | 1994 | paste(false); |
---|
1904 | 1995 | } else |
---|
| 1996 | + if (source == pasteIntoItem) |
---|
| 1997 | + { |
---|
| 1998 | + pasteInto(true, false); |
---|
| 1999 | + } else |
---|
1905 | 2000 | if (source == pasteLinkItem) |
---|
1906 | 2001 | { |
---|
1907 | | - pasteInto(false); |
---|
| 2002 | + pasteInto(false, false); |
---|
1908 | 2003 | } else |
---|
1909 | 2004 | if (source == pasteCloneItem) |
---|
1910 | 2005 | { |
---|
1911 | | - pasteInto(true); |
---|
| 2006 | + pasteInto(true, true); |
---|
1912 | 2007 | } else |
---|
1913 | 2008 | if (source == pasteExpandItem) |
---|
1914 | 2009 | { |
---|
.. | .. |
---|
2100 | 2195 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2101 | 2196 | // refreshContents(); |
---|
2102 | 2197 | // } |
---|
2103 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2198 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2104 | 2199 | { |
---|
2105 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2200 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2106 | 2201 | |
---|
2107 | 2202 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2108 | 2203 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2110 | 2205 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2111 | 2206 | for (int i=0; i<group.selection.size(); i++) |
---|
2112 | 2207 | { |
---|
2113 | | - boolean random = CameraPane.RANDOM; |
---|
2114 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2208 | + boolean random = CameraPane.SWITCH; |
---|
| 2209 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2115 | 2210 | group.selection.get(i).linkVerticesThis(content); |
---|
2116 | 2211 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2117 | | - CameraPane.RANDOM = random; |
---|
| 2212 | + CameraPane.SWITCH = random; |
---|
2118 | 2213 | } |
---|
2119 | 2214 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2120 | 2215 | refreshContents(); |
---|
.. | .. |
---|
2124 | 2219 | { |
---|
2125 | 2220 | for (int i=0; i<group.selection.size(); i++) |
---|
2126 | 2221 | { |
---|
2127 | | - boolean random = CameraPane.RANDOM; |
---|
2128 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2222 | + boolean random = CameraPane.SWITCH; |
---|
| 2223 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2129 | 2224 | group.selection.get(i).linkVerticesThis(null); |
---|
2130 | | - CameraPane.RANDOM = random; |
---|
| 2225 | + CameraPane.SWITCH = random; |
---|
2131 | 2226 | } |
---|
2132 | 2227 | |
---|
2133 | 2228 | refreshContents(); |
---|
2134 | 2229 | } else |
---|
2135 | 2230 | if (source == relinkverticesItem) |
---|
2136 | 2231 | { |
---|
2137 | | - boolean random = CameraPane.RANDOM; |
---|
2138 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2232 | + boolean random = CameraPane.SWITCH; |
---|
| 2233 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2139 | 2234 | group.selection.RelinkToSupport(); |
---|
2140 | | - CameraPane.RANDOM = random; |
---|
| 2235 | + CameraPane.SWITCH = random; |
---|
2141 | 2236 | |
---|
2142 | 2237 | refreshContents(); |
---|
2143 | 2238 | } else |
---|
.. | .. |
---|
2152 | 2247 | } else |
---|
2153 | 2248 | if (source == setMasterItem) |
---|
2154 | 2249 | { |
---|
2155 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2250 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2156 | 2251 | { |
---|
2157 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2252 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2158 | 2253 | |
---|
2159 | 2254 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2160 | 2255 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2167 | 2262 | { |
---|
2168 | 2263 | if (group.selection.size() == 1) |
---|
2169 | 2264 | { |
---|
2170 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2265 | + if (Grafreed.clipboard.size() == 1) |
---|
2171 | 2266 | { |
---|
2172 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2267 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2173 | 2268 | |
---|
2174 | 2269 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2175 | 2270 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2186 | 2281 | { |
---|
2187 | 2282 | RevertMeshes(); |
---|
2188 | 2283 | } else |
---|
2189 | | - if (source == resetMeshItem) |
---|
| 2284 | + if (source == resetAllItem) |
---|
2190 | 2285 | { |
---|
2191 | 2286 | ResetAll(); |
---|
2192 | 2287 | } else |
---|
.. | .. |
---|
2524 | 2619 | { |
---|
2525 | 2620 | SmoothMesh(); |
---|
2526 | 2621 | } else |
---|
2527 | | - if (source == transformgeometryItem) |
---|
| 2622 | + if (source == transformGeometryItem) |
---|
2528 | 2623 | { |
---|
2529 | 2624 | TransformGeometry(); |
---|
| 2625 | + } else |
---|
| 2626 | + if (source == transformChildrenItem) |
---|
| 2627 | + { |
---|
| 2628 | + TransformChildren(); |
---|
2530 | 2629 | } else |
---|
2531 | 2630 | if (source == resetTransformItem) |
---|
2532 | 2631 | { |
---|
.. | .. |
---|
2534 | 2633 | } else |
---|
2535 | 2634 | if (source == resetCentroidItem) |
---|
2536 | 2635 | { |
---|
2537 | | - ResetCentroid(); |
---|
| 2636 | + ResetCentroid(true); |
---|
| 2637 | + } else |
---|
| 2638 | + if (source == resetCentroidXZItem) |
---|
| 2639 | + { |
---|
| 2640 | + ResetCentroid(false); |
---|
2538 | 2641 | } else |
---|
2539 | 2642 | if (source == resetParentItem) |
---|
2540 | 2643 | { |
---|
.. | .. |
---|
3050 | 3153 | refreshContents(); |
---|
3051 | 3154 | } |
---|
3052 | 3155 | |
---|
| 3156 | + void TransformChildren() |
---|
| 3157 | + { |
---|
| 3158 | + Object3D obj; |
---|
| 3159 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3160 | + { |
---|
| 3161 | + obj = (Object3D)e.nextElement(); |
---|
| 3162 | + obj.KeepTextureMatrices(); |
---|
| 3163 | + obj.TransformChildren(); |
---|
| 3164 | + obj.RestoreTextureMatrices(); |
---|
| 3165 | + |
---|
| 3166 | +// if (obj.parent == null) |
---|
| 3167 | +// { |
---|
| 3168 | +// System.out.println("NULL PARENT!"); |
---|
| 3169 | +// new Exception().printStackTrace(); |
---|
| 3170 | +// } |
---|
| 3171 | +// else |
---|
| 3172 | +// TouchTransform(obj); |
---|
| 3173 | +// //obj.parent.Touch(); |
---|
| 3174 | + } |
---|
| 3175 | + |
---|
| 3176 | + refreshContents(); |
---|
| 3177 | + } |
---|
3053 | 3178 | |
---|
3054 | 3179 | void ResetTransform() |
---|
3055 | 3180 | { |
---|
.. | .. |
---|
3162 | 3287 | refreshContents(); |
---|
3163 | 3288 | } |
---|
3164 | 3289 | |
---|
3165 | | - void ResetCentroid() |
---|
| 3290 | + void ResetCentroid(boolean full) |
---|
3166 | 3291 | { |
---|
3167 | 3292 | Object3D obj; |
---|
3168 | 3293 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3177 | 3302 | LA.matIdentity(Object3D.mat); |
---|
3178 | 3303 | obj.getBounds(minima, maxima, false); |
---|
3179 | 3304 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3180 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3305 | + if (full) |
---|
| 3306 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3181 | 3307 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3182 | 3308 | obj.TransformMesh(Object3D.mat); |
---|
| 3309 | + |
---|
3183 | 3310 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3184 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3311 | + if (full) |
---|
| 3312 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3185 | 3313 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3314 | + |
---|
3186 | 3315 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3187 | 3316 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3188 | 3317 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3248 | 3377 | obj = (Object3D)e.nextElement(); |
---|
3249 | 3378 | |
---|
3250 | 3379 | System.out.println("Object is: " + obj); |
---|
3251 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3380 | + Grafreed.AnalyzeObject(obj); |
---|
3252 | 3381 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3253 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3382 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3254 | 3383 | |
---|
3255 | 3384 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3256 | 3385 | } |
---|
.. | .. |
---|
3464 | 3593 | |
---|
3465 | 3594 | void ParseVertices() |
---|
3466 | 3595 | { |
---|
3467 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3468 | | - GrafreeD.epsequal = true; |
---|
| 3596 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3597 | + Grafreed.epsequal = true; |
---|
3469 | 3598 | |
---|
3470 | 3599 | for (int i=0; i<group.selection.size(); i++) |
---|
3471 | 3600 | { |
---|
.. | .. |
---|
3490 | 3619 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3491 | 3620 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3492 | 3621 | |
---|
3493 | | - g.add(GrafreeD.clipboard); |
---|
| 3622 | + g.add(Grafreed.clipboard); |
---|
3494 | 3623 | |
---|
3495 | 3624 | buffer.add(g); |
---|
3496 | 3625 | } |
---|
.. | .. |
---|
3505 | 3634 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3506 | 3635 | } |
---|
3507 | 3636 | |
---|
3508 | | - GrafreeD.epsequal = epsequal; |
---|
| 3637 | + Grafreed.epsequal = epsequal; |
---|
3509 | 3638 | |
---|
3510 | 3639 | refreshContents(); |
---|
3511 | 3640 | } |
---|
.. | .. |
---|
3523 | 3652 | String pigment = Object3D.GetPigment(tex); |
---|
3524 | 3653 | //String bump = Object3D.GetBump(tex); |
---|
3525 | 3654 | |
---|
3526 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3655 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3656 | + |
---|
| 3657 | + try |
---|
| 3658 | + { |
---|
| 3659 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3660 | + } |
---|
| 3661 | + catch (Exception e) |
---|
| 3662 | + { |
---|
| 3663 | + System.err.println("FAIL: " + node); |
---|
| 3664 | + } |
---|
3527 | 3665 | |
---|
3528 | 3666 | double s = v.s; |
---|
3529 | 3667 | |
---|
.. | .. |
---|
3611 | 3749 | |
---|
3612 | 3750 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3613 | 3751 | |
---|
3614 | | - boolean random = CameraPane.RANDOM; |
---|
3615 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3752 | + boolean random = CameraPane.SWITCH; |
---|
| 3753 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3616 | 3754 | lowres.linkVerticesThis(null); |
---|
3617 | 3755 | lowres.linkVerticesThis(sn); |
---|
3618 | | - CameraPane.RANDOM = random; |
---|
| 3756 | + CameraPane.SWITCH = random; |
---|
3619 | 3757 | |
---|
3620 | 3758 | System.err.flush(); |
---|
3621 | 3759 | |
---|
.. | .. |
---|
3655 | 3793 | return; |
---|
3656 | 3794 | |
---|
3657 | 3795 | Object3D poses = group.selection.get(0); |
---|
3658 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3796 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3659 | 3797 | |
---|
3660 | 3798 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3661 | 3799 | |
---|
.. | .. |
---|
3849 | 3987 | |
---|
3850 | 3988 | void ClipMesh() |
---|
3851 | 3989 | { |
---|
3852 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3990 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3853 | 3991 | { |
---|
3854 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3992 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3855 | 3993 | |
---|
3856 | 3994 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3857 | 3995 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3860 | 3998 | // { |
---|
3861 | 3999 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3862 | 4000 | // } |
---|
3863 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4001 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3864 | 4002 | } |
---|
3865 | 4003 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3866 | 4004 | System.out.println("DONE."); |
---|
.. | .. |
---|
4200 | 4338 | { |
---|
4201 | 4339 | if (group.selection.isEmpty()) |
---|
4202 | 4340 | return; |
---|
4203 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4341 | + Grafreed.clipboardIsTempGroup = false; |
---|
4204 | 4342 | Composite tGroup = null; |
---|
4205 | 4343 | if (group.selection.size() > 0) // 1) |
---|
4206 | 4344 | { |
---|
4207 | 4345 | tGroup = new cGroup(); |
---|
4208 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4346 | + Grafreed.clipboardIsTempGroup = true; |
---|
4209 | 4347 | } |
---|
4210 | 4348 | |
---|
4211 | 4349 | if (cut) |
---|
.. | .. |
---|
4245 | 4383 | //System.out.println("cut " + child); |
---|
4246 | 4384 | //System.out.println("parent = " + child.parent); |
---|
4247 | 4385 | // tmp.addChild(child); |
---|
4248 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4386 | + if (Grafreed.clipboardIsTempGroup) |
---|
4249 | 4387 | tGroup.add/*Child*/(tmp); |
---|
4250 | 4388 | else |
---|
4251 | | - GrafreeD.clipboard = tmp; |
---|
| 4389 | + Grafreed.clipboard = tmp; |
---|
4252 | 4390 | } |
---|
4253 | 4391 | else |
---|
4254 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4392 | + if (Grafreed.clipboardIsTempGroup) |
---|
4255 | 4393 | tGroup.add/*Child*/(child); |
---|
4256 | 4394 | else |
---|
4257 | | - GrafreeD.clipboard = child; |
---|
| 4395 | + Grafreed.clipboard = child; |
---|
4258 | 4396 | } |
---|
4259 | 4397 | |
---|
4260 | 4398 | //ResetModel(); |
---|
.. | .. |
---|
4286 | 4424 | //System.out.println("cut " + elem); |
---|
4287 | 4425 | //System.out.println("parent = " + elem.parent); |
---|
4288 | 4426 | // tmp.addChild(elem); |
---|
4289 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4427 | + if (Grafreed.clipboardIsTempGroup) |
---|
4290 | 4428 | tGroup.add/*Child*/(tmp); |
---|
4291 | 4429 | else |
---|
4292 | | - GrafreeD.clipboard = tmp; |
---|
| 4430 | + Grafreed.clipboard = tmp; |
---|
4293 | 4431 | } |
---|
4294 | 4432 | else |
---|
4295 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4433 | + if (Grafreed.clipboardIsTempGroup) |
---|
4296 | 4434 | tGroup.add/*Child*/(child); |
---|
4297 | 4435 | else |
---|
4298 | | - GrafreeD.clipboard = child; |
---|
| 4436 | + Grafreed.clipboard = child; |
---|
4299 | 4437 | } |
---|
4300 | 4438 | |
---|
4301 | 4439 | } |
---|
4302 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4303 | | - GrafreeD.clipboard = tGroup; |
---|
| 4440 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4441 | + Grafreed.clipboard = tGroup; |
---|
4304 | 4442 | if (cut) |
---|
4305 | 4443 | { |
---|
4306 | 4444 | ResetModel(); |
---|
.. | .. |
---|
4314 | 4452 | // return; |
---|
4315 | 4453 | boolean first = true; |
---|
4316 | 4454 | |
---|
4317 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4455 | + if (Grafreed.clipboardIsTempGroup) |
---|
4318 | 4456 | { |
---|
4319 | 4457 | Composite temp; |
---|
4320 | 4458 | |
---|
.. | .. |
---|
4325 | 4463 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4326 | 4464 | */ |
---|
4327 | 4465 | Object3D elem; |
---|
4328 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4466 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4329 | 4467 | { |
---|
4330 | 4468 | Object3D child = (Object3D)e.nextElement(); |
---|
4331 | 4469 | |
---|
.. | .. |
---|
4359 | 4497 | //Object3D cb = Applet3D.clipboard; |
---|
4360 | 4498 | //temp.addChild(cb); |
---|
4361 | 4499 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4362 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4363 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4364 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4365 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4366 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4500 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4501 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4502 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4503 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4504 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4367 | 4505 | else |
---|
4368 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4369 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4506 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4507 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4370 | 4508 | } |
---|
4371 | 4509 | |
---|
4372 | 4510 | ResetModel(); |
---|
4373 | 4511 | refreshContents(); |
---|
4374 | 4512 | } |
---|
4375 | 4513 | |
---|
4376 | | - void pasteInto(boolean copyit) |
---|
| 4514 | + void pasteInto(boolean copyit, boolean clone) |
---|
4377 | 4515 | { |
---|
4378 | 4516 | // if (GrafreeD.clipboard == null) |
---|
4379 | 4517 | // return; |
---|
.. | .. |
---|
4402 | 4540 | if (copyit) |
---|
4403 | 4541 | { |
---|
4404 | 4542 | // paste(false); |
---|
4405 | | - CloneClipboard(false); // sept 2014 |
---|
| 4543 | + if (clone) |
---|
| 4544 | + { |
---|
| 4545 | + CloneClipboard(false); // sept 2014 |
---|
| 4546 | + } |
---|
| 4547 | + else |
---|
| 4548 | + { |
---|
| 4549 | + paste(false); |
---|
| 4550 | + } |
---|
4406 | 4551 | } |
---|
4407 | 4552 | else |
---|
4408 | 4553 | { |
---|
4409 | 4554 | boolean first = true; |
---|
4410 | 4555 | |
---|
4411 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4556 | + if (Grafreed.clipboardIsTempGroup) |
---|
4412 | 4557 | { |
---|
4413 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4558 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4414 | 4559 | Object3D copy; |
---|
4415 | 4560 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4416 | 4561 | { |
---|
.. | .. |
---|
4420 | 4565 | } |
---|
4421 | 4566 | } else |
---|
4422 | 4567 | { |
---|
4423 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4568 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4424 | 4569 | } |
---|
4425 | 4570 | } |
---|
4426 | 4571 | } |
---|
.. | .. |
---|
4865 | 5010 | |
---|
4866 | 5011 | void ImportVRMLX3D() |
---|
4867 | 5012 | { |
---|
4868 | | - if (GrafreeD.standAlone) |
---|
| 5013 | + if (Grafreed.standAlone) |
---|
4869 | 5014 | { |
---|
4870 | 5015 | /**/ |
---|
4871 | 5016 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4882 | 5027 | |
---|
4883 | 5028 | String GetFile(String dialogName) |
---|
4884 | 5029 | { |
---|
4885 | | - if (GrafreeD.standAlone) |
---|
| 5030 | + if (Grafreed.standAlone) |
---|
4886 | 5031 | { |
---|
4887 | 5032 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4888 | 5033 | browser.show(); |
---|
.. | .. |
---|
4950 | 5095 | cButton clearpanelButton; |
---|
4951 | 5096 | cButton unselectButton; |
---|
4952 | 5097 | |
---|
| 5098 | + cButton oneStepButton; |
---|
| 5099 | + |
---|
4953 | 5100 | cButton screenfitButton; |
---|
4954 | 5101 | cButton screenfitpointButton; |
---|
4955 | 5102 | cButton snapobjectButton; |
---|
.. | .. |
---|
4993 | 5140 | private MenuItem linkverticesItem; |
---|
4994 | 5141 | private MenuItem relinkverticesItem; |
---|
4995 | 5142 | private MenuItem setMasterItem; |
---|
4996 | | - private MenuItem resetMeshItem; |
---|
| 5143 | + private MenuItem resetAllItem; |
---|
4997 | 5144 | private MenuItem stepAllItem; |
---|
4998 | 5145 | private MenuItem revertMeshItem; |
---|
4999 | 5146 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5004 | 5151 | private MenuItem mergeGeometriesItem; |
---|
5005 | 5152 | private MenuItem copyItem; |
---|
5006 | 5153 | private MenuItem pasteItem; |
---|
| 5154 | + private MenuItem pasteIntoItem; |
---|
5007 | 5155 | private MenuItem pasteLinkItem; |
---|
5008 | 5156 | private MenuItem pasteCloneItem; |
---|
5009 | 5157 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5053 | 5201 | private MenuItem panoTexturesItem; |
---|
5054 | 5202 | |
---|
5055 | 5203 | private MenuItem resetCentroidItem; |
---|
5056 | | - private MenuItem transformgeometryItem; |
---|
| 5204 | + private MenuItem resetCentroidXZItem; |
---|
5057 | 5205 | private MenuItem resetTransformItem; |
---|
| 5206 | + private MenuItem transformGeometryItem; |
---|
| 5207 | + private MenuItem transformChildrenItem; |
---|
5058 | 5208 | private MenuItem hideItem; |
---|
5059 | 5209 | private MenuItem grabItem; |
---|
5060 | 5210 | private MenuItem backItem; |
---|
.. | .. |
---|
5101 | 5251 | private MenuItem blobItem; |
---|
5102 | 5252 | private MenuItem latheItem; |
---|
5103 | 5253 | private MenuItem bezierItem; |
---|
5104 | | - private MenuItem checkerItem; |
---|
| 5254 | + private MenuItem overlayItem; |
---|
5105 | 5255 | private MenuItem meshItem; |
---|
5106 | 5256 | // private MenuItem meshGroupItem; |
---|
5107 | 5257 | private MenuItem springItem; |
---|