.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GrafreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
102 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
104 | | - 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)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
149 | 150 | |
---|
150 | 151 | void SetupMenu2(ObjEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + if (Globals.ADVANCED) |
---|
| 154 | + { |
---|
152 | 155 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 156 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 157 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 163 | lookAtItem.addActionListener(this); |
---|
161 | 164 | //lookFromItem.addActinoListener(this); |
---|
162 | 165 | //switchItem.addActionListener(this); |
---|
| 166 | + } |
---|
| 167 | + |
---|
163 | 168 | Menu menu; |
---|
164 | 169 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 170 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 171 | //editItem.addActionListener(this); |
---|
167 | 172 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | 173 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 174 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 175 | cloneItem.addActionListener(this); |
---|
| 176 | + if (Globals.ADVANCED) |
---|
| 177 | + { |
---|
172 | 178 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 179 | cloneSupportItem.addActionListener(this); |
---|
| 180 | + } |
---|
174 | 181 | menu.add("-"); |
---|
175 | 182 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 183 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 185 | copyItem.addActionListener(this); |
---|
179 | 186 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 187 | pasteItem.addActionListener(this); |
---|
| 188 | + menu.add("-"); |
---|
| 189 | + |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 192 | + pasteIntoItem.addActionListener(this); |
---|
181 | 193 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 194 | pasteLinkItem.addActionListener(this); |
---|
183 | 195 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 196 | pasteCloneItem.addActionListener(this); |
---|
185 | 197 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 198 | // pasteExpandItem.addActionListener(this); |
---|
| 199 | + menu.add("-"); |
---|
187 | 200 | clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | 201 | clearItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + if (Globals.ADVANCED) |
---|
| 204 | + { |
---|
| 205 | + // Deletes the cameras... |
---|
189 | 206 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 207 | clearAllItem.addActionListener(this); |
---|
| 208 | + } |
---|
191 | 209 | |
---|
192 | 210 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
193 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | | - resetMeshItem.addActionListener(this); |
---|
195 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
196 | | - stepAllItem.addActionListener(this); |
---|
| 211 | + if (Globals.ADVANCED) |
---|
| 212 | + { |
---|
197 | 213 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 214 | revertMeshItem.addActionListener(this); |
---|
199 | 215 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 216 | resetreferencesItem.addActionListener(this); |
---|
201 | 217 | menu.add("-"); |
---|
| 218 | + } |
---|
202 | 219 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 220 | overwriteGeoItem.addActionListener(this); |
---|
204 | 221 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 227 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 228 | overwriteUVItem.addActionListener(this); |
---|
212 | 229 | menu.add("-"); |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
213 | 232 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 233 | generateMeshItem.addActionListener(this); |
---|
215 | 234 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 235 | poseMeshItem.addActionListener(this); |
---|
217 | 236 | menu.add("-"); |
---|
| 237 | + } |
---|
218 | 238 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 239 | resetsupportItem.addActionListener(this); |
---|
220 | 240 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 241 | linkverticesItem.addActionListener(this); |
---|
222 | 242 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 243 | relinkverticesItem.addActionListener(this); |
---|
| 244 | + |
---|
| 245 | + if (Globals.ADVANCED) |
---|
| 246 | + { |
---|
224 | 247 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 248 | setMasterItem.addActionListener(this); |
---|
| 249 | + } |
---|
226 | 250 | |
---|
227 | 251 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 252 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 257 | frontItem.addActionListener(this); |
---|
234 | 258 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 259 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 260 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 261 | hideItem.addActionListener(this); |
---|
238 | 262 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 263 | ungroupItem.addActionListener(this); |
---|
240 | 264 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 265 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 266 | randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
247 | 267 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 268 | switchGeoItem.addActionListener(this); |
---|
249 | 269 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 270 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 271 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 272 | morphItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + menu.add("-"); |
---|
| 277 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 278 | + physicsItem.addActionListener(this); |
---|
| 279 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 280 | + frameselectorItem.addActionListener(this); |
---|
253 | 281 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 282 | scriptNodeItem.addActionListener(this); |
---|
255 | 283 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 284 | cameraItem.addActionListener(this); |
---|
| 285 | + } |
---|
257 | 286 | |
---|
258 | 287 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 288 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
268 | 297 | shadowYItem.addActionListener(this); |
---|
269 | 298 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
270 | 299 | shadowZItem.addActionListener(this); |
---|
| 300 | + if (Globals.ADVANCED) |
---|
| 301 | + { |
---|
| 302 | + menu.add("-"); |
---|
271 | 303 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 304 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 305 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 306 | attributeItem.addActionListener(this); |
---|
| 307 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 308 | + templateItem.addActionListener(this); |
---|
277 | 309 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 310 | pointflowItem.addActionListener(this); |
---|
| 311 | + } |
---|
279 | 312 | menu.add("-"); |
---|
280 | 313 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 314 | resetTransformItem.addActionListener(this); |
---|
282 | 315 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 316 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - 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); |
---|
286 | 323 | |
---|
287 | 324 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 325 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 330 | genNormalsCADItem.addActionListener(this); |
---|
294 | 331 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 332 | genNormalsMESHItem.addActionListener(this); |
---|
| 333 | + if (Globals.ADVANCED) |
---|
| 334 | + { |
---|
296 | 335 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 336 | genNormalsMINEItem.addActionListener(this); |
---|
| 337 | + } |
---|
298 | 338 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 339 | stripifyItem.addActionListener(this); |
---|
300 | 340 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 356 | reduce34MeshItem.addActionListener(this); |
---|
317 | 357 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 358 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 359 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 360 | clipMeshItem.addActionListener(this); |
---|
| 361 | + |
---|
| 362 | + if (Globals.ADVANCED) |
---|
| 363 | + { |
---|
| 364 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 365 | + smoothMeshItem.addActionListener(this); |
---|
| 366 | + } |
---|
323 | 367 | |
---|
324 | 368 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 369 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 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); |
---|
327 | 375 | menu.add("-"); |
---|
328 | 376 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 377 | liveleavesItem.addActionListener(this); |
---|
330 | 378 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 379 | unliveleavesItem.addActionListener(this); |
---|
| 380 | + if (Globals.ADVANCED) |
---|
| 381 | + { |
---|
332 | 382 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 383 | supportleavesItem.addActionListener(this); |
---|
334 | 384 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 385 | unsupportleavesItem.addActionListener(this); |
---|
| 386 | + } |
---|
336 | 387 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 388 | hideleavesItem.addActionListener(this); |
---|
338 | 389 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
376 | 427 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 428 | sortbynameItem.addActionListener(this); |
---|
378 | 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. |
---|
379 | 437 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 438 | extractGeometriesItem.addActionListener(this); |
---|
381 | 439 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 440 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 441 | + } |
---|
387 | 442 | |
---|
388 | 443 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 444 | buildCreateMenu(menu); |
---|
390 | 445 | |
---|
391 | | - |
---|
392 | 446 | oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
| 447 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
398 | 448 | importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
| 449 | + menu.add("-"); |
---|
| 450 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
400 | 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); |
---|
401 | 458 | |
---|
402 | 459 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 460 | buildToolsMenu(menu); |
---|
.. | .. |
---|
433 | 490 | oe.radioPanel.add(dummyButton); |
---|
434 | 491 | oe.buttonGroup.add(dummyButton); |
---|
435 | 492 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - |
---|
438 | 493 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 494 | |
---|
440 | | - oe.aConstraints.gridwidth = 1; |
---|
441 | | - oe.aConstraints.gridx = 0; |
---|
442 | | - |
---|
443 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
444 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 495 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 496 | + liveCB.setToolTipText("Enable animation"); |
---|
445 | 497 | liveCB.addItemListener(this); |
---|
446 | 498 | |
---|
447 | | - oe.aConstraints.gridx += 1; |
---|
448 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
| 499 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 500 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 501 | + oneStepButton.addActionListener(this); |
---|
| 502 | + |
---|
| 503 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 504 | + fastCB.setToolTipText("Fast mode"); |
---|
| 505 | + fastCB.addItemListener(this); |
---|
| 506 | + |
---|
| 507 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
449 | 508 | trackCB.setToolTipText("Enable tracking"); |
---|
450 | 509 | trackCB.addItemListener(this); |
---|
451 | 510 | |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 511 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
454 | 512 | screenfitButton.setToolTipText("Screen fit"); |
---|
455 | 513 | screenfitButton.addActionListener(this); |
---|
456 | | - oe.aConstraints.gridx += 1; |
---|
| 514 | + |
---|
457 | 515 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
458 | 516 | // screenfitpointButton.addActionListener(this); |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
461 | | - snapobjectButton.addActionListener(this); |
---|
462 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
463 | | - oe.aConstraints.gridx += 1; |
---|
464 | 517 | |
---|
465 | | - //aConstraints.gridx = 0; |
---|
466 | | - //aConstraints.gridy += 1; |
---|
467 | | - oe.aConstraints.weighty = 0; |
---|
468 | | - oe.aConstraints.gridwidth = 1; |
---|
469 | | - |
---|
470 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 518 | + if (Globals.ADVANCED) |
---|
| 519 | + { |
---|
| 520 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 521 | + snapobjectButton.addActionListener(this); |
---|
| 522 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 523 | + } |
---|
| 524 | + |
---|
| 525 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
471 | 526 | flashSelectionButton.setToolTipText("Show selection"); |
---|
472 | 527 | flashSelectionButton.addActionListener(this); |
---|
473 | 528 | |
---|
474 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 529 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
475 | 530 | |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.aConstraints.weighty = 0; |
---|
478 | | - oe.aConstraints.gridwidth = 1; |
---|
479 | | - |
---|
480 | | - // |
---|
481 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 531 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
482 | 532 | twoButton.setToolTipText("Show center view only"); |
---|
483 | 533 | twoButton.addActionListener(this); |
---|
484 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 534 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 535 | fourButton.addActionListener(this); |
---|
486 | 536 | fourButton.setToolTipText("Show left panel only"); |
---|
487 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 537 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
488 | 538 | sixButton.setToolTipText("2-column layout left"); |
---|
489 | 539 | sixButton.addActionListener(this); |
---|
490 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 540 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
491 | 541 | threeButton.setToolTipText("2-column layout right"); |
---|
492 | 542 | threeButton.addActionListener(this); |
---|
493 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 543 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
494 | 544 | sevenButton.setToolTipText("3-column layout"); |
---|
495 | 545 | sevenButton.addActionListener(this); |
---|
496 | 546 | // |
---|
497 | 547 | |
---|
498 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
499 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 548 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 549 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
500 | 550 | rootButton.addActionListener(this); |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 551 | + |
---|
| 552 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
503 | 553 | closeButton.setToolTipText("Close tab"); |
---|
504 | 554 | closeButton.addActionListener(this); |
---|
505 | 555 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
506 | 556 | //clearButton.addActionListener(this); |
---|
507 | | - oe.aConstraints.gridx += 1; |
---|
508 | 557 | |
---|
509 | | - oe.aConstraints.gridx = 1; // |
---|
510 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 558 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 559 | + |
---|
| 560 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + editButton.setToolTipText("Edit selection"); |
---|
511 | 562 | editButton.addActionListener(this); |
---|
512 | | - oe.aConstraints.gridx += 1; |
---|
513 | | - oe.aConstraints.weighty = 0; |
---|
514 | | - oe.aConstraints.gridwidth = 1; |
---|
515 | 563 | |
---|
516 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 564 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + uneditButton.setToolTipText("Unedit selection"); |
---|
517 | 566 | uneditButton.addActionListener(this); |
---|
518 | 567 | |
---|
519 | | - oe.aConstraints.gridx += 1; |
---|
520 | | - oe.aConstraints.weighty = 0; |
---|
521 | | - oe.aConstraints.gridwidth = 1; |
---|
522 | | - |
---|
523 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
524 | | - clearPanelButton.addActionListener(this); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 568 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 569 | + allParamsButton.setToolTipText("Edit all params"); |
---|
531 | 570 | allParamsButton.addActionListener(this); |
---|
532 | 571 | |
---|
533 | | - oe.aConstraints.gridx += 1; |
---|
534 | | - oe.aConstraints.weighty = 0; |
---|
535 | | - oe.aConstraints.gridwidth = 1; |
---|
536 | | - |
---|
537 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 572 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 573 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 574 | + clearPanelButton.addActionListener(this); |
---|
| 575 | + |
---|
| 576 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + unselectButton.setToolTipText("Unselect"); |
---|
538 | 578 | unselectButton.addActionListener(this); |
---|
539 | 579 | |
---|
| 580 | + commandsPanel.preferredHeight = 1; |
---|
| 581 | + |
---|
| 582 | + oe.treePanel.add(commandsPanel); |
---|
| 583 | + oe.treePanel.Return(); |
---|
| 584 | + |
---|
540 | 585 | // oe.aConstraints.gridx += 1; |
---|
541 | 586 | // oe.aConstraints.weighty = 0; |
---|
542 | 587 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
548 | 593 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
549 | 594 | // gcButton.addActionListener(this); |
---|
550 | 595 | |
---|
551 | | - oe.aConstraints.gridx = 0; |
---|
552 | | - oe.aConstraints.gridy += 1; |
---|
553 | | - |
---|
554 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
555 | | - oe.aConstraints.gridwidth = 100; |
---|
556 | | - // oe.aConstraints.gridheight = 100; |
---|
557 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
558 | | - oe.aConstraints.gridheight = 1; |
---|
559 | | - oe.aConstraints.weighty = 0.5; |
---|
560 | | - oe.aConstraints.gridx = 0; |
---|
561 | | - JScrollPane jSP; |
---|
| 596 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 597 | + |
---|
| 598 | + JScrollPane jSP; |
---|
562 | 599 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
563 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 600 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
564 | 601 | ResetModel(); |
---|
565 | | - oe.aConstraints.weighty = 0.5; |
---|
566 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
567 | | - oe.aConstraints.gridy += 1; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
| 602 | + |
---|
| 603 | + oe.treePanel.add(jSPPanel); |
---|
| 604 | + oe.treePanel.Return(); |
---|
569 | 605 | |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 2; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 606 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 607 | + |
---|
| 608 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 609 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
574 | 610 | colorCB.addItemListener(this); |
---|
575 | | - oe.aConstraints.gridx += 2; |
---|
576 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 611 | + |
---|
| 612 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 613 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
577 | 614 | materialCB.addItemListener(this); |
---|
578 | | - oe.aConstraints.gridx += 2; |
---|
579 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 615 | + |
---|
| 616 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 617 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
580 | 618 | textureCB.addItemListener(this); |
---|
581 | 619 | |
---|
582 | | - oe.aConstraints.gridx = 0; |
---|
583 | | - oe.aConstraints.gridy += 1; |
---|
| 620 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 621 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 622 | + oe.treePanel.Return(); |
---|
584 | 623 | |
---|
| 624 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 625 | +// mainPanel.setResizeWeight(0.5); |
---|
| 626 | + |
---|
585 | 627 | //jList.addListSelectionListener(this); |
---|
586 | 628 | oe.jTree.addTreeSelectionListener(this); |
---|
587 | 629 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
604 | 646 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
605 | 647 | } |
---|
606 | 648 | |
---|
607 | | - void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 649 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
608 | 650 | { |
---|
609 | | - constraints.gridx = 0; |
---|
610 | | - constraints.gridy = 0; |
---|
611 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints); |
---|
612 | | - fastCB.setToolTipText("Fast mode"); |
---|
613 | | - fastCB.addItemListener(this); |
---|
614 | | - constraints.gridy += 1; |
---|
615 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints); |
---|
616 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
617 | | - supportCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - // constraints.gridy += 1; |
---|
620 | | - // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
621 | | - // localCB.addItemListener(this); |
---|
622 | | - |
---|
623 | | - constraints.gridy += 1; |
---|
624 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints); |
---|
625 | | - crowdCB.setToolTipText("Used for crowds"); |
---|
626 | | - crowdCB.addItemListener(this); |
---|
627 | | - |
---|
628 | | - constraints.gridy += 1; |
---|
629 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints); |
---|
630 | | - smoothCB.setToolTipText("Snapping delay"); |
---|
631 | | - smoothCB.addItemListener(this); |
---|
632 | | - |
---|
633 | | - constraints.gridy += 1; |
---|
634 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints); |
---|
635 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
636 | | - slowCB.addItemListener(this); |
---|
637 | | - constraints.gridy += 1; |
---|
638 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints); |
---|
| 651 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
639 | 652 | boxCB.setToolTipText("Display bounding boxes"); |
---|
640 | 653 | boxCB.addItemListener(this); |
---|
641 | | - constraints.gridy += 1; |
---|
642 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints); |
---|
| 654 | + |
---|
| 655 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
643 | 656 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
644 | 657 | zoomBoxCB.addItemListener(this); |
---|
645 | 658 | |
---|
| 659 | + if (true) // Globals.ADVANCED) |
---|
| 660 | + { |
---|
| 661 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 662 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 663 | + supportCB.addItemListener(this); |
---|
| 664 | + |
---|
| 665 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 666 | + // localCB.addItemListener(this); |
---|
| 667 | + |
---|
| 668 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 669 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 670 | + crowdCB.addItemListener(this); |
---|
| 671 | + |
---|
| 672 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 673 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 674 | + smoothCB.addItemListener(this); |
---|
| 675 | + |
---|
| 676 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 677 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 678 | + slowCB.addItemListener(this); |
---|
| 679 | + |
---|
646 | 680 | // constraints.gridy += 1; |
---|
647 | 681 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
648 | 682 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
650 | 684 | if (false) |
---|
651 | 685 | { |
---|
652 | 686 | // handled in scripts |
---|
653 | | - constraints.gridy += 1; |
---|
654 | | - panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints); |
---|
| 687 | + //constraints.gridy += 1; |
---|
| 688 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
655 | 689 | speakerCameraCB.addItemListener(this); |
---|
656 | 690 | |
---|
657 | | - constraints.gridy += 1; |
---|
658 | | - panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints); |
---|
| 691 | + //constraints.gridy += 1; |
---|
| 692 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
659 | 693 | speakerFocusCB.addItemListener(this); |
---|
660 | 694 | |
---|
661 | | - constraints.gridy += 1; |
---|
662 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints); |
---|
| 695 | + //constraints.gridy += 1; |
---|
| 696 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
663 | 697 | smoothfocusCB.addItemListener(this); |
---|
664 | 698 | } |
---|
665 | 699 | |
---|
.. | .. |
---|
667 | 701 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
668 | 702 | // debugCB.addItemListener(this); |
---|
669 | 703 | |
---|
670 | | - constraints.gridy += 1; |
---|
671 | | - panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints); |
---|
| 704 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
672 | 705 | oeilCB.addItemListener(this); |
---|
673 | 706 | |
---|
674 | | - constraints.gridy += 1; |
---|
675 | | - panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints); |
---|
| 707 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
676 | 708 | lookAtCB.setToolTipText("Look-at target"); |
---|
677 | 709 | lookAtCB.addItemListener(this); |
---|
| 710 | + |
---|
| 711 | + } |
---|
| 712 | + |
---|
| 713 | + cGridBag fill = new cGridBag(); |
---|
| 714 | + |
---|
| 715 | + fill.preferredHeight = 200; |
---|
| 716 | + |
---|
| 717 | + panel.add(fill); |
---|
678 | 718 | |
---|
679 | 719 | } |
---|
680 | 720 | |
---|
.. | .. |
---|
689 | 729 | buttonGroup.add(radioButton); |
---|
690 | 730 | radioButton.doClick(); |
---|
691 | 731 | } |
---|
| 732 | + |
---|
692 | 733 | void SetupViews(ObjEditor oe) |
---|
693 | 734 | { |
---|
694 | 735 | oe.SetupViews(); |
---|
.. | .. |
---|
905 | 946 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
906 | 947 | // return; |
---|
907 | 948 | // } |
---|
908 | | - if (string.charAt(0) == '/') |
---|
| 949 | + |
---|
| 950 | + // File path for Mac and Windows |
---|
| 951 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
909 | 952 | { |
---|
910 | 953 | // file(s) |
---|
911 | 954 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
932 | 975 | |
---|
933 | 976 | flashIt = false; |
---|
934 | 977 | CameraPane pane = (CameraPane) target; |
---|
935 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 978 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
936 | 979 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
937 | 980 | |
---|
938 | 981 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
959 | 1002 | { |
---|
960 | 1003 | loadClipboard(true); |
---|
961 | 1004 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
962 | | - pasteInto(false); |
---|
| 1005 | + pasteInto(false, false); |
---|
963 | 1006 | } else { |
---|
964 | 1007 | loadClipboard(false); |
---|
965 | 1008 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
966 | | - pasteInto(false); // true); // ??? |
---|
| 1009 | + pasteInto(false, false); // true); // ??? |
---|
967 | 1010 | } |
---|
968 | 1011 | } |
---|
969 | 1012 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1085 | 1128 | kleinItem.addActionListener(this); |
---|
1086 | 1129 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1087 | 1130 | particleItem.addActionListener(this); |
---|
| 1131 | + if (Globals.ADVANCED) |
---|
| 1132 | + { |
---|
1088 | 1133 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1089 | 1134 | ragdollItem.addActionListener(this); |
---|
1090 | 1135 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1091 | 1136 | ragdoll2Item.addActionListener(this); |
---|
| 1137 | + } |
---|
1092 | 1138 | menu.add("-"); |
---|
1093 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1139 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1094 | 1140 | meshItem.addActionListener(this); |
---|
1095 | 1141 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1096 | 1142 | // meshGroupItem.addActionListener(this); |
---|
| 1143 | + if (Globals.ADVANCED) |
---|
| 1144 | + { |
---|
1097 | 1145 | springItem = menu.add(new MenuItem("Spring")); |
---|
1098 | 1146 | springItem.addActionListener(this); |
---|
1099 | 1147 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1100 | 1148 | flagItem.addActionListener(this); |
---|
1101 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1102 | | - bezierItem.addActionListener(this); |
---|
1103 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1104 | | - checkerItem.addActionListener(this); |
---|
1105 | 1149 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1106 | 1150 | blobItem.addActionListener(this); |
---|
1107 | 1151 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1108 | 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); |
---|
1109 | 1158 | lightItem = menu.add(new MenuItem("Light")); |
---|
1110 | 1159 | lightItem.addActionListener(this); |
---|
1111 | 1160 | menu.add("-"); |
---|
.. | .. |
---|
1115 | 1164 | loopItem.addActionListener(this); |
---|
1116 | 1165 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1117 | 1166 | doubleItem.addActionListener(this); |
---|
| 1167 | + if (Globals.ADVANCED) |
---|
| 1168 | + { |
---|
1118 | 1169 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1119 | 1170 | tripleItem.addActionListener(this); |
---|
| 1171 | + } |
---|
1120 | 1172 | } |
---|
1121 | 1173 | |
---|
1122 | 1174 | void buildToolsMenu(Menu menu) |
---|
1123 | 1175 | { |
---|
1124 | 1176 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1125 | 1177 | animationItem.addItemListener(this); |
---|
1126 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1178 | + animationItem.setState(Globals.ANIMATION); |
---|
1127 | 1179 | |
---|
1128 | 1180 | menu.add("-"); |
---|
1129 | 1181 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1130 | 1182 | parseverticesItem.addActionListener(this); |
---|
1131 | 1183 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1132 | 1184 | textureFieldItem.addActionListener(this); |
---|
1133 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1185 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1134 | 1186 | alignItem.addActionListener(this); |
---|
1135 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1136 | | - mirrorItem.addActionListener(this); |
---|
1137 | 1187 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1138 | 1188 | reduceMorphItem.addActionListener(this); |
---|
1139 | 1189 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1140 | 1190 | reduce34MorphItem.addActionListener(this); |
---|
1141 | | - |
---|
| 1191 | + menu.add("-"); |
---|
1142 | 1192 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1143 | 1193 | computeAOItem.addActionListener(this); |
---|
1144 | | - menu.add("-"); |
---|
1145 | 1194 | |
---|
| 1195 | + if (Globals.ADVANCED) |
---|
| 1196 | + { |
---|
| 1197 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1198 | + mirrorItem.addActionListener(this); |
---|
| 1199 | + menu.add("-"); |
---|
1146 | 1200 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1147 | 1201 | memoryItem.addActionListener(this); |
---|
1148 | 1202 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1165 | 1219 | menu.add("-"); |
---|
1166 | 1220 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1167 | 1221 | editScriptItem.addActionListener(this); |
---|
| 1222 | + } |
---|
1168 | 1223 | } |
---|
1169 | 1224 | |
---|
1170 | 1225 | void ScreenFit() |
---|
.. | .. |
---|
1493 | 1548 | |
---|
1494 | 1549 | void Overwrite(int mask) |
---|
1495 | 1550 | { |
---|
1496 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1551 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1497 | 1552 | { |
---|
1498 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1553 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1499 | 1554 | |
---|
1500 | 1555 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1501 | 1556 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1666 | 1721 | { |
---|
1667 | 1722 | makeSomething(new BezierSurface()); |
---|
1668 | 1723 | } else |
---|
1669 | | - if (source == checkerItem) |
---|
| 1724 | + if (source == overlayItem) |
---|
1670 | 1725 | { |
---|
1671 | 1726 | /* |
---|
1672 | 1727 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1815 | 1870 | } else |
---|
1816 | 1871 | if (source == importOBJItem) |
---|
1817 | 1872 | { |
---|
1818 | | - 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 | + } |
---|
1819 | 1882 | } else |
---|
1820 | 1883 | if (source == computeAOItem) |
---|
1821 | 1884 | { |
---|
.. | .. |
---|
1835 | 1898 | if (source == invariantsItem) |
---|
1836 | 1899 | { |
---|
1837 | 1900 | System.out.println("Invariants:"); |
---|
1838 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1901 | + Grafreed.grafreeD.universe.invariants(); |
---|
1839 | 1902 | } else |
---|
1840 | 1903 | if (source == memoryItem) |
---|
1841 | 1904 | { |
---|
.. | .. |
---|
1853 | 1916 | if (source == dumpItem) |
---|
1854 | 1917 | { |
---|
1855 | 1918 | DumpObject(); |
---|
| 1919 | + } else |
---|
| 1920 | + if (source == oneStepButton) |
---|
| 1921 | + { |
---|
| 1922 | + Globals.ONESTEP = true; |
---|
| 1923 | + cameraView.repaint(); |
---|
1856 | 1924 | } else |
---|
1857 | 1925 | if (source == screenfitButton) |
---|
1858 | 1926 | { |
---|
.. | .. |
---|
1905 | 1973 | } else |
---|
1906 | 1974 | if (source == duplicateItem) |
---|
1907 | 1975 | { |
---|
1908 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 1976 | + Object3D keep = Grafreed.clipboard; |
---|
1909 | 1977 | loadClipboard(false); |
---|
1910 | 1978 | paste(false); |
---|
1911 | | - GrafreeD.clipboard = keep; |
---|
| 1979 | + Grafreed.clipboard = keep; |
---|
1912 | 1980 | } else |
---|
1913 | 1981 | if (source == cloneItem) |
---|
1914 | 1982 | { |
---|
.. | .. |
---|
1926 | 1994 | { |
---|
1927 | 1995 | paste(false); |
---|
1928 | 1996 | } else |
---|
| 1997 | + if (source == pasteIntoItem) |
---|
| 1998 | + { |
---|
| 1999 | + pasteInto(true, false); |
---|
| 2000 | + } else |
---|
1929 | 2001 | if (source == pasteLinkItem) |
---|
1930 | 2002 | { |
---|
1931 | | - pasteInto(false); |
---|
| 2003 | + pasteInto(false, false); |
---|
1932 | 2004 | } else |
---|
1933 | 2005 | if (source == pasteCloneItem) |
---|
1934 | 2006 | { |
---|
1935 | | - pasteInto(true); |
---|
| 2007 | + pasteInto(true, true); |
---|
1936 | 2008 | } else |
---|
1937 | 2009 | if (source == pasteExpandItem) |
---|
1938 | 2010 | { |
---|
.. | .. |
---|
2124 | 2196 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2125 | 2197 | // refreshContents(); |
---|
2126 | 2198 | // } |
---|
2127 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2199 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2128 | 2200 | { |
---|
2129 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2201 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2130 | 2202 | |
---|
2131 | 2203 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2132 | 2204 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2134 | 2206 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2135 | 2207 | for (int i=0; i<group.selection.size(); i++) |
---|
2136 | 2208 | { |
---|
2137 | | - boolean random = CameraPane.RANDOM; |
---|
2138 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2209 | + boolean random = CameraPane.SWITCH; |
---|
| 2210 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2139 | 2211 | group.selection.get(i).linkVerticesThis(content); |
---|
2140 | 2212 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2141 | | - CameraPane.RANDOM = random; |
---|
| 2213 | + CameraPane.SWITCH = random; |
---|
2142 | 2214 | } |
---|
2143 | 2215 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2144 | 2216 | refreshContents(); |
---|
.. | .. |
---|
2148 | 2220 | { |
---|
2149 | 2221 | for (int i=0; i<group.selection.size(); i++) |
---|
2150 | 2222 | { |
---|
2151 | | - boolean random = CameraPane.RANDOM; |
---|
2152 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2223 | + boolean random = CameraPane.SWITCH; |
---|
| 2224 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2153 | 2225 | group.selection.get(i).linkVerticesThis(null); |
---|
2154 | | - CameraPane.RANDOM = random; |
---|
| 2226 | + CameraPane.SWITCH = random; |
---|
2155 | 2227 | } |
---|
2156 | 2228 | |
---|
2157 | 2229 | refreshContents(); |
---|
2158 | 2230 | } else |
---|
2159 | 2231 | if (source == relinkverticesItem) |
---|
2160 | 2232 | { |
---|
2161 | | - boolean random = CameraPane.RANDOM; |
---|
2162 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2233 | + boolean random = CameraPane.SWITCH; |
---|
| 2234 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2163 | 2235 | group.selection.RelinkToSupport(); |
---|
2164 | | - CameraPane.RANDOM = random; |
---|
| 2236 | + CameraPane.SWITCH = random; |
---|
2165 | 2237 | |
---|
2166 | 2238 | refreshContents(); |
---|
2167 | 2239 | } else |
---|
.. | .. |
---|
2176 | 2248 | } else |
---|
2177 | 2249 | if (source == setMasterItem) |
---|
2178 | 2250 | { |
---|
2179 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2251 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2180 | 2252 | { |
---|
2181 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2253 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2182 | 2254 | |
---|
2183 | 2255 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2184 | 2256 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2191 | 2263 | { |
---|
2192 | 2264 | if (group.selection.size() == 1) |
---|
2193 | 2265 | { |
---|
2194 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2266 | + if (Grafreed.clipboard.size() == 1) |
---|
2195 | 2267 | { |
---|
2196 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2268 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2197 | 2269 | |
---|
2198 | 2270 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2199 | 2271 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2210 | 2282 | { |
---|
2211 | 2283 | RevertMeshes(); |
---|
2212 | 2284 | } else |
---|
2213 | | - if (source == resetMeshItem) |
---|
| 2285 | + if (source == resetAllItem) |
---|
2214 | 2286 | { |
---|
2215 | 2287 | ResetAll(); |
---|
2216 | 2288 | } else |
---|
.. | .. |
---|
2259 | 2331 | RandomNode random = new RandomNode(); |
---|
2260 | 2332 | group(random); |
---|
2261 | 2333 | if (random.size() > 0) |
---|
2262 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2334 | + random.name = random.get(0).name + "Switch"; |
---|
2263 | 2335 | } else |
---|
2264 | 2336 | if (source == physicsItem) |
---|
2265 | 2337 | { |
---|
.. | .. |
---|
2548 | 2620 | { |
---|
2549 | 2621 | SmoothMesh(); |
---|
2550 | 2622 | } else |
---|
2551 | | - if (source == transformgeometryItem) |
---|
| 2623 | + if (source == transformGeometryItem) |
---|
2552 | 2624 | { |
---|
2553 | 2625 | TransformGeometry(); |
---|
| 2626 | + } else |
---|
| 2627 | + if (source == transformChildrenItem) |
---|
| 2628 | + { |
---|
| 2629 | + TransformChildren(); |
---|
2554 | 2630 | } else |
---|
2555 | 2631 | if (source == resetTransformItem) |
---|
2556 | 2632 | { |
---|
.. | .. |
---|
2558 | 2634 | } else |
---|
2559 | 2635 | if (source == resetCentroidItem) |
---|
2560 | 2636 | { |
---|
2561 | | - ResetCentroid(); |
---|
| 2637 | + ResetCentroid(true); |
---|
| 2638 | + } else |
---|
| 2639 | + if (source == resetCentroidXZItem) |
---|
| 2640 | + { |
---|
| 2641 | + ResetCentroid(false); |
---|
2562 | 2642 | } else |
---|
2563 | 2643 | if (source == resetParentItem) |
---|
2564 | 2644 | { |
---|
.. | .. |
---|
2916 | 2996 | |
---|
2917 | 2997 | child.editWindow = null; // ??????????? |
---|
2918 | 2998 | } |
---|
2919 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2999 | + objEditor.ctrlPanel.FlushUI(); |
---|
2920 | 3000 | //objEditor.jTree.clearSelection(); |
---|
2921 | 3001 | //objEditor.ResetSliders(); |
---|
2922 | 3002 | refreshContents(true); |
---|
.. | .. |
---|
3000 | 3080 | frontView.object = group; |
---|
3001 | 3081 | sideView.object = group; |
---|
3002 | 3082 | } |
---|
3003 | | - group.editWindow = this; |
---|
| 3083 | + |
---|
| 3084 | +// fix "+" issue group.editWindow = this; |
---|
| 3085 | + |
---|
3004 | 3086 | /* |
---|
3005 | 3087 | currentLayout = radio.layout; |
---|
3006 | 3088 | if (currentLayout == null) |
---|
.. | .. |
---|
3074 | 3156 | refreshContents(); |
---|
3075 | 3157 | } |
---|
3076 | 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 | + } |
---|
3077 | 3181 | |
---|
3078 | 3182 | void ResetTransform() |
---|
3079 | 3183 | { |
---|
.. | .. |
---|
3186 | 3290 | refreshContents(); |
---|
3187 | 3291 | } |
---|
3188 | 3292 | |
---|
3189 | | - void ResetCentroid() |
---|
| 3293 | + void ResetCentroid(boolean full) |
---|
3190 | 3294 | { |
---|
3191 | 3295 | Object3D obj; |
---|
3192 | 3296 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3201 | 3305 | LA.matIdentity(Object3D.mat); |
---|
3202 | 3306 | obj.getBounds(minima, maxima, false); |
---|
3203 | 3307 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3204 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3308 | + if (full) |
---|
| 3309 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3205 | 3310 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3206 | 3311 | obj.TransformMesh(Object3D.mat); |
---|
| 3312 | + |
---|
3207 | 3313 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3208 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3314 | + if (full) |
---|
| 3315 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3209 | 3316 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3317 | + |
---|
3210 | 3318 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3211 | 3319 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3212 | 3320 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3272 | 3380 | obj = (Object3D)e.nextElement(); |
---|
3273 | 3381 | |
---|
3274 | 3382 | System.out.println("Object is: " + obj); |
---|
3275 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3383 | + Grafreed.AnalyzeObject(obj); |
---|
3276 | 3384 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3277 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3385 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3278 | 3386 | |
---|
3279 | 3387 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3280 | 3388 | } |
---|
.. | .. |
---|
3488 | 3596 | |
---|
3489 | 3597 | void ParseVertices() |
---|
3490 | 3598 | { |
---|
3491 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3492 | | - GrafreeD.epsequal = true; |
---|
| 3599 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3600 | + Grafreed.epsequal = true; |
---|
3493 | 3601 | |
---|
3494 | 3602 | for (int i=0; i<group.selection.size(); i++) |
---|
3495 | 3603 | { |
---|
.. | .. |
---|
3514 | 3622 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3515 | 3623 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3516 | 3624 | |
---|
3517 | | - g.add(GrafreeD.clipboard); |
---|
| 3625 | + g.add(Grafreed.clipboard); |
---|
3518 | 3626 | |
---|
3519 | 3627 | buffer.add(g); |
---|
3520 | 3628 | } |
---|
.. | .. |
---|
3529 | 3637 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3530 | 3638 | } |
---|
3531 | 3639 | |
---|
3532 | | - GrafreeD.epsequal = epsequal; |
---|
| 3640 | + Grafreed.epsequal = epsequal; |
---|
3533 | 3641 | |
---|
3534 | 3642 | refreshContents(); |
---|
3535 | 3643 | } |
---|
.. | .. |
---|
3547 | 3655 | String pigment = Object3D.GetPigment(tex); |
---|
3548 | 3656 | //String bump = Object3D.GetBump(tex); |
---|
3549 | 3657 | |
---|
3550 | | - 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 | + } |
---|
3551 | 3668 | |
---|
3552 | 3669 | double s = v.s; |
---|
3553 | 3670 | |
---|
.. | .. |
---|
3635 | 3752 | |
---|
3636 | 3753 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3637 | 3754 | |
---|
3638 | | - boolean random = CameraPane.RANDOM; |
---|
3639 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3755 | + boolean random = CameraPane.SWITCH; |
---|
| 3756 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3640 | 3757 | lowres.linkVerticesThis(null); |
---|
3641 | 3758 | lowres.linkVerticesThis(sn); |
---|
3642 | | - CameraPane.RANDOM = random; |
---|
| 3759 | + CameraPane.SWITCH = random; |
---|
3643 | 3760 | |
---|
3644 | 3761 | System.err.flush(); |
---|
3645 | 3762 | |
---|
.. | .. |
---|
3679 | 3796 | return; |
---|
3680 | 3797 | |
---|
3681 | 3798 | Object3D poses = group.selection.get(0); |
---|
3682 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3799 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3683 | 3800 | |
---|
3684 | 3801 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3685 | 3802 | |
---|
.. | .. |
---|
3873 | 3990 | |
---|
3874 | 3991 | void ClipMesh() |
---|
3875 | 3992 | { |
---|
3876 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3993 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3877 | 3994 | { |
---|
3878 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3995 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3879 | 3996 | |
---|
3880 | 3997 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3881 | 3998 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3884 | 4001 | // { |
---|
3885 | 4002 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3886 | 4003 | // } |
---|
3887 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4004 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3888 | 4005 | } |
---|
3889 | 4006 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3890 | 4007 | System.out.println("DONE."); |
---|
.. | .. |
---|
4019 | 4136 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4020 | 4137 | |
---|
4021 | 4138 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4022 | | - if(elem != group) |
---|
| 4139 | + if(elem != group || !newWindow) |
---|
4023 | 4140 | { |
---|
4024 | 4141 | // if (!(elem instanceof Composite)) |
---|
4025 | 4142 | // newWindow = false; |
---|
.. | .. |
---|
4124 | 4241 | System.err.println("info : " + child.GetPath()); |
---|
4125 | 4242 | } |
---|
4126 | 4243 | } |
---|
4127 | | - else |
---|
4128 | | - { |
---|
4129 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4130 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4131 | | - System.err.println("info : " + group.GetPath()); |
---|
4132 | | - } |
---|
| 4244 | +// else |
---|
| 4245 | +// { |
---|
| 4246 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4247 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4248 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4249 | +// } |
---|
4133 | 4250 | |
---|
4134 | 4251 | objEditor.SetText(); // jan 2014 |
---|
4135 | 4252 | |
---|
.. | .. |
---|
4224 | 4341 | { |
---|
4225 | 4342 | if (group.selection.isEmpty()) |
---|
4226 | 4343 | return; |
---|
4227 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4344 | + Grafreed.clipboardIsTempGroup = false; |
---|
4228 | 4345 | Composite tGroup = null; |
---|
4229 | 4346 | if (group.selection.size() > 0) // 1) |
---|
4230 | 4347 | { |
---|
4231 | 4348 | tGroup = new cGroup(); |
---|
4232 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4349 | + Grafreed.clipboardIsTempGroup = true; |
---|
4233 | 4350 | } |
---|
4234 | 4351 | |
---|
4235 | 4352 | if (cut) |
---|
.. | .. |
---|
4269 | 4386 | //System.out.println("cut " + child); |
---|
4270 | 4387 | //System.out.println("parent = " + child.parent); |
---|
4271 | 4388 | // tmp.addChild(child); |
---|
4272 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4389 | + if (Grafreed.clipboardIsTempGroup) |
---|
4273 | 4390 | tGroup.add/*Child*/(tmp); |
---|
4274 | 4391 | else |
---|
4275 | | - GrafreeD.clipboard = tmp; |
---|
| 4392 | + Grafreed.clipboard = tmp; |
---|
4276 | 4393 | } |
---|
4277 | 4394 | else |
---|
4278 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4395 | + if (Grafreed.clipboardIsTempGroup) |
---|
4279 | 4396 | tGroup.add/*Child*/(child); |
---|
4280 | 4397 | else |
---|
4281 | | - GrafreeD.clipboard = child; |
---|
| 4398 | + Grafreed.clipboard = child; |
---|
4282 | 4399 | } |
---|
4283 | 4400 | |
---|
4284 | 4401 | //ResetModel(); |
---|
.. | .. |
---|
4310 | 4427 | //System.out.println("cut " + elem); |
---|
4311 | 4428 | //System.out.println("parent = " + elem.parent); |
---|
4312 | 4429 | // tmp.addChild(elem); |
---|
4313 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4430 | + if (Grafreed.clipboardIsTempGroup) |
---|
4314 | 4431 | tGroup.add/*Child*/(tmp); |
---|
4315 | 4432 | else |
---|
4316 | | - GrafreeD.clipboard = tmp; |
---|
| 4433 | + Grafreed.clipboard = tmp; |
---|
4317 | 4434 | } |
---|
4318 | 4435 | else |
---|
4319 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4436 | + if (Grafreed.clipboardIsTempGroup) |
---|
4320 | 4437 | tGroup.add/*Child*/(child); |
---|
4321 | 4438 | else |
---|
4322 | | - GrafreeD.clipboard = child; |
---|
| 4439 | + Grafreed.clipboard = child; |
---|
4323 | 4440 | } |
---|
4324 | 4441 | |
---|
4325 | 4442 | } |
---|
4326 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4327 | | - GrafreeD.clipboard = tGroup; |
---|
| 4443 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4444 | + Grafreed.clipboard = tGroup; |
---|
4328 | 4445 | if (cut) |
---|
4329 | 4446 | { |
---|
4330 | 4447 | ResetModel(); |
---|
.. | .. |
---|
4338 | 4455 | // return; |
---|
4339 | 4456 | boolean first = true; |
---|
4340 | 4457 | |
---|
4341 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4458 | + if (Grafreed.clipboardIsTempGroup) |
---|
4342 | 4459 | { |
---|
4343 | 4460 | Composite temp; |
---|
4344 | 4461 | |
---|
.. | .. |
---|
4349 | 4466 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4350 | 4467 | */ |
---|
4351 | 4468 | Object3D elem; |
---|
4352 | | - 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)) |
---|
4353 | 4470 | { |
---|
4354 | 4471 | Object3D child = (Object3D)e.nextElement(); |
---|
4355 | 4472 | |
---|
.. | .. |
---|
4383 | 4500 | //Object3D cb = Applet3D.clipboard; |
---|
4384 | 4501 | //temp.addChild(cb); |
---|
4385 | 4502 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4386 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4387 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4388 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4389 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4390 | | - 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()); |
---|
4391 | 4508 | else |
---|
4392 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4393 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4509 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4510 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4394 | 4511 | } |
---|
4395 | 4512 | |
---|
4396 | 4513 | ResetModel(); |
---|
4397 | 4514 | refreshContents(); |
---|
4398 | 4515 | } |
---|
4399 | 4516 | |
---|
4400 | | - void pasteInto(boolean copyit) |
---|
| 4517 | + void pasteInto(boolean copyit, boolean clone) |
---|
4401 | 4518 | { |
---|
4402 | 4519 | // if (GrafreeD.clipboard == null) |
---|
4403 | 4520 | // return; |
---|
.. | .. |
---|
4426 | 4543 | if (copyit) |
---|
4427 | 4544 | { |
---|
4428 | 4545 | // paste(false); |
---|
4429 | | - CloneClipboard(false); // sept 2014 |
---|
| 4546 | + if (clone) |
---|
| 4547 | + { |
---|
| 4548 | + CloneClipboard(false); // sept 2014 |
---|
| 4549 | + } |
---|
| 4550 | + else |
---|
| 4551 | + { |
---|
| 4552 | + paste(false); |
---|
| 4553 | + } |
---|
4430 | 4554 | } |
---|
4431 | 4555 | else |
---|
4432 | 4556 | { |
---|
4433 | 4557 | boolean first = true; |
---|
4434 | 4558 | |
---|
4435 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4559 | + if (Grafreed.clipboardIsTempGroup) |
---|
4436 | 4560 | { |
---|
4437 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4561 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4438 | 4562 | Object3D copy; |
---|
4439 | 4563 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4440 | 4564 | { |
---|
.. | .. |
---|
4444 | 4568 | } |
---|
4445 | 4569 | } else |
---|
4446 | 4570 | { |
---|
4447 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4571 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4448 | 4572 | } |
---|
4449 | 4573 | } |
---|
4450 | 4574 | } |
---|
.. | .. |
---|
4889 | 5013 | |
---|
4890 | 5014 | void ImportVRMLX3D() |
---|
4891 | 5015 | { |
---|
4892 | | - if (GrafreeD.standAlone) |
---|
| 5016 | + if (Grafreed.standAlone) |
---|
4893 | 5017 | { |
---|
4894 | 5018 | /**/ |
---|
4895 | 5019 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4906 | 5030 | |
---|
4907 | 5031 | String GetFile(String dialogName) |
---|
4908 | 5032 | { |
---|
4909 | | - if (GrafreeD.standAlone) |
---|
| 5033 | + if (Grafreed.standAlone) |
---|
4910 | 5034 | { |
---|
4911 | 5035 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4912 | 5036 | browser.show(); |
---|
.. | .. |
---|
4970 | 5094 | cButton flashSelectionButton; |
---|
4971 | 5095 | cButton editButton; |
---|
4972 | 5096 | cButton uneditButton; |
---|
| 5097 | + JCheckBox allParamsButton; |
---|
4973 | 5098 | cButton clearpanelButton; |
---|
4974 | | - cButton allParamsButton; |
---|
4975 | 5099 | cButton unselectButton; |
---|
4976 | 5100 | |
---|
| 5101 | + cButton oneStepButton; |
---|
| 5102 | + |
---|
4977 | 5103 | cButton screenfitButton; |
---|
4978 | 5104 | cButton screenfitpointButton; |
---|
4979 | 5105 | cButton snapobjectButton; |
---|
.. | .. |
---|
5017 | 5143 | private MenuItem linkverticesItem; |
---|
5018 | 5144 | private MenuItem relinkverticesItem; |
---|
5019 | 5145 | private MenuItem setMasterItem; |
---|
5020 | | - private MenuItem resetMeshItem; |
---|
| 5146 | + private MenuItem resetAllItem; |
---|
5021 | 5147 | private MenuItem stepAllItem; |
---|
5022 | 5148 | private MenuItem revertMeshItem; |
---|
5023 | 5149 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5028 | 5154 | private MenuItem mergeGeometriesItem; |
---|
5029 | 5155 | private MenuItem copyItem; |
---|
5030 | 5156 | private MenuItem pasteItem; |
---|
| 5157 | + private MenuItem pasteIntoItem; |
---|
5031 | 5158 | private MenuItem pasteLinkItem; |
---|
5032 | 5159 | private MenuItem pasteCloneItem; |
---|
5033 | 5160 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5077 | 5204 | private MenuItem panoTexturesItem; |
---|
5078 | 5205 | |
---|
5079 | 5206 | private MenuItem resetCentroidItem; |
---|
5080 | | - private MenuItem transformgeometryItem; |
---|
| 5207 | + private MenuItem resetCentroidXZItem; |
---|
5081 | 5208 | private MenuItem resetTransformItem; |
---|
| 5209 | + private MenuItem transformGeometryItem; |
---|
| 5210 | + private MenuItem transformChildrenItem; |
---|
5082 | 5211 | private MenuItem hideItem; |
---|
5083 | 5212 | private MenuItem grabItem; |
---|
5084 | 5213 | private MenuItem backItem; |
---|
.. | .. |
---|
5125 | 5254 | private MenuItem blobItem; |
---|
5126 | 5255 | private MenuItem latheItem; |
---|
5127 | 5256 | private MenuItem bezierItem; |
---|
5128 | | - private MenuItem checkerItem; |
---|
| 5257 | + private MenuItem overlayItem; |
---|
5129 | 5258 | private MenuItem meshItem; |
---|
5130 | 5259 | // private MenuItem meshGroupItem; |
---|
5131 | 5260 | private MenuItem springItem; |
---|