Normand Briere
2019-08-17 d5d6485126da83b06645e90e3e4ce66659a56009
Cone.java
....@@ -2,7 +2,7 @@
22
33 class Cone extends Biparam implements java.io.Serializable
44 {
5
- //static final long serialVersionUID = -679715043452968126L;
5
+ static final long serialVersionUID = -2558098774090336324L; // -679715043452968126L;
66
77 Cone()
88 {
....@@ -193,6 +193,16 @@
193193 return inside;
194194 }
195195
196
+ double uStretch()
197
+ {
198
+ return 6; // Actually 6.28 (I think)
199
+ }
200
+
201
+ double vFlip(double v)
202
+ {
203
+ return 1-v;
204
+ }
205
+
196206 Vertex biparamFunction(double u, double v)
197207 {
198208 cVector tPos;
....@@ -263,9 +273,11 @@
263273 editWindow = objectUI.GetEditor();
264274 }
265275
266
- void drawEditHandles(ClickInfo info, int level)
276
+ void drawEditHandles(//ClickInfo info,
277
+ int level)
267278 {
268
- super.drawEditHandles(info, level);
279
+ super.drawEditHandles(//info,
280
+ level);
269281 if (level == 1)
270282 {
271283 return;
....@@ -273,37 +285,39 @@
273285 {
274286 cVector temp = new cVector();
275287 LA.xformPos(base, toParent, temp);
276
- Rectangle baseSpot = calcHotSpot(temp, info);
288
+ Rectangle baseSpot = calcHotSpot(temp); //, info);
277289 LA.xformPos(apex, toParent, temp);
278
- Rectangle apexSpot = calcHotSpot(temp, info);
279
- info.g.setColor(Color.green);
280
- info.g.fillRect(baseSpot.x, baseSpot.y, baseSpot.width, baseSpot.height);
281
- info.g.fillRect(apexSpot.x, apexSpot.y, apexSpot.width, apexSpot.height);
290
+ Rectangle apexSpot = calcHotSpot(temp); //, info);
291
+ clickInfo.g.setColor(Color.green);
292
+ clickInfo.g.fillRect(baseSpot.x, baseSpot.y, baseSpot.width, baseSpot.height);
293
+ clickInfo.g.fillRect(apexSpot.x, apexSpot.y, apexSpot.width, apexSpot.height);
282294 return;
283295 }
284296 }
285297
286
- boolean doEditClick(ClickInfo info, int level)
298
+ boolean doEditClick(//ClickInfo info,
299
+ int level)
287300 {
288301 //if (level == 0)
289302 //return false;
290303 hitSomething = 0;
291
- if (super.doEditClick(info, level))
304
+ if (super.doEditClick(//info,
305
+ level))
292306 {
293307 hitSomething = 1;
294308 return true;
295309 }
296310 cVector temp = new cVector();
297311 LA.xformPos(base, toParent, temp);
298
- Rectangle baseSpot = calcHotSpot(temp, info);
312
+ Rectangle baseSpot = calcHotSpot(temp); //, info);
299313 LA.xformPos(apex, toParent, temp);
300
- Rectangle apexSpot = calcHotSpot(temp, info);
301
- if (baseSpot.contains(info.x, info.y))
314
+ Rectangle apexSpot = calcHotSpot(temp); //, info);
315
+ if (baseSpot.contains(clickInfo.x, clickInfo.y))
302316 {
303317 hitSomething = 2;
304318 startRad = baseRadius;
305319 } else
306
- if (apexSpot.contains(info.x, info.y))
320
+ if (apexSpot.contains(clickInfo.x, clickInfo.y))
307321 {
308322 hitSomething = 3;
309323 startRad = apexRadius;
....@@ -311,20 +325,22 @@
311325 {
312326 return false;
313327 }
314
- startX = info.x;
328
+ startX = clickInfo.x;
315329 return true;
316330 }
317331
318
- void doEditDrag(ClickInfo info, boolean opposite)
332
+ void doEditDrag(//ClickInfo info,
333
+ boolean opposite)
319334 {
320335 if (hitSomething == 0)
321336 return;
322337 if (hitSomething == 1)
323338 {
324
- super.doEditDrag(info, opposite);
339
+ super.doEditDrag(//info,
340
+ opposite);
325341 return;
326342 }
327
- double deltaR = info.x - startX;
343
+ double deltaR = clickInfo.x - startX;
328344 double newRad = startRad + deltaR;
329345 if (newRad < 0)
330346 newRad = 0;
....@@ -333,7 +349,7 @@
333349 else
334350 apexRadius = newRad;
335351 recalculate();
336
- info.pane.repaint();
352
+ clickInfo.pane.repaint();
337353 }
338354
339355 cVector base;