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,6 +534,7 @@
519534 oe.aConstraints.gridwidth = 1;
520535
521536 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
537
+ flashSelectionButton.setToolTipText("Show selection");
522538 flashSelectionButton.addActionListener(this);
523539
524540 oe.toolbarPanel.add(new cButton(" ", false));
....@@ -529,21 +545,28 @@
529545
530546 //
531547 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
548
+ twoButton.setToolTipText("Show center view only");
532549 twoButton.addActionListener(this);
533550 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534551 fourButton.addActionListener(this);
552
+ fourButton.setToolTipText("Show left panel only");
535553 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
554
+ sixButton.setToolTipText("2-column layout left");
536555 sixButton.addActionListener(this);
537556 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
557
+ threeButton.setToolTipText("2-column layout right");
538558 threeButton.addActionListener(this);
539559 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
560
+ sevenButton.setToolTipText("3-column layout");
540561 sevenButton.addActionListener(this);
541562 //
542563
543
- 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");
544566 rootButton.addActionListener(this);
545567 oe.aConstraints.gridx += 1;
546568 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
569
+ closeButton.setToolTipText("Close tab");
547570 closeButton.addActionListener(this);
548571 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549572 //clearButton.addActionListener(this);
....@@ -649,14 +672,14 @@
649672
650673 void EditObject(Object3D obj)
651674 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- 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();
660683 }
661684 void SetupViews(ObjEditor oe)
662685 {
....@@ -676,6 +699,7 @@
676699 JCheckBox fastCB;
677700 JCheckBox slowCB;
678701 JCheckBox boxCB;
702
+ JCheckBox zoomBoxCB;
679703 JCheckBox trackCB;
680704 JCheckBox smoothfocusCB;
681705 // JCheckBox speakerMocapCB;
....@@ -755,6 +779,10 @@
755779 Recompile();
756780 cameraView.repaint();
757781 // refreshContents();
782
+ }
783
+ else if(e.getSource() == zoomBoxCB)
784
+ {
785
+ cameraView.ToggleZoomBoxMode();
758786 }
759787 else if(e.getSource() == smoothfocusCB)
760788 {
....@@ -1120,6 +1148,8 @@
11201148 resetParentItem.addActionListener(this);
11211149 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221150 repairParentItem.addActionListener(this);
1151
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1152
+ repairShadowItem.addActionListener(this);
11231153 menu.add(invariantsItem = new MenuItem("Invariants"));
11241154 invariantsItem.addActionListener(this);
11251155 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1780,8 +1810,8 @@
17801810 } else
17811811 if (event.getSource() == computeAOItem)
17821812 {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1813
+ Globals.drawMode = CameraPane.OCCLUSION;
1814
+ Globals.theRenderer.repaint();
17851815 } else
17861816 if (event.getSource() == recompileItem)
17871817 {
....@@ -2092,7 +2122,7 @@
20922122 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932123 content = ((cGroup)content).get(0);
20942124
2095
- 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));
20962126 for (int i=0; i<group.selection.size(); i++)
20972127 {
20982128 boolean random = CameraPane.RANDOM;
....@@ -2101,7 +2131,7 @@
21012131 // group.selection.get(i).setMasterThis(content); // should be identity
21022132 CameraPane.RANDOM = random;
21032133 }
2104
- 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));
21052135 refreshContents();
21062136 }
21072137 } else
....@@ -2545,6 +2575,20 @@
25452575
25462576 refreshContents();
25472577 } 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
25482592 if (event.getSource() == sortbysizeItem)
25492593 {
25502594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2895,7 +2939,7 @@
28952939 }
28962940
28972941 copy = group;
2898
- //CameraPane.theRenderer.object = group;
2942
+ //Globals.theRenderer.object = group;
28992943 if(!useclient)
29002944 {
29012945 cameraView.renderCamera = radio.camera;
....@@ -2904,7 +2948,8 @@
29042948 cameraView.cameras[cameraView.cameracount] = radio.camera;
29052949 cameraView.targetLookAt.set(radio.camera.lookAt);
29062950 cameraView.object = group;
2907
- cameraView.lighttouched = true;
2951
+ //cameraView.lighttouched = true;
2952
+ Globals.lighttouched = true;
29082953 topView.object = group;
29092954 frontView.object = group;
29102955 sideView.object = group;
....@@ -2940,7 +2985,7 @@
29402985 if (useclient)
29412986 {
29422987 cameraView.object = client;
2943
- cameraView.lighttouched = true;
2988
+ Globals.lighttouched = true;
29442989 //topView.object = client;
29452990 //frontView.object = client;
29462991 //sideView.object = client;
....@@ -2948,7 +2993,7 @@
29482993 else
29492994 {
29502995 cameraView.object = group;
2951
- cameraView.lighttouched = true;
2996
+ Globals.lighttouched = true;
29522997 //topView.object = group;
29532998 //frontView.object = group;
29542999 //sideView.object = group;
....@@ -3456,7 +3501,7 @@
34563501 String pigment = Object3D.GetPigment(tex);
34573502 //String bump = Object3D.GetBump(tex);
34583503
3459
- 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);
34603505
34613506 double s = v.s;
34623507
....@@ -3757,7 +3802,7 @@
37573802 group.selection.RelinkToSupport(); // july 2014
37583803 System.out.println("DONE.");
37593804 refreshContents();
3760
- 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));
37613806 }
37623807
37633808 void ReduceMesh(boolean reduction34)
....@@ -4042,16 +4087,16 @@
40424087
40434088 objEditor.SetText(); // jan 2014
40444089
4045
- 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))
40464091 CameraPane.flash = true;
40474092
40484093 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494094 // a camera
40504095 {
40514096 CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // 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;
40554100 }
40564101
40574102 refreshContents();
....@@ -5009,6 +5054,7 @@
50095054
50105055 private MenuItem resetParentItem;
50115056 private MenuItem repairParentItem;
5057
+ private MenuItem repairShadowItem;
50125058 private MenuItem sortbysizeItem;
50135059 private MenuItem sortbynameItem;
50145060