Normand Briere
2019-05-02 a7277e6c6381e55761f7fa87276260fac1c94d5e
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,11 +433,11 @@
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"));
385442 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386443 importGFDItem.addActionListener(this);
....@@ -425,150 +482,98 @@
425482 oe.radioPanel.add(dummyButton);
426483 oe.buttonGroup.add(dummyButton);
427484 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
485
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431486
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
487
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
+ liveCB.setToolTipText("Enabled animation");
433489 liveCB.addItemListener(this);
434490
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);
491
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ oneStepButton.setToolTipText("Animate one step forward");
493
+ oneStepButton.addActionListener(this);
494
+
495
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
496
+ fastCB.setToolTipText("Fast mode");
453497 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);
498
+
499
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
500
+ trackCB.setToolTipText("Enable tracking");
495501 trackCB.addItemListener(this);
496502
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ screenfitButton.setToolTipText("Screen fit");
499505 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
506
+
501507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502508 // 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;
507509
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);
510
+ if (Globals.ADVANCED)
511
+ {
512
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ snapobjectButton.addActionListener(this);
514
+ snapobjectButton.setToolTipText("Snap Object");
515
+ }
516
+
517
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
518
+ flashSelectionButton.setToolTipText("Show selection");
514519 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518520
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
521
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522
+
523
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
524
+ twoButton.setToolTipText("Show center view only");
521525 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523527 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
528
+ fourButton.setToolTipText("Show left panel only");
529
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
530
+ sixButton.setToolTipText("2-column layout left");
525531 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ threeButton.setToolTipText("2-column layout right");
527534 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ sevenButton.setToolTipText("3-column layout");
529537 sevenButton.addActionListener(this);
530538 //
531539
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
541
+ rootButton.setToolTipText("Edit selection in new tab");
533542 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
543
+
544
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
545
+ closeButton.setToolTipText("Close tab");
536546 closeButton.addActionListener(this);
537547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538548 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540549
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
550
+ cGridBag commandsPanel = new cGridBag();
551
+
552
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
+ editButton.setToolTipText("Edit selection");
543554 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547555
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
549558 uneditButton.addActionListener(this);
550559
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);
560
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
+ allParamsButton.setToolTipText("Edit all params");
563562 allParamsButton.addActionListener(this);
564563
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);
564
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
565
+ clearPanelButton.setToolTipText("Clear edit panel");
566
+ clearPanelButton.addActionListener(this);
567
+
568
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569
+ unselectButton.setToolTipText("Unselect");
570570 unselectButton.addActionListener(this);
571571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
572577 // oe.aConstraints.gridx += 1;
573578 // oe.aConstraints.weighty = 0;
574579 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +585,37 @@
580585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581586 // gcButton.addActionListener(this);
582587
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;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
594591 //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);
592
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596593 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
601597
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);
598
+ cGridBag copyOptionsPanel = new cGridBag();
599
+
600
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
+ colorCB.setToolTipText("Copy color when dropped");
606602 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
603
+
604
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
+ materialCB.setToolTipText("Copy material when dropped");
609606 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
607
+
608
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
+ textureCB.setToolTipText("Copy texture when dropped");
612610 textureCB.addItemListener(this);
613611
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
616615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
617619 //jList.addListSelectionListener(this);
618620 oe.jTree.addTreeSelectionListener(this);
619621 //jTree.setRootVisible(false);
....@@ -635,17 +637,89 @@
635637 radio.layout = sevenButton;
636638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637639 }
640
+
641
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
642
+ {
643
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
644
+ boxCB.setToolTipText("Display bounding boxes");
645
+ boxCB.addItemListener(this);
646
+
647
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
648
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649
+ zoomBoxCB.addItemListener(this);
650
+
651
+ if (Globals.ADVANCED)
652
+ {
653
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
+ supportCB.setToolTipText("Enable rigging");
655
+ supportCB.addItemListener(this);
656
+
657
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
658
+ // localCB.addItemListener(this);
659
+
660
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
661
+ crowdCB.setToolTipText("Used for crowds");
662
+ crowdCB.addItemListener(this);
663
+
664
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
665
+ smoothCB.setToolTipText("Snapping delay");
666
+ smoothCB.addItemListener(this);
667
+
668
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
669
+ slowCB.setToolTipText("Smooth interpolation");
670
+ slowCB.addItemListener(this);
671
+
672
+// constraints.gridy += 1;
673
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
674
+// speakerMocapCB.addItemListener(this);
675
+
676
+ if (false)
677
+ {
678
+ // handled in scripts
679
+ //constraints.gridy += 1;
680
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
681
+ speakerCameraCB.addItemListener(this);
682
+
683
+ //constraints.gridy += 1;
684
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
685
+ speakerFocusCB.addItemListener(this);
686
+
687
+ //constraints.gridy += 1;
688
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
689
+ smoothfocusCB.addItemListener(this);
690
+ }
691
+
692
+//constraints.gridx += 1;
693
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
694
+// debugCB.addItemListener(this);
695
+
696
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
697
+ oeilCB.addItemListener(this);
698
+
699
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
700
+ lookAtCB.setToolTipText("Look-at target");
701
+ lookAtCB.addItemListener(this);
702
+
703
+ }
704
+
705
+ cGridBag fill = new cGridBag();
706
+
707
+ fill.preferredHeight = 200;
708
+
709
+ panel.add(fill);
710
+
711
+ }
638712
639713 void EditObject(Object3D obj)
640714 {
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();
715
+ cRadio radioButton = new cRadio(obj.name);
716
+ radioButton.SetObject(obj);
717
+ radioButton.layout = sevenButton;
718
+ radioButton.SetCamera(cameraView.renderCamera, false);
719
+ radioButton.addActionListener(this);
720
+ radioPanel.add(radioButton);
721
+ buttonGroup.add(radioButton);
722
+ radioButton.doClick();
649723 }
650724 void SetupViews(ObjEditor oe)
651725 {
....@@ -665,6 +739,7 @@
665739 JCheckBox fastCB;
666740 JCheckBox slowCB;
667741 JCheckBox boxCB;
742
+ JCheckBox zoomBoxCB;
668743 JCheckBox trackCB;
669744 JCheckBox smoothfocusCB;
670745 // JCheckBox speakerMocapCB;
....@@ -707,8 +782,7 @@
707782 dropAttributes |= Object3D.TEXTURE;
708783 else
709784 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
785
+ } else if(e.getSource() == liveCB)
712786 {
713787 cameraView.ToggleLive();
714788 }
....@@ -745,6 +819,10 @@
745819 Recompile();
746820 cameraView.repaint();
747821 // refreshContents();
822
+ }
823
+ else if(e.getSource() == zoomBoxCB)
824
+ {
825
+ cameraView.ToggleZoomBoxMode();
748826 }
749827 else if(e.getSource() == smoothfocusCB)
750828 {
....@@ -913,11 +991,11 @@
913991 {
914992 loadClipboard(true);
915993 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
994
+ pasteInto(false, false);
917995 } else {
918996 loadClipboard(false);
919997 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
921999 }
9221000 }
9231001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1113,37 @@
10351113 torusItem.addActionListener(this);
10361114 superItem = menu.add(new MenuItem("Superellipsoid"));
10371115 superItem.addActionListener(this);
1116
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1117
+ kleinItem.addActionListener(this);
10381118 particleItem = menu.add(new MenuItem("Particle system"));
10391119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10401122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411123 ragdollItem.addActionListener(this);
10421124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431125 ragdoll2Item.addActionListener(this);
1126
+ }
10441127 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461129 meshItem.addActionListener(this);
10471130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10491134 springItem = menu.add(new MenuItem("Spring"));
10501135 springItem.addActionListener(this);
10511136 flagItem = menu.add(new MenuItem("Flag"));
10521137 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);
10571138 blobItem = menu.add(new MenuItem("Blob"));
10581139 blobItem.addActionListener(this);
10591140 latheItem = menu.add(new MenuItem("Lathe"));
10601141 latheItem.addActionListener(this);
1142
+ }
1143
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1144
+ bezierItem.addActionListener(this);
1145
+ overlayItem = menu.add(new MenuItem("Overlay"));
1146
+ overlayItem.addActionListener(this);
10611147 lightItem = menu.add(new MenuItem("Light"));
10621148 lightItem.addActionListener(this);
10631149 menu.add("-");
....@@ -1067,34 +1153,39 @@
10671153 loopItem.addActionListener(this);
10681154 doubleItem = menu.add(new MenuItem("Fork"));
10691155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
10701158 tripleItem = menu.add(new MenuItem("Trident"));
10711159 tripleItem.addActionListener(this);
1160
+ }
10721161 }
10731162
10741163 void buildToolsMenu(Menu menu)
10751164 {
10761165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771166 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
10791168
10801169 menu.add("-");
10811170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821171 parseverticesItem.addActionListener(this);
10831172 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841173 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861175 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901177 reduceMorphItem.addActionListener(this);
10911178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921179 reduce34MorphItem.addActionListener(this);
1093
-
1180
+ menu.add("-");
10941181 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951182 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
10981189 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991190 memoryItem.addActionListener(this);
11001191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1108,6 +1199,8 @@
11081199 resetParentItem.addActionListener(this);
11091200 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101201 repairParentItem.addActionListener(this);
1202
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1203
+ repairShadowItem.addActionListener(this);
11111204 menu.add(invariantsItem = new MenuItem("Invariants"));
11121205 invariantsItem.addActionListener(this);
11131206 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1208,7 @@
11151208 menu.add("-");
11161209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171210 editScriptItem.addActionListener(this);
1211
+ }
11181212 }
11191213
11201214 void ScreenFit()
....@@ -1468,6 +1562,7 @@
14681562 //
14691563 public void actionPerformed(ActionEvent event) // , Object arg)
14701564 {
1565
+ Object source = event.getSource();
14711566 /*
14721567 if (event.getSource() == nameField)
14731568 {
....@@ -1479,11 +1574,11 @@
14791574 }
14801575 else
14811576 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1577
+ if (source == lookAtItem || source == lookFromItem)
14831578 {
14841579 ScreenFit();
14851580 } else
1486
- if (event.getSource() == switchItem)
1581
+ if (source == switchItem)
14871582 {
14881583 cVector v1 = new cVector();
14891584 cVector v2 = new cVector();
....@@ -1492,11 +1587,11 @@
14921587 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931588 objEditor.cameraView.repaint();
14941589 } else
1495
- if (event.getSource() == rectoidItem)
1590
+ if (source == rectoidItem)
14961591 {
14971592 makeSomething(new Box());
14981593 } else
1499
- if (event.getSource() == particleItem)
1594
+ if (source == particleItem)
15001595 {
15011596 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021597 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1612,9 @@
15171612 applyExample(particleGeom, "SMOKE");
15181613 makeSomething(particleGeom);
15191614 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1615
+ if (source == ragdollItem || source == ragdoll2Item)
15211616 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1617
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231618
15241619 ragdoll.toParent = LA.newMatrix();
15251620 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1632,7 @@
15371632 } else
15381633 /*
15391634 */
1540
- if (event.getSource() == heightFieldItem)
1635
+ if (source == heightFieldItem)
15411636 {
15421637 Object3D obj = new Object3D();
15431638
....@@ -1575,27 +1670,31 @@
15751670
15761671 makeSomething(obj);
15771672 } else
1578
- if (event.getSource() == gridItem)
1673
+ if (source == gridItem)
15791674 {
15801675 makeSomething(new Grid());
15811676 } else
1582
- if (event.getSource() == ellipsoidItem)
1677
+ if (source == ellipsoidItem)
15831678 {
15841679 makeSomething(new Sphere());
15851680 } else
1586
- if (event.getSource() == coneItem)
1681
+ if (source == coneItem)
15871682 {
15881683 makeSomething(new Cone());
15891684 } else
1590
- if (event.getSource() == torusItem)
1685
+ if (source == torusItem)
15911686 {
15921687 makeSomething(new Torus());
15931688 } else
1594
- if (event.getSource() == superItem)
1689
+ if (source == superItem)
15951690 {
15961691 makeSomething(new Superellipsoid());
15971692 } else
1598
- if (event.getSource() == blobItem)
1693
+ if (source == kleinItem)
1694
+ {
1695
+ makeSomething(new Klein());
1696
+ } else
1697
+ if (source == blobItem)
15991698 {
16001699 Blob blob = new Blob();
16011700 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1702,15 @@
16031702 //blob.retile();
16041703 makeSomething(blob);
16051704 } else
1606
- if (event.getSource() == latheItem)
1705
+ if (source == latheItem)
16071706 {
16081707 makeSomething(new Lathe());
16091708 } else
1610
- if (event.getSource() == bezierItem)
1709
+ if (source == bezierItem)
16111710 {
16121711 makeSomething(new BezierSurface());
16131712 } else
1614
- if (event.getSource() == checkerItem)
1713
+ if (source == overlayItem)
16151714 {
16161715 /*
16171716 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1725,7 @@
16261725 */
16271726 makeSomething(new Checker());
16281727 } else
1629
- if (event.getSource() == meshItem)
1728
+ if (source == meshItem)
16301729 {
16311730 Object3D itemtomake = new Object3D();
16321731 Object3D child;
....@@ -1647,35 +1746,35 @@
16471746 makeSomething(child);
16481747 }
16491748 } else
1650
- if (event.getSource() == springItem)
1749
+ if (source == springItem)
16511750 {
16521751 cSpring s = new cSpring();
16531752 s.setup();
16541753 makeSomething(s);
16551754 } else
1656
- if (event.getSource() == flagItem)
1755
+ if (source == flagItem)
16571756 {
16581757 cSpring s = new cFlag();
16591758 s.setup();
16601759 makeSomething(s);
16611760 } else
1662
- if (event.getSource() == lightItem)
1761
+ if (source == lightItem)
16631762 {
16641763 makeSomething(new Light());
16651764 } else
1666
- if (event.getSource() == csgItem)
1765
+ if (source == csgItem)
16671766 {
16681767 group(new CSG());
16691768 } else
1670
- if (event.getSource() == templateItem)
1769
+ if (source == templateItem)
16711770 {
16721771 group(new cTemplate());
16731772 } else
1674
- if (event.getSource() == attributeItem)
1773
+ if (source == attributeItem)
16751774 {
16761775 makeSomething(new Attribute());
16771776 } else
1678
- if (event.getSource() == pointflowItem)
1777
+ if (source == pointflowItem)
16791778 {
16801779 makeSomething(new PointFlow());
16811780 } else
....@@ -1687,7 +1786,7 @@
16871786 } else
16881787 */
16891788
1690
- if (event.getSource() == superLoopItem)
1789
+ if (source == superLoopItem)
16911790 {
16921791 Composite g = new cGroup();
16931792 for (int i=0; i<15; i++)
....@@ -1709,7 +1808,7 @@
17091808
17101809 group(g);
17111810 } else
1712
- if (event.getSource() == loopItem)
1811
+ if (source == loopItem)
17131812 {
17141813 Composite csg = new GroupLeaf();
17151814 csg.count = 5;
....@@ -1718,7 +1817,7 @@
17181817 csg.addChild(child);
17191818 child.addChild(csg);
17201819 } else
1721
- if (event.getSource() == doubleItem)
1820
+ if (source == doubleItem)
17221821 {
17231822 Composite csg = new GroupLeaf();
17241823 csg.count = 5;
....@@ -1730,7 +1829,7 @@
17301829 csg.addChild(child);
17311830 child.addChild(csg);
17321831 } else
1733
- if (event.getSource() == tripleItem)
1832
+ if (source == tripleItem)
17341833 {
17351834 Composite csg = new GroupLeaf();
17361835 csg.count = 4;
....@@ -1746,70 +1845,75 @@
17461845 child.addChild(csg);
17471846 } else
17481847
1749
- if (event.getSource() == importGFDItem)
1848
+ if (source == importGFDItem)
17501849 {
17511850 ImportGFD();
17521851 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1852
+ if (source == importVRMLX3DItem)
17541853 {
17551854 ImportVRMLX3D();
17561855 } else
1757
- if (event.getSource() == import3DSItem)
1856
+ if (source == import3DSItem)
17581857 {
17591858 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601859 } else
1761
- if (event.getSource() == importOBJItem)
1860
+ if (source == importOBJItem)
17621861 {
17631862 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17641863 } else
1765
- if (event.getSource() == computeAOItem)
1864
+ if (source == computeAOItem)
17661865 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1866
+ Globals.drawMode = CameraPane.OCCLUSION;
1867
+ Globals.theRenderer.repaint();
17691868 } else
1770
- if (event.getSource() == recompileItem)
1869
+ if (source == recompileItem)
17711870 {
17721871 Recompile();
17731872 refreshContents();
17741873 } else
1775
- if (event.getSource() == editScriptItem)
1874
+ if (source == editScriptItem)
17761875 {
17771876 OpenDialog();
17781877 refreshContents();
17791878 } else
1780
- if (event.getSource() == invariantsItem)
1879
+ if (source == invariantsItem)
17811880 {
17821881 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1882
+ GrafreeD.grafreeD.universe.invariants();
17841883 } else
1785
- if (event.getSource() == memoryItem)
1884
+ if (source == memoryItem)
17861885 {
17871886 //System.out.println("Invariants:");
17881887 PrintMemory();
17891888 } else
1790
- if (event.getSource() == pathItem)
1889
+ if (source == pathItem)
17911890 {
17921891 PrintPath();
17931892 } else
1794
- if (event.getSource() == analyzeItem)
1893
+ if (source == analyzeItem)
17951894 {
17961895 AnalyzeObject();
17971896 } else
1798
- if (event.getSource() == dumpItem)
1897
+ if (source == dumpItem)
17991898 {
18001899 DumpObject();
18011900 } else
1802
- if (event.getSource() == screenfitButton)
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
1906
+ if (source == screenfitButton)
18031907 {
18041908 //Reload(lastConverter, lastFilename, true);
18051909 ScreenFit();
18061910 } else
1807
- if (event.getSource() == screenfitpointButton)
1911
+ if (source == screenfitpointButton)
18081912 {
18091913 //Reload(lastConverter, lastFilename, true);
18101914 ScreenFitPoint();
18111915 } else
1812
- if (event.getSource() == snapobjectButton)
1916
+ if (source == snapobjectButton)
18131917 {
18141918 //Reload(lastConverter, lastFilename, true);
18151919 SnapObject();
....@@ -1820,13 +1924,13 @@
18201924 // Recompile();
18211925 // refreshContents();
18221926 // } else
1823
- if (event.getSource() == gcButton)
1927
+ if (source == gcButton)
18241928 {
18251929 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261930 System.gc();
18271931 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281932 } else
1829
- if (event.getSource() == editLeafItem)
1933
+ if (source == editLeafItem)
18301934 {
18311935 Object3D obj;
18321936 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1944,66 @@
18401944 }
18411945 refreshContents(true);
18421946 } else
1843
- if (event.getSource() == openWindowItem)
1947
+ if (source == openWindowItem)
18441948 {
18451949 EditSelection(true);
18461950 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1951
+ if (source == cutItem || source == clearButton)
18481952 {
18491953 loadClipboard(true);
18501954 } else
1851
- if (event.getSource() == duplicateItem)
1955
+ if (source == duplicateItem)
18521956 {
18531957 Object3D keep = GrafreeD.clipboard;
18541958 loadClipboard(false);
18551959 paste(false);
18561960 GrafreeD.clipboard = keep;
18571961 } else
1858
- if (event.getSource() == cloneItem)
1962
+ if (source == cloneItem)
18591963 {
18601964 CloneSelection(false);
18611965 } else
1862
- if (event.getSource() == cloneSupportItem)
1966
+ if (source == cloneSupportItem)
18631967 {
18641968 CloneSelection(true);
18651969 } else
1866
- if (event.getSource() == copyItem)
1970
+ if (source == copyItem)
18671971 {
18681972 loadClipboard(false);
18691973 } else
1870
- if (event.getSource() == pasteItem)
1974
+ if (source == pasteItem)
18711975 {
18721976 paste(false);
18731977 } else
1874
- if (event.getSource() == pasteLinkItem)
1978
+ if (source == pasteIntoItem)
18751979 {
1876
- pasteInto(false);
1980
+ pasteInto(true, false);
18771981 } else
1878
- if (event.getSource() == pasteCloneItem)
1982
+ if (source == pasteLinkItem)
18791983 {
1880
- pasteInto(true);
1984
+ pasteInto(false, false);
18811985 } else
1882
- if (event.getSource() == pasteExpandItem)
1986
+ if (source == pasteCloneItem)
1987
+ {
1988
+ pasteInto(true, true);
1989
+ } else
1990
+ if (source == pasteExpandItem)
18831991 {
18841992 paste(true);
18851993 } else
1886
- if (event.getSource() == synchronizeItem)
1994
+ if (source == synchronizeItem)
18871995 {
18881996 Overwrite(Object3D.TRANSFORM);
18891997 } else
1890
- if (event.getSource() == overwriteNameItem)
1998
+ if (source == overwriteNameItem)
18911999 {
18922000 Overwrite(Object3D.NAME);
18932001 } else
1894
- if (event.getSource() == overwriteUVItem)
2002
+ if (source == overwriteUVItem)
18952003 {
18962004 Overwrite(Object3D.UV);
18972005 } else
1898
- if (event.getSource() == overwriteMatItem)
2006
+ if (source == overwriteMatItem)
18992007 {
19002008 /* july 2015
19012009 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2023,7 @@
19152023
19162024 Overwrite(dropAttributes);
19172025 }
1918
- if (event.getSource() == overwriteGeoItem)
2026
+ if (source == overwriteGeoItem)
19192027 {
19202028 Overwrite(Object3D.GEOMETRY);
19212029 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2040,7 @@
19322040 // refreshContents();
19332041 // }
19342042 } else
1935
- if (event.getSource() == generateMeshItem)
2043
+ if (source == generateMeshItem)
19362044 {
19372045 //if (group.selection.size() == 1)
19382046 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2051,7 @@
19432051 ResetModel();
19442052 refreshContents();
19452053 } else
1946
- if (event.getSource() == extractGeometriesItem)
2054
+ if (source == extractGeometriesItem)
19472055 {
19482056 boolean one = false;
19492057
....@@ -1970,7 +2078,7 @@
19702078 ResetModel();
19712079 refreshContents();
19722080 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2081
+ if (source == cloneGeometriesItem)
19742082 {
19752083 boolean one = false;
19762084
....@@ -1996,32 +2104,37 @@
19962104 ResetModel();
19972105 refreshContents();
19982106 } else
1999
- if (event.getSource() == shareGeometriesItem)
2107
+ if (source == shareGeometriesItem)
20002108 {
20012109 boolean one = false;
20022110
20032111 if (group.selection.size() == 1)
20042112 one = true;
20052113
2114
+ Object3D merge = null;
2115
+
20062116 Object3D content = new cGroup();
20072117
20082118 for (int i=0; i<group.selection.size(); i++)
20092119 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2120
+ merge = new Merge(group.selection.get(i));
20112121
20122122 if (one)
2013
- makeSomething(sel, false);
2123
+ makeSomething(merge, false);
20142124 else
2015
- content.addChild(sel);
2125
+ content.addChild(merge);
20162126 }
20172127
20182128 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2129
+ makeSomething(content, true);
2130
+ else
2131
+ {
2132
+ ResetModel();
2133
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2134
+ refreshContents();
2135
+ }
20232136 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2137
+ if (source == mergeGeometriesItem)
20252138 {
20262139 boolean one = false;
20272140
....@@ -2051,7 +2164,7 @@
20512164 ResetModel();
20522165 refreshContents();
20532166 } else
2054
- if (event.getSource() == linkverticesItem)
2167
+ if (source == linkverticesItem)
20552168 {
20562169 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572170 // {
....@@ -2071,32 +2184,41 @@
20712184 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722185 content = ((cGroup)content).get(0);
20732186
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2187
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752188 for (int i=0; i<group.selection.size(); i++)
20762189 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
20792192 group.selection.get(i).linkVerticesThis(content);
20802193 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
20822195 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2196
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842197 refreshContents();
20852198 }
20862199 } else
2087
- if (event.getSource() == resetsupportItem)
2200
+ if (source == resetsupportItem)
20882201 {
20892202 for (int i=0; i<group.selection.size(); i++)
20902203 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
20932206 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
20952208 }
20962209
20972210 refreshContents();
20982211 } else
2099
- if (event.getSource() == resetreferencesItem)
2212
+ if (source == relinkverticesItem)
2213
+ {
2214
+ boolean random = CameraPane.SWITCH;
2215
+ CameraPane.SWITCH = false; // parse all random nodes
2216
+ group.selection.RelinkToSupport();
2217
+ CameraPane.SWITCH = random;
2218
+
2219
+ refreshContents();
2220
+ } else
2221
+ if (source == resetreferencesItem)
21002222 {
21012223 for (int i=0; i<group.selection.size(); i++)
21022224 {
....@@ -2105,7 +2227,7 @@
21052227
21062228 refreshContents();
21072229 } else
2108
- if (event.getSource() == setMasterItem)
2230
+ if (source == setMasterItem)
21092231 {
21102232 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112233 {
....@@ -2118,7 +2240,7 @@
21182240 refreshContents();
21192241 }
21202242 } else
2121
- if (event.getSource() == poseMeshItem)
2243
+ if (source == poseMeshItem)
21222244 {
21232245 if (group.selection.size() == 1)
21242246 {
....@@ -2137,19 +2259,19 @@
21372259 }
21382260
21392261 } else
2140
- if (event.getSource() == revertMeshItem)
2262
+ if (source == revertMeshItem)
21412263 {
21422264 RevertMeshes();
21432265 } else
2144
- if (event.getSource() == resetMeshItem)
2266
+ if (source == resetMeshItem)
21452267 {
21462268 ResetAll();
21472269 } else
2148
- if (event.getSource() == stepAllItem)
2270
+ if (source == stepAllItem)
21492271 {
21502272 StepAll();
21512273 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2274
+ if (source == clearItem) // || event.getSource() == clearButton)
21532275 {
21542276 //int indices[] = jList.getSelectedIndices();
21552277 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2279,46 @@
21572279
21582280 ClearSelection(false);
21592281 } else
2160
- if (event.getSource() == clearAllItem)
2282
+ if (source == clearAllItem)
21612283 {
21622284 ClearSelection(true);
21632285 } else
2164
- if (event.getSource() == grabItem)
2286
+ if (source == grabItem)
21652287 {
21662288 group(new cGroup(), true);
21672289 } else
2168
- if (event.getSource() == frontItem)
2290
+ if (source == hideItem)
2291
+ {
2292
+ group(new HiddenObject());
2293
+ } else
2294
+ if (source == frontItem)
21692295 {
21702296 front();
21712297 } else
2172
- if (event.getSource() == backItem)
2298
+ if (source == backItem)
21732299 {
21742300 back();
21752301 } else
2176
- if (event.getSource() == cameraItem)
2302
+ if (source == cameraItem)
21772303 {
21782304 makeSomething(new Camera());
21792305 } else
2180
- if (event.getSource() == compositeItem)
2306
+ if (source == compositeItem)
21812307 {
21822308 group(new Composite());
21832309 } else
2184
- if (event.getSource() == randomItem)
2310
+ if (source == randomItem)
21852311 {
21862312 RandomNode random = new RandomNode();
21872313 group(random);
21882314 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
21902316 } else
2191
- if (event.getSource() == physicsItem)
2317
+ if (source == physicsItem)
21922318 {
21932319 group(new PhysicsNode());
21942320 } else
2195
- if (event.getSource() == frameselectorItem)
2321
+ if (source == frameselectorItem)
21962322 {
21972323 for (int i=0; i<group.selection.size(); i++)
21982324 {
....@@ -2204,7 +2330,7 @@
22042330 ResetModel();
22052331 refreshContents();
22062332 } else
2207
- if (event.getSource() == switchGeoItem)
2333
+ if (source == switchGeoItem)
22082334 {
22092335 for (int i=0; i<group.selection.size(); i++)
22102336 {
....@@ -2216,7 +2342,7 @@
22162342 ResetModel();
22172343 refreshContents();
22182344 } else
2219
- if (event.getSource() == switchTransfoItem)
2345
+ if (source == switchTransfoItem)
22202346 {
22212347 for (int i=0; i<group.selection.size(); i++)
22222348 {
....@@ -2228,7 +2354,7 @@
22282354 ResetModel();
22292355 refreshContents();
22302356 } else
2231
- if (event.getSource() == morphItem)
2357
+ if (source == morphItem)
22322358 {
22332359 for (int i=0; i<group.selection.size(); i++)
22342360 {
....@@ -2240,7 +2366,7 @@
22402366 ResetModel();
22412367 refreshContents();
22422368 } else
2243
- if (event.getSource() == scriptNodeItem)
2369
+ if (source == scriptNodeItem)
22442370 {
22452371 boolean atleastone = false;
22462372
....@@ -2279,199 +2405,215 @@
22792405 }
22802406 }
22812407 } else
2282
- if (event.getSource() == linkerItem)
2408
+ if (source == linkerItem)
22832409 {
22842410 group(new cLinker());
22852411 } else
2286
- if (event.getSource() == textureItem)
2412
+ if (source == textureItem)
22872413 {
22882414 group(new TextureNode());
22892415 } else
2290
- if (event.getSource() == shadowXItem)
2416
+ if (source == billboardItem)
2417
+ {
2418
+ group(new BillboardNode());
2419
+ } else
2420
+ if (source == shadowXItem)
22912421 {
22922422 CastShadow(0);
22932423 } else
2294
- if (event.getSource() == shadowYItem)
2424
+ if (source == shadowYItem)
22952425 {
22962426 CastShadow(1);
22972427 } else
2298
- if (event.getSource() == shadowZItem)
2428
+ if (source == shadowZItem)
22992429 {
23002430 CastShadow(2);
23012431 } else
2302
- if (event.getSource() == ungroupItem)
2432
+ if (source == ungroupItem)
23032433 {
2304
- ungroup();
2434
+ //ungroup();
2435
+ for (int i=0; i<group.selection.size(); i++)
2436
+ {
2437
+ Ungroup(group.selection.get(i));
2438
+ }
2439
+
2440
+ ClearSelection(false);
2441
+
2442
+ refreshContents();
23052443 } else
2306
- if (event.getSource() == genUVItem)
2444
+ if (source == genUVItem)
23072445 {
23082446 GenUV();
23092447 } else
2310
- if (event.getSource() == genNormalsCADItem)
2448
+ if (source == genNormalsCADItem)
23112449 {
23122450 GenNormals(true);
23132451 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2452
+ if (source == genNormalsMESHItem)
23152453 {
23162454 GenNormals(true); // TODO
23172455 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2456
+ if (source == genNormalsORGANItem)
23192457 {
23202458 GenNormals(false);
23212459 } else
2322
- if (event.getSource() == stripifyItem)
2460
+ if (source == genNormalsMINEItem)
2461
+ {
2462
+ GenNormalsMINE();
2463
+ } else
2464
+ if (source == stripifyItem)
23232465 {
23242466 Stripify();
23252467 } else
2326
- if (event.getSource() == unstripifyItem)
2468
+ if (source == unstripifyItem)
23272469 {
23282470 Unstripify();
23292471 } else
2330
- if (event.getSource() == trimItem)
2472
+ if (source == trimItem)
23312473 {
23322474 Trim();
23332475 } else
2334
- if (event.getSource() == untrimItem)
2476
+ if (source == untrimItem)
23352477 {
23362478 Untrim();
23372479 } else
2338
- if (event.getSource() == clearColorsItem)
2480
+ if (source == clearColorsItem)
23392481 {
23402482 ClearColors();
23412483 } else
2342
- if (event.getSource() == clearMaterialsItem)
2484
+ if (source == clearMaterialsItem)
23432485 {
23442486 ClearMaterials();
23452487 } else
2346
- if (event.getSource() == liveleavesItem)
2488
+ if (source == liveleavesItem)
23472489 {
23482490 LiveLeaves(true);
23492491 } else
2350
- if (event.getSource() == unliveleavesItem)
2492
+ if (source == unliveleavesItem)
23512493 {
23522494 LiveLeaves(false);
23532495 } else
2354
- if (event.getSource() == supportleavesItem)
2496
+ if (source == supportleavesItem)
23552497 {
23562498 SupportLeaves(true);
23572499 } else
2358
- if (event.getSource() == unsupportleavesItem)
2500
+ if (source == unsupportleavesItem)
23592501 {
23602502 SupportLeaves(false);
23612503 } else
2362
- if (event.getSource() == hideleavesItem)
2504
+ if (source == hideleavesItem)
23632505 {
23642506 HideLeaves(true);
23652507 } else
2366
- if (event.getSource() == showleavesItem)
2508
+ if (source == showleavesItem)
23672509 {
23682510 HideLeaves(false);
23692511 } else
2370
- if (event.getSource() == markleavesItem)
2512
+ if (source == markleavesItem)
23712513 {
23722514 MarkLeaves(true);
23732515 } else
2374
- if (event.getSource() == unmarkleavesItem)
2516
+ if (source == unmarkleavesItem)
23752517 {
23762518 MarkLeaves(false);
23772519 } else
2378
- if (event.getSource() == flipVItem)
2520
+ if (source == flipVItem)
23792521 {
23802522 FlipV(true);
23812523 } else
2382
- if (event.getSource() == unflipVItem)
2524
+ if (source == unflipVItem)
23832525 {
23842526 FlipV(false);
23852527 } else
2386
- if (event.getSource() == lowTexturesItem)
2528
+ if (source == lowTexturesItem)
23872529 {
23882530 SetTexRes(0);
23892531 } else
2390
- if (event.getSource() == normalTexturesItem)
2532
+ if (source == normalTexturesItem)
23912533 {
23922534 SetTexRes(1);
23932535 } else
2394
- if (event.getSource() == highTexturesItem)
2536
+ if (source == highTexturesItem)
23952537 {
23962538 SetTexRes(2);
23972539 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2540
+ if (source == veryhighTexturesItem)
23992541 {
24002542 SetTexRes(3);
24012543 } else
2402
- if (event.getSource() == maxTexturesItem)
2544
+ if (source == maxTexturesItem)
24032545 {
24042546 SetTexRes(4);
24052547 } else
2406
- if (event.getSource() == panoTexturesItem)
2548
+ if (source == panoTexturesItem)
24072549 {
24082550 SetTexRes(5);
24092551 } else
2410
- if (event.getSource() == reverseNormalsItem)
2552
+ if (source == reverseNormalsItem)
24112553 {
24122554 ReverseNormals();
24132555 } else
2414
- if (event.getSource() == parseverticesItem)
2556
+ if (source == parseverticesItem)
24152557 {
24162558 ParseVertices();
24172559 } else
2418
- if (event.getSource() == textureFieldItem)
2560
+ if (source == textureFieldItem)
24192561 {
24202562 TextureVertices();
24212563 } else
2422
- if (event.getSource() == alignItem)
2564
+ if (source == alignItem)
24232565 {
24242566 Align();
24252567 } else
2426
- if (event.getSource() == mirrorItem)
2568
+ if (source == mirrorItem)
24272569 {
24282570 MirrorPoses();
24292571 } else
2430
- if (event.getSource() == reduceMorphItem)
2572
+ if (source == reduceMorphItem)
24312573 {
24322574 MeshReduction(false);
24332575 } else
2434
- if (event.getSource() == reduce34MorphItem)
2576
+ if (source == reduce34MorphItem)
24352577 {
24362578 MeshReduction(true);
24372579 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2580
+ if (source == reverseTrianglesItem)
24392581 {
24402582 ReverseTriangles();
24412583 } else
2442
- if (event.getSource() == reduceMeshItem)
2584
+ if (source == reduceMeshItem)
24432585 {
24442586 ReduceMesh(false);
24452587 } else
2446
- if (event.getSource() == reduce34MeshItem)
2588
+ if (source == reduce34MeshItem)
24472589 {
24482590 ReduceMesh(true);
24492591 } else
2450
- if (event.getSource() == increaseMeshItem)
2592
+ if (source == increaseMeshItem)
24512593 {
24522594 IncreaseMesh();
24532595 } else
2454
- if (event.getSource() == clipMeshItem)
2596
+ if (source == clipMeshItem)
24552597 {
24562598 ClipMesh();
24572599 } else
2458
- if (event.getSource() == smoothMeshItem)
2600
+ if (source == smoothMeshItem)
24592601 {
24602602 SmoothMesh();
24612603 } else
2462
- if (event.getSource() == transformgeometryItem)
2604
+ if (source == transformgeometryItem)
24632605 {
24642606 TransformGeometry();
24652607 } else
2466
- if (event.getSource() == resetTransformItem)
2608
+ if (source == resetTransformItem)
24672609 {
24682610 ResetTransform();
24692611 } else
2470
- if (event.getSource() == resetCentroidItem)
2612
+ if (source == resetCentroidItem)
24712613 {
24722614 ResetCentroid();
24732615 } else
2474
- if (event.getSource() == resetParentItem)
2616
+ if (source == resetParentItem)
24752617 {
24762618 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772619 {
....@@ -2481,7 +2623,7 @@
24812623
24822624 refreshContents();
24832625 } else
2484
- if (event.getSource() == repairParentItem)
2626
+ if (source == repairParentItem)
24852627 {
24862628 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872629 {
....@@ -2495,7 +2637,21 @@
24952637
24962638 refreshContents();
24972639 } else
2498
- if (event.getSource() == sortbysizeItem)
2640
+ if (source == repairShadowItem)
2641
+ {
2642
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2643
+ {
2644
+ Object3D obj = (Object3D)e.nextElement();
2645
+ obj.RepairShadow();
2646
+// for (int i=0; i<obj.size(); i++)
2647
+// {
2648
+// obj.get(i).parent = obj;
2649
+// }
2650
+ }
2651
+
2652
+ refreshContents();
2653
+ } else
2654
+ if (source == sortbysizeItem)
24992655 {
25002656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012657 {
....@@ -2507,7 +2663,7 @@
25072663 ResetModel();
25082664 refreshContents();
25092665 } else
2510
- if (event.getSource() == sortbynameItem)
2666
+ if (source == sortbynameItem)
25112667 {
25122668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132669 {
....@@ -2519,7 +2675,7 @@
25192675 ResetModel();
25202676 refreshContents();
25212677 } else
2522
- if (event.getSource() == attachPigmentItem)
2678
+ if (source == attachPigmentItem)
25232679 {
25242680 String texture = GetFile("Attach pigment");
25252681 Object3D obj;
....@@ -2531,7 +2687,7 @@
25312687
25322688 refreshContents();
25332689 } else
2534
- if (event.getSource() == detachPigmentItem)
2690
+ if (source == detachPigmentItem)
25352691 {
25362692 Object3D obj;
25372693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2698,7 @@
25422698
25432699 refreshContents();
25442700 } else
2545
- if (event.getSource() == attachBumpItem)
2701
+ if (source == attachBumpItem)
25462702 {
25472703 String texture = GetFile("Attach bump");
25482704 Object3D obj;
....@@ -2554,7 +2710,7 @@
25542710
25552711 refreshContents();
25562712 } else
2557
- if (event.getSource() == detachBumpItem)
2713
+ if (source == detachBumpItem)
25582714 {
25592715 Object3D obj;
25602716 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2721,7 @@
25652721
25662722 refreshContents();
25672723 } else
2568
- if (event.getSource() == pigmentBumpItem)
2724
+ if (source == pigmentBumpItem)
25692725 {
25702726 Object3D obj;
25712727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2732,195 @@
25762732
25772733 refreshContents();
25782734 } else
2579
- if (event.getSource() == flashSelectionButton)
2735
+ if (source == flashSelectionButton)
25802736 {
25812737 CameraPane.flash = true;
25822738 refreshContents();
25832739 } else
2584
- if (event.getSource() == oneButton)
2740
+ if (source == oneButton)
25852741 {
25862742 } else
2587
- if (event.getSource() == twoButton)
2743
+ if (source == twoButton)
25882744 {
25892745 radio.layout = twoButton;
25902746 // bug
25912747 //gridPanel.setDividerLocation(1.0);
25922748 //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();
2749
+// bigThree.remove(scenePanel);
2750
+// bigThree.remove(centralPanel);
2751
+// bigThree.remove(XYZPanel);
2752
+// aWindowConstraints.gridx = 0;
2753
+// aWindowConstraints.gridy = 0;
2754
+// aWindowConstraints.gridwidth = 1;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2757
+// aWindowConstraints.weightx = 0;
2758
+// aWindowConstraints.weighty = 1;
2759
+// //bigThree.add(jtp, aWindowConstraints);
2760
+// aWindowConstraints.weightx = 1;
2761
+// aWindowConstraints.gridwidth = 3;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.gridx = 1;
2764
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2765
+// bigThree.add(centralPanel, aWindowConstraints);
2766
+// aWindowConstraints.weightx = 0;
2767
+// aWindowConstraints.gridx = 4;
2768
+// aWindowConstraints.gridwidth = 1;
2769
+// // aConstraints.gridheight = 3;
2770
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2771
+// //bigThree.add(XYZPanel, aWindowConstraints);
2772
+// scenePanel.setVisible(false);
2773
+// centralPanel.setVisible(true);
2774
+// XYZPanel.setVisible(false);
2775
+ bigThree.ClearUI();
2776
+ bigThree.add(centralPanel);
2777
+ bigThree.FlushUI();
26172778 } else
2618
- if (event.getSource() == threeButton)
2779
+ if (source == threeButton)
26192780 {
26202781 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();
2782
+
2783
+// bigThree.remove(scenePanel);
2784
+// bigThree.remove(centralPanel);
2785
+// bigThree.remove(XYZPanel);
2786
+// aWindowConstraints.gridx = 0;
2787
+// aWindowConstraints.gridy = 0;
2788
+// aWindowConstraints.gridwidth = 1;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2791
+// aWindowConstraints.weightx = 0;
2792
+// aWindowConstraints.weighty = 1;
2793
+// //bigThree.add(jtp, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 1;
2795
+// aWindowConstraints.gridwidth = 3;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.gridx = 1;
2798
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2799
+// bigThree.add(centralPanel, aWindowConstraints);
2800
+// aWindowConstraints.weightx = 0;
2801
+// aWindowConstraints.gridx = 4;
2802
+// aWindowConstraints.gridwidth = 1;
2803
+// // aConstraints.gridheight = 3;
2804
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2805
+// bigThree.add(XYZPanel, aWindowConstraints);
2806
+// bigThree.validate();
2807
+// scenePanel.setVisible(false);
2808
+// centralPanel.setVisible(true);
2809
+// XYZPanel.setVisible(true);
2810
+ bigThree.ClearUI();
2811
+ bigThree.add(centralPanel);
2812
+ bigThree.add(XYZPanel);
2813
+ bigThree.FlushUI();
26452814 } else
2646
- if (event.getSource() == fourButton)
2815
+ if (source == fourButton)
26472816 {
26482817 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();
2818
+
2819
+// bigThree.remove(scenePanel);
2820
+// bigThree.remove(centralPanel);
2821
+// bigThree.remove(XYZPanel);
2822
+// aWindowConstraints.gridx = 0;
2823
+// aWindowConstraints.gridy = 0;
2824
+// aWindowConstraints.gridwidth = 1;
2825
+// // aWindowConstraints.gridheight = 3;
2826
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.weighty = 1;
2829
+// bigThree.add(scenePanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 1;
2831
+// aWindowConstraints.gridwidth = 3;
2832
+// // aConstraints.gridheight = 3;
2833
+// aWindowConstraints.gridx = 1;
2834
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2835
+// //bigThree.add(cameraPanel, aWindowConstraints);
2836
+// aWindowConstraints.weightx = 0;
2837
+// aWindowConstraints.gridx = 4;
2838
+// aWindowConstraints.gridwidth = 1;
2839
+// // aWindowConstraints.gridheight = 3;
2840
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2841
+// //bigThree.add(XYZPanel, aWindowConstraints);
2842
+// bigThree.validate();
2843
+// scenePanel.setVisible(true);
2844
+// centralPanel.setVisible(false);
2845
+// XYZPanel.setVisible(false);
2846
+ bigThree.ClearUI();
2847
+ bigThree.add(scenePanel);
2848
+ bigThree.FlushUI();
26732849 } else
2674
- if (event.getSource() == sixButton)
2850
+ if (source == sixButton)
26752851 {
26762852 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();
2853
+
2854
+// bigThree.remove(scenePanel);
2855
+// bigThree.remove(centralPanel);
2856
+// bigThree.remove(XYZPanel);
2857
+// aWindowConstraints.gridx = 0;
2858
+// aWindowConstraints.gridy = 0;
2859
+// aWindowConstraints.gridwidth = 1;
2860
+// // aConstraints.gridheight = 3;
2861
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.weighty = 1;
2864
+// bigThree.add(scenePanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 1;
2866
+// aWindowConstraints.gridwidth = 3;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.gridx = 1;
2869
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2870
+// bigThree.add(centralPanel, aWindowConstraints);
2871
+// aWindowConstraints.weightx = 0;
2872
+// aWindowConstraints.gridx = 4;
2873
+// aWindowConstraints.gridwidth = 1;
2874
+// // aWindowConstraints.gridheight = 3;
2875
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2876
+// //bigThree.add(XYZPanel, aConstraints);
2877
+// bigThree.validate();
2878
+// scenePanel.setVisible(true);
2879
+// centralPanel.setVisible(true);
2880
+// XYZPanel.setVisible(false);
2881
+ bigThree.ClearUI();
2882
+ bigThree.add(scenePanel);
2883
+ bigThree.add(centralPanel);
2884
+ bigThree.FlushUI();
27012885 } else
2702
- if (event.getSource() == sevenButton)
2886
+ if (source == sevenButton)
27032887 {
27042888 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();
2889
+
2890
+// bigThree.remove(scenePanel);
2891
+// bigThree.remove(centralPanel);
2892
+// bigThree.remove(XYZPanel);
2893
+// aWindowConstraints.gridx = 0;
2894
+// aWindowConstraints.gridy = 0;
2895
+// aWindowConstraints.gridwidth = 1;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.weighty = 1;
2900
+// bigThree.add(scenePanel, aWindowConstraints);
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.gridwidth = 3;
2903
+// // aWindowConstraints.gridheight = 3;
2904
+// aWindowConstraints.gridx = 1;
2905
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2906
+// bigThree.add(centralPanel, aWindowConstraints);
2907
+// aWindowConstraints.weightx = 0;
2908
+// aWindowConstraints.gridx = 4;
2909
+// aWindowConstraints.gridwidth = 1;
2910
+// // aConstraints.gridheight = 3;
2911
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2912
+// bigThree.add(XYZPanel, aWindowConstraints);
2913
+// bigThree.validate();
2914
+// scenePanel.setVisible(true);
2915
+// centralPanel.setVisible(true);
2916
+// XYZPanel.setVisible(true);
2917
+ bigThree.ClearUI();
2918
+ bigThree.add(scenePanel);
2919
+ bigThree.add(centralPanel);
2920
+ bigThree.add(XYZPanel);
2921
+ bigThree.FlushUI();
27292922 } else
2730
- if (event.getSource() == rootButton)
2923
+ if (source == rootButton)
27312924 {
27322925 Object3D obj;
27332926 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2932,7 @@
27392932
27402933 refreshContents(true);
27412934 } else
2742
- if (event.getSource() == closeButton)
2935
+ if (source == closeButton)
27432936 {
27442937 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452938 cRadio ab;
....@@ -2760,11 +2953,11 @@
27602953 }
27612954 refreshContents(true);
27622955 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2956
+ if (source == editItem || source == editButton)
27642957 {
27652958 EditSelection(false);
27662959 } else
2767
- if (event.getSource() == uneditButton)
2960
+ if (source == uneditButton)
27682961 {
27692962 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702963 {
....@@ -2776,12 +2969,12 @@
27762969
27772970 child.editWindow = null; // ???????????
27782971 }
2779
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
27802973 //objEditor.jTree.clearSelection();
27812974 //objEditor.ResetSliders();
27822975 refreshContents(true);
27832976 } else
2784
- if (event.getSource() == clearPanelButton)
2977
+ if (source == clearPanelButton)
27852978 {
27862979 assert(copy == group);
27872980 //copy.ClearUI();
....@@ -2792,7 +2985,7 @@
27922985 listUI.clear();
27932986 refreshContents(true);
27942987 } else
2795
- if (event.getSource() == allParamsButton)
2988
+ if (source == allParamsButton)
27962989 {
27972990 assert(copy == group);
27982991
....@@ -2813,19 +3006,19 @@
28133006
28143007 refreshContents(true);
28153008 } else
2816
- if (event.getSource() == unselectButton)
3009
+ if (source == unselectButton)
28173010 {
28183011 objEditor.jTree.clearSelection();
28193012 // ?? oct 2012 GrafreeD.clipboard.clear();
28203013 objEditor.ResetSliders();
28213014 refreshContents(true);
28223015 } else
2823
- if(event.getSource() instanceof cRadio)
3016
+ if(source instanceof cRadio)
28243017 {
28253018 group.parent = keepparent;
28263019 group.attributes = 0;
28273020 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3021
+ /*cRadio*/ radio = (cRadio)source;
28293022 Object3D obj = radio.GetObject();
28303023 System.out.println("Edit " + obj);
28313024 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3038,7 @@
28453038 }
28463039
28473040 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3041
+ //Globals.theRenderer.object = group;
28493042 if(!useclient)
28503043 {
28513044 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +3047,8 @@
28543047 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553048 cameraView.targetLookAt.set(radio.camera.lookAt);
28563049 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3050
+ //cameraView.lighttouched = true;
3051
+ Globals.lighttouched = true;
28583052 topView.object = group;
28593053 frontView.object = group;
28603054 sideView.object = group;
....@@ -2890,7 +3084,7 @@
28903084 if (useclient)
28913085 {
28923086 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3087
+ Globals.lighttouched = true;
28943088 //topView.object = client;
28953089 //frontView.object = client;
28963090 //sideView.object = client;
....@@ -2898,7 +3092,7 @@
28983092 else
28993093 {
29003094 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3095
+ Globals.lighttouched = true;
29023096 //topView.object = group;
29033097 //frontView.object = group;
29043098 //sideView.object = group;
....@@ -3179,6 +3373,13 @@
31793373 refreshContents();
31803374 }
31813375
3376
+ void GenNormalsMINE()
3377
+ {
3378
+ group.selection.GenNormalsMINE();
3379
+
3380
+ refreshContents();
3381
+ }
3382
+
31823383 void Stripify()
31833384 {
31843385 group.StripifyS();
....@@ -3399,7 +3600,7 @@
33993600 String pigment = Object3D.GetPigment(tex);
34003601 //String bump = Object3D.GetBump(tex);
34013602
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3603
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34033604
34043605 double s = v.s;
34053606
....@@ -3447,12 +3648,26 @@
34473648
34483649 void Align()
34493650 {
3651
+ if (group.selection.size() == 0)
3652
+ return;
3653
+
3654
+ cVector bbmin = new cVector();
3655
+ cVector bbmax = new cVector();
3656
+
3657
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3658
+
3659
+ double dx = bbmax.x - bbmin.x;
3660
+ double dy = bbmax.y - bbmin.y;
3661
+ double dz = bbmax.z - bbmin.z;
3662
+
3663
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3664
+
34503665 for (int i=0; i<group.selection.size(); i++)
34513666 {
34523667 Object3D obj = group.selection.get(i);
34533668
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3669
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3670
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563671 }
34573672
34583673 refreshContents();
....@@ -3473,11 +3688,11 @@
34733688
34743689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753690
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
34783693 lowres.linkVerticesThis(null);
34793694 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
34813696
34823697 System.err.flush();
34833698
....@@ -3686,7 +3901,7 @@
36863901 group.selection.RelinkToSupport(); // july 2014
36873902 System.out.println("DONE.");
36883903 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3904
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36903905 }
36913906
36923907 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4177,25 @@
39624177 System.err.println("info : " + child.GetPath());
39634178 }
39644179 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
39714186
39724187 objEditor.SetText(); // jan 2014
39734188
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4189
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754190 CameraPane.flash = true;
39764191
39774192 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784193 // a camera
39794194 {
39804195 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;
4196
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4197
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4198
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844199 }
39854200
39864201 refreshContents();
....@@ -4235,7 +4450,7 @@
42354450 refreshContents();
42364451 }
42374452
4238
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
42394454 {
42404455 // if (GrafreeD.clipboard == null)
42414456 // return;
....@@ -4264,7 +4479,14 @@
42644479 if (copyit)
42654480 {
42664481 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
42684490 }
42694491 else
42704492 {
....@@ -4474,6 +4696,26 @@
44744696 makeSomething(csg);
44754697 }
44764698
4699
+ void Ungroup(Object3D g)
4700
+ {
4701
+ if (g instanceof HiddenObject)
4702
+ {
4703
+ HiddenObject h = (HiddenObject) g;
4704
+
4705
+ for (int i=0; i<h.ActualSize(); i++)
4706
+ {
4707
+ objEditor.makeSomething(h.get(i), false);
4708
+ }
4709
+ }
4710
+ else
4711
+ {
4712
+ for (int i=0; i<g.Size(); i++)
4713
+ {
4714
+ objEditor.makeSomething(g.get(i), false);
4715
+ }
4716
+ }
4717
+ }
4718
+
44774719 void ungroup()
44784720 {
44794721 /*
....@@ -4788,10 +5030,12 @@
47885030 cButton flashSelectionButton;
47895031 cButton editButton;
47905032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
47915034 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935035 cButton unselectButton;
47945036
5037
+ cButton oneStepButton;
5038
+
47955039 cButton screenfitButton;
47965040 cButton screenfitpointButton;
47975041 cButton snapobjectButton;
....@@ -4833,6 +5077,7 @@
48335077 private MenuItem resetsupportItem;
48345078 private MenuItem resetreferencesItem;
48355079 private MenuItem linkverticesItem;
5080
+ private MenuItem relinkverticesItem;
48365081 private MenuItem setMasterItem;
48375082 private MenuItem resetMeshItem;
48385083 private MenuItem stepAllItem;
....@@ -4845,6 +5090,7 @@
48455090 private MenuItem mergeGeometriesItem;
48465091 private MenuItem copyItem;
48475092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
48485094 private MenuItem pasteLinkItem;
48495095 private MenuItem pasteCloneItem;
48505096 private MenuItem pasteExpandItem;
....@@ -4854,6 +5100,7 @@
48545100 private MenuItem genNormalsMESHItem;
48555101 private MenuItem genNormalsCADItem;
48565102 private MenuItem genNormalsORGANItem;
5103
+ private MenuItem genNormalsMINEItem;
48575104 private MenuItem stripifyItem;
48585105 private MenuItem unstripifyItem;
48595106 private MenuItem trimItem;
....@@ -4895,6 +5142,7 @@
48955142 private MenuItem resetCentroidItem;
48965143 private MenuItem transformgeometryItem;
48975144 private MenuItem resetTransformItem;
5145
+ private MenuItem hideItem;
48985146 private MenuItem grabItem;
48995147 private MenuItem backItem;
49005148 private MenuItem frontItem;
....@@ -4915,6 +5163,7 @@
49155163
49165164 private MenuItem resetParentItem;
49175165 private MenuItem repairParentItem;
5166
+ private MenuItem repairShadowItem;
49185167 private MenuItem sortbysizeItem;
49195168 private MenuItem sortbynameItem;
49205169
....@@ -4935,10 +5184,11 @@
49355184 private MenuItem coneItem;
49365185 private MenuItem torusItem;
49375186 private MenuItem superItem;
5187
+ private MenuItem kleinItem;
49385188 private MenuItem blobItem;
49395189 private MenuItem latheItem;
49405190 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
49425192 private MenuItem meshItem;
49435193 // private MenuItem meshGroupItem;
49445194 private MenuItem springItem;
....@@ -4947,6 +5197,7 @@
49475197 private MenuItem csgItem;
49485198 private MenuItem templateItem;
49495199 private MenuItem textureItem;
5200
+ private MenuItem billboardItem;
49505201 private MenuItem shadowXItem;
49515202 private MenuItem shadowYItem;
49525203 private MenuItem shadowZItem;