Normand Briere
2019-08-12 b1d79b74514041a059b454a9f6fc3970773c0cb8
Cone.java
....@@ -2,6 +2,7 @@
22
33 class Cone extends Biparam implements java.io.Serializable
44 {
5
+ static final long serialVersionUID = -2558098774090336324L; // -679715043452968126L;
56
67 Cone()
78 {
....@@ -192,6 +193,11 @@
192193 return inside;
193194 }
194195
196
+ double uStretch()
197
+ {
198
+ return 6; // Actually 6.28 (I think)
199
+ }
200
+
195201 Vertex biparamFunction(double u, double v)
196202 {
197203 cVector tPos;
....@@ -262,9 +268,11 @@
262268 editWindow = objectUI.GetEditor();
263269 }
264270
265
- void drawEditHandles(ClickInfo info, int level)
271
+ void drawEditHandles(//ClickInfo info,
272
+ int level)
266273 {
267
- super.drawEditHandles(info, level);
274
+ super.drawEditHandles(//info,
275
+ level);
268276 if (level == 1)
269277 {
270278 return;
....@@ -272,37 +280,39 @@
272280 {
273281 cVector temp = new cVector();
274282 LA.xformPos(base, toParent, temp);
275
- Rectangle baseSpot = calcHotSpot(temp, info);
283
+ Rectangle baseSpot = calcHotSpot(temp); //, info);
276284 LA.xformPos(apex, toParent, temp);
277
- Rectangle apexSpot = calcHotSpot(temp, info);
278
- info.g.setColor(Color.green);
279
- info.g.fillRect(baseSpot.x, baseSpot.y, baseSpot.width, baseSpot.height);
280
- info.g.fillRect(apexSpot.x, apexSpot.y, apexSpot.width, apexSpot.height);
285
+ Rectangle apexSpot = calcHotSpot(temp); //, info);
286
+ clickInfo.g.setColor(Color.green);
287
+ clickInfo.g.fillRect(baseSpot.x, baseSpot.y, baseSpot.width, baseSpot.height);
288
+ clickInfo.g.fillRect(apexSpot.x, apexSpot.y, apexSpot.width, apexSpot.height);
281289 return;
282290 }
283291 }
284292
285
- boolean doEditClick(ClickInfo info, int level)
293
+ boolean doEditClick(//ClickInfo info,
294
+ int level)
286295 {
287296 //if (level == 0)
288297 //return false;
289298 hitSomething = 0;
290
- if (super.doEditClick(info, level))
299
+ if (super.doEditClick(//info,
300
+ level))
291301 {
292302 hitSomething = 1;
293303 return true;
294304 }
295305 cVector temp = new cVector();
296306 LA.xformPos(base, toParent, temp);
297
- Rectangle baseSpot = calcHotSpot(temp, info);
307
+ Rectangle baseSpot = calcHotSpot(temp); //, info);
298308 LA.xformPos(apex, toParent, temp);
299
- Rectangle apexSpot = calcHotSpot(temp, info);
300
- if (baseSpot.contains(info.x, info.y))
309
+ Rectangle apexSpot = calcHotSpot(temp); //, info);
310
+ if (baseSpot.contains(clickInfo.x, clickInfo.y))
301311 {
302312 hitSomething = 2;
303313 startRad = baseRadius;
304314 } else
305
- if (apexSpot.contains(info.x, info.y))
315
+ if (apexSpot.contains(clickInfo.x, clickInfo.y))
306316 {
307317 hitSomething = 3;
308318 startRad = apexRadius;
....@@ -310,20 +320,22 @@
310320 {
311321 return false;
312322 }
313
- startX = info.x;
323
+ startX = clickInfo.x;
314324 return true;
315325 }
316326
317
- void doEditDrag(ClickInfo info, boolean opposite)
327
+ void doEditDrag(//ClickInfo info,
328
+ boolean opposite)
318329 {
319330 if (hitSomething == 0)
320331 return;
321332 if (hitSomething == 1)
322333 {
323
- super.doEditDrag(info, opposite);
334
+ super.doEditDrag(//info,
335
+ opposite);
324336 return;
325337 }
326
- double deltaR = info.x - startX;
338
+ double deltaR = clickInfo.x - startX;
327339 double newRad = startRad + deltaR;
328340 if (newRad < 0)
329341 newRad = 0;
....@@ -332,7 +344,7 @@
332344 else
333345 apexRadius = newRad;
334346 recalculate();
335
- info.pane.repaint();
347
+ clickInfo.pane.repaint();
336348 }
337349
338350 cVector base;