|
197 | 197 | (setq width (send port :ndc-width-to-screen width))
|
198 | 198 | (setq height (send port :ndc-height-to-screen height))
|
199 | 199 | (send surface :draw-fill-arc point width height angle1 angle2))
|
200 |
| - (:draw-polyline-NDC (polyline) |
| 200 | + (:draw-polyline-NDC (polyline &optional color) |
201 | 201 | (let ((p1 (pop polyline)) p2)
|
202 | 202 | (while polyline
|
203 | 203 | (setq p2 (pop polyline))
|
204 |
| - (send self :draw-line-NDC p1 p2 t) |
| 204 | + (send self :draw-line-NDC p1 p2 t color) |
205 | 205 | (setq p1 p2))))
|
206 |
| - (:draw-box-NDC (lower-left upper-right) |
| 206 | + (:draw-box-NDC (lower-left upper-right &optional color) |
207 | 207 | (declare (float-vector lower-left upper-right))
|
208 | 208 | (let ((x1 (aref lower-left 0)) (y1 (aref lower-left 1))
|
209 | 209 | (x2 (aref upper-right 0)) (y2 (aref upper-right 1)))
|
|
212 | 212 | (float-vector x1 y1 0) (float-vector x2 y1 0)
|
213 | 213 | (float-vector x2 y2 0) (float-vector x1 y2 0)
|
214 | 214 | (float-vector x1 y1 0)))))
|
215 |
| - (:draw-star-NDC (point &optional (size 0.02)) |
| 215 | + (:draw-star-NDC (point &optional (size 0.02) (color nil)) |
216 | 216 | (send self :draw-line-NDC
|
217 | 217 | (float-vector (- (aref point 0) size) (aref point 1) 0)
|
218 |
| - (float-vector (+ (aref point 0) size) (aref point 1) 0)) |
| 218 | + (float-vector (+ (aref point 0) size) (aref point 1) 0) t color) |
219 | 219 | (send self :draw-line-NDC
|
220 | 220 | (float-vector (aref point 0) (- (aref point 1) size) 0)
|
221 |
| - (float-vector (aref point 0) (+ (aref point 1) size) 0))) ) |
| 221 | + (float-vector (aref point 0) (+ (aref point 1) size) 0) t color)) ) |
222 | 222 |
|
223 | 223 | ;; drawing primitives which work in world coordinates
|
224 | 224 | ;; First, viewing and projective transformations are applied,
|
|
234 | 234 | (setq size (float-vector size size 0.0))
|
235 | 235 | (setq v (homo2normal (send eye :view v)))
|
236 | 236 | (send self :draw-box-NDC (v- v size) (v+ v size)))
|
237 |
| - (:draw-polyline (vlist) |
| 237 | + (:draw-polyline (vlist &optional color) |
238 | 238 | (send self :draw-polyline-ndc
|
239 |
| - (mapcar #'(lambda (x) (send eye :view x)) vlist))) |
| 239 | + (mapcar #'(lambda (x) (send eye :view x)) vlist) color)) |
240 | 240 | (:draw-arc (point width height
|
241 | 241 | &optional (angle1 0) (angle2 2pi) color
|
242 | 242 | &aux v)
|
|
275 | 275 | (sys:reclaim p1) (sys:reclaim p2)
|
276 | 276 | (sys:reclaim pn) (sys:reclaim pa) (sys:reclaim pb)))
|
277 | 277 | (:pane () (send self :draw-box-NDC #f(-1 -1 0) #f(1 1 0)))
|
278 |
| - (:draw-star (v &optional size) |
| 278 | + (:draw-star (v &optional size color) |
279 | 279 | (if (null size) (setq size 0.02))
|
280 |
| - (send self :draw-star-NDC (homo2normal (send eye :view v)) size)) |
| 280 | + (send self :draw-star-NDC (homo2normal (send eye :view v)) size color)) |
281 | 281 | (:draw-2dlnseg (l)
|
282 | 282 | (send self :draw-line (send l :spos) (send l :epos))) )
|
283 | 283 |
|
|
0 commit comments