Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,18 +185,31 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
246
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
247
+ relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
222251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223252 setMasterItem.addActionListener(this);
253
+ }
224254
225255 oe.menuBar.add(menu = new Menu("Group"));
226256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +261,38 @@
231261 frontItem.addActionListener(this);
232262 compositeItem = menu.add(new MenuItem("Composite"));
233263 compositeItem.addActionListener(this);
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
265
+ hideItem.addActionListener(this);
266
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
267
+ ungroupItem.addActionListener(this);
234268 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
236270 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242272 switchGeoItem.addActionListener(this);
243273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244274 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
246276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
247285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248286 scriptNodeItem.addActionListener(this);
249287 cameraItem = menu.add(new MenuItem("Camera"));
250288 cameraItem.addActionListener(this);
289
+ }
251290
252291 oe.menuBar.add(menu = new Menu("Object"));
253292 textureItem = menu.add(new MenuItem("Texture"));
254293 textureItem.addActionListener(this);
294
+ billboardItem = menu.add(new MenuItem("Billboard"));
295
+ billboardItem.addActionListener(this);
255296 csgItem = menu.add(new MenuItem("CSG"));
256297 csgItem.addActionListener(this);
257298 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +301,25 @@
260301 shadowYItem.addActionListener(this);
261302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
263307 linkerItem = menu.add(new MenuItem("Linker"));
264308 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267309 attributeItem = menu.add(new MenuItem("Attribute"));
268310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
269313 pointflowItem = menu.add(new MenuItem("Point Flow"));
270314 pointflowItem.addActionListener(this);
315
+ }
271316 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275318 resetTransformItem.addActionListener(this);
276319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277320 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
321
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
+ transformgeometryItem.addActionListener(this);
280323
281324 oe.menuBar.add(menu = new Menu("Geometry"));
282325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +330,11 @@
287330 genNormalsCADItem.addActionListener(this);
288331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
335
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
336
+ genNormalsMINEItem.addActionListener(this);
337
+ }
290338 stripifyItem = menu.add(new MenuItem("Stripify"));
291339 stripifyItem.addActionListener(this);
292340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,10 +356,14 @@
308356 reduce34MeshItem.addActionListener(this);
309357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310358 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
315367
316368 oe.menuBar.add(menu = new Menu("Attributes"));
317369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -321,10 +373,13 @@
321373 liveleavesItem.addActionListener(this);
322374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
324378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325379 supportleavesItem.addActionListener(this);
326380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327381 unsupportleavesItem.addActionListener(this);
382
+ }
328383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329384 hideleavesItem.addActionListener(this);
330385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -367,6 +422,8 @@
367422 sortbysizeItem.addActionListener(this);
368423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
370427 menu.add("-");
371428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372429 extractGeometriesItem.addActionListener(this);
....@@ -376,20 +433,23 @@
376433 shareGeometriesItem.addActionListener(this);
377434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378435 mergeGeometriesItem.addActionListener(this);
436
+ }
379437
380438 oe.menuBar.add(menu = new Menu("Insert"));
381439 buildCreateMenu(menu);
382440
383
-
384441 oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
390443 importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
392446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
393453
394454 oe.menuBar.add(menu = new Menu("Tools"));
395455 buildToolsMenu(menu);
....@@ -425,150 +485,98 @@
425485 oe.radioPanel.add(dummyButton);
426486 oe.buttonGroup.add(dummyButton);
427487 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
488
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431489
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
+ liveCB.setToolTipText("Enabled animation");
433492 liveCB.addItemListener(this);
434493
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
498
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
499
+ fastCB.setToolTipText("Fast mode");
453500 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
503
+ trackCB.setToolTipText("Enable tracking");
495504 trackCB.addItemListener(this);
496505
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
507
+ screenfitButton.setToolTipText("Screen fit");
499508 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
509
+
501510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502511 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507512
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
513
+ if (Globals.ADVANCED)
514
+ {
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ snapobjectButton.addActionListener(this);
517
+ snapobjectButton.setToolTipText("Snap Object");
518
+ }
519
+
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
+ flashSelectionButton.setToolTipText("Show selection");
514522 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518523
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525
+
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527
+ twoButton.setToolTipText("Show center view only");
521528 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523530 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
531
+ fourButton.setToolTipText("Show left panel only");
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ sixButton.setToolTipText("2-column layout left");
525534 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ threeButton.setToolTipText("2-column layout right");
527537 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
539
+ sevenButton.setToolTipText("3-column layout");
529540 sevenButton.addActionListener(this);
530541 //
531542
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
533545 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ closeButton.setToolTipText("Close tab");
536549 closeButton.addActionListener(this);
537550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538551 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540552
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
553
+ cGridBag commandsPanel = new cGridBag();
554
+
555
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
+ editButton.setToolTipText("Edit selection");
543557 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547558
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
549561 uneditButton.addActionListener(this);
550562
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
563565 allParamsButton.addActionListener(this);
564566
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ clearPanelButton.setToolTipText("Clear edit panel");
569
+ clearPanelButton.addActionListener(this);
570
+
571
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ unselectButton.setToolTipText("Unselect");
570573 unselectButton.addActionListener(this);
571574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
572580 // oe.aConstraints.gridx += 1;
573581 // oe.aConstraints.weighty = 0;
574582 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +588,37 @@
580588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581589 // gcButton.addActionListener(this);
582590
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
594594 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
595
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596596 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
601600
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
601
+ cGridBag copyOptionsPanel = new cGridBag();
602
+
603
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
+ colorCB.setToolTipText("Copy color when dropped");
606605 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
606
+
607
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
+ materialCB.setToolTipText("Copy material when dropped");
609609 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
+
611
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
+ textureCB.setToolTipText("Copy texture when dropped");
612613 textureCB.addItemListener(this);
613614
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
616618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
617622 //jList.addListSelectionListener(this);
618623 oe.jTree.addTreeSelectionListener(this);
619624 //jTree.setRootVisible(false);
....@@ -635,17 +640,89 @@
635640 radio.layout = sevenButton;
636641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637642 }
643
+
644
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
645
+ {
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647
+ boxCB.setToolTipText("Display bounding boxes");
648
+ boxCB.addItemListener(this);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652
+ zoomBoxCB.addItemListener(this);
653
+
654
+ if (Globals.ADVANCED)
655
+ {
656
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
+ supportCB.setToolTipText("Enable rigging");
658
+ supportCB.addItemListener(this);
659
+
660
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661
+ // localCB.addItemListener(this);
662
+
663
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664
+ crowdCB.setToolTipText("Used for crowds");
665
+ crowdCB.addItemListener(this);
666
+
667
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
668
+ smoothCB.setToolTipText("Snapping delay");
669
+ smoothCB.addItemListener(this);
670
+
671
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
+ slowCB.setToolTipText("Smooth interpolation");
673
+ slowCB.addItemListener(this);
674
+
675
+// constraints.gridy += 1;
676
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
677
+// speakerMocapCB.addItemListener(this);
678
+
679
+ if (false)
680
+ {
681
+ // handled in scripts
682
+ //constraints.gridy += 1;
683
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
684
+ speakerCameraCB.addItemListener(this);
685
+
686
+ //constraints.gridy += 1;
687
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
688
+ speakerFocusCB.addItemListener(this);
689
+
690
+ //constraints.gridy += 1;
691
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
692
+ smoothfocusCB.addItemListener(this);
693
+ }
694
+
695
+//constraints.gridx += 1;
696
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
697
+// debugCB.addItemListener(this);
698
+
699
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
700
+ oeilCB.addItemListener(this);
701
+
702
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703
+ lookAtCB.setToolTipText("Look-at target");
704
+ lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
713
+
714
+ }
638715
639716 void EditObject(Object3D obj)
640717 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
718
+ cRadio radioButton = new cRadio(obj.name);
719
+ radioButton.SetObject(obj);
720
+ radioButton.layout = sevenButton;
721
+ radioButton.SetCamera(cameraView.renderCamera, false);
722
+ radioButton.addActionListener(this);
723
+ radioPanel.add(radioButton);
724
+ buttonGroup.add(radioButton);
725
+ radioButton.doClick();
649726 }
650727 void SetupViews(ObjEditor oe)
651728 {
....@@ -665,6 +742,7 @@
665742 JCheckBox fastCB;
666743 JCheckBox slowCB;
667744 JCheckBox boxCB;
745
+ JCheckBox zoomBoxCB;
668746 JCheckBox trackCB;
669747 JCheckBox smoothfocusCB;
670748 // JCheckBox speakerMocapCB;
....@@ -707,8 +785,7 @@
707785 dropAttributes |= Object3D.TEXTURE;
708786 else
709787 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
788
+ } else if(e.getSource() == liveCB)
712789 {
713790 cameraView.ToggleLive();
714791 }
....@@ -745,6 +822,10 @@
745822 Recompile();
746823 cameraView.repaint();
747824 // refreshContents();
825
+ }
826
+ else if(e.getSource() == zoomBoxCB)
827
+ {
828
+ cameraView.ToggleZoomBoxMode();
748829 }
749830 else if(e.getSource() == smoothfocusCB)
750831 {
....@@ -913,11 +994,11 @@
913994 {
914995 loadClipboard(true);
915996 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
997
+ pasteInto(false, false);
917998 } else {
918999 loadClipboard(false);
9191000 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9211002 }
9221003 }
9231004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1116,37 @@
10351116 torusItem.addActionListener(this);
10361117 superItem = menu.add(new MenuItem("Superellipsoid"));
10371118 superItem.addActionListener(this);
1119
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1120
+ kleinItem.addActionListener(this);
10381121 particleItem = menu.add(new MenuItem("Particle system"));
10391122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10401125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411126 ragdollItem.addActionListener(this);
10421127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431128 ragdoll2Item.addActionListener(this);
1129
+ }
10441130 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461132 meshItem.addActionListener(this);
10471133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10491137 springItem = menu.add(new MenuItem("Spring"));
10501138 springItem.addActionListener(this);
10511139 flagItem = menu.add(new MenuItem("Flag"));
10521140 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571141 blobItem = menu.add(new MenuItem("Blob"));
10581142 blobItem.addActionListener(this);
10591143 latheItem = menu.add(new MenuItem("Lathe"));
10601144 latheItem.addActionListener(this);
1145
+ }
1146
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1147
+ bezierItem.addActionListener(this);
1148
+ overlayItem = menu.add(new MenuItem("Overlay"));
1149
+ overlayItem.addActionListener(this);
10611150 lightItem = menu.add(new MenuItem("Light"));
10621151 lightItem.addActionListener(this);
10631152 menu.add("-");
....@@ -1067,34 +1156,39 @@
10671156 loopItem.addActionListener(this);
10681157 doubleItem = menu.add(new MenuItem("Fork"));
10691158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
10701161 tripleItem = menu.add(new MenuItem("Trident"));
10711162 tripleItem.addActionListener(this);
1163
+ }
10721164 }
10731165
10741166 void buildToolsMenu(Menu menu)
10751167 {
10761168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771169 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
10791171
10801172 menu.add("-");
10811173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821174 parseverticesItem.addActionListener(this);
10831175 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841176 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861178 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901180 reduceMorphItem.addActionListener(this);
10911181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921182 reduce34MorphItem.addActionListener(this);
1093
-
1183
+ menu.add("-");
10941184 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951185 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
10981192 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991193 memoryItem.addActionListener(this);
11001194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1108,6 +1202,8 @@
11081202 resetParentItem.addActionListener(this);
11091203 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101204 repairParentItem.addActionListener(this);
1205
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1206
+ repairShadowItem.addActionListener(this);
11111207 menu.add(invariantsItem = new MenuItem("Invariants"));
11121208 invariantsItem.addActionListener(this);
11131209 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1211,7 @@
11151211 menu.add("-");
11161212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171213 editScriptItem.addActionListener(this);
1214
+ }
11181215 }
11191216
11201217 void ScreenFit()
....@@ -1468,6 +1565,7 @@
14681565 //
14691566 public void actionPerformed(ActionEvent event) // , Object arg)
14701567 {
1568
+ Object source = event.getSource();
14711569 /*
14721570 if (event.getSource() == nameField)
14731571 {
....@@ -1479,11 +1577,11 @@
14791577 }
14801578 else
14811579 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1580
+ if (source == lookAtItem || source == lookFromItem)
14831581 {
14841582 ScreenFit();
14851583 } else
1486
- if (event.getSource() == switchItem)
1584
+ if (source == switchItem)
14871585 {
14881586 cVector v1 = new cVector();
14891587 cVector v2 = new cVector();
....@@ -1492,11 +1590,11 @@
14921590 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931591 objEditor.cameraView.repaint();
14941592 } else
1495
- if (event.getSource() == rectoidItem)
1593
+ if (source == rectoidItem)
14961594 {
14971595 makeSomething(new Box());
14981596 } else
1499
- if (event.getSource() == particleItem)
1597
+ if (source == particleItem)
15001598 {
15011599 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021600 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1615,9 @@
15171615 applyExample(particleGeom, "SMOKE");
15181616 makeSomething(particleGeom);
15191617 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1618
+ if (source == ragdollItem || source == ragdoll2Item)
15211619 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1620
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231621
15241622 ragdoll.toParent = LA.newMatrix();
15251623 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1635,7 @@
15371635 } else
15381636 /*
15391637 */
1540
- if (event.getSource() == heightFieldItem)
1638
+ if (source == heightFieldItem)
15411639 {
15421640 Object3D obj = new Object3D();
15431641
....@@ -1575,27 +1673,31 @@
15751673
15761674 makeSomething(obj);
15771675 } else
1578
- if (event.getSource() == gridItem)
1676
+ if (source == gridItem)
15791677 {
15801678 makeSomething(new Grid());
15811679 } else
1582
- if (event.getSource() == ellipsoidItem)
1680
+ if (source == ellipsoidItem)
15831681 {
15841682 makeSomething(new Sphere());
15851683 } else
1586
- if (event.getSource() == coneItem)
1684
+ if (source == coneItem)
15871685 {
15881686 makeSomething(new Cone());
15891687 } else
1590
- if (event.getSource() == torusItem)
1688
+ if (source == torusItem)
15911689 {
15921690 makeSomething(new Torus());
15931691 } else
1594
- if (event.getSource() == superItem)
1692
+ if (source == superItem)
15951693 {
15961694 makeSomething(new Superellipsoid());
15971695 } else
1598
- if (event.getSource() == blobItem)
1696
+ if (source == kleinItem)
1697
+ {
1698
+ makeSomething(new Klein());
1699
+ } else
1700
+ if (source == blobItem)
15991701 {
16001702 Blob blob = new Blob();
16011703 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1705,15 @@
16031705 //blob.retile();
16041706 makeSomething(blob);
16051707 } else
1606
- if (event.getSource() == latheItem)
1708
+ if (source == latheItem)
16071709 {
16081710 makeSomething(new Lathe());
16091711 } else
1610
- if (event.getSource() == bezierItem)
1712
+ if (source == bezierItem)
16111713 {
16121714 makeSomething(new BezierSurface());
16131715 } else
1614
- if (event.getSource() == checkerItem)
1716
+ if (source == overlayItem)
16151717 {
16161718 /*
16171719 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1728,7 @@
16261728 */
16271729 makeSomething(new Checker());
16281730 } else
1629
- if (event.getSource() == meshItem)
1731
+ if (source == meshItem)
16301732 {
16311733 Object3D itemtomake = new Object3D();
16321734 Object3D child;
....@@ -1647,35 +1749,35 @@
16471749 makeSomething(child);
16481750 }
16491751 } else
1650
- if (event.getSource() == springItem)
1752
+ if (source == springItem)
16511753 {
16521754 cSpring s = new cSpring();
16531755 s.setup();
16541756 makeSomething(s);
16551757 } else
1656
- if (event.getSource() == flagItem)
1758
+ if (source == flagItem)
16571759 {
16581760 cSpring s = new cFlag();
16591761 s.setup();
16601762 makeSomething(s);
16611763 } else
1662
- if (event.getSource() == lightItem)
1764
+ if (source == lightItem)
16631765 {
16641766 makeSomething(new Light());
16651767 } else
1666
- if (event.getSource() == csgItem)
1768
+ if (source == csgItem)
16671769 {
16681770 group(new CSG());
16691771 } else
1670
- if (event.getSource() == templateItem)
1772
+ if (source == templateItem)
16711773 {
16721774 group(new cTemplate());
16731775 } else
1674
- if (event.getSource() == attributeItem)
1776
+ if (source == attributeItem)
16751777 {
16761778 makeSomething(new Attribute());
16771779 } else
1678
- if (event.getSource() == pointflowItem)
1780
+ if (source == pointflowItem)
16791781 {
16801782 makeSomething(new PointFlow());
16811783 } else
....@@ -1687,7 +1789,7 @@
16871789 } else
16881790 */
16891791
1690
- if (event.getSource() == superLoopItem)
1792
+ if (source == superLoopItem)
16911793 {
16921794 Composite g = new cGroup();
16931795 for (int i=0; i<15; i++)
....@@ -1709,7 +1811,7 @@
17091811
17101812 group(g);
17111813 } else
1712
- if (event.getSource() == loopItem)
1814
+ if (source == loopItem)
17131815 {
17141816 Composite csg = new GroupLeaf();
17151817 csg.count = 5;
....@@ -1718,7 +1820,7 @@
17181820 csg.addChild(child);
17191821 child.addChild(csg);
17201822 } else
1721
- if (event.getSource() == doubleItem)
1823
+ if (source == doubleItem)
17221824 {
17231825 Composite csg = new GroupLeaf();
17241826 csg.count = 5;
....@@ -1730,7 +1832,7 @@
17301832 csg.addChild(child);
17311833 child.addChild(csg);
17321834 } else
1733
- if (event.getSource() == tripleItem)
1835
+ if (source == tripleItem)
17341836 {
17351837 Composite csg = new GroupLeaf();
17361838 csg.count = 4;
....@@ -1746,70 +1848,83 @@
17461848 child.addChild(csg);
17471849 } else
17481850
1749
- if (event.getSource() == importGFDItem)
1851
+ if (source == importGFDItem)
17501852 {
17511853 ImportGFD();
17521854 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1855
+ if (source == importVRMLX3DItem)
17541856 {
17551857 ImportVRMLX3D();
17561858 } else
1757
- if (event.getSource() == import3DSItem)
1859
+ if (source == import3DSItem)
17581860 {
17591861 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601862 } else
1761
- if (event.getSource() == importOBJItem)
1863
+ if (source == importOBJItem)
17621864 {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1865
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
+ browser.setVisible(true);
1868
+ String filename = browser.getFile();
1869
+ if (filename != null && filename.length() > 0)
1870
+ {
1871
+ String fullname = browser.getDirectory() + filename;
1872
+ makeSomething(ReadOBJ(fullname), true);
1873
+ }
17641874 } else
1765
- if (event.getSource() == computeAOItem)
1875
+ if (source == computeAOItem)
17661876 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1877
+ Globals.drawMode = CameraPane.OCCLUSION;
1878
+ Globals.theRenderer.repaint();
17691879 } else
1770
- if (event.getSource() == recompileItem)
1880
+ if (source == recompileItem)
17711881 {
17721882 Recompile();
17731883 refreshContents();
17741884 } else
1775
- if (event.getSource() == editScriptItem)
1885
+ if (source == editScriptItem)
17761886 {
17771887 OpenDialog();
17781888 refreshContents();
17791889 } else
1780
- if (event.getSource() == invariantsItem)
1890
+ if (source == invariantsItem)
17811891 {
17821892 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1893
+ GrafreeD.grafreeD.universe.invariants();
17841894 } else
1785
- if (event.getSource() == memoryItem)
1895
+ if (source == memoryItem)
17861896 {
17871897 //System.out.println("Invariants:");
17881898 PrintMemory();
17891899 } else
1790
- if (event.getSource() == pathItem)
1900
+ if (source == pathItem)
17911901 {
17921902 PrintPath();
17931903 } else
1794
- if (event.getSource() == analyzeItem)
1904
+ if (source == analyzeItem)
17951905 {
17961906 AnalyzeObject();
17971907 } else
1798
- if (event.getSource() == dumpItem)
1908
+ if (source == dumpItem)
17991909 {
18001910 DumpObject();
18011911 } else
1802
- if (event.getSource() == screenfitButton)
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
1916
+ } else
1917
+ if (source == screenfitButton)
18031918 {
18041919 //Reload(lastConverter, lastFilename, true);
18051920 ScreenFit();
18061921 } else
1807
- if (event.getSource() == screenfitpointButton)
1922
+ if (source == screenfitpointButton)
18081923 {
18091924 //Reload(lastConverter, lastFilename, true);
18101925 ScreenFitPoint();
18111926 } else
1812
- if (event.getSource() == snapobjectButton)
1927
+ if (source == snapobjectButton)
18131928 {
18141929 //Reload(lastConverter, lastFilename, true);
18151930 SnapObject();
....@@ -1820,13 +1935,13 @@
18201935 // Recompile();
18211936 // refreshContents();
18221937 // } else
1823
- if (event.getSource() == gcButton)
1938
+ if (source == gcButton)
18241939 {
18251940 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261941 System.gc();
18271942 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281943 } else
1829
- if (event.getSource() == editLeafItem)
1944
+ if (source == editLeafItem)
18301945 {
18311946 Object3D obj;
18321947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1955,66 @@
18401955 }
18411956 refreshContents(true);
18421957 } else
1843
- if (event.getSource() == openWindowItem)
1958
+ if (source == openWindowItem)
18441959 {
18451960 EditSelection(true);
18461961 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1962
+ if (source == cutItem || source == clearButton)
18481963 {
18491964 loadClipboard(true);
18501965 } else
1851
- if (event.getSource() == duplicateItem)
1966
+ if (source == duplicateItem)
18521967 {
18531968 Object3D keep = GrafreeD.clipboard;
18541969 loadClipboard(false);
18551970 paste(false);
18561971 GrafreeD.clipboard = keep;
18571972 } else
1858
- if (event.getSource() == cloneItem)
1973
+ if (source == cloneItem)
18591974 {
18601975 CloneSelection(false);
18611976 } else
1862
- if (event.getSource() == cloneSupportItem)
1977
+ if (source == cloneSupportItem)
18631978 {
18641979 CloneSelection(true);
18651980 } else
1866
- if (event.getSource() == copyItem)
1981
+ if (source == copyItem)
18671982 {
18681983 loadClipboard(false);
18691984 } else
1870
- if (event.getSource() == pasteItem)
1985
+ if (source == pasteItem)
18711986 {
18721987 paste(false);
18731988 } else
1874
- if (event.getSource() == pasteLinkItem)
1989
+ if (source == pasteIntoItem)
18751990 {
1876
- pasteInto(false);
1991
+ pasteInto(true, false);
18771992 } else
1878
- if (event.getSource() == pasteCloneItem)
1993
+ if (source == pasteLinkItem)
18791994 {
1880
- pasteInto(true);
1995
+ pasteInto(false, false);
18811996 } else
1882
- if (event.getSource() == pasteExpandItem)
1997
+ if (source == pasteCloneItem)
1998
+ {
1999
+ pasteInto(true, true);
2000
+ } else
2001
+ if (source == pasteExpandItem)
18832002 {
18842003 paste(true);
18852004 } else
1886
- if (event.getSource() == synchronizeItem)
2005
+ if (source == synchronizeItem)
18872006 {
18882007 Overwrite(Object3D.TRANSFORM);
18892008 } else
1890
- if (event.getSource() == overwriteNameItem)
2009
+ if (source == overwriteNameItem)
18912010 {
18922011 Overwrite(Object3D.NAME);
18932012 } else
1894
- if (event.getSource() == overwriteUVItem)
2013
+ if (source == overwriteUVItem)
18952014 {
18962015 Overwrite(Object3D.UV);
18972016 } else
1898
- if (event.getSource() == overwriteMatItem)
2017
+ if (source == overwriteMatItem)
18992018 {
19002019 /* july 2015
19012020 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2034,7 @@
19152034
19162035 Overwrite(dropAttributes);
19172036 }
1918
- if (event.getSource() == overwriteGeoItem)
2037
+ if (source == overwriteGeoItem)
19192038 {
19202039 Overwrite(Object3D.GEOMETRY);
19212040 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2051,7 @@
19322051 // refreshContents();
19332052 // }
19342053 } else
1935
- if (event.getSource() == generateMeshItem)
2054
+ if (source == generateMeshItem)
19362055 {
19372056 //if (group.selection.size() == 1)
19382057 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2062,7 @@
19432062 ResetModel();
19442063 refreshContents();
19452064 } else
1946
- if (event.getSource() == extractGeometriesItem)
2065
+ if (source == extractGeometriesItem)
19472066 {
19482067 boolean one = false;
19492068
....@@ -1970,7 +2089,7 @@
19702089 ResetModel();
19712090 refreshContents();
19722091 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2092
+ if (source == cloneGeometriesItem)
19742093 {
19752094 boolean one = false;
19762095
....@@ -1996,32 +2115,37 @@
19962115 ResetModel();
19972116 refreshContents();
19982117 } else
1999
- if (event.getSource() == shareGeometriesItem)
2118
+ if (source == shareGeometriesItem)
20002119 {
20012120 boolean one = false;
20022121
20032122 if (group.selection.size() == 1)
20042123 one = true;
20052124
2125
+ Object3D merge = null;
2126
+
20062127 Object3D content = new cGroup();
20072128
20082129 for (int i=0; i<group.selection.size(); i++)
20092130 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2131
+ merge = new Merge(group.selection.get(i));
20112132
20122133 if (one)
2013
- makeSomething(sel, false);
2134
+ makeSomething(merge, false);
20142135 else
2015
- content.addChild(sel);
2136
+ content.addChild(merge);
20162137 }
20172138
20182139 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2140
+ makeSomething(content, true);
2141
+ else
2142
+ {
2143
+ ResetModel();
2144
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2145
+ refreshContents();
2146
+ }
20232147 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2148
+ if (source == mergeGeometriesItem)
20252149 {
20262150 boolean one = false;
20272151
....@@ -2051,7 +2175,7 @@
20512175 ResetModel();
20522176 refreshContents();
20532177 } else
2054
- if (event.getSource() == linkverticesItem)
2178
+ if (source == linkverticesItem)
20552179 {
20562180 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572181 // {
....@@ -2071,32 +2195,41 @@
20712195 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722196 content = ((cGroup)content).get(0);
20732197
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2198
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752199 for (int i=0; i<group.selection.size(); i++)
20762200 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
20792203 group.selection.get(i).linkVerticesThis(content);
20802204 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
20822206 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2207
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842208 refreshContents();
20852209 }
20862210 } else
2087
- if (event.getSource() == resetsupportItem)
2211
+ if (source == resetsupportItem)
20882212 {
20892213 for (int i=0; i<group.selection.size(); i++)
20902214 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
20932217 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
20952219 }
20962220
20972221 refreshContents();
20982222 } else
2099
- if (event.getSource() == resetreferencesItem)
2223
+ if (source == relinkverticesItem)
2224
+ {
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
2227
+ group.selection.RelinkToSupport();
2228
+ CameraPane.SWITCH = random;
2229
+
2230
+ refreshContents();
2231
+ } else
2232
+ if (source == resetreferencesItem)
21002233 {
21012234 for (int i=0; i<group.selection.size(); i++)
21022235 {
....@@ -2105,7 +2238,7 @@
21052238
21062239 refreshContents();
21072240 } else
2108
- if (event.getSource() == setMasterItem)
2241
+ if (source == setMasterItem)
21092242 {
21102243 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112244 {
....@@ -2118,7 +2251,7 @@
21182251 refreshContents();
21192252 }
21202253 } else
2121
- if (event.getSource() == poseMeshItem)
2254
+ if (source == poseMeshItem)
21222255 {
21232256 if (group.selection.size() == 1)
21242257 {
....@@ -2137,19 +2270,19 @@
21372270 }
21382271
21392272 } else
2140
- if (event.getSource() == revertMeshItem)
2273
+ if (source == revertMeshItem)
21412274 {
21422275 RevertMeshes();
21432276 } else
2144
- if (event.getSource() == resetMeshItem)
2277
+ if (source == resetMeshItem)
21452278 {
21462279 ResetAll();
21472280 } else
2148
- if (event.getSource() == stepAllItem)
2281
+ if (source == stepAllItem)
21492282 {
21502283 StepAll();
21512284 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2285
+ if (source == clearItem) // || event.getSource() == clearButton)
21532286 {
21542287 //int indices[] = jList.getSelectedIndices();
21552288 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2290,46 @@
21572290
21582291 ClearSelection(false);
21592292 } else
2160
- if (event.getSource() == clearAllItem)
2293
+ if (source == clearAllItem)
21612294 {
21622295 ClearSelection(true);
21632296 } else
2164
- if (event.getSource() == grabItem)
2297
+ if (source == grabItem)
21652298 {
21662299 group(new cGroup(), true);
21672300 } else
2168
- if (event.getSource() == frontItem)
2301
+ if (source == hideItem)
2302
+ {
2303
+ group(new HiddenObject());
2304
+ } else
2305
+ if (source == frontItem)
21692306 {
21702307 front();
21712308 } else
2172
- if (event.getSource() == backItem)
2309
+ if (source == backItem)
21732310 {
21742311 back();
21752312 } else
2176
- if (event.getSource() == cameraItem)
2313
+ if (source == cameraItem)
21772314 {
21782315 makeSomething(new Camera());
21792316 } else
2180
- if (event.getSource() == compositeItem)
2317
+ if (source == compositeItem)
21812318 {
21822319 group(new Composite());
21832320 } else
2184
- if (event.getSource() == randomItem)
2321
+ if (source == randomItem)
21852322 {
21862323 RandomNode random = new RandomNode();
21872324 group(random);
21882325 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
21902327 } else
2191
- if (event.getSource() == physicsItem)
2328
+ if (source == physicsItem)
21922329 {
21932330 group(new PhysicsNode());
21942331 } else
2195
- if (event.getSource() == frameselectorItem)
2332
+ if (source == frameselectorItem)
21962333 {
21972334 for (int i=0; i<group.selection.size(); i++)
21982335 {
....@@ -2204,7 +2341,7 @@
22042341 ResetModel();
22052342 refreshContents();
22062343 } else
2207
- if (event.getSource() == switchGeoItem)
2344
+ if (source == switchGeoItem)
22082345 {
22092346 for (int i=0; i<group.selection.size(); i++)
22102347 {
....@@ -2216,7 +2353,7 @@
22162353 ResetModel();
22172354 refreshContents();
22182355 } else
2219
- if (event.getSource() == switchTransfoItem)
2356
+ if (source == switchTransfoItem)
22202357 {
22212358 for (int i=0; i<group.selection.size(); i++)
22222359 {
....@@ -2228,7 +2365,7 @@
22282365 ResetModel();
22292366 refreshContents();
22302367 } else
2231
- if (event.getSource() == morphItem)
2368
+ if (source == morphItem)
22322369 {
22332370 for (int i=0; i<group.selection.size(); i++)
22342371 {
....@@ -2240,7 +2377,7 @@
22402377 ResetModel();
22412378 refreshContents();
22422379 } else
2243
- if (event.getSource() == scriptNodeItem)
2380
+ if (source == scriptNodeItem)
22442381 {
22452382 boolean atleastone = false;
22462383
....@@ -2279,199 +2416,215 @@
22792416 }
22802417 }
22812418 } else
2282
- if (event.getSource() == linkerItem)
2419
+ if (source == linkerItem)
22832420 {
22842421 group(new cLinker());
22852422 } else
2286
- if (event.getSource() == textureItem)
2423
+ if (source == textureItem)
22872424 {
22882425 group(new TextureNode());
22892426 } else
2290
- if (event.getSource() == shadowXItem)
2427
+ if (source == billboardItem)
2428
+ {
2429
+ group(new BillboardNode());
2430
+ } else
2431
+ if (source == shadowXItem)
22912432 {
22922433 CastShadow(0);
22932434 } else
2294
- if (event.getSource() == shadowYItem)
2435
+ if (source == shadowYItem)
22952436 {
22962437 CastShadow(1);
22972438 } else
2298
- if (event.getSource() == shadowZItem)
2439
+ if (source == shadowZItem)
22992440 {
23002441 CastShadow(2);
23012442 } else
2302
- if (event.getSource() == ungroupItem)
2443
+ if (source == ungroupItem)
23032444 {
2304
- ungroup();
2445
+ //ungroup();
2446
+ for (int i=0; i<group.selection.size(); i++)
2447
+ {
2448
+ Ungroup(group.selection.get(i));
2449
+ }
2450
+
2451
+ ClearSelection(false);
2452
+
2453
+ refreshContents();
23052454 } else
2306
- if (event.getSource() == genUVItem)
2455
+ if (source == genUVItem)
23072456 {
23082457 GenUV();
23092458 } else
2310
- if (event.getSource() == genNormalsCADItem)
2459
+ if (source == genNormalsCADItem)
23112460 {
23122461 GenNormals(true);
23132462 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2463
+ if (source == genNormalsMESHItem)
23152464 {
23162465 GenNormals(true); // TODO
23172466 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2467
+ if (source == genNormalsORGANItem)
23192468 {
23202469 GenNormals(false);
23212470 } else
2322
- if (event.getSource() == stripifyItem)
2471
+ if (source == genNormalsMINEItem)
2472
+ {
2473
+ GenNormalsMINE();
2474
+ } else
2475
+ if (source == stripifyItem)
23232476 {
23242477 Stripify();
23252478 } else
2326
- if (event.getSource() == unstripifyItem)
2479
+ if (source == unstripifyItem)
23272480 {
23282481 Unstripify();
23292482 } else
2330
- if (event.getSource() == trimItem)
2483
+ if (source == trimItem)
23312484 {
23322485 Trim();
23332486 } else
2334
- if (event.getSource() == untrimItem)
2487
+ if (source == untrimItem)
23352488 {
23362489 Untrim();
23372490 } else
2338
- if (event.getSource() == clearColorsItem)
2491
+ if (source == clearColorsItem)
23392492 {
23402493 ClearColors();
23412494 } else
2342
- if (event.getSource() == clearMaterialsItem)
2495
+ if (source == clearMaterialsItem)
23432496 {
23442497 ClearMaterials();
23452498 } else
2346
- if (event.getSource() == liveleavesItem)
2499
+ if (source == liveleavesItem)
23472500 {
23482501 LiveLeaves(true);
23492502 } else
2350
- if (event.getSource() == unliveleavesItem)
2503
+ if (source == unliveleavesItem)
23512504 {
23522505 LiveLeaves(false);
23532506 } else
2354
- if (event.getSource() == supportleavesItem)
2507
+ if (source == supportleavesItem)
23552508 {
23562509 SupportLeaves(true);
23572510 } else
2358
- if (event.getSource() == unsupportleavesItem)
2511
+ if (source == unsupportleavesItem)
23592512 {
23602513 SupportLeaves(false);
23612514 } else
2362
- if (event.getSource() == hideleavesItem)
2515
+ if (source == hideleavesItem)
23632516 {
23642517 HideLeaves(true);
23652518 } else
2366
- if (event.getSource() == showleavesItem)
2519
+ if (source == showleavesItem)
23672520 {
23682521 HideLeaves(false);
23692522 } else
2370
- if (event.getSource() == markleavesItem)
2523
+ if (source == markleavesItem)
23712524 {
23722525 MarkLeaves(true);
23732526 } else
2374
- if (event.getSource() == unmarkleavesItem)
2527
+ if (source == unmarkleavesItem)
23752528 {
23762529 MarkLeaves(false);
23772530 } else
2378
- if (event.getSource() == flipVItem)
2531
+ if (source == flipVItem)
23792532 {
23802533 FlipV(true);
23812534 } else
2382
- if (event.getSource() == unflipVItem)
2535
+ if (source == unflipVItem)
23832536 {
23842537 FlipV(false);
23852538 } else
2386
- if (event.getSource() == lowTexturesItem)
2539
+ if (source == lowTexturesItem)
23872540 {
23882541 SetTexRes(0);
23892542 } else
2390
- if (event.getSource() == normalTexturesItem)
2543
+ if (source == normalTexturesItem)
23912544 {
23922545 SetTexRes(1);
23932546 } else
2394
- if (event.getSource() == highTexturesItem)
2547
+ if (source == highTexturesItem)
23952548 {
23962549 SetTexRes(2);
23972550 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2551
+ if (source == veryhighTexturesItem)
23992552 {
24002553 SetTexRes(3);
24012554 } else
2402
- if (event.getSource() == maxTexturesItem)
2555
+ if (source == maxTexturesItem)
24032556 {
24042557 SetTexRes(4);
24052558 } else
2406
- if (event.getSource() == panoTexturesItem)
2559
+ if (source == panoTexturesItem)
24072560 {
24082561 SetTexRes(5);
24092562 } else
2410
- if (event.getSource() == reverseNormalsItem)
2563
+ if (source == reverseNormalsItem)
24112564 {
24122565 ReverseNormals();
24132566 } else
2414
- if (event.getSource() == parseverticesItem)
2567
+ if (source == parseverticesItem)
24152568 {
24162569 ParseVertices();
24172570 } else
2418
- if (event.getSource() == textureFieldItem)
2571
+ if (source == textureFieldItem)
24192572 {
24202573 TextureVertices();
24212574 } else
2422
- if (event.getSource() == alignItem)
2575
+ if (source == alignItem)
24232576 {
24242577 Align();
24252578 } else
2426
- if (event.getSource() == mirrorItem)
2579
+ if (source == mirrorItem)
24272580 {
24282581 MirrorPoses();
24292582 } else
2430
- if (event.getSource() == reduceMorphItem)
2583
+ if (source == reduceMorphItem)
24312584 {
24322585 MeshReduction(false);
24332586 } else
2434
- if (event.getSource() == reduce34MorphItem)
2587
+ if (source == reduce34MorphItem)
24352588 {
24362589 MeshReduction(true);
24372590 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2591
+ if (source == reverseTrianglesItem)
24392592 {
24402593 ReverseTriangles();
24412594 } else
2442
- if (event.getSource() == reduceMeshItem)
2595
+ if (source == reduceMeshItem)
24432596 {
24442597 ReduceMesh(false);
24452598 } else
2446
- if (event.getSource() == reduce34MeshItem)
2599
+ if (source == reduce34MeshItem)
24472600 {
24482601 ReduceMesh(true);
24492602 } else
2450
- if (event.getSource() == increaseMeshItem)
2603
+ if (source == increaseMeshItem)
24512604 {
24522605 IncreaseMesh();
24532606 } else
2454
- if (event.getSource() == clipMeshItem)
2607
+ if (source == clipMeshItem)
24552608 {
24562609 ClipMesh();
24572610 } else
2458
- if (event.getSource() == smoothMeshItem)
2611
+ if (source == smoothMeshItem)
24592612 {
24602613 SmoothMesh();
24612614 } else
2462
- if (event.getSource() == transformgeometryItem)
2615
+ if (source == transformgeometryItem)
24632616 {
24642617 TransformGeometry();
24652618 } else
2466
- if (event.getSource() == resetTransformItem)
2619
+ if (source == resetTransformItem)
24672620 {
24682621 ResetTransform();
24692622 } else
2470
- if (event.getSource() == resetCentroidItem)
2623
+ if (source == resetCentroidItem)
24712624 {
24722625 ResetCentroid();
24732626 } else
2474
- if (event.getSource() == resetParentItem)
2627
+ if (source == resetParentItem)
24752628 {
24762629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772630 {
....@@ -2481,7 +2634,7 @@
24812634
24822635 refreshContents();
24832636 } else
2484
- if (event.getSource() == repairParentItem)
2637
+ if (source == repairParentItem)
24852638 {
24862639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872640 {
....@@ -2495,7 +2648,21 @@
24952648
24962649 refreshContents();
24972650 } else
2498
- if (event.getSource() == sortbysizeItem)
2651
+ if (source == repairShadowItem)
2652
+ {
2653
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2654
+ {
2655
+ Object3D obj = (Object3D)e.nextElement();
2656
+ obj.RepairShadow();
2657
+// for (int i=0; i<obj.size(); i++)
2658
+// {
2659
+// obj.get(i).parent = obj;
2660
+// }
2661
+ }
2662
+
2663
+ refreshContents();
2664
+ } else
2665
+ if (source == sortbysizeItem)
24992666 {
25002667 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012668 {
....@@ -2507,7 +2674,7 @@
25072674 ResetModel();
25082675 refreshContents();
25092676 } else
2510
- if (event.getSource() == sortbynameItem)
2677
+ if (source == sortbynameItem)
25112678 {
25122679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132680 {
....@@ -2519,7 +2686,7 @@
25192686 ResetModel();
25202687 refreshContents();
25212688 } else
2522
- if (event.getSource() == attachPigmentItem)
2689
+ if (source == attachPigmentItem)
25232690 {
25242691 String texture = GetFile("Attach pigment");
25252692 Object3D obj;
....@@ -2531,7 +2698,7 @@
25312698
25322699 refreshContents();
25332700 } else
2534
- if (event.getSource() == detachPigmentItem)
2701
+ if (source == detachPigmentItem)
25352702 {
25362703 Object3D obj;
25372704 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2709,7 @@
25422709
25432710 refreshContents();
25442711 } else
2545
- if (event.getSource() == attachBumpItem)
2712
+ if (source == attachBumpItem)
25462713 {
25472714 String texture = GetFile("Attach bump");
25482715 Object3D obj;
....@@ -2554,7 +2721,7 @@
25542721
25552722 refreshContents();
25562723 } else
2557
- if (event.getSource() == detachBumpItem)
2724
+ if (source == detachBumpItem)
25582725 {
25592726 Object3D obj;
25602727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2732,7 @@
25652732
25662733 refreshContents();
25672734 } else
2568
- if (event.getSource() == pigmentBumpItem)
2735
+ if (source == pigmentBumpItem)
25692736 {
25702737 Object3D obj;
25712738 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2743,195 @@
25762743
25772744 refreshContents();
25782745 } else
2579
- if (event.getSource() == flashSelectionButton)
2746
+ if (source == flashSelectionButton)
25802747 {
25812748 CameraPane.flash = true;
25822749 refreshContents();
25832750 } else
2584
- if (event.getSource() == oneButton)
2751
+ if (source == oneButton)
25852752 {
25862753 } else
2587
- if (event.getSource() == twoButton)
2754
+ if (source == twoButton)
25882755 {
25892756 radio.layout = twoButton;
25902757 // bug
25912758 //gridPanel.setDividerLocation(1.0);
25922759 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
2760
+// bigThree.remove(scenePanel);
2761
+// bigThree.remove(centralPanel);
2762
+// bigThree.remove(XYZPanel);
2763
+// aWindowConstraints.gridx = 0;
2764
+// aWindowConstraints.gridy = 0;
2765
+// aWindowConstraints.gridwidth = 1;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2768
+// aWindowConstraints.weightx = 0;
2769
+// aWindowConstraints.weighty = 1;
2770
+// //bigThree.add(jtp, aWindowConstraints);
2771
+// aWindowConstraints.weightx = 1;
2772
+// aWindowConstraints.gridwidth = 3;
2773
+// // aConstraints.gridheight = 3;
2774
+// aWindowConstraints.gridx = 1;
2775
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2776
+// bigThree.add(centralPanel, aWindowConstraints);
2777
+// aWindowConstraints.weightx = 0;
2778
+// aWindowConstraints.gridx = 4;
2779
+// aWindowConstraints.gridwidth = 1;
2780
+// // aConstraints.gridheight = 3;
2781
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2782
+// //bigThree.add(XYZPanel, aWindowConstraints);
2783
+// scenePanel.setVisible(false);
2784
+// centralPanel.setVisible(true);
2785
+// XYZPanel.setVisible(false);
2786
+ bigThree.ClearUI();
2787
+ bigThree.add(centralPanel);
2788
+ bigThree.FlushUI();
26172789 } else
2618
- if (event.getSource() == threeButton)
2790
+ if (source == threeButton)
26192791 {
26202792 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
2793
+
2794
+// bigThree.remove(scenePanel);
2795
+// bigThree.remove(centralPanel);
2796
+// bigThree.remove(XYZPanel);
2797
+// aWindowConstraints.gridx = 0;
2798
+// aWindowConstraints.gridy = 0;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// aWindowConstraints.weightx = 0;
2803
+// aWindowConstraints.weighty = 1;
2804
+// //bigThree.add(jtp, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 1;
2806
+// aWindowConstraints.gridwidth = 3;
2807
+// // aConstraints.gridheight = 3;
2808
+// aWindowConstraints.gridx = 1;
2809
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2810
+// bigThree.add(centralPanel, aWindowConstraints);
2811
+// aWindowConstraints.weightx = 0;
2812
+// aWindowConstraints.gridx = 4;
2813
+// aWindowConstraints.gridwidth = 1;
2814
+// // aConstraints.gridheight = 3;
2815
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2816
+// bigThree.add(XYZPanel, aWindowConstraints);
2817
+// bigThree.validate();
2818
+// scenePanel.setVisible(false);
2819
+// centralPanel.setVisible(true);
2820
+// XYZPanel.setVisible(true);
2821
+ bigThree.ClearUI();
2822
+ bigThree.add(centralPanel);
2823
+ bigThree.add(XYZPanel);
2824
+ bigThree.FlushUI();
26452825 } else
2646
- if (event.getSource() == fourButton)
2826
+ if (source == fourButton)
26472827 {
26482828 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
2829
+
2830
+// bigThree.remove(scenePanel);
2831
+// bigThree.remove(centralPanel);
2832
+// bigThree.remove(XYZPanel);
2833
+// aWindowConstraints.gridx = 0;
2834
+// aWindowConstraints.gridy = 0;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aWindowConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2838
+// aWindowConstraints.weightx = 1;
2839
+// aWindowConstraints.weighty = 1;
2840
+// bigThree.add(scenePanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 1;
2842
+// aWindowConstraints.gridwidth = 3;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.gridx = 1;
2845
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2846
+// //bigThree.add(cameraPanel, aWindowConstraints);
2847
+// aWindowConstraints.weightx = 0;
2848
+// aWindowConstraints.gridx = 4;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aWindowConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// //bigThree.add(XYZPanel, aWindowConstraints);
2853
+// bigThree.validate();
2854
+// scenePanel.setVisible(true);
2855
+// centralPanel.setVisible(false);
2856
+// XYZPanel.setVisible(false);
2857
+ bigThree.ClearUI();
2858
+ bigThree.add(scenePanel);
2859
+ bigThree.FlushUI();
26732860 } else
2674
- if (event.getSource() == sixButton)
2861
+ if (source == sixButton)
26752862 {
26762863 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
2864
+
2865
+// bigThree.remove(scenePanel);
2866
+// bigThree.remove(centralPanel);
2867
+// bigThree.remove(XYZPanel);
2868
+// aWindowConstraints.gridx = 0;
2869
+// aWindowConstraints.gridy = 0;
2870
+// aWindowConstraints.gridwidth = 1;
2871
+// // aConstraints.gridheight = 3;
2872
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2873
+// aWindowConstraints.weightx = 0;
2874
+// aWindowConstraints.weighty = 1;
2875
+// bigThree.add(scenePanel, aWindowConstraints);
2876
+// aWindowConstraints.weightx = 1;
2877
+// aWindowConstraints.gridwidth = 3;
2878
+// // aWindowConstraints.gridheight = 3;
2879
+// aWindowConstraints.gridx = 1;
2880
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2881
+// bigThree.add(centralPanel, aWindowConstraints);
2882
+// aWindowConstraints.weightx = 0;
2883
+// aWindowConstraints.gridx = 4;
2884
+// aWindowConstraints.gridwidth = 1;
2885
+// // aWindowConstraints.gridheight = 3;
2886
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2887
+// //bigThree.add(XYZPanel, aConstraints);
2888
+// bigThree.validate();
2889
+// scenePanel.setVisible(true);
2890
+// centralPanel.setVisible(true);
2891
+// XYZPanel.setVisible(false);
2892
+ bigThree.ClearUI();
2893
+ bigThree.add(scenePanel);
2894
+ bigThree.add(centralPanel);
2895
+ bigThree.FlushUI();
27012896 } else
2702
- if (event.getSource() == sevenButton)
2897
+ if (source == sevenButton)
27032898 {
27042899 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
2900
+
2901
+// bigThree.remove(scenePanel);
2902
+// bigThree.remove(centralPanel);
2903
+// bigThree.remove(XYZPanel);
2904
+// aWindowConstraints.gridx = 0;
2905
+// aWindowConstraints.gridy = 0;
2906
+// aWindowConstraints.gridwidth = 1;
2907
+// // aWindowConstraints.gridheight = 3;
2908
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2909
+// aWindowConstraints.weightx = 0;
2910
+// aWindowConstraints.weighty = 1;
2911
+// bigThree.add(scenePanel, aWindowConstraints);
2912
+// aWindowConstraints.weightx = 1;
2913
+// aWindowConstraints.gridwidth = 3;
2914
+// // aWindowConstraints.gridheight = 3;
2915
+// aWindowConstraints.gridx = 1;
2916
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2917
+// bigThree.add(centralPanel, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 0;
2919
+// aWindowConstraints.gridx = 4;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// bigThree.add(XYZPanel, aWindowConstraints);
2924
+// bigThree.validate();
2925
+// scenePanel.setVisible(true);
2926
+// centralPanel.setVisible(true);
2927
+// XYZPanel.setVisible(true);
2928
+ bigThree.ClearUI();
2929
+ bigThree.add(scenePanel);
2930
+ bigThree.add(centralPanel);
2931
+ bigThree.add(XYZPanel);
2932
+ bigThree.FlushUI();
27292933 } else
2730
- if (event.getSource() == rootButton)
2934
+ if (source == rootButton)
27312935 {
27322936 Object3D obj;
27332937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2943,7 @@
27392943
27402944 refreshContents(true);
27412945 } else
2742
- if (event.getSource() == closeButton)
2946
+ if (source == closeButton)
27432947 {
27442948 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452949 cRadio ab;
....@@ -2760,11 +2964,11 @@
27602964 }
27612965 refreshContents(true);
27622966 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2967
+ if (source == editItem || source == editButton)
27642968 {
27652969 EditSelection(false);
27662970 } else
2767
- if (event.getSource() == uneditButton)
2971
+ if (source == uneditButton)
27682972 {
27692973 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702974 {
....@@ -2776,12 +2980,12 @@
27762980
27772981 child.editWindow = null; // ???????????
27782982 }
2779
- objEditor.ctrlPanel.revalidate();
2983
+ objEditor.ctrlPanel.FlushUI();
27802984 //objEditor.jTree.clearSelection();
27812985 //objEditor.ResetSliders();
27822986 refreshContents(true);
27832987 } else
2784
- if (event.getSource() == clearPanelButton)
2988
+ if (source == clearPanelButton)
27852989 {
27862990 assert(copy == group);
27872991 //copy.ClearUI();
....@@ -2792,7 +2996,7 @@
27922996 listUI.clear();
27932997 refreshContents(true);
27942998 } else
2795
- if (event.getSource() == allParamsButton)
2999
+ if (source == allParamsButton)
27963000 {
27973001 assert(copy == group);
27983002
....@@ -2813,19 +3017,19 @@
28133017
28143018 refreshContents(true);
28153019 } else
2816
- if (event.getSource() == unselectButton)
3020
+ if (source == unselectButton)
28173021 {
28183022 objEditor.jTree.clearSelection();
28193023 // ?? oct 2012 GrafreeD.clipboard.clear();
28203024 objEditor.ResetSliders();
28213025 refreshContents(true);
28223026 } else
2823
- if(event.getSource() instanceof cRadio)
3027
+ if(source instanceof cRadio)
28243028 {
28253029 group.parent = keepparent;
28263030 group.attributes = 0;
28273031 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3032
+ /*cRadio*/ radio = (cRadio)source;
28293033 Object3D obj = radio.GetObject();
28303034 System.out.println("Edit " + obj);
28313035 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3049,7 @@
28453049 }
28463050
28473051 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3052
+ //Globals.theRenderer.object = group;
28493053 if(!useclient)
28503054 {
28513055 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +3058,8 @@
28543058 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553059 cameraView.targetLookAt.set(radio.camera.lookAt);
28563060 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3061
+ //cameraView.lighttouched = true;
3062
+ Globals.lighttouched = true;
28583063 topView.object = group;
28593064 frontView.object = group;
28603065 sideView.object = group;
....@@ -2890,7 +3095,7 @@
28903095 if (useclient)
28913096 {
28923097 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3098
+ Globals.lighttouched = true;
28943099 //topView.object = client;
28953100 //frontView.object = client;
28963101 //sideView.object = client;
....@@ -2898,7 +3103,7 @@
28983103 else
28993104 {
29003105 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3106
+ Globals.lighttouched = true;
29023107 //topView.object = group;
29033108 //frontView.object = group;
29043109 //sideView.object = group;
....@@ -3179,6 +3384,13 @@
31793384 refreshContents();
31803385 }
31813386
3387
+ void GenNormalsMINE()
3388
+ {
3389
+ group.selection.GenNormalsMINE();
3390
+
3391
+ refreshContents();
3392
+ }
3393
+
31823394 void Stripify()
31833395 {
31843396 group.StripifyS();
....@@ -3399,7 +3611,7 @@
33993611 String pigment = Object3D.GetPigment(tex);
34003612 //String bump = Object3D.GetBump(tex);
34013613
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3614
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34033615
34043616 double s = v.s;
34053617
....@@ -3447,12 +3659,26 @@
34473659
34483660 void Align()
34493661 {
3662
+ if (group.selection.size() == 0)
3663
+ return;
3664
+
3665
+ cVector bbmin = new cVector();
3666
+ cVector bbmax = new cVector();
3667
+
3668
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3669
+
3670
+ double dx = bbmax.x - bbmin.x;
3671
+ double dy = bbmax.y - bbmin.y;
3672
+ double dz = bbmax.z - bbmin.z;
3673
+
3674
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3675
+
34503676 for (int i=0; i<group.selection.size(); i++)
34513677 {
34523678 Object3D obj = group.selection.get(i);
34533679
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3680
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3681
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563682 }
34573683
34583684 refreshContents();
....@@ -3473,11 +3699,11 @@
34733699
34743700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753701
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
34783704 lowres.linkVerticesThis(null);
34793705 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
34813707
34823708 System.err.flush();
34833709
....@@ -3686,7 +3912,7 @@
36863912 group.selection.RelinkToSupport(); // july 2014
36873913 System.out.println("DONE.");
36883914 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3915
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36903916 }
36913917
36923918 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4188,25 @@
39624188 System.err.println("info : " + child.GetPath());
39634189 }
39644190 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
39714197
39724198 objEditor.SetText(); // jan 2014
39734199
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4200
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754201 CameraPane.flash = true;
39764202
39774203 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784204 // a camera
39794205 {
39804206 CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4207
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4208
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4209
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844210 }
39854211
39864212 refreshContents();
....@@ -4235,7 +4461,7 @@
42354461 refreshContents();
42364462 }
42374463
4238
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
42394465 {
42404466 // if (GrafreeD.clipboard == null)
42414467 // return;
....@@ -4264,7 +4490,14 @@
42644490 if (copyit)
42654491 {
42664492 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
42684501 }
42694502 else
42704503 {
....@@ -4474,6 +4707,26 @@
44744707 makeSomething(csg);
44754708 }
44764709
4710
+ void Ungroup(Object3D g)
4711
+ {
4712
+ if (g instanceof HiddenObject)
4713
+ {
4714
+ HiddenObject h = (HiddenObject) g;
4715
+
4716
+ for (int i=0; i<h.ActualSize(); i++)
4717
+ {
4718
+ objEditor.makeSomething(h.get(i), false);
4719
+ }
4720
+ }
4721
+ else
4722
+ {
4723
+ for (int i=0; i<g.Size(); i++)
4724
+ {
4725
+ objEditor.makeSomething(g.get(i), false);
4726
+ }
4727
+ }
4728
+ }
4729
+
44774730 void ungroup()
44784731 {
44794732 /*
....@@ -4788,10 +5041,12 @@
47885041 cButton flashSelectionButton;
47895042 cButton editButton;
47905043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
47915045 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935046 cButton unselectButton;
47945047
5048
+ cButton oneStepButton;
5049
+
47955050 cButton screenfitButton;
47965051 cButton screenfitpointButton;
47975052 cButton snapobjectButton;
....@@ -4833,6 +5088,7 @@
48335088 private MenuItem resetsupportItem;
48345089 private MenuItem resetreferencesItem;
48355090 private MenuItem linkverticesItem;
5091
+ private MenuItem relinkverticesItem;
48365092 private MenuItem setMasterItem;
48375093 private MenuItem resetMeshItem;
48385094 private MenuItem stepAllItem;
....@@ -4845,6 +5101,7 @@
48455101 private MenuItem mergeGeometriesItem;
48465102 private MenuItem copyItem;
48475103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
48485105 private MenuItem pasteLinkItem;
48495106 private MenuItem pasteCloneItem;
48505107 private MenuItem pasteExpandItem;
....@@ -4854,6 +5111,7 @@
48545111 private MenuItem genNormalsMESHItem;
48555112 private MenuItem genNormalsCADItem;
48565113 private MenuItem genNormalsORGANItem;
5114
+ private MenuItem genNormalsMINEItem;
48575115 private MenuItem stripifyItem;
48585116 private MenuItem unstripifyItem;
48595117 private MenuItem trimItem;
....@@ -4895,6 +5153,7 @@
48955153 private MenuItem resetCentroidItem;
48965154 private MenuItem transformgeometryItem;
48975155 private MenuItem resetTransformItem;
5156
+ private MenuItem hideItem;
48985157 private MenuItem grabItem;
48995158 private MenuItem backItem;
49005159 private MenuItem frontItem;
....@@ -4915,6 +5174,7 @@
49155174
49165175 private MenuItem resetParentItem;
49175176 private MenuItem repairParentItem;
5177
+ private MenuItem repairShadowItem;
49185178 private MenuItem sortbysizeItem;
49195179 private MenuItem sortbynameItem;
49205180
....@@ -4935,10 +5195,11 @@
49355195 private MenuItem coneItem;
49365196 private MenuItem torusItem;
49375197 private MenuItem superItem;
5198
+ private MenuItem kleinItem;
49385199 private MenuItem blobItem;
49395200 private MenuItem latheItem;
49405201 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
49425203 private MenuItem meshItem;
49435204 // private MenuItem meshGroupItem;
49445205 private MenuItem springItem;
....@@ -4947,6 +5208,7 @@
49475208 private MenuItem csgItem;
49485209 private MenuItem templateItem;
49495210 private MenuItem textureItem;
5211
+ private MenuItem billboardItem;
49505212 private MenuItem shadowXItem;
49515213 private MenuItem shadowYItem;
49525214 private MenuItem shadowZItem;