Normand Briere
2019-04-28 f1c718cce66e5651a0dae91375db6ebfaded1a92
GroupEditor.java
....@@ -437,11 +437,17 @@
437437 oe.aConstraints.gridwidth = 1;
438438 oe.aConstraints.gridx = 0;
439439
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
440
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
+ liveCB.setToolTipText("Enabled animation");
441442 liveCB.addItemListener(this);
442443
443444 oe.aConstraints.gridx += 1;
445
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
446
+ fastCB.setToolTipText("Fast mode");
447
+ fastCB.addItemListener(this);
448
+ oe.aConstraints.gridx += 1;
444449 oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
+ supportCB.setToolTipText("Enabled rigging");
445451 supportCB.addItemListener(this);
446452
447453 // oe.aConstraints.gridx += 1;
....@@ -449,22 +455,27 @@
449455 // localCB.addItemListener(this);
450456
451457 oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
458
+ oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
+ crowdCB.setToolTipText("Used for crowds");
453460 crowdCB.addItemListener(this);
454461
455462 oe.aConstraints.gridx += 1;
456463 oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
+ smoothCB.setToolTipText("Snapping delay");
457465 smoothCB.addItemListener(this);
458466
459467 oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
461
- fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463468 oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
+ slowCB.setToolTipText("Smooth interpolation");
464470 slowCB.addItemListener(this);
465471 oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
472
+ oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
+ boxCB.setToolTipText("Display bounding boxes");
467474 boxCB.addItemListener(this);
475
+ oe.aConstraints.gridx += 1;
476
+ oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
+ zoomBoxCB.addItemListener(this);
468479
469480 // oe.aConstraints.gridx += 1;
470481 // oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
....@@ -491,19 +502,22 @@
491502 // debugCB.addItemListener(this);
492503
493504 oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
505
+ oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
495506 oeilCB.addItemListener(this);
496507
497508 oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
509
+ oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
+ lookAtCB.setToolTipText("Look-at target");
499511 lookAtCB.addItemListener(this);
500512
501513 oe.aConstraints.gridx += 1;
502514 oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
515
+ trackCB.setToolTipText("Enable tracking");
503516 trackCB.addItemListener(this);
504517
505518 oe.aConstraints.gridx += 1;
506519 oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
520
+ screenfitButton.setToolTipText("Screen fit");
507521 screenfitButton.addActionListener(this);
508522 oe.aConstraints.gridx += 1;
509523 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
....@@ -511,6 +525,7 @@
511525 // oe.aConstraints.gridx += 1;
512526 oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513527 snapobjectButton.addActionListener(this);
528
+ snapobjectButton.setToolTipText("Snap Object");
514529 oe.aConstraints.gridx += 1;
515530
516531 //aConstraints.gridx = 0;
....@@ -519,28 +534,39 @@
519534 oe.aConstraints.gridwidth = 1;
520535
521536 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
537
+ flashSelectionButton.setToolTipText("Show selection");
522538 flashSelectionButton.addActionListener(this);
539
+
540
+ oe.toolbarPanel.add(new cButton(" ", false));
541
+
523542 oe.aConstraints.gridx += 1;
524543 oe.aConstraints.weighty = 0;
525544 oe.aConstraints.gridwidth = 1;
526545
527546 //
528547 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
548
+ twoButton.setToolTipText("Show center view only");
529549 twoButton.addActionListener(this);
530550 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
531551 fourButton.addActionListener(this);
552
+ fourButton.setToolTipText("Show left panel only");
532553 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
554
+ sixButton.setToolTipText("2-column layout left");
533555 sixButton.addActionListener(this);
534556 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
557
+ threeButton.setToolTipText("2-column layout right");
535558 threeButton.addActionListener(this);
536559 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
560
+ sevenButton.setToolTipText("3-column layout");
537561 sevenButton.addActionListener(this);
538562 //
539563
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
564
+ oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
+ rootButton.setToolTipText("Edit object in new tab");
541566 rootButton.addActionListener(this);
542567 oe.aConstraints.gridx += 1;
543568 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
569
+ closeButton.setToolTipText("Close tab");
544570 closeButton.addActionListener(this);
545571 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546572 //clearButton.addActionListener(this);
....@@ -646,14 +672,14 @@
646672
647673 void EditObject(Object3D obj)
648674 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
675
+ cRadio radioButton = new cRadio(obj.name);
676
+ radioButton.SetObject(obj);
677
+ radioButton.layout = sevenButton;
678
+ radioButton.SetCamera(cameraView.renderCamera, false);
679
+ radioButton.addActionListener(this);
680
+ radioPanel.add(radioButton);
681
+ buttonGroup.add(radioButton);
682
+ radioButton.doClick();
657683 }
658684 void SetupViews(ObjEditor oe)
659685 {
....@@ -673,6 +699,7 @@
673699 JCheckBox fastCB;
674700 JCheckBox slowCB;
675701 JCheckBox boxCB;
702
+ JCheckBox zoomBoxCB;
676703 JCheckBox trackCB;
677704 JCheckBox smoothfocusCB;
678705 // JCheckBox speakerMocapCB;
....@@ -715,8 +742,7 @@
715742 dropAttributes |= Object3D.TEXTURE;
716743 else
717744 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
745
+ } else if(e.getSource() == liveCB)
720746 {
721747 cameraView.ToggleLive();
722748 }
....@@ -753,6 +779,10 @@
753779 Recompile();
754780 cameraView.repaint();
755781 // refreshContents();
782
+ }
783
+ else if(e.getSource() == zoomBoxCB)
784
+ {
785
+ cameraView.ToggleZoomBoxMode();
756786 }
757787 else if(e.getSource() == smoothfocusCB)
758788 {
....@@ -1118,6 +1148,8 @@
11181148 resetParentItem.addActionListener(this);
11191149 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201150 repairParentItem.addActionListener(this);
1151
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1152
+ repairShadowItem.addActionListener(this);
11211153 menu.add(invariantsItem = new MenuItem("Invariants"));
11221154 invariantsItem.addActionListener(this);
11231155 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1778,8 +1810,8 @@
17781810 } else
17791811 if (event.getSource() == computeAOItem)
17801812 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1813
+ Globals.drawMode = CameraPane.OCCLUSION;
1814
+ Globals.theRenderer.repaint();
17831815 } else
17841816 if (event.getSource() == recompileItem)
17851817 {
....@@ -1794,7 +1826,7 @@
17941826 if (event.getSource() == invariantsItem)
17951827 {
17961828 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1829
+ GrafreeD.grafreeD.universe.invariants();
17981830 } else
17991831 if (event.getSource() == memoryItem)
18001832 {
....@@ -2090,7 +2122,7 @@
20902122 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912123 content = ((cGroup)content).get(0);
20922124
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2125
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942126 for (int i=0; i<group.selection.size(); i++)
20952127 {
20962128 boolean random = CameraPane.RANDOM;
....@@ -2099,7 +2131,7 @@
20992131 // group.selection.get(i).setMasterThis(content); // should be identity
21002132 CameraPane.RANDOM = random;
21012133 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2134
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032135 refreshContents();
21042136 }
21052137 } else
....@@ -2543,6 +2575,20 @@
25432575
25442576 refreshContents();
25452577 } else
2578
+ if (event.getSource() == repairShadowItem)
2579
+ {
2580
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2581
+ {
2582
+ Object3D obj = (Object3D)e.nextElement();
2583
+ obj.RepairShadow();
2584
+// for (int i=0; i<obj.size(); i++)
2585
+// {
2586
+// obj.get(i).parent = obj;
2587
+// }
2588
+ }
2589
+
2590
+ refreshContents();
2591
+ } else
25462592 if (event.getSource() == sortbysizeItem)
25472593 {
25482594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2638,8 +2684,8 @@
26382684 // bug
26392685 //gridPanel.setDividerLocation(1.0);
26402686 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2642
- bigThree.remove(cameraPanel);
2687
+ bigThree.remove(scenePanel);
2688
+ bigThree.remove(centralPanel);
26432689 bigThree.remove(XYZPanel);
26442690 aWindowConstraints.gridx = 0;
26452691 aWindowConstraints.gridy = 0;
....@@ -2654,7 +2700,7 @@
26542700 // aConstraints.gridheight = 3;
26552701 aWindowConstraints.gridx = 1;
26562702 aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2703
+ bigThree.add(centralPanel, aWindowConstraints);
26582704 aWindowConstraints.weightx = 0;
26592705 aWindowConstraints.gridx = 4;
26602706 aWindowConstraints.gridwidth = 1;
....@@ -2666,8 +2712,8 @@
26662712 if (event.getSource() == threeButton)
26672713 {
26682714 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2670
- bigThree.remove(cameraPanel);
2715
+ bigThree.remove(scenePanel);
2716
+ bigThree.remove(centralPanel);
26712717 bigThree.remove(XYZPanel);
26722718 aWindowConstraints.gridx = 0;
26732719 aWindowConstraints.gridy = 0;
....@@ -2682,7 +2728,7 @@
26822728 // aConstraints.gridheight = 3;
26832729 aWindowConstraints.gridx = 1;
26842730 aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2731
+ bigThree.add(centralPanel, aWindowConstraints);
26862732 aWindowConstraints.weightx = 0;
26872733 aWindowConstraints.gridx = 4;
26882734 aWindowConstraints.gridwidth = 1;
....@@ -2694,8 +2740,8 @@
26942740 if (event.getSource() == fourButton)
26952741 {
26962742 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2698
- bigThree.remove(cameraPanel);
2743
+ bigThree.remove(scenePanel);
2744
+ bigThree.remove(centralPanel);
26992745 bigThree.remove(XYZPanel);
27002746 aWindowConstraints.gridx = 0;
27012747 aWindowConstraints.gridy = 0;
....@@ -2704,7 +2750,7 @@
27042750 aWindowConstraints.fill = GridBagConstraints.BOTH;
27052751 aWindowConstraints.weightx = 1;
27062752 aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2753
+ bigThree.add(scenePanel, aWindowConstraints);
27082754 aWindowConstraints.weightx = 1;
27092755 aWindowConstraints.gridwidth = 3;
27102756 // aConstraints.gridheight = 3;
....@@ -2722,8 +2768,8 @@
27222768 if (event.getSource() == sixButton)
27232769 {
27242770 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2726
- bigThree.remove(cameraPanel);
2771
+ bigThree.remove(scenePanel);
2772
+ bigThree.remove(centralPanel);
27272773 bigThree.remove(XYZPanel);
27282774 aWindowConstraints.gridx = 0;
27292775 aWindowConstraints.gridy = 0;
....@@ -2732,13 +2778,13 @@
27322778 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27332779 aWindowConstraints.weightx = 0;
27342780 aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2781
+ bigThree.add(scenePanel, aWindowConstraints);
27362782 aWindowConstraints.weightx = 1;
27372783 aWindowConstraints.gridwidth = 3;
27382784 // aWindowConstraints.gridheight = 3;
27392785 aWindowConstraints.gridx = 1;
27402786 aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2787
+ bigThree.add(centralPanel, aWindowConstraints);
27422788 aWindowConstraints.weightx = 0;
27432789 aWindowConstraints.gridx = 4;
27442790 aWindowConstraints.gridwidth = 1;
....@@ -2750,8 +2796,8 @@
27502796 if (event.getSource() == sevenButton)
27512797 {
27522798 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2754
- bigThree.remove(cameraPanel);
2799
+ bigThree.remove(scenePanel);
2800
+ bigThree.remove(centralPanel);
27552801 bigThree.remove(XYZPanel);
27562802 aWindowConstraints.gridx = 0;
27572803 aWindowConstraints.gridy = 0;
....@@ -2760,13 +2806,13 @@
27602806 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27612807 aWindowConstraints.weightx = 0;
27622808 aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2809
+ bigThree.add(scenePanel, aWindowConstraints);
27642810 aWindowConstraints.weightx = 1;
27652811 aWindowConstraints.gridwidth = 3;
27662812 // aWindowConstraints.gridheight = 3;
27672813 aWindowConstraints.gridx = 1;
27682814 aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2815
+ bigThree.add(centralPanel, aWindowConstraints);
27702816 aWindowConstraints.weightx = 0;
27712817 aWindowConstraints.gridx = 4;
27722818 aWindowConstraints.gridwidth = 1;
....@@ -2893,7 +2939,7 @@
28932939 }
28942940
28952941 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2942
+ //Globals.theRenderer.object = group;
28972943 if(!useclient)
28982944 {
28992945 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2948,8 @@
29022948 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032949 cameraView.targetLookAt.set(radio.camera.lookAt);
29042950 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2951
+ //cameraView.lighttouched = true;
2952
+ Globals.lighttouched = true;
29062953 topView.object = group;
29072954 frontView.object = group;
29082955 sideView.object = group;
....@@ -2938,7 +2985,7 @@
29382985 if (useclient)
29392986 {
29402987 cameraView.object = client;
2941
- cameraView.lighttouched = true;
2988
+ Globals.lighttouched = true;
29422989 //topView.object = client;
29432990 //frontView.object = client;
29442991 //sideView.object = client;
....@@ -2946,7 +2993,7 @@
29462993 else
29472994 {
29482995 cameraView.object = group;
2949
- cameraView.lighttouched = true;
2996
+ Globals.lighttouched = true;
29502997 //topView.object = group;
29512998 //frontView.object = group;
29522999 //sideView.object = group;
....@@ -3454,7 +3501,7 @@
34543501 String pigment = Object3D.GetPigment(tex);
34553502 //String bump = Object3D.GetBump(tex);
34563503
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3504
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34583505
34593506 double s = v.s;
34603507
....@@ -3755,7 +3802,7 @@
37553802 group.selection.RelinkToSupport(); // july 2014
37563803 System.out.println("DONE.");
37573804 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3805
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37593806 }
37603807
37613808 void ReduceMesh(boolean reduction34)
....@@ -4040,16 +4087,16 @@
40404087
40414088 objEditor.SetText(); // jan 2014
40424089
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4090
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40444091 CameraPane.flash = true;
40454092
40464093 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474094 // a camera
40484095 {
40494096 CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4097
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4098
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4099
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534100 }
40544101
40554102 refreshContents();
....@@ -5007,6 +5054,7 @@
50075054
50085055 private MenuItem resetParentItem;
50095056 private MenuItem repairParentItem;
5057
+ private MenuItem repairShadowItem;
50105058 private MenuItem sortbysizeItem;
50115059 private MenuItem sortbynameItem;
50125060