From f868664f7e7626f651e6ade9c9f6863851ef43b7 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Wed, 06 Nov 2019 23:12:57 -0500
Subject: [PATCH] Dangerous "reset".

---
 ObjEditor.java   |    1 
 icons/scenes.jpg |    0 
 CameraPane.java  |    9 +++-
 SuperEditor.java |    8 ++--
 Camera.java      |    7 +++
 GroupEditor.java |    3 +
 Biparam.java     |    6 +++
 Object3D.java    |   14 ++++---
 Composite.java   |   48 ++++++++++++++++--------
 9 files changed, 66 insertions(+), 30 deletions(-)

diff --git a/Biparam.java b/Biparam.java
index 51c6b3f..fd069b1 100644
--- a/Biparam.java
+++ b/Biparam.java
@@ -37,6 +37,12 @@
             bRep.SetVertex(v, i);
         }
         
+        if (reset)
+        {
+            this.recalculate();
+            reset = false;
+        }
+        
         super.DrawNode(display, root, selected);
     }
     
diff --git a/Camera.java b/Camera.java
index 0de6989..2bb124c 100644
--- a/Camera.java
+++ b/Camera.java
@@ -388,8 +388,13 @@
             locationBuf.y = location.y * K + locationBuf.y * (1 - K);
             lookAtBuf.y = lookAt.y * K + lookAtBuf.y * (1 - K);
             
+            int Y = 1;
+            
+            if (UP.y < 0)
+                Y = -1;
+            
             UP.x = 0 * K + UP.x * (1 - K);
-            UP.y = 1 * K + UP.y * (1 - K);
+            UP.y = Y * K + UP.y * (1 - K);
             UP.z = 0 * K + UP.z * (1 - K);
             UP.normalize();
             
diff --git a/CameraPane.java b/CameraPane.java
index 7120432..7f7f48b 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -15647,7 +15647,8 @@
     {
 // Set the blank cursor to the JFrame.
 //object.editWindow.frame.
-        setCursor(blankCursor);
+        if (Globals.ADVANCED)
+            setCursor(blankCursor); // Contaminates other apps!
 
         if (key >= '0' && key <= '5')
             clampbit = (key-'0');
@@ -16112,12 +16113,14 @@
                 }
                 repaint();
                 break;
+            case '.':
+                Globals.ONESTEP = true;
+                repaint();
+                break;
             case BACKSPACE:
                 // almost working enablebackspace = true;
                 Globals.WALK ^= true;
                 
-            object.Step();
-            object.Touch();
    //             SwitchCameras(false);
                 repaint();
                 break;
diff --git a/Composite.java b/Composite.java
index 32ee24c..9301234 100644
--- a/Composite.java
+++ b/Composite.java
@@ -543,33 +543,49 @@
 
     void SoftTouch()
     {
-        super.SoftTouch();
-        for (int i = 0; i < Children().size(); i++)
+        if (blockloop)
         {
-            Object3D obj = (Object3D) Children().reserve(i);
-            
-            if (obj == null)
-                continue;
-            
-            if (obj.material == null)
-            {
-                obj.SoftTouch();
-            }
-            Children().release(i);
+            return;
         }
+
+        blockloop = true;
+        
+        super.SoftTouch();
+        
+        for (int i = 0; i < Size(); i++)
+        {
+            Object3D child = (Object3D) get(i);
+            if (child == null)
+                continue;
+            if (child.material == null)
+            {
+                child.SoftTouch();
+            }
+        }
+        
+        blockloop = false;
     }
 
     void HardTouch()
     {
-        super.HardTouch();
-        for (int i = 0; i < Children().size(); i++)
+        if (blockloop)
         {
-            Object3D child = (Object3D) Children().reserve(i);
+            return;
+        }
+
+        blockloop = true;
+        
+        super.HardTouch();
+        
+        for (int i = 0; i < Size(); i++)
+        {
+            Object3D child = (Object3D) get(i);
             if (child == null)
                 continue;
             child.HardTouch();
-            Children().release(i);
         }
+        
+        blockloop = false;
     }
 
 //    void ClearMaterial()
diff --git a/GroupEditor.java b/GroupEditor.java
index fac0d64..d849672 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -2042,8 +2042,11 @@
 		animationItem.addItemListener(this);
                 animationItem.setState(Globals.ANIMATION);
                 
+        if (Globals.ADVANCED)
+        {
 		menu.add(archiveItem = new MenuItem("Archive3D..."));
 		archiveItem.addActionListener(this);
+        }
                 
 		menu.add("-");
 		parseverticesItem = menu.add(new MenuItem("Multiplicity"));
diff --git a/ObjEditor.java b/ObjEditor.java
index 9a57cca..1627a33 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -5064,6 +5064,7 @@
         
         ResetModel();
         objEditor.copy.HardTouch(); // recompile?
+        Globals.lighttouched = true;
         
         cRadio ab;
         for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();)
diff --git a/Object3D.java b/Object3D.java
index 54f9cd8..f3f692a 100644
--- a/Object3D.java
+++ b/Object3D.java
@@ -5711,8 +5711,9 @@
     {
     }
 //    transient int displaylist = 0; // -1;
-    transient boolean touched = true;
-    transient boolean softtouched = true;
+    transient boolean reset = false; // Recalculate
+    transient boolean touched = true; // call list only
+    transient boolean softtouched = true; // aucune idee
 
     void Touch()
     {
@@ -5765,6 +5766,7 @@
     {
         //System.out.println("HardTouch " + this); // new Exception().printStackTrace();
         //new Exception().printStackTrace();
+        reset = true;
         touched = true;
         CameraPane.touched = true;
     //if (parent != null)
@@ -6624,7 +6626,7 @@
                     }
                 }
                 
-                assert (!(this instanceof Composite));
+        // Bezier surface:        assert (!(this instanceof Composite));
                 {
 // CRASH MOCAP!!                   for (int i = 0; i < size(); i++)
 //                    {
@@ -6905,11 +6907,11 @@
 
             if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
                 return;
-
-            if (hide)
-                return;
         }
         
+        if (hide)
+            return;
+            
         if (scriptnode != null)
         {
             scriptnode.DrawNode(display, root, selected);
diff --git a/SuperEditor.java b/SuperEditor.java
index 52a920d..dfb8fbc 100644
--- a/SuperEditor.java
+++ b/SuperEditor.java
@@ -52,13 +52,13 @@
             northPanel = new cGridBag();
             
 		northPanel.add(northLabel = new JLabel("XY factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
-                northPanel.add(northField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
+                northPanel.add(northField = new cNumberSlider(this, 0.0001,3, 1.1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
                 oe.ctrlPanel.add(northPanel);		
                 
                 oe.ctrlPanel.Return();
             eastPanel = new cGridBag();
                 eastPanel.add(eastLabel = new JLabel("Z factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
-                eastPanel.add(eastField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
+                eastPanel.add(eastField = new cNumberSlider(this, 0.0001,3, 1.1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
                 oe.ctrlPanel.add(eastPanel);		
 
                 oe.ctrlPanel.Return();
@@ -171,8 +171,8 @@
 	public void applySelf()
 	{
 		super.applySelf();
-		superE.north = northField.getFloat();
-		superE.east = eastField.getFloat();
+		superE.north = northField.getFloat() * 2;
+		superE.east = eastField.getFloat() * 2;
 		superE.recalculate();
 	}
 	
diff --git a/icons/scenes.jpg b/icons/scenes.jpg
new file mode 100644
index 0000000..bfe6673
--- /dev/null
+++ b/icons/scenes.jpg
Binary files differ

--
Gitblit v1.6.2