Normand Briere
2019-08-23 60cec91731a350fe67e9b5ffe7a00d70e9026314
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,16 @@
192193 return inside;
193194 }
194195
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
+
195206 Vertex biparamFunction(double u, double v)
196207 {
197208 cVector tPos;
....@@ -262,9 +273,11 @@
262273 editWindow = objectUI.GetEditor();
263274 }
264275
265
- void drawEditHandles(ClickInfo info, int level)
276
+ void drawEditHandles(//ClickInfo info,
277
+ int level)
266278 {
267
- super.drawEditHandles(info, level);
279
+ super.drawEditHandles(//info,
280
+ level);
268281 if (level == 1)
269282 {
270283 return;
....@@ -272,37 +285,39 @@
272285 {
273286 cVector temp = new cVector();
274287 LA.xformPos(base, toParent, temp);
275
- Rectangle baseSpot = calcHotSpot(temp, info);
288
+ Rectangle baseSpot = calcHotSpot(temp); //, info);
276289 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);
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);
281294 return;
282295 }
283296 }
284297
285
- boolean doEditClick(ClickInfo info, int level)
298
+ boolean doEditClick(//ClickInfo info,
299
+ int level)
286300 {
287301 //if (level == 0)
288302 //return false;
289303 hitSomething = 0;
290
- if (super.doEditClick(info, level))
304
+ if (super.doEditClick(//info,
305
+ level))
291306 {
292307 hitSomething = 1;
293308 return true;
294309 }
295310 cVector temp = new cVector();
296311 LA.xformPos(base, toParent, temp);
297
- Rectangle baseSpot = calcHotSpot(temp, info);
312
+ Rectangle baseSpot = calcHotSpot(temp); //, info);
298313 LA.xformPos(apex, toParent, temp);
299
- Rectangle apexSpot = calcHotSpot(temp, info);
300
- if (baseSpot.contains(info.x, info.y))
314
+ Rectangle apexSpot = calcHotSpot(temp); //, info);
315
+ if (baseSpot.contains(clickInfo.x, clickInfo.y))
301316 {
302317 hitSomething = 2;
303318 startRad = baseRadius;
304319 } else
305
- if (apexSpot.contains(info.x, info.y))
320
+ if (apexSpot.contains(clickInfo.x, clickInfo.y))
306321 {
307322 hitSomething = 3;
308323 startRad = apexRadius;
....@@ -310,20 +325,22 @@
310325 {
311326 return false;
312327 }
313
- startX = info.x;
328
+ startX = clickInfo.x;
314329 return true;
315330 }
316331
317
- void doEditDrag(ClickInfo info, boolean opposite)
332
+ void doEditDrag(//ClickInfo info,
333
+ boolean opposite)
318334 {
319335 if (hitSomething == 0)
320336 return;
321337 if (hitSomething == 1)
322338 {
323
- super.doEditDrag(info, opposite);
339
+ super.doEditDrag(//info,
340
+ opposite);
324341 return;
325342 }
326
- double deltaR = info.x - startX;
343
+ double deltaR = clickInfo.x - startX;
327344 double newRad = startRad + deltaR;
328345 if (newRad < 0)
329346 newRad = 0;
....@@ -332,7 +349,7 @@
332349 else
333350 apexRadius = newRad;
334351 recalculate();
335
- info.pane.repaint();
352
+ clickInfo.pane.repaint();
336353 }
337354
338355 cVector base;