@@ -281,6 +281,51 @@ def draw_line(self, gc, x0, y0, x1, y1):
281
281
ps = '%1.3f %1.3f m %1.3f %1.3f l' % (x0 , y0 , x1 , y1 )
282
282
self ._draw_ps (ps , gc , None , "line" )
283
283
284
+ def _draw_markers (self , gc , path , x , y , transform ):
285
+ """
286
+ Draw the markers defined by path at each of the positions in x
287
+ and y. path coordinates are points, x and y coords will be
288
+ transformed by the transform
289
+ """
290
+ if debugPS :
291
+ self ._pswriter .write ("% markers\n " )
292
+
293
+ if transform .need_nonlinear ():
294
+ x ,y = transform .nonlinear_only_numerix (x , y )
295
+
296
+ # the a,b,c,d,tx,ty affine which transforms x and y
297
+ vec6 = transform .as_vec6_val ()
298
+ # this defines a single vertex. We need to define this as ps
299
+ # function, properly stroked and filled with linewidth etc,
300
+ # and then simply iterate over the x and y and call this
301
+ # function at each position. Eg, this is the path that is
302
+ # relative to each x and y offset.
303
+ ps = []
304
+ for p in path :
305
+ code = p [0 ]
306
+ if code == MOVETO :
307
+ mx , my = p [1 :]
308
+ ps .append ('%1.3f %1.3f m' )
309
+ elif code == LINETO :
310
+ mx , my = p [1 :]
311
+ ps .append ('%1.3f %1.3f l' )
312
+ elif code == ENDPOLY :
313
+ fill = p [1 ]
314
+ if fill : # we can get the fill color here
315
+ rgba = p [2 :]
316
+
317
+ vertfunc = 'some magic ps function that draws the marker relative to an x,y point'
318
+ # the gc contains the stroke width and color as always
319
+ for i in xrange (len (x )):
320
+ # for large numbers of markers you may need to chunk the
321
+ # output, eg dump the ps in 1000 marker batches
322
+ thisx = x [i ]
323
+ thisy = y [i ]
324
+ # apply affine transform x and y to define marker center
325
+ #draw_marker_here
326
+
327
+ print 'I did nothing!'
328
+
284
329
def _draw_lines (self , gc , points ):
285
330
"""
286
331
Draw many lines. 'points' is a list of point coordinates.
0 commit comments