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"));
....@@ -285,6 +328,13 @@
285328 genNormalsORGANItem.addActionListener(this);
286329 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287330 genNormalsCADItem.addActionListener(this);
331
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
332
+ genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
335
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
336
+ genNormalsMINEItem.addActionListener(this);
337
+ }
288338 stripifyItem = menu.add(new MenuItem("Stripify"));
289339 stripifyItem.addActionListener(this);
290340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,10 +356,14 @@
306356 reduce34MeshItem.addActionListener(this);
307357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308358 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
313367
314368 oe.menuBar.add(menu = new Menu("Attributes"));
315369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -319,10 +373,13 @@
319373 liveleavesItem.addActionListener(this);
320374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
322378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323379 supportleavesItem.addActionListener(this);
324380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325381 unsupportleavesItem.addActionListener(this);
382
+ }
326383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327384 hideleavesItem.addActionListener(this);
328385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -365,6 +422,8 @@
365422 sortbysizeItem.addActionListener(this);
366423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
368427 menu.add("-");
369428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370429 extractGeometriesItem.addActionListener(this);
....@@ -374,11 +433,11 @@
374433 shareGeometriesItem.addActionListener(this);
375434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376435 mergeGeometriesItem.addActionListener(this);
436
+ }
377437
378438 oe.menuBar.add(menu = new Menu("Insert"));
379439 buildCreateMenu(menu);
380440
381
-
382441 oe.menuBar.add(menu = new Menu("Include"));
383442 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384443 importGFDItem.addActionListener(this);
....@@ -423,150 +482,98 @@
423482 oe.radioPanel.add(dummyButton);
424483 oe.buttonGroup.add(dummyButton);
425484 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
485
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429486
430
- 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");
431489 liveCB.addItemListener(this);
432490
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- 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");
451497 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- 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");
493501 trackCB.addItemListener(this);
494502
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ screenfitButton.setToolTipText("Screen fit");
497505 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
506
+
499507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500508 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505509
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- 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");
512519 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516520
517
- //
518
- 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");
519525 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521527 fourButton.addActionListener(this);
522
- 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");
523531 sixButton.addActionListener(this);
524
- 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");
525534 threeButton.addActionListener(this);
526
- 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");
527537 sevenButton.addActionListener(this);
528538 //
529539
530
- 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");
531542 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- 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");
534546 closeButton.addActionListener(this);
535547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536548 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538549
539
- oe.aConstraints.gridx = 1; //
540
- 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");
541554 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545555
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
547558 uneditButton.addActionListener(this);
548559
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- 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");
561562 allParamsButton.addActionListener(this);
562563
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- 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");
568570 unselectButton.addActionListener(this);
569571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
570577 // oe.aConstraints.gridx += 1;
571578 // oe.aConstraints.weighty = 0;
572579 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +585,37 @@
578585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579586 // gcButton.addActionListener(this);
580587
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
592591 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- 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);
594593 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
599597
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- 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");
604602 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- 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");
607606 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- 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");
610610 textureCB.addItemListener(this);
611611
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
614615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
615619 //jList.addListSelectionListener(this);
616620 oe.jTree.addTreeSelectionListener(this);
617621 //jTree.setRootVisible(false);
....@@ -633,17 +637,89 @@
633637 radio.layout = sevenButton;
634638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635639 }
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
+ }
636712
637713 void EditObject(Object3D obj)
638714 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- 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();
647723 }
648724 void SetupViews(ObjEditor oe)
649725 {
....@@ -663,6 +739,7 @@
663739 JCheckBox fastCB;
664740 JCheckBox slowCB;
665741 JCheckBox boxCB;
742
+ JCheckBox zoomBoxCB;
666743 JCheckBox trackCB;
667744 JCheckBox smoothfocusCB;
668745 // JCheckBox speakerMocapCB;
....@@ -705,8 +782,7 @@
705782 dropAttributes |= Object3D.TEXTURE;
706783 else
707784 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
785
+ } else if(e.getSource() == liveCB)
710786 {
711787 cameraView.ToggleLive();
712788 }
....@@ -743,6 +819,10 @@
743819 Recompile();
744820 cameraView.repaint();
745821 // refreshContents();
822
+ }
823
+ else if(e.getSource() == zoomBoxCB)
824
+ {
825
+ cameraView.ToggleZoomBoxMode();
746826 }
747827 else if(e.getSource() == smoothfocusCB)
748828 {
....@@ -911,11 +991,11 @@
911991 {
912992 loadClipboard(true);
913993 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
994
+ pasteInto(false, false);
915995 } else {
916996 loadClipboard(false);
917997 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
919999 }
9201000 }
9211001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1113,37 @@
10331113 torusItem.addActionListener(this);
10341114 superItem = menu.add(new MenuItem("Superellipsoid"));
10351115 superItem.addActionListener(this);
1116
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1117
+ kleinItem.addActionListener(this);
10361118 particleItem = menu.add(new MenuItem("Particle system"));
10371119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10381122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391123 ragdollItem.addActionListener(this);
10401124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411125 ragdoll2Item.addActionListener(this);
1126
+ }
10421127 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441129 meshItem.addActionListener(this);
10451130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10471134 springItem = menu.add(new MenuItem("Spring"));
10481135 springItem.addActionListener(this);
10491136 flagItem = menu.add(new MenuItem("Flag"));
10501137 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551138 blobItem = menu.add(new MenuItem("Blob"));
10561139 blobItem.addActionListener(this);
10571140 latheItem = menu.add(new MenuItem("Lathe"));
10581141 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);
10591147 lightItem = menu.add(new MenuItem("Light"));
10601148 lightItem.addActionListener(this);
10611149 menu.add("-");
....@@ -1065,34 +1153,39 @@
10651153 loopItem.addActionListener(this);
10661154 doubleItem = menu.add(new MenuItem("Fork"));
10671155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
10681158 tripleItem = menu.add(new MenuItem("Trident"));
10691159 tripleItem.addActionListener(this);
1160
+ }
10701161 }
10711162
10721163 void buildToolsMenu(Menu menu)
10731164 {
10741165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751166 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
10771168
10781169 menu.add("-");
10791170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801171 parseverticesItem.addActionListener(this);
10811172 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821173 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841175 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881177 reduceMorphItem.addActionListener(this);
10891178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901179 reduce34MorphItem.addActionListener(this);
1091
-
1180
+ menu.add("-");
10921181 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931182 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
10961189 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971190 memoryItem.addActionListener(this);
10981191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1199,8 @@
11061199 resetParentItem.addActionListener(this);
11071200 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081201 repairParentItem.addActionListener(this);
1202
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1203
+ repairShadowItem.addActionListener(this);
11091204 menu.add(invariantsItem = new MenuItem("Invariants"));
11101205 invariantsItem.addActionListener(this);
11111206 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1208,7 @@
11131208 menu.add("-");
11141209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151210 editScriptItem.addActionListener(this);
1211
+ }
11161212 }
11171213
11181214 void ScreenFit()
....@@ -1466,6 +1562,7 @@
14661562 //
14671563 public void actionPerformed(ActionEvent event) // , Object arg)
14681564 {
1565
+ Object source = event.getSource();
14691566 /*
14701567 if (event.getSource() == nameField)
14711568 {
....@@ -1477,11 +1574,11 @@
14771574 }
14781575 else
14791576 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1577
+ if (source == lookAtItem || source == lookFromItem)
14811578 {
14821579 ScreenFit();
14831580 } else
1484
- if (event.getSource() == switchItem)
1581
+ if (source == switchItem)
14851582 {
14861583 cVector v1 = new cVector();
14871584 cVector v2 = new cVector();
....@@ -1490,11 +1587,11 @@
14901587 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911588 objEditor.cameraView.repaint();
14921589 } else
1493
- if (event.getSource() == rectoidItem)
1590
+ if (source == rectoidItem)
14941591 {
14951592 makeSomething(new Box());
14961593 } else
1497
- if (event.getSource() == particleItem)
1594
+ if (source == particleItem)
14981595 {
14991596 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001597 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1612,9 @@
15151612 applyExample(particleGeom, "SMOKE");
15161613 makeSomething(particleGeom);
15171614 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1615
+ if (source == ragdollItem || source == ragdoll2Item)
15191616 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1617
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211618
15221619 ragdoll.toParent = LA.newMatrix();
15231620 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1632,7 @@
15351632 } else
15361633 /*
15371634 */
1538
- if (event.getSource() == heightFieldItem)
1635
+ if (source == heightFieldItem)
15391636 {
15401637 Object3D obj = new Object3D();
15411638
....@@ -1573,27 +1670,31 @@
15731670
15741671 makeSomething(obj);
15751672 } else
1576
- if (event.getSource() == gridItem)
1673
+ if (source == gridItem)
15771674 {
15781675 makeSomething(new Grid());
15791676 } else
1580
- if (event.getSource() == ellipsoidItem)
1677
+ if (source == ellipsoidItem)
15811678 {
15821679 makeSomething(new Sphere());
15831680 } else
1584
- if (event.getSource() == coneItem)
1681
+ if (source == coneItem)
15851682 {
15861683 makeSomething(new Cone());
15871684 } else
1588
- if (event.getSource() == torusItem)
1685
+ if (source == torusItem)
15891686 {
15901687 makeSomething(new Torus());
15911688 } else
1592
- if (event.getSource() == superItem)
1689
+ if (source == superItem)
15931690 {
15941691 makeSomething(new Superellipsoid());
15951692 } else
1596
- if (event.getSource() == blobItem)
1693
+ if (source == kleinItem)
1694
+ {
1695
+ makeSomething(new Klein());
1696
+ } else
1697
+ if (source == blobItem)
15971698 {
15981699 Blob blob = new Blob();
15991700 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1702,15 @@
16011702 //blob.retile();
16021703 makeSomething(blob);
16031704 } else
1604
- if (event.getSource() == latheItem)
1705
+ if (source == latheItem)
16051706 {
16061707 makeSomething(new Lathe());
16071708 } else
1608
- if (event.getSource() == bezierItem)
1709
+ if (source == bezierItem)
16091710 {
16101711 makeSomething(new BezierSurface());
16111712 } else
1612
- if (event.getSource() == checkerItem)
1713
+ if (source == overlayItem)
16131714 {
16141715 /*
16151716 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1725,7 @@
16241725 */
16251726 makeSomething(new Checker());
16261727 } else
1627
- if (event.getSource() == meshItem)
1728
+ if (source == meshItem)
16281729 {
16291730 Object3D itemtomake = new Object3D();
16301731 Object3D child;
....@@ -1645,35 +1746,35 @@
16451746 makeSomething(child);
16461747 }
16471748 } else
1648
- if (event.getSource() == springItem)
1749
+ if (source == springItem)
16491750 {
16501751 cSpring s = new cSpring();
16511752 s.setup();
16521753 makeSomething(s);
16531754 } else
1654
- if (event.getSource() == flagItem)
1755
+ if (source == flagItem)
16551756 {
16561757 cSpring s = new cFlag();
16571758 s.setup();
16581759 makeSomething(s);
16591760 } else
1660
- if (event.getSource() == lightItem)
1761
+ if (source == lightItem)
16611762 {
16621763 makeSomething(new Light());
16631764 } else
1664
- if (event.getSource() == csgItem)
1765
+ if (source == csgItem)
16651766 {
16661767 group(new CSG());
16671768 } else
1668
- if (event.getSource() == templateItem)
1769
+ if (source == templateItem)
16691770 {
16701771 group(new cTemplate());
16711772 } else
1672
- if (event.getSource() == attributeItem)
1773
+ if (source == attributeItem)
16731774 {
16741775 makeSomething(new Attribute());
16751776 } else
1676
- if (event.getSource() == pointflowItem)
1777
+ if (source == pointflowItem)
16771778 {
16781779 makeSomething(new PointFlow());
16791780 } else
....@@ -1685,7 +1786,7 @@
16851786 } else
16861787 */
16871788
1688
- if (event.getSource() == superLoopItem)
1789
+ if (source == superLoopItem)
16891790 {
16901791 Composite g = new cGroup();
16911792 for (int i=0; i<15; i++)
....@@ -1707,7 +1808,7 @@
17071808
17081809 group(g);
17091810 } else
1710
- if (event.getSource() == loopItem)
1811
+ if (source == loopItem)
17111812 {
17121813 Composite csg = new GroupLeaf();
17131814 csg.count = 5;
....@@ -1716,7 +1817,7 @@
17161817 csg.addChild(child);
17171818 child.addChild(csg);
17181819 } else
1719
- if (event.getSource() == doubleItem)
1820
+ if (source == doubleItem)
17201821 {
17211822 Composite csg = new GroupLeaf();
17221823 csg.count = 5;
....@@ -1728,7 +1829,7 @@
17281829 csg.addChild(child);
17291830 child.addChild(csg);
17301831 } else
1731
- if (event.getSource() == tripleItem)
1832
+ if (source == tripleItem)
17321833 {
17331834 Composite csg = new GroupLeaf();
17341835 csg.count = 4;
....@@ -1744,70 +1845,75 @@
17441845 child.addChild(csg);
17451846 } else
17461847
1747
- if (event.getSource() == importGFDItem)
1848
+ if (source == importGFDItem)
17481849 {
17491850 ImportGFD();
17501851 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1852
+ if (source == importVRMLX3DItem)
17521853 {
17531854 ImportVRMLX3D();
17541855 } else
1755
- if (event.getSource() == import3DSItem)
1856
+ if (source == import3DSItem)
17561857 {
17571858 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17581859 } else
1759
- if (event.getSource() == importOBJItem)
1860
+ if (source == importOBJItem)
17601861 {
17611862 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17621863 } else
1763
- if (event.getSource() == computeAOItem)
1864
+ if (source == computeAOItem)
17641865 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1866
+ Globals.drawMode = CameraPane.OCCLUSION;
1867
+ Globals.theRenderer.repaint();
17671868 } else
1768
- if (event.getSource() == recompileItem)
1869
+ if (source == recompileItem)
17691870 {
17701871 Recompile();
17711872 refreshContents();
17721873 } else
1773
- if (event.getSource() == editScriptItem)
1874
+ if (source == editScriptItem)
17741875 {
17751876 OpenDialog();
17761877 refreshContents();
17771878 } else
1778
- if (event.getSource() == invariantsItem)
1879
+ if (source == invariantsItem)
17791880 {
17801881 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1882
+ GrafreeD.grafreeD.universe.invariants();
17821883 } else
1783
- if (event.getSource() == memoryItem)
1884
+ if (source == memoryItem)
17841885 {
17851886 //System.out.println("Invariants:");
17861887 PrintMemory();
17871888 } else
1788
- if (event.getSource() == pathItem)
1889
+ if (source == pathItem)
17891890 {
17901891 PrintPath();
17911892 } else
1792
- if (event.getSource() == analyzeItem)
1893
+ if (source == analyzeItem)
17931894 {
17941895 AnalyzeObject();
17951896 } else
1796
- if (event.getSource() == dumpItem)
1897
+ if (source == dumpItem)
17971898 {
17981899 DumpObject();
17991900 } else
1800
- if (event.getSource() == screenfitButton)
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
1906
+ if (source == screenfitButton)
18011907 {
18021908 //Reload(lastConverter, lastFilename, true);
18031909 ScreenFit();
18041910 } else
1805
- if (event.getSource() == screenfitpointButton)
1911
+ if (source == screenfitpointButton)
18061912 {
18071913 //Reload(lastConverter, lastFilename, true);
18081914 ScreenFitPoint();
18091915 } else
1810
- if (event.getSource() == snapobjectButton)
1916
+ if (source == snapobjectButton)
18111917 {
18121918 //Reload(lastConverter, lastFilename, true);
18131919 SnapObject();
....@@ -1818,13 +1924,13 @@
18181924 // Recompile();
18191925 // refreshContents();
18201926 // } else
1821
- if (event.getSource() == gcButton)
1927
+ if (source == gcButton)
18221928 {
18231929 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241930 System.gc();
18251931 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261932 } else
1827
- if (event.getSource() == editLeafItem)
1933
+ if (source == editLeafItem)
18281934 {
18291935 Object3D obj;
18301936 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1944,66 @@
18381944 }
18391945 refreshContents(true);
18401946 } else
1841
- if (event.getSource() == openWindowItem)
1947
+ if (source == openWindowItem)
18421948 {
18431949 EditSelection(true);
18441950 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1951
+ if (source == cutItem || source == clearButton)
18461952 {
18471953 loadClipboard(true);
18481954 } else
1849
- if (event.getSource() == duplicateItem)
1955
+ if (source == duplicateItem)
18501956 {
18511957 Object3D keep = GrafreeD.clipboard;
18521958 loadClipboard(false);
18531959 paste(false);
18541960 GrafreeD.clipboard = keep;
18551961 } else
1856
- if (event.getSource() == cloneItem)
1962
+ if (source == cloneItem)
18571963 {
18581964 CloneSelection(false);
18591965 } else
1860
- if (event.getSource() == cloneSupportItem)
1966
+ if (source == cloneSupportItem)
18611967 {
18621968 CloneSelection(true);
18631969 } else
1864
- if (event.getSource() == copyItem)
1970
+ if (source == copyItem)
18651971 {
18661972 loadClipboard(false);
18671973 } else
1868
- if (event.getSource() == pasteItem)
1974
+ if (source == pasteItem)
18691975 {
18701976 paste(false);
18711977 } else
1872
- if (event.getSource() == pasteLinkItem)
1978
+ if (source == pasteIntoItem)
18731979 {
1874
- pasteInto(false);
1980
+ pasteInto(true, false);
18751981 } else
1876
- if (event.getSource() == pasteCloneItem)
1982
+ if (source == pasteLinkItem)
18771983 {
1878
- pasteInto(true);
1984
+ pasteInto(false, false);
18791985 } else
1880
- if (event.getSource() == pasteExpandItem)
1986
+ if (source == pasteCloneItem)
1987
+ {
1988
+ pasteInto(true, true);
1989
+ } else
1990
+ if (source == pasteExpandItem)
18811991 {
18821992 paste(true);
18831993 } else
1884
- if (event.getSource() == synchronizeItem)
1994
+ if (source == synchronizeItem)
18851995 {
18861996 Overwrite(Object3D.TRANSFORM);
18871997 } else
1888
- if (event.getSource() == overwriteNameItem)
1998
+ if (source == overwriteNameItem)
18891999 {
18902000 Overwrite(Object3D.NAME);
18912001 } else
1892
- if (event.getSource() == overwriteUVItem)
2002
+ if (source == overwriteUVItem)
18932003 {
18942004 Overwrite(Object3D.UV);
18952005 } else
1896
- if (event.getSource() == overwriteMatItem)
2006
+ if (source == overwriteMatItem)
18972007 {
18982008 /* july 2015
18992009 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2023,7 @@
19132023
19142024 Overwrite(dropAttributes);
19152025 }
1916
- if (event.getSource() == overwriteGeoItem)
2026
+ if (source == overwriteGeoItem)
19172027 {
19182028 Overwrite(Object3D.GEOMETRY);
19192029 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2040,7 @@
19302040 // refreshContents();
19312041 // }
19322042 } else
1933
- if (event.getSource() == generateMeshItem)
2043
+ if (source == generateMeshItem)
19342044 {
19352045 //if (group.selection.size() == 1)
19362046 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2051,7 @@
19412051 ResetModel();
19422052 refreshContents();
19432053 } else
1944
- if (event.getSource() == extractGeometriesItem)
2054
+ if (source == extractGeometriesItem)
19452055 {
19462056 boolean one = false;
19472057
....@@ -1968,7 +2078,7 @@
19682078 ResetModel();
19692079 refreshContents();
19702080 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2081
+ if (source == cloneGeometriesItem)
19722082 {
19732083 boolean one = false;
19742084
....@@ -1994,32 +2104,37 @@
19942104 ResetModel();
19952105 refreshContents();
19962106 } else
1997
- if (event.getSource() == shareGeometriesItem)
2107
+ if (source == shareGeometriesItem)
19982108 {
19992109 boolean one = false;
20002110
20012111 if (group.selection.size() == 1)
20022112 one = true;
20032113
2114
+ Object3D merge = null;
2115
+
20042116 Object3D content = new cGroup();
20052117
20062118 for (int i=0; i<group.selection.size(); i++)
20072119 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2120
+ merge = new Merge(group.selection.get(i));
20092121
20102122 if (one)
2011
- makeSomething(sel, false);
2123
+ makeSomething(merge, false);
20122124 else
2013
- content.addChild(sel);
2125
+ content.addChild(merge);
20142126 }
20152127
20162128 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2129
+ makeSomething(content, true);
2130
+ else
2131
+ {
2132
+ ResetModel();
2133
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2134
+ refreshContents();
2135
+ }
20212136 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2137
+ if (source == mergeGeometriesItem)
20232138 {
20242139 boolean one = false;
20252140
....@@ -2049,7 +2164,7 @@
20492164 ResetModel();
20502165 refreshContents();
20512166 } else
2052
- if (event.getSource() == linkverticesItem)
2167
+ if (source == linkverticesItem)
20532168 {
20542169 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552170 // {
....@@ -2069,32 +2184,41 @@
20692184 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702185 content = ((cGroup)content).get(0);
20712186
2072
- 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));
20732188 for (int i=0; i<group.selection.size(); i++)
20742189 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
20772192 group.selection.get(i).linkVerticesThis(content);
20782193 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
20802195 }
2081
- 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));
20822197 refreshContents();
20832198 }
20842199 } else
2085
- if (event.getSource() == resetsupportItem)
2200
+ if (source == resetsupportItem)
20862201 {
20872202 for (int i=0; i<group.selection.size(); i++)
20882203 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
20912206 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
20932208 }
20942209
20952210 refreshContents();
20962211 } else
2097
- 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)
20982222 {
20992223 for (int i=0; i<group.selection.size(); i++)
21002224 {
....@@ -2103,7 +2227,7 @@
21032227
21042228 refreshContents();
21052229 } else
2106
- if (event.getSource() == setMasterItem)
2230
+ if (source == setMasterItem)
21072231 {
21082232 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21092233 {
....@@ -2116,7 +2240,7 @@
21162240 refreshContents();
21172241 }
21182242 } else
2119
- if (event.getSource() == poseMeshItem)
2243
+ if (source == poseMeshItem)
21202244 {
21212245 if (group.selection.size() == 1)
21222246 {
....@@ -2135,19 +2259,19 @@
21352259 }
21362260
21372261 } else
2138
- if (event.getSource() == revertMeshItem)
2262
+ if (source == revertMeshItem)
21392263 {
21402264 RevertMeshes();
21412265 } else
2142
- if (event.getSource() == resetMeshItem)
2266
+ if (source == resetMeshItem)
21432267 {
21442268 ResetAll();
21452269 } else
2146
- if (event.getSource() == stepAllItem)
2270
+ if (source == stepAllItem)
21472271 {
21482272 StepAll();
21492273 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2274
+ if (source == clearItem) // || event.getSource() == clearButton)
21512275 {
21522276 //int indices[] = jList.getSelectedIndices();
21532277 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2279,46 @@
21552279
21562280 ClearSelection(false);
21572281 } else
2158
- if (event.getSource() == clearAllItem)
2282
+ if (source == clearAllItem)
21592283 {
21602284 ClearSelection(true);
21612285 } else
2162
- if (event.getSource() == grabItem)
2286
+ if (source == grabItem)
21632287 {
21642288 group(new cGroup(), true);
21652289 } else
2166
- if (event.getSource() == frontItem)
2290
+ if (source == hideItem)
2291
+ {
2292
+ group(new HiddenObject());
2293
+ } else
2294
+ if (source == frontItem)
21672295 {
21682296 front();
21692297 } else
2170
- if (event.getSource() == backItem)
2298
+ if (source == backItem)
21712299 {
21722300 back();
21732301 } else
2174
- if (event.getSource() == cameraItem)
2302
+ if (source == cameraItem)
21752303 {
21762304 makeSomething(new Camera());
21772305 } else
2178
- if (event.getSource() == compositeItem)
2306
+ if (source == compositeItem)
21792307 {
21802308 group(new Composite());
21812309 } else
2182
- if (event.getSource() == randomItem)
2310
+ if (source == randomItem)
21832311 {
21842312 RandomNode random = new RandomNode();
21852313 group(random);
21862314 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
21882316 } else
2189
- if (event.getSource() == physicsItem)
2317
+ if (source == physicsItem)
21902318 {
21912319 group(new PhysicsNode());
21922320 } else
2193
- if (event.getSource() == frameselectorItem)
2321
+ if (source == frameselectorItem)
21942322 {
21952323 for (int i=0; i<group.selection.size(); i++)
21962324 {
....@@ -2202,7 +2330,7 @@
22022330 ResetModel();
22032331 refreshContents();
22042332 } else
2205
- if (event.getSource() == switchGeoItem)
2333
+ if (source == switchGeoItem)
22062334 {
22072335 for (int i=0; i<group.selection.size(); i++)
22082336 {
....@@ -2214,7 +2342,7 @@
22142342 ResetModel();
22152343 refreshContents();
22162344 } else
2217
- if (event.getSource() == switchTransfoItem)
2345
+ if (source == switchTransfoItem)
22182346 {
22192347 for (int i=0; i<group.selection.size(); i++)
22202348 {
....@@ -2226,7 +2354,7 @@
22262354 ResetModel();
22272355 refreshContents();
22282356 } else
2229
- if (event.getSource() == morphItem)
2357
+ if (source == morphItem)
22302358 {
22312359 for (int i=0; i<group.selection.size(); i++)
22322360 {
....@@ -2238,7 +2366,7 @@
22382366 ResetModel();
22392367 refreshContents();
22402368 } else
2241
- if (event.getSource() == scriptNodeItem)
2369
+ if (source == scriptNodeItem)
22422370 {
22432371 boolean atleastone = false;
22442372
....@@ -2277,195 +2405,215 @@
22772405 }
22782406 }
22792407 } else
2280
- if (event.getSource() == linkerItem)
2408
+ if (source == linkerItem)
22812409 {
22822410 group(new cLinker());
22832411 } else
2284
- if (event.getSource() == textureItem)
2412
+ if (source == textureItem)
22852413 {
22862414 group(new TextureNode());
22872415 } else
2288
- if (event.getSource() == shadowXItem)
2416
+ if (source == billboardItem)
2417
+ {
2418
+ group(new BillboardNode());
2419
+ } else
2420
+ if (source == shadowXItem)
22892421 {
22902422 CastShadow(0);
22912423 } else
2292
- if (event.getSource() == shadowYItem)
2424
+ if (source == shadowYItem)
22932425 {
22942426 CastShadow(1);
22952427 } else
2296
- if (event.getSource() == shadowZItem)
2428
+ if (source == shadowZItem)
22972429 {
22982430 CastShadow(2);
22992431 } else
2300
- if (event.getSource() == ungroupItem)
2432
+ if (source == ungroupItem)
23012433 {
2302
- 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();
23032443 } else
2304
- if (event.getSource() == genUVItem)
2444
+ if (source == genUVItem)
23052445 {
23062446 GenUV();
23072447 } else
2308
- if (event.getSource() == genNormalsCADItem)
2448
+ if (source == genNormalsCADItem)
23092449 {
23102450 GenNormals(true);
23112451 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2452
+ if (source == genNormalsMESHItem)
2453
+ {
2454
+ GenNormals(true); // TODO
2455
+ } else
2456
+ if (source == genNormalsORGANItem)
23132457 {
23142458 GenNormals(false);
23152459 } else
2316
- if (event.getSource() == stripifyItem)
2460
+ if (source == genNormalsMINEItem)
2461
+ {
2462
+ GenNormalsMINE();
2463
+ } else
2464
+ if (source == stripifyItem)
23172465 {
23182466 Stripify();
23192467 } else
2320
- if (event.getSource() == unstripifyItem)
2468
+ if (source == unstripifyItem)
23212469 {
23222470 Unstripify();
23232471 } else
2324
- if (event.getSource() == trimItem)
2472
+ if (source == trimItem)
23252473 {
23262474 Trim();
23272475 } else
2328
- if (event.getSource() == untrimItem)
2476
+ if (source == untrimItem)
23292477 {
23302478 Untrim();
23312479 } else
2332
- if (event.getSource() == clearColorsItem)
2480
+ if (source == clearColorsItem)
23332481 {
23342482 ClearColors();
23352483 } else
2336
- if (event.getSource() == clearMaterialsItem)
2484
+ if (source == clearMaterialsItem)
23372485 {
23382486 ClearMaterials();
23392487 } else
2340
- if (event.getSource() == liveleavesItem)
2488
+ if (source == liveleavesItem)
23412489 {
23422490 LiveLeaves(true);
23432491 } else
2344
- if (event.getSource() == unliveleavesItem)
2492
+ if (source == unliveleavesItem)
23452493 {
23462494 LiveLeaves(false);
23472495 } else
2348
- if (event.getSource() == supportleavesItem)
2496
+ if (source == supportleavesItem)
23492497 {
23502498 SupportLeaves(true);
23512499 } else
2352
- if (event.getSource() == unsupportleavesItem)
2500
+ if (source == unsupportleavesItem)
23532501 {
23542502 SupportLeaves(false);
23552503 } else
2356
- if (event.getSource() == hideleavesItem)
2504
+ if (source == hideleavesItem)
23572505 {
23582506 HideLeaves(true);
23592507 } else
2360
- if (event.getSource() == showleavesItem)
2508
+ if (source == showleavesItem)
23612509 {
23622510 HideLeaves(false);
23632511 } else
2364
- if (event.getSource() == markleavesItem)
2512
+ if (source == markleavesItem)
23652513 {
23662514 MarkLeaves(true);
23672515 } else
2368
- if (event.getSource() == unmarkleavesItem)
2516
+ if (source == unmarkleavesItem)
23692517 {
23702518 MarkLeaves(false);
23712519 } else
2372
- if (event.getSource() == flipVItem)
2520
+ if (source == flipVItem)
23732521 {
23742522 FlipV(true);
23752523 } else
2376
- if (event.getSource() == unflipVItem)
2524
+ if (source == unflipVItem)
23772525 {
23782526 FlipV(false);
23792527 } else
2380
- if (event.getSource() == lowTexturesItem)
2528
+ if (source == lowTexturesItem)
23812529 {
23822530 SetTexRes(0);
23832531 } else
2384
- if (event.getSource() == normalTexturesItem)
2532
+ if (source == normalTexturesItem)
23852533 {
23862534 SetTexRes(1);
23872535 } else
2388
- if (event.getSource() == highTexturesItem)
2536
+ if (source == highTexturesItem)
23892537 {
23902538 SetTexRes(2);
23912539 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2540
+ if (source == veryhighTexturesItem)
23932541 {
23942542 SetTexRes(3);
23952543 } else
2396
- if (event.getSource() == maxTexturesItem)
2544
+ if (source == maxTexturesItem)
23972545 {
23982546 SetTexRes(4);
23992547 } else
2400
- if (event.getSource() == panoTexturesItem)
2548
+ if (source == panoTexturesItem)
24012549 {
24022550 SetTexRes(5);
24032551 } else
2404
- if (event.getSource() == reverseNormalsItem)
2552
+ if (source == reverseNormalsItem)
24052553 {
24062554 ReverseNormals();
24072555 } else
2408
- if (event.getSource() == parseverticesItem)
2556
+ if (source == parseverticesItem)
24092557 {
24102558 ParseVertices();
24112559 } else
2412
- if (event.getSource() == textureFieldItem)
2560
+ if (source == textureFieldItem)
24132561 {
24142562 TextureVertices();
24152563 } else
2416
- if (event.getSource() == alignItem)
2564
+ if (source == alignItem)
24172565 {
24182566 Align();
24192567 } else
2420
- if (event.getSource() == mirrorItem)
2568
+ if (source == mirrorItem)
24212569 {
24222570 MirrorPoses();
24232571 } else
2424
- if (event.getSource() == reduceMorphItem)
2572
+ if (source == reduceMorphItem)
24252573 {
24262574 MeshReduction(false);
24272575 } else
2428
- if (event.getSource() == reduce34MorphItem)
2576
+ if (source == reduce34MorphItem)
24292577 {
24302578 MeshReduction(true);
24312579 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2580
+ if (source == reverseTrianglesItem)
24332581 {
24342582 ReverseTriangles();
24352583 } else
2436
- if (event.getSource() == reduceMeshItem)
2584
+ if (source == reduceMeshItem)
24372585 {
24382586 ReduceMesh(false);
24392587 } else
2440
- if (event.getSource() == reduce34MeshItem)
2588
+ if (source == reduce34MeshItem)
24412589 {
24422590 ReduceMesh(true);
24432591 } else
2444
- if (event.getSource() == increaseMeshItem)
2592
+ if (source == increaseMeshItem)
24452593 {
24462594 IncreaseMesh();
24472595 } else
2448
- if (event.getSource() == clipMeshItem)
2596
+ if (source == clipMeshItem)
24492597 {
24502598 ClipMesh();
24512599 } else
2452
- if (event.getSource() == smoothMeshItem)
2600
+ if (source == smoothMeshItem)
24532601 {
24542602 SmoothMesh();
24552603 } else
2456
- if (event.getSource() == transformgeometryItem)
2604
+ if (source == transformgeometryItem)
24572605 {
24582606 TransformGeometry();
24592607 } else
2460
- if (event.getSource() == resetTransformItem)
2608
+ if (source == resetTransformItem)
24612609 {
24622610 ResetTransform();
24632611 } else
2464
- if (event.getSource() == resetCentroidItem)
2612
+ if (source == resetCentroidItem)
24652613 {
24662614 ResetCentroid();
24672615 } else
2468
- if (event.getSource() == resetParentItem)
2616
+ if (source == resetParentItem)
24692617 {
24702618 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712619 {
....@@ -2475,7 +2623,7 @@
24752623
24762624 refreshContents();
24772625 } else
2478
- if (event.getSource() == repairParentItem)
2626
+ if (source == repairParentItem)
24792627 {
24802628 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812629 {
....@@ -2489,7 +2637,21 @@
24892637
24902638 refreshContents();
24912639 } else
2492
- 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)
24932655 {
24942656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952657 {
....@@ -2501,7 +2663,7 @@
25012663 ResetModel();
25022664 refreshContents();
25032665 } else
2504
- if (event.getSource() == sortbynameItem)
2666
+ if (source == sortbynameItem)
25052667 {
25062668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072669 {
....@@ -2513,7 +2675,7 @@
25132675 ResetModel();
25142676 refreshContents();
25152677 } else
2516
- if (event.getSource() == attachPigmentItem)
2678
+ if (source == attachPigmentItem)
25172679 {
25182680 String texture = GetFile("Attach pigment");
25192681 Object3D obj;
....@@ -2525,7 +2687,7 @@
25252687
25262688 refreshContents();
25272689 } else
2528
- if (event.getSource() == detachPigmentItem)
2690
+ if (source == detachPigmentItem)
25292691 {
25302692 Object3D obj;
25312693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2698,7 @@
25362698
25372699 refreshContents();
25382700 } else
2539
- if (event.getSource() == attachBumpItem)
2701
+ if (source == attachBumpItem)
25402702 {
25412703 String texture = GetFile("Attach bump");
25422704 Object3D obj;
....@@ -2548,7 +2710,7 @@
25482710
25492711 refreshContents();
25502712 } else
2551
- if (event.getSource() == detachBumpItem)
2713
+ if (source == detachBumpItem)
25522714 {
25532715 Object3D obj;
25542716 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2721,7 @@
25592721
25602722 refreshContents();
25612723 } else
2562
- if (event.getSource() == pigmentBumpItem)
2724
+ if (source == pigmentBumpItem)
25632725 {
25642726 Object3D obj;
25652727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2732,195 @@
25702732
25712733 refreshContents();
25722734 } else
2573
- if (event.getSource() == flashSelectionButton)
2735
+ if (source == flashSelectionButton)
25742736 {
25752737 CameraPane.flash = true;
25762738 refreshContents();
25772739 } else
2578
- if (event.getSource() == oneButton)
2740
+ if (source == oneButton)
25792741 {
25802742 } else
2581
- if (event.getSource() == twoButton)
2743
+ if (source == twoButton)
25822744 {
25832745 radio.layout = twoButton;
25842746 // bug
25852747 //gridPanel.setDividerLocation(1.0);
25862748 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- 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();
26112778 } else
2612
- if (event.getSource() == threeButton)
2779
+ if (source == threeButton)
26132780 {
26142781 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- 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();
26392814 } else
2640
- if (event.getSource() == fourButton)
2815
+ if (source == fourButton)
26412816 {
26422817 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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();
26672849 } else
2668
- if (event.getSource() == sixButton)
2850
+ if (source == sixButton)
26692851 {
26702852 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- 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();
26952885 } else
2696
- if (event.getSource() == sevenButton)
2886
+ if (source == sevenButton)
26972887 {
26982888 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27232922 } else
2724
- if (event.getSource() == rootButton)
2923
+ if (source == rootButton)
27252924 {
27262925 Object3D obj;
27272926 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2932,7 @@
27332932
27342933 refreshContents(true);
27352934 } else
2736
- if (event.getSource() == closeButton)
2935
+ if (source == closeButton)
27372936 {
27382937 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392938 cRadio ab;
....@@ -2754,11 +2953,11 @@
27542953 }
27552954 refreshContents(true);
27562955 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
2956
+ if (source == editItem || source == editButton)
27582957 {
27592958 EditSelection(false);
27602959 } else
2761
- if (event.getSource() == uneditButton)
2960
+ if (source == uneditButton)
27622961 {
27632962 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27642963 {
....@@ -2770,12 +2969,12 @@
27702969
27712970 child.editWindow = null; // ???????????
27722971 }
2773
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
27742973 //objEditor.jTree.clearSelection();
27752974 //objEditor.ResetSliders();
27762975 refreshContents(true);
27772976 } else
2778
- if (event.getSource() == clearPanelButton)
2977
+ if (source == clearPanelButton)
27792978 {
27802979 assert(copy == group);
27812980 //copy.ClearUI();
....@@ -2786,7 +2985,7 @@
27862985 listUI.clear();
27872986 refreshContents(true);
27882987 } else
2789
- if (event.getSource() == allParamsButton)
2988
+ if (source == allParamsButton)
27902989 {
27912990 assert(copy == group);
27922991
....@@ -2807,19 +3006,19 @@
28073006
28083007 refreshContents(true);
28093008 } else
2810
- if (event.getSource() == unselectButton)
3009
+ if (source == unselectButton)
28113010 {
28123011 objEditor.jTree.clearSelection();
28133012 // ?? oct 2012 GrafreeD.clipboard.clear();
28143013 objEditor.ResetSliders();
28153014 refreshContents(true);
28163015 } else
2817
- if(event.getSource() instanceof cRadio)
3016
+ if(source instanceof cRadio)
28183017 {
28193018 group.parent = keepparent;
28203019 group.attributes = 0;
28213020 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3021
+ /*cRadio*/ radio = (cRadio)source;
28233022 Object3D obj = radio.GetObject();
28243023 System.out.println("Edit " + obj);
28253024 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3038,7 @@
28393038 }
28403039
28413040 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3041
+ //Globals.theRenderer.object = group;
28433042 if(!useclient)
28443043 {
28453044 cameraView.renderCamera = radio.camera;
....@@ -2848,7 +3047,8 @@
28483047 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493048 cameraView.targetLookAt.set(radio.camera.lookAt);
28503049 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3050
+ //cameraView.lighttouched = true;
3051
+ Globals.lighttouched = true;
28523052 topView.object = group;
28533053 frontView.object = group;
28543054 sideView.object = group;
....@@ -2884,7 +3084,7 @@
28843084 if (useclient)
28853085 {
28863086 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3087
+ Globals.lighttouched = true;
28883088 //topView.object = client;
28893089 //frontView.object = client;
28903090 //sideView.object = client;
....@@ -2892,7 +3092,7 @@
28923092 else
28933093 {
28943094 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3095
+ Globals.lighttouched = true;
28963096 //topView.object = group;
28973097 //frontView.object = group;
28983098 //sideView.object = group;
....@@ -3173,6 +3373,13 @@
31733373 refreshContents();
31743374 }
31753375
3376
+ void GenNormalsMINE()
3377
+ {
3378
+ group.selection.GenNormalsMINE();
3379
+
3380
+ refreshContents();
3381
+ }
3382
+
31763383 void Stripify()
31773384 {
31783385 group.StripifyS();
....@@ -3393,7 +3600,7 @@
33933600 String pigment = Object3D.GetPigment(tex);
33943601 //String bump = Object3D.GetBump(tex);
33953602
3396
- 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);
33973604
33983605 double s = v.s;
33993606
....@@ -3441,12 +3648,26 @@
34413648
34423649 void Align()
34433650 {
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
+
34443665 for (int i=0; i<group.selection.size(); i++)
34453666 {
34463667 Object3D obj = group.selection.get(i);
34473668
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- 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);
34503671 }
34513672
34523673 refreshContents();
....@@ -3467,11 +3688,11 @@
34673688
34683689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693690
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
34723693 lowres.linkVerticesThis(null);
34733694 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
34753696
34763697 System.err.flush();
34773698
....@@ -3680,7 +3901,7 @@
36803901 group.selection.RelinkToSupport(); // july 2014
36813902 System.out.println("DONE.");
36823903 refreshContents();
3683
- 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));
36843905 }
36853906
36863907 void ReduceMesh(boolean reduction34)
....@@ -3956,25 +4177,25 @@
39564177 System.err.println("info : " + child.GetPath());
39574178 }
39584179 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
39654186
39664187 objEditor.SetText(); // jan 2014
39674188
3968
- 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))
39694190 CameraPane.flash = true;
39704191
39714192 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724193 // a camera
39734194 {
39744195 CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // 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;
39784199 }
39794200
39804201 refreshContents();
....@@ -4229,7 +4450,7 @@
42294450 refreshContents();
42304451 }
42314452
4232
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
42334454 {
42344455 // if (GrafreeD.clipboard == null)
42354456 // return;
....@@ -4258,7 +4479,14 @@
42584479 if (copyit)
42594480 {
42604481 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
42624490 }
42634491 else
42644492 {
....@@ -4468,6 +4696,26 @@
44684696 makeSomething(csg);
44694697 }
44704698
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
+
44714719 void ungroup()
44724720 {
44734721 /*
....@@ -4782,10 +5030,12 @@
47825030 cButton flashSelectionButton;
47835031 cButton editButton;
47845032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
47855034 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875035 cButton unselectButton;
47885036
5037
+ cButton oneStepButton;
5038
+
47895039 cButton screenfitButton;
47905040 cButton screenfitpointButton;
47915041 cButton snapobjectButton;
....@@ -4827,6 +5077,7 @@
48275077 private MenuItem resetsupportItem;
48285078 private MenuItem resetreferencesItem;
48295079 private MenuItem linkverticesItem;
5080
+ private MenuItem relinkverticesItem;
48305081 private MenuItem setMasterItem;
48315082 private MenuItem resetMeshItem;
48325083 private MenuItem stepAllItem;
....@@ -4839,14 +5090,17 @@
48395090 private MenuItem mergeGeometriesItem;
48405091 private MenuItem copyItem;
48415092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
48425094 private MenuItem pasteLinkItem;
48435095 private MenuItem pasteCloneItem;
48445096 private MenuItem pasteExpandItem;
48455097 private MenuItem clearItem;
48465098 private MenuItem clearAllItem;
48475099 private MenuItem genUVItem;
5100
+ private MenuItem genNormalsMESHItem;
48485101 private MenuItem genNormalsCADItem;
48495102 private MenuItem genNormalsORGANItem;
5103
+ private MenuItem genNormalsMINEItem;
48505104 private MenuItem stripifyItem;
48515105 private MenuItem unstripifyItem;
48525106 private MenuItem trimItem;
....@@ -4888,6 +5142,7 @@
48885142 private MenuItem resetCentroidItem;
48895143 private MenuItem transformgeometryItem;
48905144 private MenuItem resetTransformItem;
5145
+ private MenuItem hideItem;
48915146 private MenuItem grabItem;
48925147 private MenuItem backItem;
48935148 private MenuItem frontItem;
....@@ -4908,6 +5163,7 @@
49085163
49095164 private MenuItem resetParentItem;
49105165 private MenuItem repairParentItem;
5166
+ private MenuItem repairShadowItem;
49115167 private MenuItem sortbysizeItem;
49125168 private MenuItem sortbynameItem;
49135169
....@@ -4928,10 +5184,11 @@
49285184 private MenuItem coneItem;
49295185 private MenuItem torusItem;
49305186 private MenuItem superItem;
5187
+ private MenuItem kleinItem;
49315188 private MenuItem blobItem;
49325189 private MenuItem latheItem;
49335190 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
49355192 private MenuItem meshItem;
49365193 // private MenuItem meshGroupItem;
49375194 private MenuItem springItem;
....@@ -4940,6 +5197,7 @@
49405197 private MenuItem csgItem;
49415198 private MenuItem templateItem;
49425199 private MenuItem textureItem;
5200
+ private MenuItem billboardItem;
49435201 private MenuItem shadowXItem;
49445202 private MenuItem shadowYItem;
49455203 private MenuItem shadowZItem;