From f9325048496d7cdbcad233f8a6b84c88e79adcc2 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Tue, 17 Sep 2019 20:11:47 -0400
Subject: [PATCH] Rename link2master to link2support.

---
 Torus.java |   64 ++++++++++++++++++++------------
 1 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/Torus.java b/Torus.java
index af74364..7bf9ec5 100644
--- a/Torus.java
+++ b/Torus.java
@@ -2,12 +2,14 @@
 
 class Torus extends Biparam implements java.io.Serializable
 {
+        static final long serialVersionUID = -7637054329820073252L; // Old
+
     Torus()
     {
         inPnt = new cVector();
         name = "Torus";
-        uDivs = 35; // 64;
-        vDivs = 19; // 24;
+        uDivs = 61; // 35; // 64;
+        vDivs = 21; // 19; // 24;
         minUDivs = 3;
         minVDivs = 3;
         retile();
@@ -23,9 +25,9 @@
         return t;
     }
 
-    protected void deepCopySelf(Object3D other)
+    protected void deepCopyNode(Object3D other)
     {
-        super.deepCopySelf(other);
+        super.deepCopyNode(other);
         Torus t = (Torus)other;
         t.major = major;
         t.minor = minor;
@@ -54,6 +56,11 @@
         buffer.append("}\n");
     }
 
+    double uStretch()
+    {
+        return 6; // Actually 6.28 (I think)
+    }
+    
     Vertex biparamFunction(double u, double v)
     {
         if (u == 1)
@@ -62,7 +69,7 @@
             v = 0;
         
         double uAng = u * 2 * Math.PI;
-        double vAng = v * 2 * Math.PI;
+        double vAng = -v * 2 * Math.PI;
         double cosua = Math.cos(uAng);
         double sinua = Math.sin(uAng);
         double cosva = Math.cos(vAng);
@@ -85,6 +92,9 @@
         //temp.pos = tPos; // useless new
         temp.norm = tNorm;
 		LA.vecNormalize(temp.norm);
+                
+        temp.y += minor;
+                
         return temp;
     }
 
@@ -116,55 +126,59 @@
         return rad2 <= minor * minor;
     }
 
-    void drawEditHandles(ClickInfo info, int level)
+    void drawEditHandles(//ClickInfo info,
+            int level)
     {
         if (level == 0)
         {
             return;
         } else
         {
-            super.drawEditHandles(info, level);
+            super.drawEditHandles(//info,
+                    level);
             cVector temp = LA.newVector(0, 0, minor);
             LA.xformPos(temp, toParent, temp);
-            Rectangle majorSpot = calcHotSpot(temp, info);
+            Rectangle majorSpot = calcHotSpot(temp); //, info);
             majorSpot.translate(4, 4);
             temp.x = major;
             temp.y = temp.z = 0;
             LA.xformPos(temp, toParent, temp);
-            Rectangle minorSpot = calcHotSpot(temp, info);
+            Rectangle minorSpot = calcHotSpot(temp); //, info);
             minorSpot.translate(4, 4);
-            info.g.setColor(Color.green);
-            info.g.fillRect(majorSpot.x, majorSpot.y, majorSpot.width, majorSpot.height);
-            info.g.fillRect(minorSpot.x, minorSpot.y, minorSpot.width, minorSpot.height);
+            clickInfo.g.setColor(Color.green);
+            clickInfo.g.fillRect(majorSpot.x, majorSpot.y, majorSpot.width, majorSpot.height);
+            clickInfo.g.fillRect(minorSpot.x, minorSpot.y, minorSpot.width, minorSpot.height);
             return;
         }
     }
 
-    boolean doEditClick(ClickInfo info, int level)
+    boolean doEditClick(//ClickInfo info,
+            int level)
     {
         if (level == 0)
             return false;
         hitSomething = 0;
-        if (super.doEditClick(info, level))
+        if (super.doEditClick(//info,
+                level))
         {
             hitSomething = 1;
             return true;
         }
         cVector temp = LA.newVector(0, 0, minor);
         LA.xformPos(temp, toParent, temp);
-        Rectangle majorSpot = calcHotSpot(temp, info);
+        Rectangle majorSpot = calcHotSpot(temp); //, info);
         majorSpot.translate(4, 4);
         temp.x = major;
         temp.y = temp.z = 0;
         LA.xformPos(temp, toParent, temp);
-        Rectangle minorSpot = calcHotSpot(temp, info);
+        Rectangle minorSpot = calcHotSpot(temp); //, info);
         minorSpot.translate(4, 4);
-        if (majorSpot.contains(info.x, info.y))
+        if (majorSpot.contains(clickInfo.x, clickInfo.y))
         {
             hitSomething = 2;
             startRad = major;
         } else
-        if (minorSpot.contains(info.x, info.y))
+        if (minorSpot.contains(clickInfo.x, clickInfo.y))
         {
             hitSomething = 3;
             startRad = minor;
@@ -172,23 +186,25 @@
         {
             return false;
         }
-        startX = info.x;
+        startX = clickInfo.x;
         return true;
     }
 
-    void doEditDrag(ClickInfo info)
+    void doEditDrag(//ClickInfo info,
+            boolean opposite)
     {
         if (hitSomething == 0)
             return;
         if (hitSomething == 1)
         {
-            super.doEditDrag(info);
+            super.doEditDrag(//info,
+                    opposite);
             return;
         }
-        double deltaR = info.x - startX;
+        double deltaR = clickInfo.x - startX;
         //cVector delta = LA.newVector(info.x - startX, 0, 0);
         //LA.xformDir(delta, info.camera.fromScreen, delta);
-		deltaR /= 100 * info.camera.SCALE / info.camera.Distance();
+		deltaR /= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
         double newRad = startRad + deltaR;
         if (newRad < 0)
             newRad = 0;
@@ -197,7 +213,7 @@
         else
             minor = newRad;
         recalculate();
-        info.pane.repaint();
+        clickInfo.pane.repaint();
     }
 
     double major;

--
Gitblit v1.6.2