|
From: Christoph B. <us...@be...> - 2013-04-19 06:26:39
|
Am 18.04.2013 22:40, schrieb Ethan A Merritt: > On Thursday, April 18, 2013 12:06:59 pm Christoph Bersch wrote: >> >> * I would suggest, that the information, whether clipping is necessary, >> and to which rectangle it should be clipped is provided by a >> terminal-independent function. > > The current clipping area is maintained in the global structure > gadgets.h:extern BoundingBox *clip_area; /* Current clipping box */ Yes, I saw this, but didn't know if this information was supposed to be transparent to the terminal drivers. >> In the current implementation >> the circle object is useless for marking something around the graph >> boundary (could just be a single dot on the border). > > Not really. You just have to specify the position in screen, rather > than plot, coordinates. You wouldn't normally specify the graph > boundary in plot coordinates anyhow so I don't see this as much of a > restriction. It is true that the most obvious way to position > something on the graph boundary is to use graph coordinates > set obj 1 at graph 0, graph 1 > and currently the code in graphics.c would set the corresponding > clip area to the graph boundary. Perhaps it shouldn't? Or perhaps > that would be where your proposed clipping flag would come in? Yes, in my case it was something like: set xrange[0:10] set yrange[-1.2:1.2] set object circle at graph 0, first 1 radius 0.1 plot cos(x) And specifying this circle center with screen coordinates is somewhat fiddly. Also if one plots with circle >> This might also be >> implemented as a new value for 'set clip' and could also affect all >> other objects. > > The same clipping area and clipping primitives are used for all > objects. The clipping of filled curves is a partial exception, > since it gets very complicated to determine the correct clipping > for a filled curves whose vertices are off the edge of the canvas. > >> As another thing I would suggest two distinct terminal entries _arc() >> and filledarc(). >> >> I'm looking forward to your comments and suggestions, > > I suggest that before investing a lot of time in this you first > dummy up a bit of terminal-specific output and compare it to the > result of the generic code in do_arc(). You might be surprised > at how much alike they look. I originally coded up a postscript > specific term->arc routine that used the PS Level 2 arc function. > But the result was not notably better than the generic function > so I abandoned the idea. That was before the cairo terminals > were added, however, so I didn't do the comparison for those. I already have some code snippets for the cairo, Postscript and SVG terminals. You are right, there is hardly any difference, but I liked the idea of having an own terminal entries for graphic primitives like the circle :-) Thank you for you comments, Christoph |