.. | .. |
---|
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 | |
---|
.. | .. |
---|
665 | 729 | buttonGroup.add(radioButton); |
---|
666 | 730 | radioButton.doClick(); |
---|
667 | 731 | } |
---|
| 732 | + |
---|
668 | 733 | void SetupViews(ObjEditor oe) |
---|
669 | 734 | { |
---|
670 | 735 | oe.SetupViews(); |
---|
.. | .. |
---|
881 | 946 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
882 | 947 | // return; |
---|
883 | 948 | // } |
---|
884 | | - if (string.charAt(0) == '/') |
---|
| 949 | + |
---|
| 950 | + // File path for Mac and Windows |
---|
| 951 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
885 | 952 | { |
---|
886 | 953 | // file(s) |
---|
887 | 954 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
908 | 975 | |
---|
909 | 976 | flashIt = false; |
---|
910 | 977 | CameraPane pane = (CameraPane) target; |
---|
911 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 978 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
912 | 979 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
913 | 980 | |
---|
914 | 981 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
935 | 1002 | { |
---|
936 | 1003 | loadClipboard(true); |
---|
937 | 1004 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
938 | | - pasteInto(false); |
---|
| 1005 | + pasteInto(false, false); |
---|
939 | 1006 | } else { |
---|
940 | 1007 | loadClipboard(false); |
---|
941 | 1008 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
942 | | - pasteInto(false); // true); // ??? |
---|
| 1009 | + pasteInto(false, false); // true); // ??? |
---|
943 | 1010 | } |
---|
944 | 1011 | } |
---|
945 | 1012 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1061 | 1128 | kleinItem.addActionListener(this); |
---|
1062 | 1129 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1063 | 1130 | particleItem.addActionListener(this); |
---|
| 1131 | + if (Globals.ADVANCED) |
---|
| 1132 | + { |
---|
1064 | 1133 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1065 | 1134 | ragdollItem.addActionListener(this); |
---|
1066 | 1135 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1067 | 1136 | ragdoll2Item.addActionListener(this); |
---|
| 1137 | + } |
---|
1068 | 1138 | menu.add("-"); |
---|
1069 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1139 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1070 | 1140 | meshItem.addActionListener(this); |
---|
1071 | 1141 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1072 | 1142 | // meshGroupItem.addActionListener(this); |
---|
| 1143 | + if (Globals.ADVANCED) |
---|
| 1144 | + { |
---|
1073 | 1145 | springItem = menu.add(new MenuItem("Spring")); |
---|
1074 | 1146 | springItem.addActionListener(this); |
---|
1075 | 1147 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1076 | 1148 | 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 | 1149 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1082 | 1150 | blobItem.addActionListener(this); |
---|
1083 | 1151 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1084 | 1152 | latheItem.addActionListener(this); |
---|
| 1153 | + } |
---|
| 1154 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1155 | + bezierItem.addActionListener(this); |
---|
| 1156 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1157 | + overlayItem.addActionListener(this); |
---|
1085 | 1158 | lightItem = menu.add(new MenuItem("Light")); |
---|
1086 | 1159 | lightItem.addActionListener(this); |
---|
1087 | 1160 | menu.add("-"); |
---|
.. | .. |
---|
1091 | 1164 | loopItem.addActionListener(this); |
---|
1092 | 1165 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1093 | 1166 | doubleItem.addActionListener(this); |
---|
| 1167 | + if (Globals.ADVANCED) |
---|
| 1168 | + { |
---|
1094 | 1169 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1095 | 1170 | tripleItem.addActionListener(this); |
---|
| 1171 | + } |
---|
1096 | 1172 | } |
---|
1097 | 1173 | |
---|
1098 | 1174 | void buildToolsMenu(Menu menu) |
---|
.. | .. |
---|
1106 | 1182 | parseverticesItem.addActionListener(this); |
---|
1107 | 1183 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1108 | 1184 | textureFieldItem.addActionListener(this); |
---|
1109 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1185 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1110 | 1186 | alignItem.addActionListener(this); |
---|
1111 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1112 | | - mirrorItem.addActionListener(this); |
---|
1113 | 1187 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1114 | 1188 | reduceMorphItem.addActionListener(this); |
---|
1115 | 1189 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1116 | 1190 | reduce34MorphItem.addActionListener(this); |
---|
1117 | | - |
---|
| 1191 | + menu.add("-"); |
---|
1118 | 1192 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1119 | 1193 | computeAOItem.addActionListener(this); |
---|
1120 | | - menu.add("-"); |
---|
1121 | 1194 | |
---|
| 1195 | + if (Globals.ADVANCED) |
---|
| 1196 | + { |
---|
| 1197 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1198 | + mirrorItem.addActionListener(this); |
---|
| 1199 | + menu.add("-"); |
---|
1122 | 1200 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1123 | 1201 | memoryItem.addActionListener(this); |
---|
1124 | 1202 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1141 | 1219 | menu.add("-"); |
---|
1142 | 1220 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1143 | 1221 | editScriptItem.addActionListener(this); |
---|
| 1222 | + } |
---|
1144 | 1223 | } |
---|
1145 | 1224 | |
---|
1146 | 1225 | void ScreenFit() |
---|
.. | .. |
---|
1469 | 1548 | |
---|
1470 | 1549 | void Overwrite(int mask) |
---|
1471 | 1550 | { |
---|
1472 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1551 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1473 | 1552 | { |
---|
1474 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1553 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1475 | 1554 | |
---|
1476 | 1555 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1477 | 1556 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1642 | 1721 | { |
---|
1643 | 1722 | makeSomething(new BezierSurface()); |
---|
1644 | 1723 | } else |
---|
1645 | | - if (source == checkerItem) |
---|
| 1724 | + if (source == overlayItem) |
---|
1646 | 1725 | { |
---|
1647 | 1726 | /* |
---|
1648 | 1727 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1791 | 1870 | } else |
---|
1792 | 1871 | if (source == importOBJItem) |
---|
1793 | 1872 | { |
---|
1794 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1873 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1874 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 1875 | + browser.setVisible(true); |
---|
| 1876 | + String filename = browser.getFile(); |
---|
| 1877 | + if (filename != null && filename.length() > 0) |
---|
| 1878 | + { |
---|
| 1879 | + String fullname = browser.getDirectory() + filename; |
---|
| 1880 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 1881 | + } |
---|
1795 | 1882 | } else |
---|
1796 | 1883 | if (source == computeAOItem) |
---|
1797 | 1884 | { |
---|
.. | .. |
---|
1811 | 1898 | if (source == invariantsItem) |
---|
1812 | 1899 | { |
---|
1813 | 1900 | System.out.println("Invariants:"); |
---|
1814 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1901 | + Grafreed.grafreeD.universe.invariants(); |
---|
1815 | 1902 | } else |
---|
1816 | 1903 | if (source == memoryItem) |
---|
1817 | 1904 | { |
---|
.. | .. |
---|
1829 | 1916 | if (source == dumpItem) |
---|
1830 | 1917 | { |
---|
1831 | 1918 | DumpObject(); |
---|
| 1919 | + } else |
---|
| 1920 | + if (source == oneStepButton) |
---|
| 1921 | + { |
---|
| 1922 | + Globals.ONESTEP = true; |
---|
| 1923 | + cameraView.repaint(); |
---|
1832 | 1924 | } else |
---|
1833 | 1925 | if (source == screenfitButton) |
---|
1834 | 1926 | { |
---|
.. | .. |
---|
1881 | 1973 | } else |
---|
1882 | 1974 | if (source == duplicateItem) |
---|
1883 | 1975 | { |
---|
1884 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 1976 | + Object3D keep = Grafreed.clipboard; |
---|
1885 | 1977 | loadClipboard(false); |
---|
1886 | 1978 | paste(false); |
---|
1887 | | - GrafreeD.clipboard = keep; |
---|
| 1979 | + Grafreed.clipboard = keep; |
---|
1888 | 1980 | } else |
---|
1889 | 1981 | if (source == cloneItem) |
---|
1890 | 1982 | { |
---|
.. | .. |
---|
1902 | 1994 | { |
---|
1903 | 1995 | paste(false); |
---|
1904 | 1996 | } else |
---|
| 1997 | + if (source == pasteIntoItem) |
---|
| 1998 | + { |
---|
| 1999 | + pasteInto(true, false); |
---|
| 2000 | + } else |
---|
1905 | 2001 | if (source == pasteLinkItem) |
---|
1906 | 2002 | { |
---|
1907 | | - pasteInto(false); |
---|
| 2003 | + pasteInto(false, false); |
---|
1908 | 2004 | } else |
---|
1909 | 2005 | if (source == pasteCloneItem) |
---|
1910 | 2006 | { |
---|
1911 | | - pasteInto(true); |
---|
| 2007 | + pasteInto(true, true); |
---|
1912 | 2008 | } else |
---|
1913 | 2009 | if (source == pasteExpandItem) |
---|
1914 | 2010 | { |
---|
.. | .. |
---|
2100 | 2196 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2101 | 2197 | // refreshContents(); |
---|
2102 | 2198 | // } |
---|
2103 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2199 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2104 | 2200 | { |
---|
2105 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2201 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2106 | 2202 | |
---|
2107 | 2203 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2108 | 2204 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2110 | 2206 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2111 | 2207 | for (int i=0; i<group.selection.size(); i++) |
---|
2112 | 2208 | { |
---|
2113 | | - boolean random = CameraPane.RANDOM; |
---|
2114 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2209 | + boolean random = CameraPane.SWITCH; |
---|
| 2210 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2115 | 2211 | group.selection.get(i).linkVerticesThis(content); |
---|
2116 | 2212 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2117 | | - CameraPane.RANDOM = random; |
---|
| 2213 | + CameraPane.SWITCH = random; |
---|
2118 | 2214 | } |
---|
2119 | 2215 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2120 | 2216 | refreshContents(); |
---|
.. | .. |
---|
2124 | 2220 | { |
---|
2125 | 2221 | for (int i=0; i<group.selection.size(); i++) |
---|
2126 | 2222 | { |
---|
2127 | | - boolean random = CameraPane.RANDOM; |
---|
2128 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2223 | + boolean random = CameraPane.SWITCH; |
---|
| 2224 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2129 | 2225 | group.selection.get(i).linkVerticesThis(null); |
---|
2130 | | - CameraPane.RANDOM = random; |
---|
| 2226 | + CameraPane.SWITCH = random; |
---|
2131 | 2227 | } |
---|
2132 | 2228 | |
---|
2133 | 2229 | refreshContents(); |
---|
2134 | 2230 | } else |
---|
2135 | 2231 | if (source == relinkverticesItem) |
---|
2136 | 2232 | { |
---|
2137 | | - boolean random = CameraPane.RANDOM; |
---|
2138 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2233 | + boolean random = CameraPane.SWITCH; |
---|
| 2234 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2139 | 2235 | group.selection.RelinkToSupport(); |
---|
2140 | | - CameraPane.RANDOM = random; |
---|
| 2236 | + CameraPane.SWITCH = random; |
---|
2141 | 2237 | |
---|
2142 | 2238 | refreshContents(); |
---|
2143 | 2239 | } else |
---|
.. | .. |
---|
2152 | 2248 | } else |
---|
2153 | 2249 | if (source == setMasterItem) |
---|
2154 | 2250 | { |
---|
2155 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2251 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2156 | 2252 | { |
---|
2157 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2253 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2158 | 2254 | |
---|
2159 | 2255 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2160 | 2256 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2167 | 2263 | { |
---|
2168 | 2264 | if (group.selection.size() == 1) |
---|
2169 | 2265 | { |
---|
2170 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2266 | + if (Grafreed.clipboard.size() == 1) |
---|
2171 | 2267 | { |
---|
2172 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2268 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2173 | 2269 | |
---|
2174 | 2270 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2175 | 2271 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2186 | 2282 | { |
---|
2187 | 2283 | RevertMeshes(); |
---|
2188 | 2284 | } else |
---|
2189 | | - if (source == resetMeshItem) |
---|
| 2285 | + if (source == resetAllItem) |
---|
2190 | 2286 | { |
---|
2191 | 2287 | ResetAll(); |
---|
2192 | 2288 | } else |
---|
.. | .. |
---|
2524 | 2620 | { |
---|
2525 | 2621 | SmoothMesh(); |
---|
2526 | 2622 | } else |
---|
2527 | | - if (source == transformgeometryItem) |
---|
| 2623 | + if (source == transformGeometryItem) |
---|
2528 | 2624 | { |
---|
2529 | 2625 | TransformGeometry(); |
---|
| 2626 | + } else |
---|
| 2627 | + if (source == transformChildrenItem) |
---|
| 2628 | + { |
---|
| 2629 | + TransformChildren(); |
---|
2530 | 2630 | } else |
---|
2531 | 2631 | if (source == resetTransformItem) |
---|
2532 | 2632 | { |
---|
.. | .. |
---|
2534 | 2634 | } else |
---|
2535 | 2635 | if (source == resetCentroidItem) |
---|
2536 | 2636 | { |
---|
2537 | | - ResetCentroid(); |
---|
| 2637 | + ResetCentroid(true); |
---|
| 2638 | + } else |
---|
| 2639 | + if (source == resetCentroidXZItem) |
---|
| 2640 | + { |
---|
| 2641 | + ResetCentroid(false); |
---|
2538 | 2642 | } else |
---|
2539 | 2643 | if (source == resetParentItem) |
---|
2540 | 2644 | { |
---|
.. | .. |
---|
2976 | 3080 | frontView.object = group; |
---|
2977 | 3081 | sideView.object = group; |
---|
2978 | 3082 | } |
---|
2979 | | - group.editWindow = this; |
---|
| 3083 | + |
---|
| 3084 | +// fix "+" issue group.editWindow = this; |
---|
| 3085 | + |
---|
2980 | 3086 | /* |
---|
2981 | 3087 | currentLayout = radio.layout; |
---|
2982 | 3088 | if (currentLayout == null) |
---|
.. | .. |
---|
3050 | 3156 | refreshContents(); |
---|
3051 | 3157 | } |
---|
3052 | 3158 | |
---|
| 3159 | + void TransformChildren() |
---|
| 3160 | + { |
---|
| 3161 | + Object3D obj; |
---|
| 3162 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3163 | + { |
---|
| 3164 | + obj = (Object3D)e.nextElement(); |
---|
| 3165 | + obj.KeepTextureMatrices(); |
---|
| 3166 | + obj.TransformChildren(); |
---|
| 3167 | + obj.RestoreTextureMatrices(); |
---|
| 3168 | + |
---|
| 3169 | +// if (obj.parent == null) |
---|
| 3170 | +// { |
---|
| 3171 | +// System.out.println("NULL PARENT!"); |
---|
| 3172 | +// new Exception().printStackTrace(); |
---|
| 3173 | +// } |
---|
| 3174 | +// else |
---|
| 3175 | +// TouchTransform(obj); |
---|
| 3176 | +// //obj.parent.Touch(); |
---|
| 3177 | + } |
---|
| 3178 | + |
---|
| 3179 | + refreshContents(); |
---|
| 3180 | + } |
---|
3053 | 3181 | |
---|
3054 | 3182 | void ResetTransform() |
---|
3055 | 3183 | { |
---|
.. | .. |
---|
3162 | 3290 | refreshContents(); |
---|
3163 | 3291 | } |
---|
3164 | 3292 | |
---|
3165 | | - void ResetCentroid() |
---|
| 3293 | + void ResetCentroid(boolean full) |
---|
3166 | 3294 | { |
---|
3167 | 3295 | Object3D obj; |
---|
3168 | 3296 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3177 | 3305 | LA.matIdentity(Object3D.mat); |
---|
3178 | 3306 | obj.getBounds(minima, maxima, false); |
---|
3179 | 3307 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3180 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3308 | + if (full) |
---|
| 3309 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3181 | 3310 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3182 | 3311 | obj.TransformMesh(Object3D.mat); |
---|
| 3312 | + |
---|
3183 | 3313 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3184 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3314 | + if (full) |
---|
| 3315 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3185 | 3316 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3317 | + |
---|
3186 | 3318 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3187 | 3319 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3188 | 3320 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3248 | 3380 | obj = (Object3D)e.nextElement(); |
---|
3249 | 3381 | |
---|
3250 | 3382 | System.out.println("Object is: " + obj); |
---|
3251 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3383 | + Grafreed.AnalyzeObject(obj); |
---|
3252 | 3384 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3253 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3385 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3254 | 3386 | |
---|
3255 | 3387 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3256 | 3388 | } |
---|
.. | .. |
---|
3464 | 3596 | |
---|
3465 | 3597 | void ParseVertices() |
---|
3466 | 3598 | { |
---|
3467 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3468 | | - GrafreeD.epsequal = true; |
---|
| 3599 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3600 | + Grafreed.epsequal = true; |
---|
3469 | 3601 | |
---|
3470 | 3602 | for (int i=0; i<group.selection.size(); i++) |
---|
3471 | 3603 | { |
---|
.. | .. |
---|
3490 | 3622 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3491 | 3623 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3492 | 3624 | |
---|
3493 | | - g.add(GrafreeD.clipboard); |
---|
| 3625 | + g.add(Grafreed.clipboard); |
---|
3494 | 3626 | |
---|
3495 | 3627 | buffer.add(g); |
---|
3496 | 3628 | } |
---|
.. | .. |
---|
3505 | 3637 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3506 | 3638 | } |
---|
3507 | 3639 | |
---|
3508 | | - GrafreeD.epsequal = epsequal; |
---|
| 3640 | + Grafreed.epsequal = epsequal; |
---|
3509 | 3641 | |
---|
3510 | 3642 | refreshContents(); |
---|
3511 | 3643 | } |
---|
.. | .. |
---|
3523 | 3655 | String pigment = Object3D.GetPigment(tex); |
---|
3524 | 3656 | //String bump = Object3D.GetBump(tex); |
---|
3525 | 3657 | |
---|
3526 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3658 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3659 | + |
---|
| 3660 | + try |
---|
| 3661 | + { |
---|
| 3662 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3663 | + } |
---|
| 3664 | + catch (Exception e) |
---|
| 3665 | + { |
---|
| 3666 | + System.err.println("FAIL: " + node); |
---|
| 3667 | + } |
---|
3527 | 3668 | |
---|
3528 | 3669 | double s = v.s; |
---|
3529 | 3670 | |
---|
.. | .. |
---|
3611 | 3752 | |
---|
3612 | 3753 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3613 | 3754 | |
---|
3614 | | - boolean random = CameraPane.RANDOM; |
---|
3615 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3755 | + boolean random = CameraPane.SWITCH; |
---|
| 3756 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3616 | 3757 | lowres.linkVerticesThis(null); |
---|
3617 | 3758 | lowres.linkVerticesThis(sn); |
---|
3618 | | - CameraPane.RANDOM = random; |
---|
| 3759 | + CameraPane.SWITCH = random; |
---|
3619 | 3760 | |
---|
3620 | 3761 | System.err.flush(); |
---|
3621 | 3762 | |
---|
.. | .. |
---|
3655 | 3796 | return; |
---|
3656 | 3797 | |
---|
3657 | 3798 | Object3D poses = group.selection.get(0); |
---|
3658 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3799 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3659 | 3800 | |
---|
3660 | 3801 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3661 | 3802 | |
---|
.. | .. |
---|
3849 | 3990 | |
---|
3850 | 3991 | void ClipMesh() |
---|
3851 | 3992 | { |
---|
3852 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3993 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3853 | 3994 | { |
---|
3854 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3995 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3855 | 3996 | |
---|
3856 | 3997 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3857 | 3998 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3860 | 4001 | // { |
---|
3861 | 4002 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3862 | 4003 | // } |
---|
3863 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4004 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3864 | 4005 | } |
---|
3865 | 4006 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3866 | 4007 | System.out.println("DONE."); |
---|
.. | .. |
---|
3995 | 4136 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3996 | 4137 | |
---|
3997 | 4138 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3998 | | - if(elem != group) |
---|
| 4139 | + if(elem != group || !newWindow) |
---|
3999 | 4140 | { |
---|
4000 | 4141 | // if (!(elem instanceof Composite)) |
---|
4001 | 4142 | // newWindow = false; |
---|
.. | .. |
---|
4200 | 4341 | { |
---|
4201 | 4342 | if (group.selection.isEmpty()) |
---|
4202 | 4343 | return; |
---|
4203 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4344 | + Grafreed.clipboardIsTempGroup = false; |
---|
4204 | 4345 | Composite tGroup = null; |
---|
4205 | 4346 | if (group.selection.size() > 0) // 1) |
---|
4206 | 4347 | { |
---|
4207 | 4348 | tGroup = new cGroup(); |
---|
4208 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4349 | + Grafreed.clipboardIsTempGroup = true; |
---|
4209 | 4350 | } |
---|
4210 | 4351 | |
---|
4211 | 4352 | if (cut) |
---|
.. | .. |
---|
4245 | 4386 | //System.out.println("cut " + child); |
---|
4246 | 4387 | //System.out.println("parent = " + child.parent); |
---|
4247 | 4388 | // tmp.addChild(child); |
---|
4248 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4389 | + if (Grafreed.clipboardIsTempGroup) |
---|
4249 | 4390 | tGroup.add/*Child*/(tmp); |
---|
4250 | 4391 | else |
---|
4251 | | - GrafreeD.clipboard = tmp; |
---|
| 4392 | + Grafreed.clipboard = tmp; |
---|
4252 | 4393 | } |
---|
4253 | 4394 | else |
---|
4254 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4395 | + if (Grafreed.clipboardIsTempGroup) |
---|
4255 | 4396 | tGroup.add/*Child*/(child); |
---|
4256 | 4397 | else |
---|
4257 | | - GrafreeD.clipboard = child; |
---|
| 4398 | + Grafreed.clipboard = child; |
---|
4258 | 4399 | } |
---|
4259 | 4400 | |
---|
4260 | 4401 | //ResetModel(); |
---|
.. | .. |
---|
4286 | 4427 | //System.out.println("cut " + elem); |
---|
4287 | 4428 | //System.out.println("parent = " + elem.parent); |
---|
4288 | 4429 | // tmp.addChild(elem); |
---|
4289 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4430 | + if (Grafreed.clipboardIsTempGroup) |
---|
4290 | 4431 | tGroup.add/*Child*/(tmp); |
---|
4291 | 4432 | else |
---|
4292 | | - GrafreeD.clipboard = tmp; |
---|
| 4433 | + Grafreed.clipboard = tmp; |
---|
4293 | 4434 | } |
---|
4294 | 4435 | else |
---|
4295 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4436 | + if (Grafreed.clipboardIsTempGroup) |
---|
4296 | 4437 | tGroup.add/*Child*/(child); |
---|
4297 | 4438 | else |
---|
4298 | | - GrafreeD.clipboard = child; |
---|
| 4439 | + Grafreed.clipboard = child; |
---|
4299 | 4440 | } |
---|
4300 | 4441 | |
---|
4301 | 4442 | } |
---|
4302 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4303 | | - GrafreeD.clipboard = tGroup; |
---|
| 4443 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4444 | + Grafreed.clipboard = tGroup; |
---|
4304 | 4445 | if (cut) |
---|
4305 | 4446 | { |
---|
4306 | 4447 | ResetModel(); |
---|
.. | .. |
---|
4314 | 4455 | // return; |
---|
4315 | 4456 | boolean first = true; |
---|
4316 | 4457 | |
---|
4317 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4458 | + if (Grafreed.clipboardIsTempGroup) |
---|
4318 | 4459 | { |
---|
4319 | 4460 | Composite temp; |
---|
4320 | 4461 | |
---|
.. | .. |
---|
4325 | 4466 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4326 | 4467 | */ |
---|
4327 | 4468 | Object3D elem; |
---|
4328 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4469 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4329 | 4470 | { |
---|
4330 | 4471 | Object3D child = (Object3D)e.nextElement(); |
---|
4331 | 4472 | |
---|
.. | .. |
---|
4359 | 4500 | //Object3D cb = Applet3D.clipboard; |
---|
4360 | 4501 | //temp.addChild(cb); |
---|
4361 | 4502 | //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()); |
---|
| 4503 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4504 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4505 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4506 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4507 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4367 | 4508 | else |
---|
4368 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4369 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4509 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4510 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4370 | 4511 | } |
---|
4371 | 4512 | |
---|
4372 | 4513 | ResetModel(); |
---|
4373 | 4514 | refreshContents(); |
---|
4374 | 4515 | } |
---|
4375 | 4516 | |
---|
4376 | | - void pasteInto(boolean copyit) |
---|
| 4517 | + void pasteInto(boolean copyit, boolean clone) |
---|
4377 | 4518 | { |
---|
4378 | 4519 | // if (GrafreeD.clipboard == null) |
---|
4379 | 4520 | // return; |
---|
.. | .. |
---|
4402 | 4543 | if (copyit) |
---|
4403 | 4544 | { |
---|
4404 | 4545 | // paste(false); |
---|
4405 | | - CloneClipboard(false); // sept 2014 |
---|
| 4546 | + if (clone) |
---|
| 4547 | + { |
---|
| 4548 | + CloneClipboard(false); // sept 2014 |
---|
| 4549 | + } |
---|
| 4550 | + else |
---|
| 4551 | + { |
---|
| 4552 | + paste(false); |
---|
| 4553 | + } |
---|
4406 | 4554 | } |
---|
4407 | 4555 | else |
---|
4408 | 4556 | { |
---|
4409 | 4557 | boolean first = true; |
---|
4410 | 4558 | |
---|
4411 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4559 | + if (Grafreed.clipboardIsTempGroup) |
---|
4412 | 4560 | { |
---|
4413 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4561 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4414 | 4562 | Object3D copy; |
---|
4415 | 4563 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4416 | 4564 | { |
---|
.. | .. |
---|
4420 | 4568 | } |
---|
4421 | 4569 | } else |
---|
4422 | 4570 | { |
---|
4423 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4571 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4424 | 4572 | } |
---|
4425 | 4573 | } |
---|
4426 | 4574 | } |
---|
.. | .. |
---|
4865 | 5013 | |
---|
4866 | 5014 | void ImportVRMLX3D() |
---|
4867 | 5015 | { |
---|
4868 | | - if (GrafreeD.standAlone) |
---|
| 5016 | + if (Grafreed.standAlone) |
---|
4869 | 5017 | { |
---|
4870 | 5018 | /**/ |
---|
4871 | 5019 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4882 | 5030 | |
---|
4883 | 5031 | String GetFile(String dialogName) |
---|
4884 | 5032 | { |
---|
4885 | | - if (GrafreeD.standAlone) |
---|
| 5033 | + if (Grafreed.standAlone) |
---|
4886 | 5034 | { |
---|
4887 | 5035 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4888 | 5036 | browser.show(); |
---|
.. | .. |
---|
4950 | 5098 | cButton clearpanelButton; |
---|
4951 | 5099 | cButton unselectButton; |
---|
4952 | 5100 | |
---|
| 5101 | + cButton oneStepButton; |
---|
| 5102 | + |
---|
4953 | 5103 | cButton screenfitButton; |
---|
4954 | 5104 | cButton screenfitpointButton; |
---|
4955 | 5105 | cButton snapobjectButton; |
---|
.. | .. |
---|
4993 | 5143 | private MenuItem linkverticesItem; |
---|
4994 | 5144 | private MenuItem relinkverticesItem; |
---|
4995 | 5145 | private MenuItem setMasterItem; |
---|
4996 | | - private MenuItem resetMeshItem; |
---|
| 5146 | + private MenuItem resetAllItem; |
---|
4997 | 5147 | private MenuItem stepAllItem; |
---|
4998 | 5148 | private MenuItem revertMeshItem; |
---|
4999 | 5149 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5004 | 5154 | private MenuItem mergeGeometriesItem; |
---|
5005 | 5155 | private MenuItem copyItem; |
---|
5006 | 5156 | private MenuItem pasteItem; |
---|
| 5157 | + private MenuItem pasteIntoItem; |
---|
5007 | 5158 | private MenuItem pasteLinkItem; |
---|
5008 | 5159 | private MenuItem pasteCloneItem; |
---|
5009 | 5160 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5053 | 5204 | private MenuItem panoTexturesItem; |
---|
5054 | 5205 | |
---|
5055 | 5206 | private MenuItem resetCentroidItem; |
---|
5056 | | - private MenuItem transformgeometryItem; |
---|
| 5207 | + private MenuItem resetCentroidXZItem; |
---|
5057 | 5208 | private MenuItem resetTransformItem; |
---|
| 5209 | + private MenuItem transformGeometryItem; |
---|
| 5210 | + private MenuItem transformChildrenItem; |
---|
5058 | 5211 | private MenuItem hideItem; |
---|
5059 | 5212 | private MenuItem grabItem; |
---|
5060 | 5213 | private MenuItem backItem; |
---|
.. | .. |
---|
5101 | 5254 | private MenuItem blobItem; |
---|
5102 | 5255 | private MenuItem latheItem; |
---|
5103 | 5256 | private MenuItem bezierItem; |
---|
5104 | | - private MenuItem checkerItem; |
---|
| 5257 | + private MenuItem overlayItem; |
---|
5105 | 5258 | private MenuItem meshItem; |
---|
5106 | 5259 | // private MenuItem meshGroupItem; |
---|
5107 | 5260 | private MenuItem springItem; |
---|