Normand Briere
2019-05-05 631719825b865aaf9fa1cb124d9fc5bd9dd78bd4
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 {
....@@ -859,7 +940,9 @@
859940 // objEditor.DropFile((java.io.File[]) object, true);
860941 // return;
861942 // }
862
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
863946 {
864947 // file(s)
865948 String[] names = string.split("\n");
....@@ -886,7 +969,7 @@
886969
887970 flashIt = false;
888971 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
890973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
891974
892975 if (group.selection.size() == 1)
....@@ -913,11 +996,11 @@
913996 {
914997 loadClipboard(true);
915998 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
999
+ pasteInto(false, false);
9171000 } else {
9181001 loadClipboard(false);
9191002 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
1003
+ pasteInto(false, false); // true); // ???
9211004 }
9221005 }
9231006 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1118,37 @@
10351118 torusItem.addActionListener(this);
10361119 superItem = menu.add(new MenuItem("Superellipsoid"));
10371120 superItem.addActionListener(this);
1121
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1122
+ kleinItem.addActionListener(this);
10381123 particleItem = menu.add(new MenuItem("Particle system"));
10391124 particleItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10401127 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411128 ragdollItem.addActionListener(this);
10421129 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431130 ragdoll2Item.addActionListener(this);
1131
+ }
10441132 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1133
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461134 meshItem.addActionListener(this);
10471135 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481136 // meshGroupItem.addActionListener(this);
1137
+ if (Globals.ADVANCED)
1138
+ {
10491139 springItem = menu.add(new MenuItem("Spring"));
10501140 springItem.addActionListener(this);
10511141 flagItem = menu.add(new MenuItem("Flag"));
10521142 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);
10571143 blobItem = menu.add(new MenuItem("Blob"));
10581144 blobItem.addActionListener(this);
10591145 latheItem = menu.add(new MenuItem("Lathe"));
10601146 latheItem.addActionListener(this);
1147
+ }
1148
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1149
+ bezierItem.addActionListener(this);
1150
+ overlayItem = menu.add(new MenuItem("Overlay"));
1151
+ overlayItem.addActionListener(this);
10611152 lightItem = menu.add(new MenuItem("Light"));
10621153 lightItem.addActionListener(this);
10631154 menu.add("-");
....@@ -1067,34 +1158,39 @@
10671158 loopItem.addActionListener(this);
10681159 doubleItem = menu.add(new MenuItem("Fork"));
10691160 doubleItem.addActionListener(this);
1161
+ if (Globals.ADVANCED)
1162
+ {
10701163 tripleItem = menu.add(new MenuItem("Trident"));
10711164 tripleItem.addActionListener(this);
1165
+ }
10721166 }
10731167
10741168 void buildToolsMenu(Menu menu)
10751169 {
10761170 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771171 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1172
+ animationItem.setState(Globals.ANIMATION);
10791173
10801174 menu.add("-");
10811175 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821176 parseverticesItem.addActionListener(this);
10831177 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841178 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1179
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861180 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891181 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901182 reduceMorphItem.addActionListener(this);
10911183 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921184 reduce34MorphItem.addActionListener(this);
1093
-
1185
+ menu.add("-");
10941186 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951187 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971188
1189
+ if (Globals.ADVANCED)
1190
+ {
1191
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1192
+ mirrorItem.addActionListener(this);
1193
+ menu.add("-");
10981194 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991195 memoryItem.addActionListener(this);
11001196 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1108,6 +1204,8 @@
11081204 resetParentItem.addActionListener(this);
11091205 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101206 repairParentItem.addActionListener(this);
1207
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1208
+ repairShadowItem.addActionListener(this);
11111209 menu.add(invariantsItem = new MenuItem("Invariants"));
11121210 invariantsItem.addActionListener(this);
11131211 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1213,7 @@
11151213 menu.add("-");
11161214 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171215 editScriptItem.addActionListener(this);
1216
+ }
11181217 }
11191218
11201219 void ScreenFit()
....@@ -1468,6 +1567,7 @@
14681567 //
14691568 public void actionPerformed(ActionEvent event) // , Object arg)
14701569 {
1570
+ Object source = event.getSource();
14711571 /*
14721572 if (event.getSource() == nameField)
14731573 {
....@@ -1479,11 +1579,11 @@
14791579 }
14801580 else
14811581 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1582
+ if (source == lookAtItem || source == lookFromItem)
14831583 {
14841584 ScreenFit();
14851585 } else
1486
- if (event.getSource() == switchItem)
1586
+ if (source == switchItem)
14871587 {
14881588 cVector v1 = new cVector();
14891589 cVector v2 = new cVector();
....@@ -1492,11 +1592,11 @@
14921592 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931593 objEditor.cameraView.repaint();
14941594 } else
1495
- if (event.getSource() == rectoidItem)
1595
+ if (source == rectoidItem)
14961596 {
14971597 makeSomething(new Box());
14981598 } else
1499
- if (event.getSource() == particleItem)
1599
+ if (source == particleItem)
15001600 {
15011601 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021602 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1617,9 @@
15171617 applyExample(particleGeom, "SMOKE");
15181618 makeSomething(particleGeom);
15191619 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1620
+ if (source == ragdollItem || source == ragdoll2Item)
15211621 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1622
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231623
15241624 ragdoll.toParent = LA.newMatrix();
15251625 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1637,7 @@
15371637 } else
15381638 /*
15391639 */
1540
- if (event.getSource() == heightFieldItem)
1640
+ if (source == heightFieldItem)
15411641 {
15421642 Object3D obj = new Object3D();
15431643
....@@ -1575,27 +1675,31 @@
15751675
15761676 makeSomething(obj);
15771677 } else
1578
- if (event.getSource() == gridItem)
1678
+ if (source == gridItem)
15791679 {
15801680 makeSomething(new Grid());
15811681 } else
1582
- if (event.getSource() == ellipsoidItem)
1682
+ if (source == ellipsoidItem)
15831683 {
15841684 makeSomething(new Sphere());
15851685 } else
1586
- if (event.getSource() == coneItem)
1686
+ if (source == coneItem)
15871687 {
15881688 makeSomething(new Cone());
15891689 } else
1590
- if (event.getSource() == torusItem)
1690
+ if (source == torusItem)
15911691 {
15921692 makeSomething(new Torus());
15931693 } else
1594
- if (event.getSource() == superItem)
1694
+ if (source == superItem)
15951695 {
15961696 makeSomething(new Superellipsoid());
15971697 } else
1598
- if (event.getSource() == blobItem)
1698
+ if (source == kleinItem)
1699
+ {
1700
+ makeSomething(new Klein());
1701
+ } else
1702
+ if (source == blobItem)
15991703 {
16001704 Blob blob = new Blob();
16011705 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1707,15 @@
16031707 //blob.retile();
16041708 makeSomething(blob);
16051709 } else
1606
- if (event.getSource() == latheItem)
1710
+ if (source == latheItem)
16071711 {
16081712 makeSomething(new Lathe());
16091713 } else
1610
- if (event.getSource() == bezierItem)
1714
+ if (source == bezierItem)
16111715 {
16121716 makeSomething(new BezierSurface());
16131717 } else
1614
- if (event.getSource() == checkerItem)
1718
+ if (source == overlayItem)
16151719 {
16161720 /*
16171721 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1730,7 @@
16261730 */
16271731 makeSomething(new Checker());
16281732 } else
1629
- if (event.getSource() == meshItem)
1733
+ if (source == meshItem)
16301734 {
16311735 Object3D itemtomake = new Object3D();
16321736 Object3D child;
....@@ -1647,35 +1751,35 @@
16471751 makeSomething(child);
16481752 }
16491753 } else
1650
- if (event.getSource() == springItem)
1754
+ if (source == springItem)
16511755 {
16521756 cSpring s = new cSpring();
16531757 s.setup();
16541758 makeSomething(s);
16551759 } else
1656
- if (event.getSource() == flagItem)
1760
+ if (source == flagItem)
16571761 {
16581762 cSpring s = new cFlag();
16591763 s.setup();
16601764 makeSomething(s);
16611765 } else
1662
- if (event.getSource() == lightItem)
1766
+ if (source == lightItem)
16631767 {
16641768 makeSomething(new Light());
16651769 } else
1666
- if (event.getSource() == csgItem)
1770
+ if (source == csgItem)
16671771 {
16681772 group(new CSG());
16691773 } else
1670
- if (event.getSource() == templateItem)
1774
+ if (source == templateItem)
16711775 {
16721776 group(new cTemplate());
16731777 } else
1674
- if (event.getSource() == attributeItem)
1778
+ if (source == attributeItem)
16751779 {
16761780 makeSomething(new Attribute());
16771781 } else
1678
- if (event.getSource() == pointflowItem)
1782
+ if (source == pointflowItem)
16791783 {
16801784 makeSomething(new PointFlow());
16811785 } else
....@@ -1687,7 +1791,7 @@
16871791 } else
16881792 */
16891793
1690
- if (event.getSource() == superLoopItem)
1794
+ if (source == superLoopItem)
16911795 {
16921796 Composite g = new cGroup();
16931797 for (int i=0; i<15; i++)
....@@ -1709,7 +1813,7 @@
17091813
17101814 group(g);
17111815 } else
1712
- if (event.getSource() == loopItem)
1816
+ if (source == loopItem)
17131817 {
17141818 Composite csg = new GroupLeaf();
17151819 csg.count = 5;
....@@ -1718,7 +1822,7 @@
17181822 csg.addChild(child);
17191823 child.addChild(csg);
17201824 } else
1721
- if (event.getSource() == doubleItem)
1825
+ if (source == doubleItem)
17221826 {
17231827 Composite csg = new GroupLeaf();
17241828 csg.count = 5;
....@@ -1730,7 +1834,7 @@
17301834 csg.addChild(child);
17311835 child.addChild(csg);
17321836 } else
1733
- if (event.getSource() == tripleItem)
1837
+ if (source == tripleItem)
17341838 {
17351839 Composite csg = new GroupLeaf();
17361840 csg.count = 4;
....@@ -1746,70 +1850,83 @@
17461850 child.addChild(csg);
17471851 } else
17481852
1749
- if (event.getSource() == importGFDItem)
1853
+ if (source == importGFDItem)
17501854 {
17511855 ImportGFD();
17521856 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1857
+ if (source == importVRMLX3DItem)
17541858 {
17551859 ImportVRMLX3D();
17561860 } else
1757
- if (event.getSource() == import3DSItem)
1861
+ if (source == import3DSItem)
17581862 {
17591863 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601864 } else
1761
- if (event.getSource() == importOBJItem)
1865
+ if (source == importOBJItem)
17621866 {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1867
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
+ browser.setVisible(true);
1870
+ String filename = browser.getFile();
1871
+ if (filename != null && filename.length() > 0)
1872
+ {
1873
+ String fullname = browser.getDirectory() + filename;
1874
+ makeSomething(ReadOBJ(fullname), true);
1875
+ }
17641876 } else
1765
- if (event.getSource() == computeAOItem)
1877
+ if (source == computeAOItem)
17661878 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1879
+ Globals.drawMode = CameraPane.OCCLUSION;
1880
+ Globals.theRenderer.repaint();
17691881 } else
1770
- if (event.getSource() == recompileItem)
1882
+ if (source == recompileItem)
17711883 {
17721884 Recompile();
17731885 refreshContents();
17741886 } else
1775
- if (event.getSource() == editScriptItem)
1887
+ if (source == editScriptItem)
17761888 {
17771889 OpenDialog();
17781890 refreshContents();
17791891 } else
1780
- if (event.getSource() == invariantsItem)
1892
+ if (source == invariantsItem)
17811893 {
17821894 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1895
+ GrafreeD.grafreeD.universe.invariants();
17841896 } else
1785
- if (event.getSource() == memoryItem)
1897
+ if (source == memoryItem)
17861898 {
17871899 //System.out.println("Invariants:");
17881900 PrintMemory();
17891901 } else
1790
- if (event.getSource() == pathItem)
1902
+ if (source == pathItem)
17911903 {
17921904 PrintPath();
17931905 } else
1794
- if (event.getSource() == analyzeItem)
1906
+ if (source == analyzeItem)
17951907 {
17961908 AnalyzeObject();
17971909 } else
1798
- if (event.getSource() == dumpItem)
1910
+ if (source == dumpItem)
17991911 {
18001912 DumpObject();
18011913 } else
1802
- if (event.getSource() == screenfitButton)
1914
+ if (source == oneStepButton)
1915
+ {
1916
+ Globals.ONESTEP = true;
1917
+ cameraView.repaint();
1918
+ } else
1919
+ if (source == screenfitButton)
18031920 {
18041921 //Reload(lastConverter, lastFilename, true);
18051922 ScreenFit();
18061923 } else
1807
- if (event.getSource() == screenfitpointButton)
1924
+ if (source == screenfitpointButton)
18081925 {
18091926 //Reload(lastConverter, lastFilename, true);
18101927 ScreenFitPoint();
18111928 } else
1812
- if (event.getSource() == snapobjectButton)
1929
+ if (source == snapobjectButton)
18131930 {
18141931 //Reload(lastConverter, lastFilename, true);
18151932 SnapObject();
....@@ -1820,13 +1937,13 @@
18201937 // Recompile();
18211938 // refreshContents();
18221939 // } else
1823
- if (event.getSource() == gcButton)
1940
+ if (source == gcButton)
18241941 {
18251942 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261943 System.gc();
18271944 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281945 } else
1829
- if (event.getSource() == editLeafItem)
1946
+ if (source == editLeafItem)
18301947 {
18311948 Object3D obj;
18321949 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1957,66 @@
18401957 }
18411958 refreshContents(true);
18421959 } else
1843
- if (event.getSource() == openWindowItem)
1960
+ if (source == openWindowItem)
18441961 {
18451962 EditSelection(true);
18461963 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1964
+ if (source == cutItem || source == clearButton)
18481965 {
18491966 loadClipboard(true);
18501967 } else
1851
- if (event.getSource() == duplicateItem)
1968
+ if (source == duplicateItem)
18521969 {
18531970 Object3D keep = GrafreeD.clipboard;
18541971 loadClipboard(false);
18551972 paste(false);
18561973 GrafreeD.clipboard = keep;
18571974 } else
1858
- if (event.getSource() == cloneItem)
1975
+ if (source == cloneItem)
18591976 {
18601977 CloneSelection(false);
18611978 } else
1862
- if (event.getSource() == cloneSupportItem)
1979
+ if (source == cloneSupportItem)
18631980 {
18641981 CloneSelection(true);
18651982 } else
1866
- if (event.getSource() == copyItem)
1983
+ if (source == copyItem)
18671984 {
18681985 loadClipboard(false);
18691986 } else
1870
- if (event.getSource() == pasteItem)
1987
+ if (source == pasteItem)
18711988 {
18721989 paste(false);
18731990 } else
1874
- if (event.getSource() == pasteLinkItem)
1991
+ if (source == pasteIntoItem)
18751992 {
1876
- pasteInto(false);
1993
+ pasteInto(true, false);
18771994 } else
1878
- if (event.getSource() == pasteCloneItem)
1995
+ if (source == pasteLinkItem)
18791996 {
1880
- pasteInto(true);
1997
+ pasteInto(false, false);
18811998 } else
1882
- if (event.getSource() == pasteExpandItem)
1999
+ if (source == pasteCloneItem)
2000
+ {
2001
+ pasteInto(true, true);
2002
+ } else
2003
+ if (source == pasteExpandItem)
18832004 {
18842005 paste(true);
18852006 } else
1886
- if (event.getSource() == synchronizeItem)
2007
+ if (source == synchronizeItem)
18872008 {
18882009 Overwrite(Object3D.TRANSFORM);
18892010 } else
1890
- if (event.getSource() == overwriteNameItem)
2011
+ if (source == overwriteNameItem)
18912012 {
18922013 Overwrite(Object3D.NAME);
18932014 } else
1894
- if (event.getSource() == overwriteUVItem)
2015
+ if (source == overwriteUVItem)
18952016 {
18962017 Overwrite(Object3D.UV);
18972018 } else
1898
- if (event.getSource() == overwriteMatItem)
2019
+ if (source == overwriteMatItem)
18992020 {
19002021 /* july 2015
19012022 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2036,7 @@
19152036
19162037 Overwrite(dropAttributes);
19172038 }
1918
- if (event.getSource() == overwriteGeoItem)
2039
+ if (source == overwriteGeoItem)
19192040 {
19202041 Overwrite(Object3D.GEOMETRY);
19212042 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2053,7 @@
19322053 // refreshContents();
19332054 // }
19342055 } else
1935
- if (event.getSource() == generateMeshItem)
2056
+ if (source == generateMeshItem)
19362057 {
19372058 //if (group.selection.size() == 1)
19382059 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2064,7 @@
19432064 ResetModel();
19442065 refreshContents();
19452066 } else
1946
- if (event.getSource() == extractGeometriesItem)
2067
+ if (source == extractGeometriesItem)
19472068 {
19482069 boolean one = false;
19492070
....@@ -1970,7 +2091,7 @@
19702091 ResetModel();
19712092 refreshContents();
19722093 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2094
+ if (source == cloneGeometriesItem)
19742095 {
19752096 boolean one = false;
19762097
....@@ -1996,32 +2117,37 @@
19962117 ResetModel();
19972118 refreshContents();
19982119 } else
1999
- if (event.getSource() == shareGeometriesItem)
2120
+ if (source == shareGeometriesItem)
20002121 {
20012122 boolean one = false;
20022123
20032124 if (group.selection.size() == 1)
20042125 one = true;
20052126
2127
+ Object3D merge = null;
2128
+
20062129 Object3D content = new cGroup();
20072130
20082131 for (int i=0; i<group.selection.size(); i++)
20092132 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2133
+ merge = new Merge(group.selection.get(i));
20112134
20122135 if (one)
2013
- makeSomething(sel, false);
2136
+ makeSomething(merge, false);
20142137 else
2015
- content.addChild(sel);
2138
+ content.addChild(merge);
20162139 }
20172140
20182141 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2142
+ makeSomething(content, true);
2143
+ else
2144
+ {
2145
+ ResetModel();
2146
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2147
+ refreshContents();
2148
+ }
20232149 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2150
+ if (source == mergeGeometriesItem)
20252151 {
20262152 boolean one = false;
20272153
....@@ -2051,7 +2177,7 @@
20512177 ResetModel();
20522178 refreshContents();
20532179 } else
2054
- if (event.getSource() == linkverticesItem)
2180
+ if (source == linkverticesItem)
20552181 {
20562182 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572183 // {
....@@ -2071,32 +2197,41 @@
20712197 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722198 content = ((cGroup)content).get(0);
20732199
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2200
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752201 for (int i=0; i<group.selection.size(); i++)
20762202 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2203
+ boolean random = CameraPane.SWITCH;
2204
+ CameraPane.SWITCH = false; // parse all random nodes
20792205 group.selection.get(i).linkVerticesThis(content);
20802206 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
20822208 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2209
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842210 refreshContents();
20852211 }
20862212 } else
2087
- if (event.getSource() == resetsupportItem)
2213
+ if (source == resetsupportItem)
20882214 {
20892215 for (int i=0; i<group.selection.size(); i++)
20902216 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2217
+ boolean random = CameraPane.SWITCH;
2218
+ CameraPane.SWITCH = false; // parse all random nodes
20932219 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2220
+ CameraPane.SWITCH = random;
20952221 }
20962222
20972223 refreshContents();
20982224 } else
2099
- if (event.getSource() == resetreferencesItem)
2225
+ if (source == relinkverticesItem)
2226
+ {
2227
+ boolean random = CameraPane.SWITCH;
2228
+ CameraPane.SWITCH = false; // parse all random nodes
2229
+ group.selection.RelinkToSupport();
2230
+ CameraPane.SWITCH = random;
2231
+
2232
+ refreshContents();
2233
+ } else
2234
+ if (source == resetreferencesItem)
21002235 {
21012236 for (int i=0; i<group.selection.size(); i++)
21022237 {
....@@ -2105,7 +2240,7 @@
21052240
21062241 refreshContents();
21072242 } else
2108
- if (event.getSource() == setMasterItem)
2243
+ if (source == setMasterItem)
21092244 {
21102245 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112246 {
....@@ -2118,7 +2253,7 @@
21182253 refreshContents();
21192254 }
21202255 } else
2121
- if (event.getSource() == poseMeshItem)
2256
+ if (source == poseMeshItem)
21222257 {
21232258 if (group.selection.size() == 1)
21242259 {
....@@ -2137,19 +2272,19 @@
21372272 }
21382273
21392274 } else
2140
- if (event.getSource() == revertMeshItem)
2275
+ if (source == revertMeshItem)
21412276 {
21422277 RevertMeshes();
21432278 } else
2144
- if (event.getSource() == resetMeshItem)
2279
+ if (source == resetMeshItem)
21452280 {
21462281 ResetAll();
21472282 } else
2148
- if (event.getSource() == stepAllItem)
2283
+ if (source == stepAllItem)
21492284 {
21502285 StepAll();
21512286 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2287
+ if (source == clearItem) // || event.getSource() == clearButton)
21532288 {
21542289 //int indices[] = jList.getSelectedIndices();
21552290 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2292,46 @@
21572292
21582293 ClearSelection(false);
21592294 } else
2160
- if (event.getSource() == clearAllItem)
2295
+ if (source == clearAllItem)
21612296 {
21622297 ClearSelection(true);
21632298 } else
2164
- if (event.getSource() == grabItem)
2299
+ if (source == grabItem)
21652300 {
21662301 group(new cGroup(), true);
21672302 } else
2168
- if (event.getSource() == frontItem)
2303
+ if (source == hideItem)
2304
+ {
2305
+ group(new HiddenObject());
2306
+ } else
2307
+ if (source == frontItem)
21692308 {
21702309 front();
21712310 } else
2172
- if (event.getSource() == backItem)
2311
+ if (source == backItem)
21732312 {
21742313 back();
21752314 } else
2176
- if (event.getSource() == cameraItem)
2315
+ if (source == cameraItem)
21772316 {
21782317 makeSomething(new Camera());
21792318 } else
2180
- if (event.getSource() == compositeItem)
2319
+ if (source == compositeItem)
21812320 {
21822321 group(new Composite());
21832322 } else
2184
- if (event.getSource() == randomItem)
2323
+ if (source == randomItem)
21852324 {
21862325 RandomNode random = new RandomNode();
21872326 group(random);
21882327 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2328
+ random.name = random.get(0).name + "Switch";
21902329 } else
2191
- if (event.getSource() == physicsItem)
2330
+ if (source == physicsItem)
21922331 {
21932332 group(new PhysicsNode());
21942333 } else
2195
- if (event.getSource() == frameselectorItem)
2334
+ if (source == frameselectorItem)
21962335 {
21972336 for (int i=0; i<group.selection.size(); i++)
21982337 {
....@@ -2204,7 +2343,7 @@
22042343 ResetModel();
22052344 refreshContents();
22062345 } else
2207
- if (event.getSource() == switchGeoItem)
2346
+ if (source == switchGeoItem)
22082347 {
22092348 for (int i=0; i<group.selection.size(); i++)
22102349 {
....@@ -2216,7 +2355,7 @@
22162355 ResetModel();
22172356 refreshContents();
22182357 } else
2219
- if (event.getSource() == switchTransfoItem)
2358
+ if (source == switchTransfoItem)
22202359 {
22212360 for (int i=0; i<group.selection.size(); i++)
22222361 {
....@@ -2228,7 +2367,7 @@
22282367 ResetModel();
22292368 refreshContents();
22302369 } else
2231
- if (event.getSource() == morphItem)
2370
+ if (source == morphItem)
22322371 {
22332372 for (int i=0; i<group.selection.size(); i++)
22342373 {
....@@ -2240,7 +2379,7 @@
22402379 ResetModel();
22412380 refreshContents();
22422381 } else
2243
- if (event.getSource() == scriptNodeItem)
2382
+ if (source == scriptNodeItem)
22442383 {
22452384 boolean atleastone = false;
22462385
....@@ -2279,199 +2418,215 @@
22792418 }
22802419 }
22812420 } else
2282
- if (event.getSource() == linkerItem)
2421
+ if (source == linkerItem)
22832422 {
22842423 group(new cLinker());
22852424 } else
2286
- if (event.getSource() == textureItem)
2425
+ if (source == textureItem)
22872426 {
22882427 group(new TextureNode());
22892428 } else
2290
- if (event.getSource() == shadowXItem)
2429
+ if (source == billboardItem)
2430
+ {
2431
+ group(new BillboardNode());
2432
+ } else
2433
+ if (source == shadowXItem)
22912434 {
22922435 CastShadow(0);
22932436 } else
2294
- if (event.getSource() == shadowYItem)
2437
+ if (source == shadowYItem)
22952438 {
22962439 CastShadow(1);
22972440 } else
2298
- if (event.getSource() == shadowZItem)
2441
+ if (source == shadowZItem)
22992442 {
23002443 CastShadow(2);
23012444 } else
2302
- if (event.getSource() == ungroupItem)
2445
+ if (source == ungroupItem)
23032446 {
2304
- ungroup();
2447
+ //ungroup();
2448
+ for (int i=0; i<group.selection.size(); i++)
2449
+ {
2450
+ Ungroup(group.selection.get(i));
2451
+ }
2452
+
2453
+ ClearSelection(false);
2454
+
2455
+ refreshContents();
23052456 } else
2306
- if (event.getSource() == genUVItem)
2457
+ if (source == genUVItem)
23072458 {
23082459 GenUV();
23092460 } else
2310
- if (event.getSource() == genNormalsCADItem)
2461
+ if (source == genNormalsCADItem)
23112462 {
23122463 GenNormals(true);
23132464 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2465
+ if (source == genNormalsMESHItem)
23152466 {
23162467 GenNormals(true); // TODO
23172468 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2469
+ if (source == genNormalsORGANItem)
23192470 {
23202471 GenNormals(false);
23212472 } else
2322
- if (event.getSource() == stripifyItem)
2473
+ if (source == genNormalsMINEItem)
2474
+ {
2475
+ GenNormalsMINE();
2476
+ } else
2477
+ if (source == stripifyItem)
23232478 {
23242479 Stripify();
23252480 } else
2326
- if (event.getSource() == unstripifyItem)
2481
+ if (source == unstripifyItem)
23272482 {
23282483 Unstripify();
23292484 } else
2330
- if (event.getSource() == trimItem)
2485
+ if (source == trimItem)
23312486 {
23322487 Trim();
23332488 } else
2334
- if (event.getSource() == untrimItem)
2489
+ if (source == untrimItem)
23352490 {
23362491 Untrim();
23372492 } else
2338
- if (event.getSource() == clearColorsItem)
2493
+ if (source == clearColorsItem)
23392494 {
23402495 ClearColors();
23412496 } else
2342
- if (event.getSource() == clearMaterialsItem)
2497
+ if (source == clearMaterialsItem)
23432498 {
23442499 ClearMaterials();
23452500 } else
2346
- if (event.getSource() == liveleavesItem)
2501
+ if (source == liveleavesItem)
23472502 {
23482503 LiveLeaves(true);
23492504 } else
2350
- if (event.getSource() == unliveleavesItem)
2505
+ if (source == unliveleavesItem)
23512506 {
23522507 LiveLeaves(false);
23532508 } else
2354
- if (event.getSource() == supportleavesItem)
2509
+ if (source == supportleavesItem)
23552510 {
23562511 SupportLeaves(true);
23572512 } else
2358
- if (event.getSource() == unsupportleavesItem)
2513
+ if (source == unsupportleavesItem)
23592514 {
23602515 SupportLeaves(false);
23612516 } else
2362
- if (event.getSource() == hideleavesItem)
2517
+ if (source == hideleavesItem)
23632518 {
23642519 HideLeaves(true);
23652520 } else
2366
- if (event.getSource() == showleavesItem)
2521
+ if (source == showleavesItem)
23672522 {
23682523 HideLeaves(false);
23692524 } else
2370
- if (event.getSource() == markleavesItem)
2525
+ if (source == markleavesItem)
23712526 {
23722527 MarkLeaves(true);
23732528 } else
2374
- if (event.getSource() == unmarkleavesItem)
2529
+ if (source == unmarkleavesItem)
23752530 {
23762531 MarkLeaves(false);
23772532 } else
2378
- if (event.getSource() == flipVItem)
2533
+ if (source == flipVItem)
23792534 {
23802535 FlipV(true);
23812536 } else
2382
- if (event.getSource() == unflipVItem)
2537
+ if (source == unflipVItem)
23832538 {
23842539 FlipV(false);
23852540 } else
2386
- if (event.getSource() == lowTexturesItem)
2541
+ if (source == lowTexturesItem)
23872542 {
23882543 SetTexRes(0);
23892544 } else
2390
- if (event.getSource() == normalTexturesItem)
2545
+ if (source == normalTexturesItem)
23912546 {
23922547 SetTexRes(1);
23932548 } else
2394
- if (event.getSource() == highTexturesItem)
2549
+ if (source == highTexturesItem)
23952550 {
23962551 SetTexRes(2);
23972552 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2553
+ if (source == veryhighTexturesItem)
23992554 {
24002555 SetTexRes(3);
24012556 } else
2402
- if (event.getSource() == maxTexturesItem)
2557
+ if (source == maxTexturesItem)
24032558 {
24042559 SetTexRes(4);
24052560 } else
2406
- if (event.getSource() == panoTexturesItem)
2561
+ if (source == panoTexturesItem)
24072562 {
24082563 SetTexRes(5);
24092564 } else
2410
- if (event.getSource() == reverseNormalsItem)
2565
+ if (source == reverseNormalsItem)
24112566 {
24122567 ReverseNormals();
24132568 } else
2414
- if (event.getSource() == parseverticesItem)
2569
+ if (source == parseverticesItem)
24152570 {
24162571 ParseVertices();
24172572 } else
2418
- if (event.getSource() == textureFieldItem)
2573
+ if (source == textureFieldItem)
24192574 {
24202575 TextureVertices();
24212576 } else
2422
- if (event.getSource() == alignItem)
2577
+ if (source == alignItem)
24232578 {
24242579 Align();
24252580 } else
2426
- if (event.getSource() == mirrorItem)
2581
+ if (source == mirrorItem)
24272582 {
24282583 MirrorPoses();
24292584 } else
2430
- if (event.getSource() == reduceMorphItem)
2585
+ if (source == reduceMorphItem)
24312586 {
24322587 MeshReduction(false);
24332588 } else
2434
- if (event.getSource() == reduce34MorphItem)
2589
+ if (source == reduce34MorphItem)
24352590 {
24362591 MeshReduction(true);
24372592 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2593
+ if (source == reverseTrianglesItem)
24392594 {
24402595 ReverseTriangles();
24412596 } else
2442
- if (event.getSource() == reduceMeshItem)
2597
+ if (source == reduceMeshItem)
24432598 {
24442599 ReduceMesh(false);
24452600 } else
2446
- if (event.getSource() == reduce34MeshItem)
2601
+ if (source == reduce34MeshItem)
24472602 {
24482603 ReduceMesh(true);
24492604 } else
2450
- if (event.getSource() == increaseMeshItem)
2605
+ if (source == increaseMeshItem)
24512606 {
24522607 IncreaseMesh();
24532608 } else
2454
- if (event.getSource() == clipMeshItem)
2609
+ if (source == clipMeshItem)
24552610 {
24562611 ClipMesh();
24572612 } else
2458
- if (event.getSource() == smoothMeshItem)
2613
+ if (source == smoothMeshItem)
24592614 {
24602615 SmoothMesh();
24612616 } else
2462
- if (event.getSource() == transformgeometryItem)
2617
+ if (source == transformgeometryItem)
24632618 {
24642619 TransformGeometry();
24652620 } else
2466
- if (event.getSource() == resetTransformItem)
2621
+ if (source == resetTransformItem)
24672622 {
24682623 ResetTransform();
24692624 } else
2470
- if (event.getSource() == resetCentroidItem)
2625
+ if (source == resetCentroidItem)
24712626 {
24722627 ResetCentroid();
24732628 } else
2474
- if (event.getSource() == resetParentItem)
2629
+ if (source == resetParentItem)
24752630 {
24762631 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772632 {
....@@ -2481,7 +2636,7 @@
24812636
24822637 refreshContents();
24832638 } else
2484
- if (event.getSource() == repairParentItem)
2639
+ if (source == repairParentItem)
24852640 {
24862641 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872642 {
....@@ -2495,7 +2650,21 @@
24952650
24962651 refreshContents();
24972652 } else
2498
- if (event.getSource() == sortbysizeItem)
2653
+ if (source == repairShadowItem)
2654
+ {
2655
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2656
+ {
2657
+ Object3D obj = (Object3D)e.nextElement();
2658
+ obj.RepairShadow();
2659
+// for (int i=0; i<obj.size(); i++)
2660
+// {
2661
+// obj.get(i).parent = obj;
2662
+// }
2663
+ }
2664
+
2665
+ refreshContents();
2666
+ } else
2667
+ if (source == sortbysizeItem)
24992668 {
25002669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012670 {
....@@ -2507,7 +2676,7 @@
25072676 ResetModel();
25082677 refreshContents();
25092678 } else
2510
- if (event.getSource() == sortbynameItem)
2679
+ if (source == sortbynameItem)
25112680 {
25122681 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132682 {
....@@ -2519,7 +2688,7 @@
25192688 ResetModel();
25202689 refreshContents();
25212690 } else
2522
- if (event.getSource() == attachPigmentItem)
2691
+ if (source == attachPigmentItem)
25232692 {
25242693 String texture = GetFile("Attach pigment");
25252694 Object3D obj;
....@@ -2531,7 +2700,7 @@
25312700
25322701 refreshContents();
25332702 } else
2534
- if (event.getSource() == detachPigmentItem)
2703
+ if (source == detachPigmentItem)
25352704 {
25362705 Object3D obj;
25372706 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2711,7 @@
25422711
25432712 refreshContents();
25442713 } else
2545
- if (event.getSource() == attachBumpItem)
2714
+ if (source == attachBumpItem)
25462715 {
25472716 String texture = GetFile("Attach bump");
25482717 Object3D obj;
....@@ -2554,7 +2723,7 @@
25542723
25552724 refreshContents();
25562725 } else
2557
- if (event.getSource() == detachBumpItem)
2726
+ if (source == detachBumpItem)
25582727 {
25592728 Object3D obj;
25602729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2734,7 @@
25652734
25662735 refreshContents();
25672736 } else
2568
- if (event.getSource() == pigmentBumpItem)
2737
+ if (source == pigmentBumpItem)
25692738 {
25702739 Object3D obj;
25712740 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2745,195 @@
25762745
25772746 refreshContents();
25782747 } else
2579
- if (event.getSource() == flashSelectionButton)
2748
+ if (source == flashSelectionButton)
25802749 {
25812750 CameraPane.flash = true;
25822751 refreshContents();
25832752 } else
2584
- if (event.getSource() == oneButton)
2753
+ if (source == oneButton)
25852754 {
25862755 } else
2587
- if (event.getSource() == twoButton)
2756
+ if (source == twoButton)
25882757 {
25892758 radio.layout = twoButton;
25902759 // bug
25912760 //gridPanel.setDividerLocation(1.0);
25922761 //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();
2762
+// bigThree.remove(scenePanel);
2763
+// bigThree.remove(centralPanel);
2764
+// bigThree.remove(XYZPanel);
2765
+// aWindowConstraints.gridx = 0;
2766
+// aWindowConstraints.gridy = 0;
2767
+// aWindowConstraints.gridwidth = 1;
2768
+// // aConstraints.gridheight = 3;
2769
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.weighty = 1;
2772
+// //bigThree.add(jtp, aWindowConstraints);
2773
+// aWindowConstraints.weightx = 1;
2774
+// aWindowConstraints.gridwidth = 3;
2775
+// // aConstraints.gridheight = 3;
2776
+// aWindowConstraints.gridx = 1;
2777
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2778
+// bigThree.add(centralPanel, aWindowConstraints);
2779
+// aWindowConstraints.weightx = 0;
2780
+// aWindowConstraints.gridx = 4;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// //bigThree.add(XYZPanel, aWindowConstraints);
2785
+// scenePanel.setVisible(false);
2786
+// centralPanel.setVisible(true);
2787
+// XYZPanel.setVisible(false);
2788
+ bigThree.ClearUI();
2789
+ bigThree.add(centralPanel);
2790
+ bigThree.FlushUI();
26172791 } else
2618
- if (event.getSource() == threeButton)
2792
+ if (source == threeButton)
26192793 {
26202794 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();
2795
+
2796
+// bigThree.remove(scenePanel);
2797
+// bigThree.remove(centralPanel);
2798
+// bigThree.remove(XYZPanel);
2799
+// aWindowConstraints.gridx = 0;
2800
+// aWindowConstraints.gridy = 0;
2801
+// aWindowConstraints.gridwidth = 1;
2802
+// // aConstraints.gridheight = 3;
2803
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2804
+// aWindowConstraints.weightx = 0;
2805
+// aWindowConstraints.weighty = 1;
2806
+// //bigThree.add(jtp, aWindowConstraints);
2807
+// aWindowConstraints.weightx = 1;
2808
+// aWindowConstraints.gridwidth = 3;
2809
+// // aConstraints.gridheight = 3;
2810
+// aWindowConstraints.gridx = 1;
2811
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2812
+// bigThree.add(centralPanel, aWindowConstraints);
2813
+// aWindowConstraints.weightx = 0;
2814
+// aWindowConstraints.gridx = 4;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// bigThree.add(XYZPanel, aWindowConstraints);
2819
+// bigThree.validate();
2820
+// scenePanel.setVisible(false);
2821
+// centralPanel.setVisible(true);
2822
+// XYZPanel.setVisible(true);
2823
+ bigThree.ClearUI();
2824
+ bigThree.add(centralPanel);
2825
+ bigThree.add(XYZPanel);
2826
+ bigThree.FlushUI();
26452827 } else
2646
- if (event.getSource() == fourButton)
2828
+ if (source == fourButton)
26472829 {
26482830 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();
2831
+
2832
+// bigThree.remove(scenePanel);
2833
+// bigThree.remove(centralPanel);
2834
+// bigThree.remove(XYZPanel);
2835
+// aWindowConstraints.gridx = 0;
2836
+// aWindowConstraints.gridy = 0;
2837
+// aWindowConstraints.gridwidth = 1;
2838
+// // aWindowConstraints.gridheight = 3;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// aWindowConstraints.weightx = 1;
2841
+// aWindowConstraints.weighty = 1;
2842
+// bigThree.add(scenePanel, aWindowConstraints);
2843
+// aWindowConstraints.weightx = 1;
2844
+// aWindowConstraints.gridwidth = 3;
2845
+// // aConstraints.gridheight = 3;
2846
+// aWindowConstraints.gridx = 1;
2847
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2848
+// //bigThree.add(cameraPanel, aWindowConstraints);
2849
+// aWindowConstraints.weightx = 0;
2850
+// aWindowConstraints.gridx = 4;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2854
+// //bigThree.add(XYZPanel, aWindowConstraints);
2855
+// bigThree.validate();
2856
+// scenePanel.setVisible(true);
2857
+// centralPanel.setVisible(false);
2858
+// XYZPanel.setVisible(false);
2859
+ bigThree.ClearUI();
2860
+ bigThree.add(scenePanel);
2861
+ bigThree.FlushUI();
26732862 } else
2674
- if (event.getSource() == sixButton)
2863
+ if (source == sixButton)
26752864 {
26762865 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();
2866
+
2867
+// bigThree.remove(scenePanel);
2868
+// bigThree.remove(centralPanel);
2869
+// bigThree.remove(XYZPanel);
2870
+// aWindowConstraints.gridx = 0;
2871
+// aWindowConstraints.gridy = 0;
2872
+// aWindowConstraints.gridwidth = 1;
2873
+// // aConstraints.gridheight = 3;
2874
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2875
+// aWindowConstraints.weightx = 0;
2876
+// aWindowConstraints.weighty = 1;
2877
+// bigThree.add(scenePanel, aWindowConstraints);
2878
+// aWindowConstraints.weightx = 1;
2879
+// aWindowConstraints.gridwidth = 3;
2880
+// // aWindowConstraints.gridheight = 3;
2881
+// aWindowConstraints.gridx = 1;
2882
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2883
+// bigThree.add(centralPanel, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 0;
2885
+// aWindowConstraints.gridx = 4;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aWindowConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// //bigThree.add(XYZPanel, aConstraints);
2890
+// bigThree.validate();
2891
+// scenePanel.setVisible(true);
2892
+// centralPanel.setVisible(true);
2893
+// XYZPanel.setVisible(false);
2894
+ bigThree.ClearUI();
2895
+ bigThree.add(scenePanel);
2896
+ bigThree.add(centralPanel);
2897
+ bigThree.FlushUI();
27012898 } else
2702
- if (event.getSource() == sevenButton)
2899
+ if (source == sevenButton)
27032900 {
27042901 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();
2902
+
2903
+// bigThree.remove(scenePanel);
2904
+// bigThree.remove(centralPanel);
2905
+// bigThree.remove(XYZPanel);
2906
+// aWindowConstraints.gridx = 0;
2907
+// aWindowConstraints.gridy = 0;
2908
+// aWindowConstraints.gridwidth = 1;
2909
+// // aWindowConstraints.gridheight = 3;
2910
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2911
+// aWindowConstraints.weightx = 0;
2912
+// aWindowConstraints.weighty = 1;
2913
+// bigThree.add(scenePanel, aWindowConstraints);
2914
+// aWindowConstraints.weightx = 1;
2915
+// aWindowConstraints.gridwidth = 3;
2916
+// // aWindowConstraints.gridheight = 3;
2917
+// aWindowConstraints.gridx = 1;
2918
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2919
+// bigThree.add(centralPanel, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 0;
2921
+// aWindowConstraints.gridx = 4;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// bigThree.add(XYZPanel, aWindowConstraints);
2926
+// bigThree.validate();
2927
+// scenePanel.setVisible(true);
2928
+// centralPanel.setVisible(true);
2929
+// XYZPanel.setVisible(true);
2930
+ bigThree.ClearUI();
2931
+ bigThree.add(scenePanel);
2932
+ bigThree.add(centralPanel);
2933
+ bigThree.add(XYZPanel);
2934
+ bigThree.FlushUI();
27292935 } else
2730
- if (event.getSource() == rootButton)
2936
+ if (source == rootButton)
27312937 {
27322938 Object3D obj;
27332939 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2945,7 @@
27392945
27402946 refreshContents(true);
27412947 } else
2742
- if (event.getSource() == closeButton)
2948
+ if (source == closeButton)
27432949 {
27442950 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452951 cRadio ab;
....@@ -2760,11 +2966,11 @@
27602966 }
27612967 refreshContents(true);
27622968 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2969
+ if (source == editItem || source == editButton)
27642970 {
27652971 EditSelection(false);
27662972 } else
2767
- if (event.getSource() == uneditButton)
2973
+ if (source == uneditButton)
27682974 {
27692975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702976 {
....@@ -2776,12 +2982,12 @@
27762982
27772983 child.editWindow = null; // ???????????
27782984 }
2779
- objEditor.ctrlPanel.revalidate();
2985
+ objEditor.ctrlPanel.FlushUI();
27802986 //objEditor.jTree.clearSelection();
27812987 //objEditor.ResetSliders();
27822988 refreshContents(true);
27832989 } else
2784
- if (event.getSource() == clearPanelButton)
2990
+ if (source == clearPanelButton)
27852991 {
27862992 assert(copy == group);
27872993 //copy.ClearUI();
....@@ -2792,7 +2998,7 @@
27922998 listUI.clear();
27932999 refreshContents(true);
27943000 } else
2795
- if (event.getSource() == allParamsButton)
3001
+ if (source == allParamsButton)
27963002 {
27973003 assert(copy == group);
27983004
....@@ -2813,19 +3019,19 @@
28133019
28143020 refreshContents(true);
28153021 } else
2816
- if (event.getSource() == unselectButton)
3022
+ if (source == unselectButton)
28173023 {
28183024 objEditor.jTree.clearSelection();
28193025 // ?? oct 2012 GrafreeD.clipboard.clear();
28203026 objEditor.ResetSliders();
28213027 refreshContents(true);
28223028 } else
2823
- if(event.getSource() instanceof cRadio)
3029
+ if(source instanceof cRadio)
28243030 {
28253031 group.parent = keepparent;
28263032 group.attributes = 0;
28273033 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3034
+ /*cRadio*/ radio = (cRadio)source;
28293035 Object3D obj = radio.GetObject();
28303036 System.out.println("Edit " + obj);
28313037 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3051,7 @@
28453051 }
28463052
28473053 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3054
+ //Globals.theRenderer.object = group;
28493055 if(!useclient)
28503056 {
28513057 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +3060,8 @@
28543060 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553061 cameraView.targetLookAt.set(radio.camera.lookAt);
28563062 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3063
+ //cameraView.lighttouched = true;
3064
+ Globals.lighttouched = true;
28583065 topView.object = group;
28593066 frontView.object = group;
28603067 sideView.object = group;
....@@ -2890,7 +3097,7 @@
28903097 if (useclient)
28913098 {
28923099 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3100
+ Globals.lighttouched = true;
28943101 //topView.object = client;
28953102 //frontView.object = client;
28963103 //sideView.object = client;
....@@ -2898,7 +3105,7 @@
28983105 else
28993106 {
29003107 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3108
+ Globals.lighttouched = true;
29023109 //topView.object = group;
29033110 //frontView.object = group;
29043111 //sideView.object = group;
....@@ -3179,6 +3386,13 @@
31793386 refreshContents();
31803387 }
31813388
3389
+ void GenNormalsMINE()
3390
+ {
3391
+ group.selection.GenNormalsMINE();
3392
+
3393
+ refreshContents();
3394
+ }
3395
+
31823396 void Stripify()
31833397 {
31843398 group.StripifyS();
....@@ -3399,7 +3613,7 @@
33993613 String pigment = Object3D.GetPigment(tex);
34003614 //String bump = Object3D.GetBump(tex);
34013615
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3616
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34033617
34043618 double s = v.s;
34053619
....@@ -3447,12 +3661,26 @@
34473661
34483662 void Align()
34493663 {
3664
+ if (group.selection.size() == 0)
3665
+ return;
3666
+
3667
+ cVector bbmin = new cVector();
3668
+ cVector bbmax = new cVector();
3669
+
3670
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3671
+
3672
+ double dx = bbmax.x - bbmin.x;
3673
+ double dy = bbmax.y - bbmin.y;
3674
+ double dz = bbmax.z - bbmin.z;
3675
+
3676
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3677
+
34503678 for (int i=0; i<group.selection.size(); i++)
34513679 {
34523680 Object3D obj = group.selection.get(i);
34533681
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3682
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3683
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563684 }
34573685
34583686 refreshContents();
....@@ -3473,11 +3701,11 @@
34733701
34743702 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753703
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3704
+ boolean random = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false; // parse all random nodes
34783706 lowres.linkVerticesThis(null);
34793707 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3708
+ CameraPane.SWITCH = random;
34813709
34823710 System.err.flush();
34833711
....@@ -3686,7 +3914,7 @@
36863914 group.selection.RelinkToSupport(); // july 2014
36873915 System.out.println("DONE.");
36883916 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3917
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36903918 }
36913919
36923920 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4190,25 @@
39624190 System.err.println("info : " + child.GetPath());
39634191 }
39644192 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4193
+// else
4194
+// {
4195
+// objEditor.SetMaterial(group); // .GetMaterial());
4196
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4197
+// System.err.println("info : " + group.GetPath());
4198
+// }
39714199
39724200 objEditor.SetText(); // jan 2014
39734201
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4202
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754203 CameraPane.flash = true;
39764204
39774205 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784206 // a camera
39794207 {
39804208 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;
4209
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4210
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4211
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844212 }
39854213
39864214 refreshContents();
....@@ -4235,7 +4463,7 @@
42354463 refreshContents();
42364464 }
42374465
4238
- void pasteInto(boolean copyit)
4466
+ void pasteInto(boolean copyit, boolean clone)
42394467 {
42404468 // if (GrafreeD.clipboard == null)
42414469 // return;
....@@ -4264,7 +4492,14 @@
42644492 if (copyit)
42654493 {
42664494 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4495
+ if (clone)
4496
+ {
4497
+ CloneClipboard(false); // sept 2014
4498
+ }
4499
+ else
4500
+ {
4501
+ paste(false);
4502
+ }
42684503 }
42694504 else
42704505 {
....@@ -4474,6 +4709,26 @@
44744709 makeSomething(csg);
44754710 }
44764711
4712
+ void Ungroup(Object3D g)
4713
+ {
4714
+ if (g instanceof HiddenObject)
4715
+ {
4716
+ HiddenObject h = (HiddenObject) g;
4717
+
4718
+ for (int i=0; i<h.ActualSize(); i++)
4719
+ {
4720
+ objEditor.makeSomething(h.get(i), false);
4721
+ }
4722
+ }
4723
+ else
4724
+ {
4725
+ for (int i=0; i<g.Size(); i++)
4726
+ {
4727
+ objEditor.makeSomething(g.get(i), false);
4728
+ }
4729
+ }
4730
+ }
4731
+
44774732 void ungroup()
44784733 {
44794734 /*
....@@ -4788,10 +5043,12 @@
47885043 cButton flashSelectionButton;
47895044 cButton editButton;
47905045 cButton uneditButton;
5046
+ JCheckBox allParamsButton;
47915047 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935048 cButton unselectButton;
47945049
5050
+ cButton oneStepButton;
5051
+
47955052 cButton screenfitButton;
47965053 cButton screenfitpointButton;
47975054 cButton snapobjectButton;
....@@ -4833,6 +5090,7 @@
48335090 private MenuItem resetsupportItem;
48345091 private MenuItem resetreferencesItem;
48355092 private MenuItem linkverticesItem;
5093
+ private MenuItem relinkverticesItem;
48365094 private MenuItem setMasterItem;
48375095 private MenuItem resetMeshItem;
48385096 private MenuItem stepAllItem;
....@@ -4845,6 +5103,7 @@
48455103 private MenuItem mergeGeometriesItem;
48465104 private MenuItem copyItem;
48475105 private MenuItem pasteItem;
5106
+ private MenuItem pasteIntoItem;
48485107 private MenuItem pasteLinkItem;
48495108 private MenuItem pasteCloneItem;
48505109 private MenuItem pasteExpandItem;
....@@ -4854,6 +5113,7 @@
48545113 private MenuItem genNormalsMESHItem;
48555114 private MenuItem genNormalsCADItem;
48565115 private MenuItem genNormalsORGANItem;
5116
+ private MenuItem genNormalsMINEItem;
48575117 private MenuItem stripifyItem;
48585118 private MenuItem unstripifyItem;
48595119 private MenuItem trimItem;
....@@ -4895,6 +5155,7 @@
48955155 private MenuItem resetCentroidItem;
48965156 private MenuItem transformgeometryItem;
48975157 private MenuItem resetTransformItem;
5158
+ private MenuItem hideItem;
48985159 private MenuItem grabItem;
48995160 private MenuItem backItem;
49005161 private MenuItem frontItem;
....@@ -4915,6 +5176,7 @@
49155176
49165177 private MenuItem resetParentItem;
49175178 private MenuItem repairParentItem;
5179
+ private MenuItem repairShadowItem;
49185180 private MenuItem sortbysizeItem;
49195181 private MenuItem sortbynameItem;
49205182
....@@ -4935,10 +5197,11 @@
49355197 private MenuItem coneItem;
49365198 private MenuItem torusItem;
49375199 private MenuItem superItem;
5200
+ private MenuItem kleinItem;
49385201 private MenuItem blobItem;
49395202 private MenuItem latheItem;
49405203 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5204
+ private MenuItem overlayItem;
49425205 private MenuItem meshItem;
49435206 // private MenuItem meshGroupItem;
49445207 private MenuItem springItem;
....@@ -4947,6 +5210,7 @@
49475210 private MenuItem csgItem;
49485211 private MenuItem templateItem;
49495212 private MenuItem textureItem;
5213
+ private MenuItem billboardItem;
49505214 private MenuItem shadowXItem;
49515215 private MenuItem shadowYItem;
49525216 private MenuItem shadowZItem;