[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    proposed update for X11_filled_polygon()
From:       Petr Mikulik <mikulik () monoceros ! physics ! muni ! cz>
Date:       2001-09-19 15:44:38
[Download RAW message or body]

> > I would propose to wait until Petr's filledcurves code has matured a bit.
> > In its current state, it's hardly usable on what probably are the two most
> > important terminal drivers we have: X11 and MS Windows.  

It was pretty easy to add one Reallocate() call to win/wgraph.c.

> Oh, didn't follow that discussion.

> Yes, result on X11 is not very encouraging currently ...
> I agree, that should be attacked first.

Hm, X11 is again not the number 1 :-((
Some ideas how you (you!) can do it:

x11.trm:

#define X11_GR_FILLED_POLYGON_SMALL  '1'
#define X11_GR_FILLED_POLYGON_CHUNK  '2'

...

TERM_PUBLIC void X11_filled_polygon(int points, gpiPoint *corners)
{
int max_chunk_corners = 100;
  /* a magic number according to the buffer size in gplt_x11.c */

if (corners < max_chunk_corners) {
  fputc(X11_GR_FILLED_POLYGON,_1CHUNK, X11_ipc);
  reuse the current code
  return;
}
/* must pass the corners in several chunks */
int number_of_chunks = corners / max_chunk_corners;
fprintf X11_GR_FILLED_POLYGON
fprintf number_of_chunks

for (int chunk = 0; chunk < number_of_chunks; chunk++) {
   fprintf X11_GR_FILLED_POLYGON_CHUNK
   fprintf points_in_chunk
   reuse the previous code points_in_chunk
}


***

gplt_x11.c:

store_command() (binary X11) or exec_cmd() should reconstruct the polygon
from several subsequent commands.


Well, the automn season of conferences has just started so that I have no
time to implement this. I wish *you* a lot of fun.

---
Petr Mikulik


[[[[ unsubscribe from info-gnuplot-beta via majordomo@dartmouth.edu ]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic