Curve.st
changeset 289 c4a61914a9a0
parent 285 7d46d088d2c0
child 331 9ad8e3f94da5
--- a/Curve.st	Thu May 09 00:08:18 1996 +0200
+++ b/Curve.st	Thu May 09 01:09:18 1996 +0200
@@ -146,28 +146,46 @@
     "Created: 8.5.1996 / 21:09:40 / cg"
 ! !
 
+!Curve methodsFor:'converting'!
+
+asPointArray
+    "return an array containing my points."
+
+    ^ Array with:startPoint with:middlePoint with:endPoint
+
+    "Created: 9.5.1996 / 01:07:07 / cg"
+!
+
+asPolygon
+    "return a polygon, approximating the spline"
+
+    ^ Polygon vertices:(self computeLineSegments)
+
+    "Created: 9.5.1996 / 01:08:12 / cg"
+! !
+
 !Curve methodsFor:'displaying'!
 
 displayFilledOn:aGC
     "draw the receiver as a filled curve in a graphicsContext, aGC"
 
-    aGC fillPolygon:self computeLines
+    aGC fillPolygon:self computeLineSegments
 
     "Created: 8.5.1996 / 21:24:15 / cg"
-    "Modified: 8.5.1996 / 21:25:33 / cg"
+    "Modified: 9.5.1996 / 01:08:34 / cg"
 !
 
 displayStrokedOn:aGC
     "draw the receiver as a unfilled curve in a graphicsContext, aGC"
 
-    aGC displayPolygon:self computeLines
+    aGC displayPolygon:self computeLineSegments
 
-    "Modified: 8.5.1996 / 21:25:35 / cg"
+    "Modified: 9.5.1996 / 01:08:36 / cg"
 ! !
 
 !Curve methodsFor:'helpers'!
 
-computeLines
+computeLineSegments
     "compute the lines which approxiamte this curve"
 
     |lines pa pb 
@@ -192,7 +210,7 @@
 
     ^ lines
 
-    "Created: 8.5.1996 / 21:23:29 / cg"
+    "Created: 9.5.1996 / 01:08:21 / cg"
 ! !
 
 !Curve methodsFor:'queries'!
@@ -217,5 +235,5 @@
 !Curve class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Curve.st,v 1.1 1996-05-08 19:33:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Curve.st,v 1.2 1996-05-08 23:09:05 cg Exp $'
 ! !