From f1c718cce66e5651a0dae91375db6ebfaded1a92 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Sat, 27 Apr 2019 21:33:41 -0400
Subject: [PATCH] Test unfold UV

---
 GroupEditor.java |  108 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 77 insertions(+), 31 deletions(-)

diff --git a/GroupEditor.java b/GroupEditor.java
index aafbf22..b72085f 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -437,11 +437,17 @@
 		oe.aConstraints.gridwidth = 1;
         	oe.aConstraints.gridx = 0;
                 
-                oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
+                oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
+                liveCB.setToolTipText("Enabled animation");
                                 liveCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
+                oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
+                fastCB.setToolTipText("Fast mode");
+                                fastCB.addItemListener(this);
+        	oe.aConstraints.gridx += 1;
                 oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
+                supportCB.setToolTipText("Enabled rigging");
                                 supportCB.addItemListener(this);
 
         //	oe.aConstraints.gridx += 1;
@@ -449,22 +455,27 @@
         //                        localCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
-                oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
+                oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
+                crowdCB.setToolTipText("Used for crowds");
                                 crowdCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
                 oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
+                smoothCB.setToolTipText("Snapping delay");
                                 smoothCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
-                oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
-                                fastCB.addItemListener(this);
-        	oe.aConstraints.gridx += 1;
                 oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
+                slowCB.setToolTipText("Smooth interpolation");
                                 slowCB.addItemListener(this);
         	oe.aConstraints.gridx += 1;
-                oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
+                oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
+                boxCB.setToolTipText("Display bounding boxes");
                                 boxCB.addItemListener(this);
+        	oe.aConstraints.gridx += 1;
+                oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
+                zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
+                                zoomBoxCB.addItemListener(this);
 
 //        	oe.aConstraints.gridx += 1;
 //                oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
@@ -491,19 +502,22 @@
 //                debugCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
-                oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
+                oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
                                 oeilCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
-                oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
+                oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
+                lookAtCB.setToolTipText("Look-at target");
                                 lookAtCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
                 oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
+                trackCB.setToolTipText("Enable tracking");
                                 trackCB.addItemListener(this);
 
         	oe.aConstraints.gridx += 1;
 		oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
+                screenfitButton.setToolTipText("Screen fit");
 		screenfitButton.addActionListener(this);
 			oe.aConstraints.gridx += 1;
 //		oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
@@ -511,6 +525,7 @@
 //			oe.aConstraints.gridx += 1;
 		oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
 		snapobjectButton.addActionListener(this);
+                snapobjectButton.setToolTipText("Snap Object");
 			oe.aConstraints.gridx += 1;
 
                 //aConstraints.gridx = 0;
@@ -519,6 +534,7 @@
 		oe.aConstraints.gridwidth = 1;
 		
 		oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
+                flashSelectionButton.setToolTipText("Show selection");
 		flashSelectionButton.addActionListener(this);
                 
 		oe.toolbarPanel.add(new cButton("     ", false));
@@ -529,21 +545,28 @@
                 
                 //
 		oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
+                twoButton.setToolTipText("Show center view only");
 		twoButton.addActionListener(this);
 		oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
 		fourButton.addActionListener(this);
+                fourButton.setToolTipText("Show left panel only");
 		oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
+                sixButton.setToolTipText("2-column layout left");
 		sixButton.addActionListener(this);
 		oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
+                threeButton.setToolTipText("2-column layout right");
 		threeButton.addActionListener(this);
 		oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
+                sevenButton.setToolTipText("3-column layout");
 		sevenButton.addActionListener(this);
                 //
 
-		oe.toolbarPanel.add(rootButton = new cButton(" o o o  E  ")); //, oe.aConstraints);
+		oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
+                rootButton.setToolTipText("Edit object in new tab");
 		rootButton.addActionListener(this);
 			oe.aConstraints.gridx += 1;
 		oe.toolbarPanel.add(closeButton = new cButton("  X  ")); //, oe.aConstraints);
+                closeButton.setToolTipText("Close tab");
 		closeButton.addActionListener(this);
 		//oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
 		//clearButton.addActionListener(this);
@@ -649,14 +672,14 @@
 	
         void EditObject(Object3D obj)
         {
-            cRadio dummyButton = new cRadio(obj.name);
-            dummyButton.SetObject(obj);
-            dummyButton.layout = sevenButton;
-            dummyButton.SetCamera(cameraView.renderCamera, false);
-            dummyButton.addActionListener(this);
-            radioPanel.add(dummyButton);
-            buttonGroup.add(dummyButton);
-            dummyButton.doClick();
+            cRadio radioButton = new cRadio(obj.name);
+            radioButton.SetObject(obj);
+            radioButton.layout = sevenButton;
+            radioButton.SetCamera(cameraView.renderCamera, false);
+            radioButton.addActionListener(this);
+            radioPanel.add(radioButton);
+            buttonGroup.add(radioButton);
+            radioButton.doClick();
         }
         void SetupViews(ObjEditor oe)
         {
@@ -676,6 +699,7 @@
         JCheckBox fastCB;
         JCheckBox slowCB;
         JCheckBox boxCB;
+        JCheckBox zoomBoxCB;
         JCheckBox trackCB;
         JCheckBox smoothfocusCB;
 //        JCheckBox speakerMocapCB;
@@ -755,6 +779,10 @@
                 Recompile();
         cameraView.repaint();
 //                refreshContents();
+            }
+            else if(e.getSource() == zoomBoxCB)
+            {
+                cameraView.ToggleZoomBoxMode();
             }
             else if(e.getSource() == smoothfocusCB)
             {
@@ -1120,6 +1148,8 @@
 		resetParentItem.addActionListener(this);
 		repairParentItem = menu.add(new MenuItem("Repair Parent"));
 		repairParentItem.addActionListener(this);
+		repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
+		repairShadowItem.addActionListener(this);
 		menu.add(invariantsItem = new MenuItem("Invariants"));
 		invariantsItem.addActionListener(this);
 		menu.add(recompileItem = new MenuItem("Recompile"));
@@ -1780,8 +1810,8 @@
 		} else
 		if (event.getSource() == computeAOItem)
 		{
-                    CameraPane.drawMode = CameraPane.OCCLUSION;
-                    CameraPane.theRenderer.repaint();
+                    Globals.drawMode = CameraPane.OCCLUSION;
+                    Globals.theRenderer.repaint();
 		} else
 		if (event.getSource() == recompileItem)
 		{
@@ -2092,7 +2122,7 @@
                         if (content instanceof cGroup && ((cGroup)content).transientlink )
                             content = ((cGroup)content).get(0);
 
-            CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
+            Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
                         for (int i=0; i<group.selection.size(); i++)
                         {
                             boolean random = CameraPane.RANDOM;
@@ -2101,7 +2131,7 @@
                       //      group.selection.get(i).setMasterThis(content); // should be identity
                             CameraPane.RANDOM = random;
                         }
-            CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
+            Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
 		refreshContents();
                     }
 		} else
@@ -2545,6 +2575,20 @@
 			
 			refreshContents();
 		} else
+		if (event.getSource() == repairShadowItem)
+		{
+			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
+			{
+				Object3D obj = (Object3D)e.nextElement();
+                                obj.RepairShadow();
+//                                for (int i=0; i<obj.size(); i++)
+//                                {
+//                                    obj.get(i).parent = obj;
+//                                }
+			}
+			
+			refreshContents();
+		} else
 		if (event.getSource() == sortbysizeItem)
 		{
 			for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
@@ -2895,7 +2939,7 @@
                     }
                     
                     copy = group;
-                    //CameraPane.theRenderer.object = group;
+                    //Globals.theRenderer.object = group;
                     if(!useclient)
                     {
                         cameraView.renderCamera = radio.camera;
@@ -2904,7 +2948,8 @@
                         cameraView.cameras[cameraView.cameracount] = radio.camera;
                         cameraView.targetLookAt.set(radio.camera.lookAt);
                         cameraView.object = group;
-                        cameraView.lighttouched = true;
+                        //cameraView.lighttouched = true;
+                        Globals.lighttouched = true;
                         topView.object = group;
                         frontView.object = group;
                         sideView.object = group;
@@ -2940,7 +2985,7 @@
             if (useclient)
             {
                 cameraView.object = client;
-                cameraView.lighttouched = true;
+                Globals.lighttouched = true;
                 //topView.object = client;
                 //frontView.object = client;
                 //sideView.object = client;
@@ -2948,7 +2993,7 @@
             else
             {
                 cameraView.object = group;
-                cameraView.lighttouched = true;
+                Globals.lighttouched = true;
                 //topView.object = group;
                 //frontView.object = group;
                 //sideView.object = group;
@@ -3456,7 +3501,7 @@
                             String pigment = Object3D.GetPigment(tex);
                             //String bump = Object3D.GetBump(tex);
                             
-                            com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
+                            com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
                             
                             double s = v.s;
                             
@@ -3757,7 +3802,7 @@
             group.selection.RelinkToSupport(); // july 2014
             System.out.println("DONE.");
             refreshContents();
-        CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
+        Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
         }
         
 	void ReduceMesh(boolean reduction34)
@@ -4042,16 +4087,16 @@
 			
                         objEditor.SetText(); // jan 2014
                         
-			if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
+			if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
 				CameraPane.flash = true;
                         
 			if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
                             // a camera
                         {
                             CameraPane.camerachangeframe = 0; // don't refuse it
-                            CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
-                         //   CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
-                         //   CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
+                            Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
+                         //   Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
+                         //   Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
                         }
                             
 			refreshContents();
@@ -5009,6 +5054,7 @@
         
 	private MenuItem resetParentItem;
 	private MenuItem repairParentItem;
+	private MenuItem repairShadowItem;
 	private MenuItem sortbysizeItem;
 	private MenuItem sortbynameItem;
         

--
Gitblit v1.6.2