Normand Briere
2019-05-01 d1e1417edc8a6ccf195b6da3270f22234dda61e4
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,
....@@ -219,6 +220,8 @@
219220 resetsupportItem.addActionListener(this);
220221 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221222 linkverticesItem.addActionListener(this);
223
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224
+ relinkverticesItem.addActionListener(this);
222225 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223226 setMasterItem.addActionListener(this);
224227
....@@ -231,17 +234,21 @@
231234 frontItem.addActionListener(this);
232235 compositeItem = menu.add(new MenuItem("Composite"));
233236 compositeItem.addActionListener(this);
237
+ hideItem = menu.add(new MenuItem("Hide"));
238
+ hideItem.addActionListener(this);
239
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
240
+ ungroupItem.addActionListener(this);
234241 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
242
+ randomItem = menu.add(new MenuItem("Switch node"));
236243 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);
241244 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242245 switchGeoItem.addActionListener(this);
243246 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244247 switchTransfoItem.addActionListener(this);
248
+ physicsItem = menu.add(new MenuItem("Physics"));
249
+ physicsItem.addActionListener(this);
250
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251
+ frameselectorItem.addActionListener(this);
245252 morphItem = menu.add(new MenuItem("Morph"));
246253 morphItem.addActionListener(this);
247254 scriptNodeItem = menu.add(new MenuItem("Script Node"));
....@@ -252,6 +259,8 @@
252259 oe.menuBar.add(menu = new Menu("Object"));
253260 textureItem = menu.add(new MenuItem("Texture"));
254261 textureItem.addActionListener(this);
262
+ billboardItem = menu.add(new MenuItem("Billboard"));
263
+ billboardItem.addActionListener(this);
255264 csgItem = menu.add(new MenuItem("CSG"));
256265 csgItem.addActionListener(this);
257266 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -269,14 +278,12 @@
269278 pointflowItem = menu.add(new MenuItem("Point Flow"));
270279 pointflowItem.addActionListener(this);
271280 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274281 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275282 resetTransformItem.addActionListener(this);
276283 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277284 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
285
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
+ transformgeometryItem.addActionListener(this);
280287
281288 oe.menuBar.add(menu = new Menu("Geometry"));
282289 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +294,8 @@
287294 genNormalsCADItem.addActionListener(this);
288295 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289296 genNormalsMESHItem.addActionListener(this);
297
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298
+ genNormalsMINEItem.addActionListener(this);
290299 stripifyItem = menu.add(new MenuItem("Stripify"));
291300 stripifyItem.addActionListener(this);
292301 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -425,150 +434,94 @@
425434 oe.radioPanel.add(dummyButton);
426435 oe.buttonGroup.add(dummyButton);
427436 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431438
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
433441 liveCB.addItemListener(this);
434442
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);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
453445 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);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
+ trackCB.setToolTipText("Enable tracking");
495449 trackCB.addItemListener(this);
496450
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
452
+ screenfitButton.setToolTipText("Screen fit");
499453 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
454
+
501455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502456 // 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;
507457
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);
458
+ if (Globals.ADVANCED)
459
+ {
460
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461
+ snapobjectButton.addActionListener(this);
462
+ snapobjectButton.setToolTipText("Snap Object");
463
+ }
464
+
465
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
466
+ flashSelectionButton.setToolTipText("Show selection");
514467 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518468
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
469
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470
+
471
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
472
+ twoButton.setToolTipText("Show center view only");
521473 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
474
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523475 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ fourButton.setToolTipText("Show left panel only");
477
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
478
+ sixButton.setToolTipText("2-column layout left");
525479 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ threeButton.setToolTipText("2-column layout right");
527482 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ sevenButton.setToolTipText("3-column layout");
529485 sevenButton.addActionListener(this);
530486 //
531487
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
488
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
489
+ rootButton.setToolTipText("Edit selection in new tab");
533490 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
493
+ closeButton.setToolTipText("Close tab");
536494 closeButton.addActionListener(this);
537495 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538496 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540497
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
498
+ cGridBag commandsPanel = new cGridBag();
499
+
500
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
501
+ editButton.setToolTipText("Edit selection");
543502 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547503
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
504
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505
+ uneditButton.setToolTipText("Unedit selection");
549506 uneditButton.addActionListener(this);
550507
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);
508
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
509
+ clearPanelButton.setToolTipText("Clear edit panel");
556510 clearPanelButton.addActionListener(this);
557511
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);
512
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ allParamsButton.setToolTipText("All params??");
563514 allParamsButton.addActionListener(this);
564515
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);
516
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ unselectButton.setToolTipText("Unselect");
570518 unselectButton.addActionListener(this);
571519
520
+ commandsPanel.preferredHeight = 1;
521
+
522
+ oe.treePanel.add(commandsPanel);
523
+ oe.treePanel.Return();
524
+
572525 // oe.aConstraints.gridx += 1;
573526 // oe.aConstraints.weighty = 0;
574527 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +533,37 @@
580533 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581534 // gcButton.addActionListener(this);
582535
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;
536
+ cGridBag jSPPanel = new cGridBag();
537
+
538
+ JScrollPane jSP;
594539 //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);
540
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596541 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
542
+
543
+ oe.treePanel.add(jSPPanel);
544
+ oe.treePanel.Return();
601545
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);
546
+ cGridBag copyOptionsPanel = new cGridBag();
547
+
548
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
549
+ colorCB.setToolTipText("Copy color when dropped");
606550 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
551
+
552
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
553
+ materialCB.setToolTipText("Copy material when dropped");
609554 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
555
+
556
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
557
+ textureCB.setToolTipText("Copy texture when dropped");
612558 textureCB.addItemListener(this);
613559
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
560
+ copyOptionsPanel.preferredHeight = 1;
561
+ oe.treePanel.add(copyOptionsPanel);
562
+ oe.treePanel.Return();
616563
564
+// mainPanel.setDividerLocation(0.5); //1.0);
565
+// mainPanel.setResizeWeight(0.5);
566
+
617567 //jList.addListSelectionListener(this);
618568 oe.jTree.addTreeSelectionListener(this);
619569 //jTree.setRootVisible(false);
....@@ -635,17 +585,85 @@
635585 radio.layout = sevenButton;
636586 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637587 }
588
+
589
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590
+ {
591
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
+ supportCB.setToolTipText("Enabled rigging");
593
+ supportCB.addItemListener(this);
594
+
595
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
596
+ // localCB.addItemListener(this);
597
+
598
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
599
+ crowdCB.setToolTipText("Used for crowds");
600
+ crowdCB.addItemListener(this);
601
+
602
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
603
+ smoothCB.setToolTipText("Snapping delay");
604
+ smoothCB.addItemListener(this);
605
+
606
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
607
+ slowCB.setToolTipText("Smooth interpolation");
608
+ slowCB.addItemListener(this);
609
+
610
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
+ boxCB.setToolTipText("Display bounding boxes");
612
+ boxCB.addItemListener(this);
613
+
614
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
+ zoomBoxCB.addItemListener(this);
617
+
618
+// constraints.gridy += 1;
619
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620
+// speakerMocapCB.addItemListener(this);
621
+
622
+ if (false)
623
+ {
624
+ // handled in scripts
625
+ //constraints.gridy += 1;
626
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
627
+ speakerCameraCB.addItemListener(this);
628
+
629
+ //constraints.gridy += 1;
630
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
631
+ speakerFocusCB.addItemListener(this);
632
+
633
+ //constraints.gridy += 1;
634
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
635
+ smoothfocusCB.addItemListener(this);
636
+ }
637
+
638
+//constraints.gridx += 1;
639
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
640
+// debugCB.addItemListener(this);
641
+
642
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
643
+ oeilCB.addItemListener(this);
644
+
645
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646
+ lookAtCB.setToolTipText("Look-at target");
647
+ lookAtCB.addItemListener(this);
648
+
649
+ cGridBag fill = new cGridBag();
650
+
651
+ fill.preferredHeight = 200;
652
+
653
+ panel.add(fill);
654
+
655
+ }
638656
639657 void EditObject(Object3D obj)
640658 {
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();
659
+ cRadio radioButton = new cRadio(obj.name);
660
+ radioButton.SetObject(obj);
661
+ radioButton.layout = sevenButton;
662
+ radioButton.SetCamera(cameraView.renderCamera, false);
663
+ radioButton.addActionListener(this);
664
+ radioPanel.add(radioButton);
665
+ buttonGroup.add(radioButton);
666
+ radioButton.doClick();
649667 }
650668 void SetupViews(ObjEditor oe)
651669 {
....@@ -665,6 +683,7 @@
665683 JCheckBox fastCB;
666684 JCheckBox slowCB;
667685 JCheckBox boxCB;
686
+ JCheckBox zoomBoxCB;
668687 JCheckBox trackCB;
669688 JCheckBox smoothfocusCB;
670689 // JCheckBox speakerMocapCB;
....@@ -707,8 +726,7 @@
707726 dropAttributes |= Object3D.TEXTURE;
708727 else
709728 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
729
+ } else if(e.getSource() == liveCB)
712730 {
713731 cameraView.ToggleLive();
714732 }
....@@ -745,6 +763,10 @@
745763 Recompile();
746764 cameraView.repaint();
747765 // refreshContents();
766
+ }
767
+ else if(e.getSource() == zoomBoxCB)
768
+ {
769
+ cameraView.ToggleZoomBoxMode();
748770 }
749771 else if(e.getSource() == smoothfocusCB)
750772 {
....@@ -1035,6 +1057,8 @@
10351057 torusItem.addActionListener(this);
10361058 superItem = menu.add(new MenuItem("Superellipsoid"));
10371059 superItem.addActionListener(this);
1060
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1061
+ kleinItem.addActionListener(this);
10381062 particleItem = menu.add(new MenuItem("Particle system"));
10391063 particleItem.addActionListener(this);
10401064 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1075,7 +1099,7 @@
10751099 {
10761100 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771101 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1102
+ animationItem.setState(Globals.ANIMATION);
10791103
10801104 menu.add("-");
10811105 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1108,6 +1132,8 @@
11081132 resetParentItem.addActionListener(this);
11091133 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101134 repairParentItem.addActionListener(this);
1135
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1136
+ repairShadowItem.addActionListener(this);
11111137 menu.add(invariantsItem = new MenuItem("Invariants"));
11121138 invariantsItem.addActionListener(this);
11131139 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1468,6 +1494,7 @@
14681494 //
14691495 public void actionPerformed(ActionEvent event) // , Object arg)
14701496 {
1497
+ Object source = event.getSource();
14711498 /*
14721499 if (event.getSource() == nameField)
14731500 {
....@@ -1479,11 +1506,11 @@
14791506 }
14801507 else
14811508 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1509
+ if (source == lookAtItem || source == lookFromItem)
14831510 {
14841511 ScreenFit();
14851512 } else
1486
- if (event.getSource() == switchItem)
1513
+ if (source == switchItem)
14871514 {
14881515 cVector v1 = new cVector();
14891516 cVector v2 = new cVector();
....@@ -1492,11 +1519,11 @@
14921519 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931520 objEditor.cameraView.repaint();
14941521 } else
1495
- if (event.getSource() == rectoidItem)
1522
+ if (source == rectoidItem)
14961523 {
14971524 makeSomething(new Box());
14981525 } else
1499
- if (event.getSource() == particleItem)
1526
+ if (source == particleItem)
15001527 {
15011528 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021529 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1544,9 @@
15171544 applyExample(particleGeom, "SMOKE");
15181545 makeSomething(particleGeom);
15191546 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1547
+ if (source == ragdollItem || source == ragdoll2Item)
15211548 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1549
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231550
15241551 ragdoll.toParent = LA.newMatrix();
15251552 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1564,7 @@
15371564 } else
15381565 /*
15391566 */
1540
- if (event.getSource() == heightFieldItem)
1567
+ if (source == heightFieldItem)
15411568 {
15421569 Object3D obj = new Object3D();
15431570
....@@ -1575,27 +1602,31 @@
15751602
15761603 makeSomething(obj);
15771604 } else
1578
- if (event.getSource() == gridItem)
1605
+ if (source == gridItem)
15791606 {
15801607 makeSomething(new Grid());
15811608 } else
1582
- if (event.getSource() == ellipsoidItem)
1609
+ if (source == ellipsoidItem)
15831610 {
15841611 makeSomething(new Sphere());
15851612 } else
1586
- if (event.getSource() == coneItem)
1613
+ if (source == coneItem)
15871614 {
15881615 makeSomething(new Cone());
15891616 } else
1590
- if (event.getSource() == torusItem)
1617
+ if (source == torusItem)
15911618 {
15921619 makeSomething(new Torus());
15931620 } else
1594
- if (event.getSource() == superItem)
1621
+ if (source == superItem)
15951622 {
15961623 makeSomething(new Superellipsoid());
15971624 } else
1598
- if (event.getSource() == blobItem)
1625
+ if (source == kleinItem)
1626
+ {
1627
+ makeSomething(new Klein());
1628
+ } else
1629
+ if (source == blobItem)
15991630 {
16001631 Blob blob = new Blob();
16011632 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1634,15 @@
16031634 //blob.retile();
16041635 makeSomething(blob);
16051636 } else
1606
- if (event.getSource() == latheItem)
1637
+ if (source == latheItem)
16071638 {
16081639 makeSomething(new Lathe());
16091640 } else
1610
- if (event.getSource() == bezierItem)
1641
+ if (source == bezierItem)
16111642 {
16121643 makeSomething(new BezierSurface());
16131644 } else
1614
- if (event.getSource() == checkerItem)
1645
+ if (source == checkerItem)
16151646 {
16161647 /*
16171648 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1657,7 @@
16261657 */
16271658 makeSomething(new Checker());
16281659 } else
1629
- if (event.getSource() == meshItem)
1660
+ if (source == meshItem)
16301661 {
16311662 Object3D itemtomake = new Object3D();
16321663 Object3D child;
....@@ -1647,35 +1678,35 @@
16471678 makeSomething(child);
16481679 }
16491680 } else
1650
- if (event.getSource() == springItem)
1681
+ if (source == springItem)
16511682 {
16521683 cSpring s = new cSpring();
16531684 s.setup();
16541685 makeSomething(s);
16551686 } else
1656
- if (event.getSource() == flagItem)
1687
+ if (source == flagItem)
16571688 {
16581689 cSpring s = new cFlag();
16591690 s.setup();
16601691 makeSomething(s);
16611692 } else
1662
- if (event.getSource() == lightItem)
1693
+ if (source == lightItem)
16631694 {
16641695 makeSomething(new Light());
16651696 } else
1666
- if (event.getSource() == csgItem)
1697
+ if (source == csgItem)
16671698 {
16681699 group(new CSG());
16691700 } else
1670
- if (event.getSource() == templateItem)
1701
+ if (source == templateItem)
16711702 {
16721703 group(new cTemplate());
16731704 } else
1674
- if (event.getSource() == attributeItem)
1705
+ if (source == attributeItem)
16751706 {
16761707 makeSomething(new Attribute());
16771708 } else
1678
- if (event.getSource() == pointflowItem)
1709
+ if (source == pointflowItem)
16791710 {
16801711 makeSomething(new PointFlow());
16811712 } else
....@@ -1687,7 +1718,7 @@
16871718 } else
16881719 */
16891720
1690
- if (event.getSource() == superLoopItem)
1721
+ if (source == superLoopItem)
16911722 {
16921723 Composite g = new cGroup();
16931724 for (int i=0; i<15; i++)
....@@ -1709,7 +1740,7 @@
17091740
17101741 group(g);
17111742 } else
1712
- if (event.getSource() == loopItem)
1743
+ if (source == loopItem)
17131744 {
17141745 Composite csg = new GroupLeaf();
17151746 csg.count = 5;
....@@ -1718,7 +1749,7 @@
17181749 csg.addChild(child);
17191750 child.addChild(csg);
17201751 } else
1721
- if (event.getSource() == doubleItem)
1752
+ if (source == doubleItem)
17221753 {
17231754 Composite csg = new GroupLeaf();
17241755 csg.count = 5;
....@@ -1730,7 +1761,7 @@
17301761 csg.addChild(child);
17311762 child.addChild(csg);
17321763 } else
1733
- if (event.getSource() == tripleItem)
1764
+ if (source == tripleItem)
17341765 {
17351766 Composite csg = new GroupLeaf();
17361767 csg.count = 4;
....@@ -1746,70 +1777,70 @@
17461777 child.addChild(csg);
17471778 } else
17481779
1749
- if (event.getSource() == importGFDItem)
1780
+ if (source == importGFDItem)
17501781 {
17511782 ImportGFD();
17521783 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1784
+ if (source == importVRMLX3DItem)
17541785 {
17551786 ImportVRMLX3D();
17561787 } else
1757
- if (event.getSource() == import3DSItem)
1788
+ if (source == import3DSItem)
17581789 {
17591790 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17601791 } else
1761
- if (event.getSource() == importOBJItem)
1792
+ if (source == importOBJItem)
17621793 {
17631794 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17641795 } else
1765
- if (event.getSource() == computeAOItem)
1796
+ if (source == computeAOItem)
17661797 {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1798
+ Globals.drawMode = CameraPane.OCCLUSION;
1799
+ Globals.theRenderer.repaint();
17691800 } else
1770
- if (event.getSource() == recompileItem)
1801
+ if (source == recompileItem)
17711802 {
17721803 Recompile();
17731804 refreshContents();
17741805 } else
1775
- if (event.getSource() == editScriptItem)
1806
+ if (source == editScriptItem)
17761807 {
17771808 OpenDialog();
17781809 refreshContents();
17791810 } else
1780
- if (event.getSource() == invariantsItem)
1811
+ if (source == invariantsItem)
17811812 {
17821813 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1814
+ GrafreeD.grafreeD.universe.invariants();
17841815 } else
1785
- if (event.getSource() == memoryItem)
1816
+ if (source == memoryItem)
17861817 {
17871818 //System.out.println("Invariants:");
17881819 PrintMemory();
17891820 } else
1790
- if (event.getSource() == pathItem)
1821
+ if (source == pathItem)
17911822 {
17921823 PrintPath();
17931824 } else
1794
- if (event.getSource() == analyzeItem)
1825
+ if (source == analyzeItem)
17951826 {
17961827 AnalyzeObject();
17971828 } else
1798
- if (event.getSource() == dumpItem)
1829
+ if (source == dumpItem)
17991830 {
18001831 DumpObject();
18011832 } else
1802
- if (event.getSource() == screenfitButton)
1833
+ if (source == screenfitButton)
18031834 {
18041835 //Reload(lastConverter, lastFilename, true);
18051836 ScreenFit();
18061837 } else
1807
- if (event.getSource() == screenfitpointButton)
1838
+ if (source == screenfitpointButton)
18081839 {
18091840 //Reload(lastConverter, lastFilename, true);
18101841 ScreenFitPoint();
18111842 } else
1812
- if (event.getSource() == snapobjectButton)
1843
+ if (source == snapobjectButton)
18131844 {
18141845 //Reload(lastConverter, lastFilename, true);
18151846 SnapObject();
....@@ -1820,13 +1851,13 @@
18201851 // Recompile();
18211852 // refreshContents();
18221853 // } else
1823
- if (event.getSource() == gcButton)
1854
+ if (source == gcButton)
18241855 {
18251856 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261857 System.gc();
18271858 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281859 } else
1829
- if (event.getSource() == editLeafItem)
1860
+ if (source == editLeafItem)
18301861 {
18311862 Object3D obj;
18321863 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1871,62 @@
18401871 }
18411872 refreshContents(true);
18421873 } else
1843
- if (event.getSource() == openWindowItem)
1874
+ if (source == openWindowItem)
18441875 {
18451876 EditSelection(true);
18461877 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1878
+ if (source == cutItem || source == clearButton)
18481879 {
18491880 loadClipboard(true);
18501881 } else
1851
- if (event.getSource() == duplicateItem)
1882
+ if (source == duplicateItem)
18521883 {
18531884 Object3D keep = GrafreeD.clipboard;
18541885 loadClipboard(false);
18551886 paste(false);
18561887 GrafreeD.clipboard = keep;
18571888 } else
1858
- if (event.getSource() == cloneItem)
1889
+ if (source == cloneItem)
18591890 {
18601891 CloneSelection(false);
18611892 } else
1862
- if (event.getSource() == cloneSupportItem)
1893
+ if (source == cloneSupportItem)
18631894 {
18641895 CloneSelection(true);
18651896 } else
1866
- if (event.getSource() == copyItem)
1897
+ if (source == copyItem)
18671898 {
18681899 loadClipboard(false);
18691900 } else
1870
- if (event.getSource() == pasteItem)
1901
+ if (source == pasteItem)
18711902 {
18721903 paste(false);
18731904 } else
1874
- if (event.getSource() == pasteLinkItem)
1905
+ if (source == pasteLinkItem)
18751906 {
18761907 pasteInto(false);
18771908 } else
1878
- if (event.getSource() == pasteCloneItem)
1909
+ if (source == pasteCloneItem)
18791910 {
18801911 pasteInto(true);
18811912 } else
1882
- if (event.getSource() == pasteExpandItem)
1913
+ if (source == pasteExpandItem)
18831914 {
18841915 paste(true);
18851916 } else
1886
- if (event.getSource() == synchronizeItem)
1917
+ if (source == synchronizeItem)
18871918 {
18881919 Overwrite(Object3D.TRANSFORM);
18891920 } else
1890
- if (event.getSource() == overwriteNameItem)
1921
+ if (source == overwriteNameItem)
18911922 {
18921923 Overwrite(Object3D.NAME);
18931924 } else
1894
- if (event.getSource() == overwriteUVItem)
1925
+ if (source == overwriteUVItem)
18951926 {
18961927 Overwrite(Object3D.UV);
18971928 } else
1898
- if (event.getSource() == overwriteMatItem)
1929
+ if (source == overwriteMatItem)
18991930 {
19001931 /* july 2015
19011932 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +1946,7 @@
19151946
19161947 Overwrite(dropAttributes);
19171948 }
1918
- if (event.getSource() == overwriteGeoItem)
1949
+ if (source == overwriteGeoItem)
19191950 {
19201951 Overwrite(Object3D.GEOMETRY);
19211952 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +1963,7 @@
19321963 // refreshContents();
19331964 // }
19341965 } else
1935
- if (event.getSource() == generateMeshItem)
1966
+ if (source == generateMeshItem)
19361967 {
19371968 //if (group.selection.size() == 1)
19381969 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +1974,7 @@
19431974 ResetModel();
19441975 refreshContents();
19451976 } else
1946
- if (event.getSource() == extractGeometriesItem)
1977
+ if (source == extractGeometriesItem)
19471978 {
19481979 boolean one = false;
19491980
....@@ -1970,7 +2001,7 @@
19702001 ResetModel();
19712002 refreshContents();
19722003 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2004
+ if (source == cloneGeometriesItem)
19742005 {
19752006 boolean one = false;
19762007
....@@ -1996,32 +2027,37 @@
19962027 ResetModel();
19972028 refreshContents();
19982029 } else
1999
- if (event.getSource() == shareGeometriesItem)
2030
+ if (source == shareGeometriesItem)
20002031 {
20012032 boolean one = false;
20022033
20032034 if (group.selection.size() == 1)
20042035 one = true;
20052036
2037
+ Object3D merge = null;
2038
+
20062039 Object3D content = new cGroup();
20072040
20082041 for (int i=0; i<group.selection.size(); i++)
20092042 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2043
+ merge = new Merge(group.selection.get(i));
20112044
20122045 if (one)
2013
- makeSomething(sel, false);
2046
+ makeSomething(merge, false);
20142047 else
2015
- content.addChild(sel);
2048
+ content.addChild(merge);
20162049 }
20172050
20182051 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2052
+ makeSomething(content, true);
2053
+ else
2054
+ {
2055
+ ResetModel();
2056
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2057
+ refreshContents();
2058
+ }
20232059 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2060
+ if (source == mergeGeometriesItem)
20252061 {
20262062 boolean one = false;
20272063
....@@ -2051,7 +2087,7 @@
20512087 ResetModel();
20522088 refreshContents();
20532089 } else
2054
- if (event.getSource() == linkverticesItem)
2090
+ if (source == linkverticesItem)
20552091 {
20562092 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572093 // {
....@@ -2071,7 +2107,7 @@
20712107 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722108 content = ((cGroup)content).get(0);
20732109
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2110
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752111 for (int i=0; i<group.selection.size(); i++)
20762112 {
20772113 boolean random = CameraPane.RANDOM;
....@@ -2080,11 +2116,11 @@
20802116 // group.selection.get(i).setMasterThis(content); // should be identity
20812117 CameraPane.RANDOM = random;
20822118 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2119
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842120 refreshContents();
20852121 }
20862122 } else
2087
- if (event.getSource() == resetsupportItem)
2123
+ if (source == resetsupportItem)
20882124 {
20892125 for (int i=0; i<group.selection.size(); i++)
20902126 {
....@@ -2096,7 +2132,16 @@
20962132
20972133 refreshContents();
20982134 } else
2099
- if (event.getSource() == resetreferencesItem)
2135
+ if (source == relinkverticesItem)
2136
+ {
2137
+ boolean random = CameraPane.RANDOM;
2138
+ CameraPane.RANDOM = false; // parse all random nodes
2139
+ group.selection.RelinkToSupport();
2140
+ CameraPane.RANDOM = random;
2141
+
2142
+ refreshContents();
2143
+ } else
2144
+ if (source == resetreferencesItem)
21002145 {
21012146 for (int i=0; i<group.selection.size(); i++)
21022147 {
....@@ -2105,7 +2150,7 @@
21052150
21062151 refreshContents();
21072152 } else
2108
- if (event.getSource() == setMasterItem)
2153
+ if (source == setMasterItem)
21092154 {
21102155 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21112156 {
....@@ -2118,7 +2163,7 @@
21182163 refreshContents();
21192164 }
21202165 } else
2121
- if (event.getSource() == poseMeshItem)
2166
+ if (source == poseMeshItem)
21222167 {
21232168 if (group.selection.size() == 1)
21242169 {
....@@ -2137,19 +2182,19 @@
21372182 }
21382183
21392184 } else
2140
- if (event.getSource() == revertMeshItem)
2185
+ if (source == revertMeshItem)
21412186 {
21422187 RevertMeshes();
21432188 } else
2144
- if (event.getSource() == resetMeshItem)
2189
+ if (source == resetMeshItem)
21452190 {
21462191 ResetAll();
21472192 } else
2148
- if (event.getSource() == stepAllItem)
2193
+ if (source == stepAllItem)
21492194 {
21502195 StepAll();
21512196 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2197
+ if (source == clearItem) // || event.getSource() == clearButton)
21532198 {
21542199 //int indices[] = jList.getSelectedIndices();
21552200 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2202,46 @@
21572202
21582203 ClearSelection(false);
21592204 } else
2160
- if (event.getSource() == clearAllItem)
2205
+ if (source == clearAllItem)
21612206 {
21622207 ClearSelection(true);
21632208 } else
2164
- if (event.getSource() == grabItem)
2209
+ if (source == grabItem)
21652210 {
21662211 group(new cGroup(), true);
21672212 } else
2168
- if (event.getSource() == frontItem)
2213
+ if (source == hideItem)
2214
+ {
2215
+ group(new HiddenObject());
2216
+ } else
2217
+ if (source == frontItem)
21692218 {
21702219 front();
21712220 } else
2172
- if (event.getSource() == backItem)
2221
+ if (source == backItem)
21732222 {
21742223 back();
21752224 } else
2176
- if (event.getSource() == cameraItem)
2225
+ if (source == cameraItem)
21772226 {
21782227 makeSomething(new Camera());
21792228 } else
2180
- if (event.getSource() == compositeItem)
2229
+ if (source == compositeItem)
21812230 {
21822231 group(new Composite());
21832232 } else
2184
- if (event.getSource() == randomItem)
2233
+ if (source == randomItem)
21852234 {
21862235 RandomNode random = new RandomNode();
21872236 group(random);
21882237 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2238
+ random.name = random.get(0).name + "Switch";
21902239 } else
2191
- if (event.getSource() == physicsItem)
2240
+ if (source == physicsItem)
21922241 {
21932242 group(new PhysicsNode());
21942243 } else
2195
- if (event.getSource() == frameselectorItem)
2244
+ if (source == frameselectorItem)
21962245 {
21972246 for (int i=0; i<group.selection.size(); i++)
21982247 {
....@@ -2204,7 +2253,7 @@
22042253 ResetModel();
22052254 refreshContents();
22062255 } else
2207
- if (event.getSource() == switchGeoItem)
2256
+ if (source == switchGeoItem)
22082257 {
22092258 for (int i=0; i<group.selection.size(); i++)
22102259 {
....@@ -2216,7 +2265,7 @@
22162265 ResetModel();
22172266 refreshContents();
22182267 } else
2219
- if (event.getSource() == switchTransfoItem)
2268
+ if (source == switchTransfoItem)
22202269 {
22212270 for (int i=0; i<group.selection.size(); i++)
22222271 {
....@@ -2228,7 +2277,7 @@
22282277 ResetModel();
22292278 refreshContents();
22302279 } else
2231
- if (event.getSource() == morphItem)
2280
+ if (source == morphItem)
22322281 {
22332282 for (int i=0; i<group.selection.size(); i++)
22342283 {
....@@ -2240,7 +2289,7 @@
22402289 ResetModel();
22412290 refreshContents();
22422291 } else
2243
- if (event.getSource() == scriptNodeItem)
2292
+ if (source == scriptNodeItem)
22442293 {
22452294 boolean atleastone = false;
22462295
....@@ -2279,199 +2328,215 @@
22792328 }
22802329 }
22812330 } else
2282
- if (event.getSource() == linkerItem)
2331
+ if (source == linkerItem)
22832332 {
22842333 group(new cLinker());
22852334 } else
2286
- if (event.getSource() == textureItem)
2335
+ if (source == textureItem)
22872336 {
22882337 group(new TextureNode());
22892338 } else
2290
- if (event.getSource() == shadowXItem)
2339
+ if (source == billboardItem)
2340
+ {
2341
+ group(new BillboardNode());
2342
+ } else
2343
+ if (source == shadowXItem)
22912344 {
22922345 CastShadow(0);
22932346 } else
2294
- if (event.getSource() == shadowYItem)
2347
+ if (source == shadowYItem)
22952348 {
22962349 CastShadow(1);
22972350 } else
2298
- if (event.getSource() == shadowZItem)
2351
+ if (source == shadowZItem)
22992352 {
23002353 CastShadow(2);
23012354 } else
2302
- if (event.getSource() == ungroupItem)
2355
+ if (source == ungroupItem)
23032356 {
2304
- ungroup();
2357
+ //ungroup();
2358
+ for (int i=0; i<group.selection.size(); i++)
2359
+ {
2360
+ Ungroup(group.selection.get(i));
2361
+ }
2362
+
2363
+ ClearSelection(false);
2364
+
2365
+ refreshContents();
23052366 } else
2306
- if (event.getSource() == genUVItem)
2367
+ if (source == genUVItem)
23072368 {
23082369 GenUV();
23092370 } else
2310
- if (event.getSource() == genNormalsCADItem)
2371
+ if (source == genNormalsCADItem)
23112372 {
23122373 GenNormals(true);
23132374 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2375
+ if (source == genNormalsMESHItem)
23152376 {
23162377 GenNormals(true); // TODO
23172378 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2379
+ if (source == genNormalsORGANItem)
23192380 {
23202381 GenNormals(false);
23212382 } else
2322
- if (event.getSource() == stripifyItem)
2383
+ if (source == genNormalsMINEItem)
2384
+ {
2385
+ GenNormalsMINE();
2386
+ } else
2387
+ if (source == stripifyItem)
23232388 {
23242389 Stripify();
23252390 } else
2326
- if (event.getSource() == unstripifyItem)
2391
+ if (source == unstripifyItem)
23272392 {
23282393 Unstripify();
23292394 } else
2330
- if (event.getSource() == trimItem)
2395
+ if (source == trimItem)
23312396 {
23322397 Trim();
23332398 } else
2334
- if (event.getSource() == untrimItem)
2399
+ if (source == untrimItem)
23352400 {
23362401 Untrim();
23372402 } else
2338
- if (event.getSource() == clearColorsItem)
2403
+ if (source == clearColorsItem)
23392404 {
23402405 ClearColors();
23412406 } else
2342
- if (event.getSource() == clearMaterialsItem)
2407
+ if (source == clearMaterialsItem)
23432408 {
23442409 ClearMaterials();
23452410 } else
2346
- if (event.getSource() == liveleavesItem)
2411
+ if (source == liveleavesItem)
23472412 {
23482413 LiveLeaves(true);
23492414 } else
2350
- if (event.getSource() == unliveleavesItem)
2415
+ if (source == unliveleavesItem)
23512416 {
23522417 LiveLeaves(false);
23532418 } else
2354
- if (event.getSource() == supportleavesItem)
2419
+ if (source == supportleavesItem)
23552420 {
23562421 SupportLeaves(true);
23572422 } else
2358
- if (event.getSource() == unsupportleavesItem)
2423
+ if (source == unsupportleavesItem)
23592424 {
23602425 SupportLeaves(false);
23612426 } else
2362
- if (event.getSource() == hideleavesItem)
2427
+ if (source == hideleavesItem)
23632428 {
23642429 HideLeaves(true);
23652430 } else
2366
- if (event.getSource() == showleavesItem)
2431
+ if (source == showleavesItem)
23672432 {
23682433 HideLeaves(false);
23692434 } else
2370
- if (event.getSource() == markleavesItem)
2435
+ if (source == markleavesItem)
23712436 {
23722437 MarkLeaves(true);
23732438 } else
2374
- if (event.getSource() == unmarkleavesItem)
2439
+ if (source == unmarkleavesItem)
23752440 {
23762441 MarkLeaves(false);
23772442 } else
2378
- if (event.getSource() == flipVItem)
2443
+ if (source == flipVItem)
23792444 {
23802445 FlipV(true);
23812446 } else
2382
- if (event.getSource() == unflipVItem)
2447
+ if (source == unflipVItem)
23832448 {
23842449 FlipV(false);
23852450 } else
2386
- if (event.getSource() == lowTexturesItem)
2451
+ if (source == lowTexturesItem)
23872452 {
23882453 SetTexRes(0);
23892454 } else
2390
- if (event.getSource() == normalTexturesItem)
2455
+ if (source == normalTexturesItem)
23912456 {
23922457 SetTexRes(1);
23932458 } else
2394
- if (event.getSource() == highTexturesItem)
2459
+ if (source == highTexturesItem)
23952460 {
23962461 SetTexRes(2);
23972462 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2463
+ if (source == veryhighTexturesItem)
23992464 {
24002465 SetTexRes(3);
24012466 } else
2402
- if (event.getSource() == maxTexturesItem)
2467
+ if (source == maxTexturesItem)
24032468 {
24042469 SetTexRes(4);
24052470 } else
2406
- if (event.getSource() == panoTexturesItem)
2471
+ if (source == panoTexturesItem)
24072472 {
24082473 SetTexRes(5);
24092474 } else
2410
- if (event.getSource() == reverseNormalsItem)
2475
+ if (source == reverseNormalsItem)
24112476 {
24122477 ReverseNormals();
24132478 } else
2414
- if (event.getSource() == parseverticesItem)
2479
+ if (source == parseverticesItem)
24152480 {
24162481 ParseVertices();
24172482 } else
2418
- if (event.getSource() == textureFieldItem)
2483
+ if (source == textureFieldItem)
24192484 {
24202485 TextureVertices();
24212486 } else
2422
- if (event.getSource() == alignItem)
2487
+ if (source == alignItem)
24232488 {
24242489 Align();
24252490 } else
2426
- if (event.getSource() == mirrorItem)
2491
+ if (source == mirrorItem)
24272492 {
24282493 MirrorPoses();
24292494 } else
2430
- if (event.getSource() == reduceMorphItem)
2495
+ if (source == reduceMorphItem)
24312496 {
24322497 MeshReduction(false);
24332498 } else
2434
- if (event.getSource() == reduce34MorphItem)
2499
+ if (source == reduce34MorphItem)
24352500 {
24362501 MeshReduction(true);
24372502 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2503
+ if (source == reverseTrianglesItem)
24392504 {
24402505 ReverseTriangles();
24412506 } else
2442
- if (event.getSource() == reduceMeshItem)
2507
+ if (source == reduceMeshItem)
24432508 {
24442509 ReduceMesh(false);
24452510 } else
2446
- if (event.getSource() == reduce34MeshItem)
2511
+ if (source == reduce34MeshItem)
24472512 {
24482513 ReduceMesh(true);
24492514 } else
2450
- if (event.getSource() == increaseMeshItem)
2515
+ if (source == increaseMeshItem)
24512516 {
24522517 IncreaseMesh();
24532518 } else
2454
- if (event.getSource() == clipMeshItem)
2519
+ if (source == clipMeshItem)
24552520 {
24562521 ClipMesh();
24572522 } else
2458
- if (event.getSource() == smoothMeshItem)
2523
+ if (source == smoothMeshItem)
24592524 {
24602525 SmoothMesh();
24612526 } else
2462
- if (event.getSource() == transformgeometryItem)
2527
+ if (source == transformgeometryItem)
24632528 {
24642529 TransformGeometry();
24652530 } else
2466
- if (event.getSource() == resetTransformItem)
2531
+ if (source == resetTransformItem)
24672532 {
24682533 ResetTransform();
24692534 } else
2470
- if (event.getSource() == resetCentroidItem)
2535
+ if (source == resetCentroidItem)
24712536 {
24722537 ResetCentroid();
24732538 } else
2474
- if (event.getSource() == resetParentItem)
2539
+ if (source == resetParentItem)
24752540 {
24762541 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772542 {
....@@ -2481,7 +2546,7 @@
24812546
24822547 refreshContents();
24832548 } else
2484
- if (event.getSource() == repairParentItem)
2549
+ if (source == repairParentItem)
24852550 {
24862551 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872552 {
....@@ -2495,7 +2560,21 @@
24952560
24962561 refreshContents();
24972562 } else
2498
- if (event.getSource() == sortbysizeItem)
2563
+ if (source == repairShadowItem)
2564
+ {
2565
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2566
+ {
2567
+ Object3D obj = (Object3D)e.nextElement();
2568
+ obj.RepairShadow();
2569
+// for (int i=0; i<obj.size(); i++)
2570
+// {
2571
+// obj.get(i).parent = obj;
2572
+// }
2573
+ }
2574
+
2575
+ refreshContents();
2576
+ } else
2577
+ if (source == sortbysizeItem)
24992578 {
25002579 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012580 {
....@@ -2507,7 +2586,7 @@
25072586 ResetModel();
25082587 refreshContents();
25092588 } else
2510
- if (event.getSource() == sortbynameItem)
2589
+ if (source == sortbynameItem)
25112590 {
25122591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132592 {
....@@ -2519,7 +2598,7 @@
25192598 ResetModel();
25202599 refreshContents();
25212600 } else
2522
- if (event.getSource() == attachPigmentItem)
2601
+ if (source == attachPigmentItem)
25232602 {
25242603 String texture = GetFile("Attach pigment");
25252604 Object3D obj;
....@@ -2531,7 +2610,7 @@
25312610
25322611 refreshContents();
25332612 } else
2534
- if (event.getSource() == detachPigmentItem)
2613
+ if (source == detachPigmentItem)
25352614 {
25362615 Object3D obj;
25372616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2621,7 @@
25422621
25432622 refreshContents();
25442623 } else
2545
- if (event.getSource() == attachBumpItem)
2624
+ if (source == attachBumpItem)
25462625 {
25472626 String texture = GetFile("Attach bump");
25482627 Object3D obj;
....@@ -2554,7 +2633,7 @@
25542633
25552634 refreshContents();
25562635 } else
2557
- if (event.getSource() == detachBumpItem)
2636
+ if (source == detachBumpItem)
25582637 {
25592638 Object3D obj;
25602639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2644,7 @@
25652644
25662645 refreshContents();
25672646 } else
2568
- if (event.getSource() == pigmentBumpItem)
2647
+ if (source == pigmentBumpItem)
25692648 {
25702649 Object3D obj;
25712650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2655,195 @@
25762655
25772656 refreshContents();
25782657 } else
2579
- if (event.getSource() == flashSelectionButton)
2658
+ if (source == flashSelectionButton)
25802659 {
25812660 CameraPane.flash = true;
25822661 refreshContents();
25832662 } else
2584
- if (event.getSource() == oneButton)
2663
+ if (source == oneButton)
25852664 {
25862665 } else
2587
- if (event.getSource() == twoButton)
2666
+ if (source == twoButton)
25882667 {
25892668 radio.layout = twoButton;
25902669 // bug
25912670 //gridPanel.setDividerLocation(1.0);
25922671 //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();
2672
+// bigThree.remove(scenePanel);
2673
+// bigThree.remove(centralPanel);
2674
+// bigThree.remove(XYZPanel);
2675
+// aWindowConstraints.gridx = 0;
2676
+// aWindowConstraints.gridy = 0;
2677
+// aWindowConstraints.gridwidth = 1;
2678
+// // aConstraints.gridheight = 3;
2679
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2680
+// aWindowConstraints.weightx = 0;
2681
+// aWindowConstraints.weighty = 1;
2682
+// //bigThree.add(jtp, aWindowConstraints);
2683
+// aWindowConstraints.weightx = 1;
2684
+// aWindowConstraints.gridwidth = 3;
2685
+// // aConstraints.gridheight = 3;
2686
+// aWindowConstraints.gridx = 1;
2687
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2688
+// bigThree.add(centralPanel, aWindowConstraints);
2689
+// aWindowConstraints.weightx = 0;
2690
+// aWindowConstraints.gridx = 4;
2691
+// aWindowConstraints.gridwidth = 1;
2692
+// // aConstraints.gridheight = 3;
2693
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2694
+// //bigThree.add(XYZPanel, aWindowConstraints);
2695
+// scenePanel.setVisible(false);
2696
+// centralPanel.setVisible(true);
2697
+// XYZPanel.setVisible(false);
2698
+ bigThree.ClearUI();
2699
+ bigThree.add(centralPanel);
2700
+ bigThree.FlushUI();
26172701 } else
2618
- if (event.getSource() == threeButton)
2702
+ if (source == threeButton)
26192703 {
26202704 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();
2705
+
2706
+// bigThree.remove(scenePanel);
2707
+// bigThree.remove(centralPanel);
2708
+// bigThree.remove(XYZPanel);
2709
+// aWindowConstraints.gridx = 0;
2710
+// aWindowConstraints.gridy = 0;
2711
+// aWindowConstraints.gridwidth = 1;
2712
+// // aConstraints.gridheight = 3;
2713
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2714
+// aWindowConstraints.weightx = 0;
2715
+// aWindowConstraints.weighty = 1;
2716
+// //bigThree.add(jtp, aWindowConstraints);
2717
+// aWindowConstraints.weightx = 1;
2718
+// aWindowConstraints.gridwidth = 3;
2719
+// // aConstraints.gridheight = 3;
2720
+// aWindowConstraints.gridx = 1;
2721
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2722
+// bigThree.add(centralPanel, aWindowConstraints);
2723
+// aWindowConstraints.weightx = 0;
2724
+// aWindowConstraints.gridx = 4;
2725
+// aWindowConstraints.gridwidth = 1;
2726
+// // aConstraints.gridheight = 3;
2727
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2728
+// bigThree.add(XYZPanel, aWindowConstraints);
2729
+// bigThree.validate();
2730
+// scenePanel.setVisible(false);
2731
+// centralPanel.setVisible(true);
2732
+// XYZPanel.setVisible(true);
2733
+ bigThree.ClearUI();
2734
+ bigThree.add(centralPanel);
2735
+ bigThree.add(XYZPanel);
2736
+ bigThree.FlushUI();
26452737 } else
2646
- if (event.getSource() == fourButton)
2738
+ if (source == fourButton)
26472739 {
26482740 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();
2741
+
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aWindowConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2750
+// aWindowConstraints.weightx = 1;
2751
+// aWindowConstraints.weighty = 1;
2752
+// bigThree.add(scenePanel, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// //bigThree.add(cameraPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aWindowConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// bigThree.validate();
2766
+// scenePanel.setVisible(true);
2767
+// centralPanel.setVisible(false);
2768
+// XYZPanel.setVisible(false);
2769
+ bigThree.ClearUI();
2770
+ bigThree.add(scenePanel);
2771
+ bigThree.FlushUI();
26732772 } else
2674
- if (event.getSource() == sixButton)
2773
+ if (source == sixButton)
26752774 {
26762775 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();
2776
+
2777
+// bigThree.remove(scenePanel);
2778
+// bigThree.remove(centralPanel);
2779
+// bigThree.remove(XYZPanel);
2780
+// aWindowConstraints.gridx = 0;
2781
+// aWindowConstraints.gridy = 0;
2782
+// aWindowConstraints.gridwidth = 1;
2783
+// // aConstraints.gridheight = 3;
2784
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2785
+// aWindowConstraints.weightx = 0;
2786
+// aWindowConstraints.weighty = 1;
2787
+// bigThree.add(scenePanel, aWindowConstraints);
2788
+// aWindowConstraints.weightx = 1;
2789
+// aWindowConstraints.gridwidth = 3;
2790
+// // aWindowConstraints.gridheight = 3;
2791
+// aWindowConstraints.gridx = 1;
2792
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2793
+// bigThree.add(centralPanel, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 0;
2795
+// aWindowConstraints.gridx = 4;
2796
+// aWindowConstraints.gridwidth = 1;
2797
+// // aWindowConstraints.gridheight = 3;
2798
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2799
+// //bigThree.add(XYZPanel, aConstraints);
2800
+// bigThree.validate();
2801
+// scenePanel.setVisible(true);
2802
+// centralPanel.setVisible(true);
2803
+// XYZPanel.setVisible(false);
2804
+ bigThree.ClearUI();
2805
+ bigThree.add(scenePanel);
2806
+ bigThree.add(centralPanel);
2807
+ bigThree.FlushUI();
27012808 } else
2702
- if (event.getSource() == sevenButton)
2809
+ if (source == sevenButton)
27032810 {
27042811 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();
2812
+
2813
+// bigThree.remove(scenePanel);
2814
+// bigThree.remove(centralPanel);
2815
+// bigThree.remove(XYZPanel);
2816
+// aWindowConstraints.gridx = 0;
2817
+// aWindowConstraints.gridy = 0;
2818
+// aWindowConstraints.gridwidth = 1;
2819
+// // aWindowConstraints.gridheight = 3;
2820
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
+// aWindowConstraints.weightx = 0;
2822
+// aWindowConstraints.weighty = 1;
2823
+// bigThree.add(scenePanel, aWindowConstraints);
2824
+// aWindowConstraints.weightx = 1;
2825
+// aWindowConstraints.gridwidth = 3;
2826
+// // aWindowConstraints.gridheight = 3;
2827
+// aWindowConstraints.gridx = 1;
2828
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2829
+// bigThree.add(centralPanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 0;
2831
+// aWindowConstraints.gridx = 4;
2832
+// aWindowConstraints.gridwidth = 1;
2833
+// // aConstraints.gridheight = 3;
2834
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2835
+// bigThree.add(XYZPanel, aWindowConstraints);
2836
+// bigThree.validate();
2837
+// scenePanel.setVisible(true);
2838
+// centralPanel.setVisible(true);
2839
+// XYZPanel.setVisible(true);
2840
+ bigThree.ClearUI();
2841
+ bigThree.add(scenePanel);
2842
+ bigThree.add(centralPanel);
2843
+ bigThree.add(XYZPanel);
2844
+ bigThree.FlushUI();
27292845 } else
2730
- if (event.getSource() == rootButton)
2846
+ if (source == rootButton)
27312847 {
27322848 Object3D obj;
27332849 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2855,7 @@
27392855
27402856 refreshContents(true);
27412857 } else
2742
- if (event.getSource() == closeButton)
2858
+ if (source == closeButton)
27432859 {
27442860 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452861 cRadio ab;
....@@ -2760,11 +2876,11 @@
27602876 }
27612877 refreshContents(true);
27622878 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
2879
+ if (source == editItem || source == editButton)
27642880 {
27652881 EditSelection(false);
27662882 } else
2767
- if (event.getSource() == uneditButton)
2883
+ if (source == uneditButton)
27682884 {
27692885 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27702886 {
....@@ -2776,12 +2892,12 @@
27762892
27772893 child.editWindow = null; // ???????????
27782894 }
2779
- objEditor.ctrlPanel.revalidate();
2895
+ objEditor.ctrlPanel.validate();
27802896 //objEditor.jTree.clearSelection();
27812897 //objEditor.ResetSliders();
27822898 refreshContents(true);
27832899 } else
2784
- if (event.getSource() == clearPanelButton)
2900
+ if (source == clearPanelButton)
27852901 {
27862902 assert(copy == group);
27872903 //copy.ClearUI();
....@@ -2792,7 +2908,7 @@
27922908 listUI.clear();
27932909 refreshContents(true);
27942910 } else
2795
- if (event.getSource() == allParamsButton)
2911
+ if (source == allParamsButton)
27962912 {
27972913 assert(copy == group);
27982914
....@@ -2813,19 +2929,19 @@
28132929
28142930 refreshContents(true);
28152931 } else
2816
- if (event.getSource() == unselectButton)
2932
+ if (source == unselectButton)
28172933 {
28182934 objEditor.jTree.clearSelection();
28192935 // ?? oct 2012 GrafreeD.clipboard.clear();
28202936 objEditor.ResetSliders();
28212937 refreshContents(true);
28222938 } else
2823
- if(event.getSource() instanceof cRadio)
2939
+ if(source instanceof cRadio)
28242940 {
28252941 group.parent = keepparent;
28262942 group.attributes = 0;
28272943 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
2944
+ /*cRadio*/ radio = (cRadio)source;
28292945 Object3D obj = radio.GetObject();
28302946 System.out.println("Edit " + obj);
28312947 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +2961,7 @@
28452961 }
28462962
28472963 copy = group;
2848
- //CameraPane.theRenderer.object = group;
2964
+ //Globals.theRenderer.object = group;
28492965 if(!useclient)
28502966 {
28512967 cameraView.renderCamera = radio.camera;
....@@ -2854,7 +2970,8 @@
28542970 cameraView.cameras[cameraView.cameracount] = radio.camera;
28552971 cameraView.targetLookAt.set(radio.camera.lookAt);
28562972 cameraView.object = group;
2857
- cameraView.lighttouched = true;
2973
+ //cameraView.lighttouched = true;
2974
+ Globals.lighttouched = true;
28582975 topView.object = group;
28592976 frontView.object = group;
28602977 sideView.object = group;
....@@ -2890,7 +3007,7 @@
28903007 if (useclient)
28913008 {
28923009 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3010
+ Globals.lighttouched = true;
28943011 //topView.object = client;
28953012 //frontView.object = client;
28963013 //sideView.object = client;
....@@ -2898,7 +3015,7 @@
28983015 else
28993016 {
29003017 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3018
+ Globals.lighttouched = true;
29023019 //topView.object = group;
29033020 //frontView.object = group;
29043021 //sideView.object = group;
....@@ -3179,6 +3296,13 @@
31793296 refreshContents();
31803297 }
31813298
3299
+ void GenNormalsMINE()
3300
+ {
3301
+ group.selection.GenNormalsMINE();
3302
+
3303
+ refreshContents();
3304
+ }
3305
+
31823306 void Stripify()
31833307 {
31843308 group.StripifyS();
....@@ -3399,7 +3523,7 @@
33993523 String pigment = Object3D.GetPigment(tex);
34003524 //String bump = Object3D.GetBump(tex);
34013525
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3526
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34033527
34043528 double s = v.s;
34053529
....@@ -3447,12 +3571,26 @@
34473571
34483572 void Align()
34493573 {
3574
+ if (group.selection.size() == 0)
3575
+ return;
3576
+
3577
+ cVector bbmin = new cVector();
3578
+ cVector bbmax = new cVector();
3579
+
3580
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3581
+
3582
+ double dx = bbmax.x - bbmin.x;
3583
+ double dy = bbmax.y - bbmin.y;
3584
+ double dz = bbmax.z - bbmin.z;
3585
+
3586
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3587
+
34503588 for (int i=0; i<group.selection.size(); i++)
34513589 {
34523590 Object3D obj = group.selection.get(i);
34533591
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3592
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3593
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563594 }
34573595
34583596 refreshContents();
....@@ -3686,7 +3824,7 @@
36863824 group.selection.RelinkToSupport(); // july 2014
36873825 System.out.println("DONE.");
36883826 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3827
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36903828 }
36913829
36923830 void ReduceMesh(boolean reduction34)
....@@ -3962,25 +4100,25 @@
39624100 System.err.println("info : " + child.GetPath());
39634101 }
39644102 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4103
+// else
4104
+// {
4105
+// objEditor.SetMaterial(group); // .GetMaterial());
4106
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4107
+// System.err.println("info : " + group.GetPath());
4108
+// }
39714109
39724110 objEditor.SetText(); // jan 2014
39734111
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4112
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754113 CameraPane.flash = true;
39764114
39774115 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784116 // a camera
39794117 {
39804118 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;
4119
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4120
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4121
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844122 }
39854123
39864124 refreshContents();
....@@ -4474,6 +4612,26 @@
44744612 makeSomething(csg);
44754613 }
44764614
4615
+ void Ungroup(Object3D g)
4616
+ {
4617
+ if (g instanceof HiddenObject)
4618
+ {
4619
+ HiddenObject h = (HiddenObject) g;
4620
+
4621
+ for (int i=0; i<h.ActualSize(); i++)
4622
+ {
4623
+ objEditor.makeSomething(h.get(i), false);
4624
+ }
4625
+ }
4626
+ else
4627
+ {
4628
+ for (int i=0; i<g.Size(); i++)
4629
+ {
4630
+ objEditor.makeSomething(g.get(i), false);
4631
+ }
4632
+ }
4633
+ }
4634
+
44774635 void ungroup()
44784636 {
44794637 /*
....@@ -4833,6 +4991,7 @@
48334991 private MenuItem resetsupportItem;
48344992 private MenuItem resetreferencesItem;
48354993 private MenuItem linkverticesItem;
4994
+ private MenuItem relinkverticesItem;
48364995 private MenuItem setMasterItem;
48374996 private MenuItem resetMeshItem;
48384997 private MenuItem stepAllItem;
....@@ -4854,6 +5013,7 @@
48545013 private MenuItem genNormalsMESHItem;
48555014 private MenuItem genNormalsCADItem;
48565015 private MenuItem genNormalsORGANItem;
5016
+ private MenuItem genNormalsMINEItem;
48575017 private MenuItem stripifyItem;
48585018 private MenuItem unstripifyItem;
48595019 private MenuItem trimItem;
....@@ -4895,6 +5055,7 @@
48955055 private MenuItem resetCentroidItem;
48965056 private MenuItem transformgeometryItem;
48975057 private MenuItem resetTransformItem;
5058
+ private MenuItem hideItem;
48985059 private MenuItem grabItem;
48995060 private MenuItem backItem;
49005061 private MenuItem frontItem;
....@@ -4915,6 +5076,7 @@
49155076
49165077 private MenuItem resetParentItem;
49175078 private MenuItem repairParentItem;
5079
+ private MenuItem repairShadowItem;
49185080 private MenuItem sortbysizeItem;
49195081 private MenuItem sortbynameItem;
49205082
....@@ -4935,6 +5097,7 @@
49355097 private MenuItem coneItem;
49365098 private MenuItem torusItem;
49375099 private MenuItem superItem;
5100
+ private MenuItem kleinItem;
49385101 private MenuItem blobItem;
49395102 private MenuItem latheItem;
49405103 private MenuItem bezierItem;
....@@ -4947,6 +5110,7 @@
49475110 private MenuItem csgItem;
49485111 private MenuItem templateItem;
49495112 private MenuItem textureItem;
5113
+ private MenuItem billboardItem;
49505114 private MenuItem shadowXItem;
49515115 private MenuItem shadowYItem;
49525116 private MenuItem shadowZItem;