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. --- Cone.java | 60 ++++++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 38 insertions(+), 22 deletions(-) diff --git a/Cone.java b/Cone.java index 938fe77..490678a 100644 --- a/Cone.java +++ b/Cone.java @@ -2,7 +2,7 @@ class Cone extends Biparam implements java.io.Serializable { - //static final long serialVersionUID = -679715043452968126L; + static final long serialVersionUID = -2558098774090336324L; // -679715043452968126L; Cone() { @@ -16,7 +16,7 @@ retile(); base = LA.newVector(0, 0, 0); // -1); apex = LA.newVector(0, 1, 0); // 1); - baseRadius = apexRadius = 1; // 0.125; + baseRadius = apexRadius = 0.5; // 0.125; //fromStandard = new double[4][4]; //toStandard = new double[4][4]; //LA.matIdentity(fromStandard); @@ -86,9 +86,9 @@ return cone; } - protected void deepCopySelf(Object3D other) + protected void deepCopyNode(Object3D other) { - super.deepCopySelf(other); + super.deepCopyNode(other); Cone c = (Cone)other; LA.vecCopy(base, c.base); c.baseRadius = baseRadius; @@ -193,6 +193,16 @@ return inside; } + double uStretch() + { + return 3; // Actually 3.14 (I think) + } + + double vFlip(double v) + { + return 1-v; + } + Vertex biparamFunction(double u, double v) { cVector tPos; @@ -263,9 +273,11 @@ editWindow = objectUI.GetEditor(); } - void drawEditHandles(ClickInfo info, int level) + void drawEditHandles(//ClickInfo info, + int level) { - super.drawEditHandles(info, level); + super.drawEditHandles(//info, + level); if (level == 1) { return; @@ -273,37 +285,39 @@ { cVector temp = new cVector(); LA.xformPos(base, toParent, temp); - Rectangle baseSpot = calcHotSpot(temp, info); + Rectangle baseSpot = calcHotSpot(temp); //, info); LA.xformPos(apex, toParent, temp); - Rectangle apexSpot = calcHotSpot(temp, info); - info.g.setColor(Color.green); - info.g.fillRect(baseSpot.x, baseSpot.y, baseSpot.width, baseSpot.height); - info.g.fillRect(apexSpot.x, apexSpot.y, apexSpot.width, apexSpot.height); + Rectangle apexSpot = calcHotSpot(temp); //, info); + clickInfo.g.setColor(Color.green); + clickInfo.g.fillRect(baseSpot.x, baseSpot.y, baseSpot.width, baseSpot.height); + clickInfo.g.fillRect(apexSpot.x, apexSpot.y, apexSpot.width, apexSpot.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 = new cVector(); LA.xformPos(base, toParent, temp); - Rectangle baseSpot = calcHotSpot(temp, info); + Rectangle baseSpot = calcHotSpot(temp); //, info); LA.xformPos(apex, toParent, temp); - Rectangle apexSpot = calcHotSpot(temp, info); - if (baseSpot.contains(info.x, info.y)) + Rectangle apexSpot = calcHotSpot(temp); //, info); + if (baseSpot.contains(clickInfo.x, clickInfo.y)) { hitSomething = 2; startRad = baseRadius; } else - if (apexSpot.contains(info.x, info.y)) + if (apexSpot.contains(clickInfo.x, clickInfo.y)) { hitSomething = 3; startRad = apexRadius; @@ -311,20 +325,22 @@ { return false; } - startX = info.x; + startX = clickInfo.x; return true; } - void doEditDrag(ClickInfo info, boolean opposite) + void doEditDrag(//ClickInfo info, + boolean opposite) { if (hitSomething == 0) return; if (hitSomething == 1) { - super.doEditDrag(info, opposite); + super.doEditDrag(//info, + opposite); return; } - double deltaR = info.x - startX; + double deltaR = clickInfo.x - startX; double newRad = startRad + deltaR; if (newRad < 0) newRad = 0; @@ -333,7 +349,7 @@ else apexRadius = newRad; recalculate(); - info.pane.repaint(); + clickInfo.pane.repaint(); } cVector base; -- Gitblit v1.6.2