[BACK]Return to rect.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / pari / src / graph

Annotation of OpenXM_contrib/pari/src/graph/rect.h, Revision 1.1.1.1

1.1       maekawa     1: /* $Id: rect.h,v 1.1.1.1 1999/09/16 13:47:44 karim Exp $ */
                      2:
                      3: #define PLOT_NAME_LEN 20
                      4: #define NUMRECT 18
                      5:
                      6: typedef struct PARI_plot {
                      7:   long width;
                      8:   long height;
                      9:   long hunit;
                     10:   long vunit;
                     11:   long fwidth;
                     12:   long fheight;
                     13:   long init;
                     14:   char name[PLOT_NAME_LEN+1];
                     15: } PARI_plot;
                     16:
                     17: extern PARI_plot pari_plot, pari_psplot;
                     18:
                     19: #define w_height (pari_plot.height)
                     20: #define w_width (pari_plot.width)
                     21: #define f_height (pari_plot.fheight)
                     22: #define f_width (pari_plot.fwidth)
                     23: #define h_unit (pari_plot.hunit)
                     24: #define v_unit (pari_plot.vunit)
                     25: #define lmargin (f_width*10)
                     26: #define rmargin (h_unit - 1)
                     27: #define tmargin (v_unit - 1)
                     28: #define bmargin (v_unit + f_height - 1)
                     29:
                     30: typedef struct dblPointList{
                     31:   double *d;                   /* data */
                     32:   long nb;                     /* number of elements */
                     33:   double xsml,xbig,ysml,ybig;  /* extrema */
                     34: } dblPointList;
                     35:
                     36: typedef struct RectObj {
                     37:   struct RectObj *next;
                     38:   long code,color;
                     39: } RectObj;
                     40:
                     41: typedef struct PariRect {
                     42:   RectObj *head,*tail;
                     43:   long sizex,sizey;
                     44:   double cursorx,cursory;
                     45:   double xscale,yscale;
                     46:   double xshift,yshift;
                     47: } PariRect;
                     48:
                     49: /* The structures below are "subclasses" of RectObj. */
                     50:
                     51: typedef struct RectObj1P {
                     52:   struct RectObj *next;
                     53:   long code,color;
                     54:   long x,y;
                     55: } RectObj1P;
                     56:
                     57: typedef struct RectObj2P {
                     58:   struct RectObj *next;
                     59:   long code,color;
                     60:   long x1,y1;
                     61:   long x2,y2;
                     62: } RectObj2P;
                     63:
                     64: typedef struct RectObjMP {
                     65:   struct RectObj *next;
                     66:   long code,color;
                     67:   long count;
                     68:   long *xs,*ys;
                     69: } RectObjMP;
                     70:
                     71: typedef struct RectObjST {
                     72:   struct RectObj *next;
                     73:   long code,color;
                     74:   long length;
                     75:   char *s;
                     76:   long x,y;
                     77: } RectObjST;
                     78:
                     79: typedef struct RectObjPN {
                     80:   struct RectObj *next;
                     81:   long code,color;
                     82:   long pen;
                     83: } RectObjPN;
                     84:
                     85: typedef struct RectObjPS {
                     86:   struct RectObj *next;
                     87:   long code,color;
                     88:   double size;
                     89: } RectObjPS;
                     90:
                     91: #define BLACK      1 /* Default */
                     92: #define BLUE       2 /* Axes */
                     93: #define SIENNA     3 /* Odd numbered curves in ploth */
                     94: #define RED        4 /* Curves, or Even numbered curves in ploth */
                     95: #define CORNSILK   5
                     96: #define GREY       6
                     97: #define GAINSBORO  7
                     98:
                     99: #define MAX_COLORS 8
                    100: #define DEFAULT_COLOR BLACK
                    101:
                    102: #define ROt_MV 0                       /* Move */
                    103: #define ROt_PT 1                       /* Point */
                    104: #define ROt_LN 2                       /* Line */
                    105: #define ROt_BX 3                       /* Box */
                    106: #define ROt_MP 4                       /* Multiple point */
                    107: #define ROt_ML 5                       /* Multiple lines */
                    108: #define ROt_ST 6                       /* String */
                    109: #define ROt_PTT 7                      /* Point type change */
                    110: #define ROt_LNT 8                      /* Line type change */
                    111: #define ROt_PTS 9                      /* Point size change */
                    112: #define ROt_NULL 10            /* To be the start of the chain */
                    113:
                    114: #define ROt_MAX 10             /* Maximal type */
                    115:
                    116: /* Pointer conversion. */
                    117:
                    118: #define RoMV(rop) ((RectObj1P*)rop)
                    119: #define RoPT(rop) ((RectObj1P*)rop)
                    120: #define RoLN(rop) ((RectObj2P*)rop)
                    121: #define RoBX(rop) ((RectObj2P*)rop)
                    122: #define RoMP(rop) ((RectObjMP*)rop)
                    123: #define RoML(rop) ((RectObjMP*)rop)
                    124: #define RoST(rop) ((RectObjST*)rop)
                    125: #define RoPTT(rop) ((RectObjPN*)rop)
                    126: #define RoPTS(rop) ((RectObjPS*)rop)
                    127: #define RoLNT(rop) ((RectObjPN*)rop)
                    128: #define RoNULL(rop) ((RectObj*)rop)
                    129:
                    130: /* All the access to the rectangle data _should_ go via these macros! */
                    131:
                    132: #define RHead(rp) ((rp)->head)
                    133: #define RTail(rp) ((rp)->tail)
                    134: #define RXsize(rp) ((rp)->sizex)
                    135: #define RYsize(rp) ((rp)->sizey)
                    136: #define RXcursor(rp) ((rp)->cursorx)
                    137: #define RYcursor(rp) ((rp)->cursory)
                    138: #define RXshift(rp) ((rp)->xshift)
                    139: #define RYshift(rp) ((rp)->yshift)
                    140: #define RXscale(rp) ((rp)->xscale)
                    141: #define RYscale(rp) ((rp)->yscale)
                    142:
                    143: #define RoNext(rop) ((rop)->next)
                    144: #define RoType(rop) ((rop)->code)
                    145: #define RoCol(rop) ((rop)->color)
                    146: #define RoMVx(rop) (RoMV(rop)->x)
                    147: #define RoMVy(rop) (RoMV(rop)->y)
                    148: #define RoPTx(rop) (RoPT(rop)->x)
                    149: #define RoPTy(rop) (RoPT(rop)->y)
                    150: #define RoLNx1(rop) (RoLN(rop)->x1)
                    151: #define RoLNy1(rop) (RoLN(rop)->y1)
                    152: #define RoLNx2(rop) (RoLN(rop)->x2)
                    153: #define RoLNy2(rop) (RoLN(rop)->y2)
                    154: #define RoBXx1(rop) (RoBX(rop)->x1)
                    155: #define RoBXy1(rop) (RoBX(rop)->y1)
                    156: #define RoBXx2(rop) (RoBX(rop)->x2)
                    157: #define RoBXy2(rop) (RoBX(rop)->y2)
                    158:
                    159: #define RoMPcnt(rop) (RoMP(rop)->count)
                    160: #define RoMPxs(rop) (RoMP(rop)->xs)
                    161: #define RoMPys(rop) (RoMP(rop)->ys)
                    162:
                    163: #define RoMLcnt(rop) (RoML(rop)->count)
                    164: #define RoMLxs(rop) (RoML(rop)->xs)
                    165: #define RoMLys(rop) (RoML(rop)->ys)
                    166:
                    167: #define RoSTs(rop) (RoST(rop)->s)
                    168: #define RoSTl(rop) (RoST(rop)->length)
                    169: #define RoSTx(rop) (RoST(rop)->x)
                    170: #define RoSTy(rop) (RoST(rop)->y)
                    171:
                    172: #define RoPTTpen(rop) (RoPTT(rop)->pen)
                    173: #define RoLNTpen(rop) (RoLNT(rop)->pen)
                    174: #define RoPTSsize(rop) (RoPTS(rop)->size)
                    175:
                    176: #define PL_POINTS 1
                    177: #define GOODRECT(r) (0 <= r && r < NUMRECT)
                    178: #define GOODCOLOR(c) (1 <= c && c < MAX_COLORS)
                    179:
                    180: #define PLOT_PARAMETRIC   0x00001
                    181: #define PLOT_RECURSIVE    0x00002
                    182: #define PLOT_NO_RESCALE   0x00004
                    183: #define PLOT_NO_AXE_X     0x00008
                    184: #define PLOT_NO_AXE_Y     0x00010
                    185: #define PLOT_NO_FRAME     0x00020
                    186: #define PLOT_POINTS       0x00040
                    187: #define PLOT_POINTS_LINES 0x00080
                    188: #define PLOT_SPLINES      0x00100
                    189:
                    190: #define PLOT_POSTSCRIPT   0x80000
                    191:
                    192: extern PariRect  **rectgraph;
                    193: extern long  rectpoint_itype;
                    194: extern long  rectline_itype;
                    195:
                    196: /* plotport.c */
                    197:
                    198: void    initrect(long ne, long x, long y);
                    199: void    killrect(long ne);
                    200: void    plot(entree *ep, GEN a, GEN b, char *ch, long prec);
                    201: GEN     ploth(entree *ep, GEN a, GEN b, char *ch, long prec, long flag, long numpoints);
                    202: GEN     ploth2(entree *ep, GEN a, GEN b, char *ch, long prec);
                    203: GEN     plothmult(entree *ep, GEN a, GEN b, char *ch, long prec);
                    204: GEN     plothraw(GEN listx, GEN listy, long flag);
                    205: GEN     plothsizes();
                    206: void    postdraw(GEN list);
                    207: GEN     postploth(entree *ep,GEN a,GEN b,char *ch,long prec,long flag,long numpoints);
                    208: GEN     postploth2(entree *ep,GEN a,GEN b,char *ch,long prec,long numpoints);
                    209: GEN     postplothraw(GEN listx, GEN listy, long flag);
                    210: void    rectbox(long ne, GEN gx2, GEN gy2);
                    211: void    rectcolor(long ne, long color);
                    212: void    rectcopy(long source, long dest, long xoff, long yoff);
                    213: GEN     rectcursor(long ne);
                    214: void    rectdraw(GEN list);
                    215: void    rectline(long ne, GEN gx2, GEN gy2);
                    216: void    rectlines(long ne, GEN listx, GEN listy, long flag);
                    217: void    rectlinetype(long ne, long t);
                    218: void    rectmove(long ne, GEN x, GEN y);
                    219: GEN     rectploth(long drawrect,entree *ep, GEN a, GEN b, char *ch, long prec, ulong flags, long testpoints);
                    220: GEN     rectplothraw(long drawrect, GEN data, long flags);
                    221: void    rectpoint(long ne, GEN x, GEN y);
                    222: void    rectpoints(long ne, GEN listx, GEN listy);
                    223: void    rectpointtype(long ne, long t);
                    224: void   rectpointsize(long ne, GEN size);
                    225: void    rectrbox(long ne, GEN gx2, GEN gy2);
                    226: void    rectrline(long ne, GEN gx2, GEN gy2);
                    227: void    rectrmove(long ne, GEN x, GEN y);
                    228: void    rectrpoint(long ne, GEN x, GEN y);
                    229: void    rectscale(long ne, GEN x1, GEN x2, GEN y1, GEN y2);
                    230: void    rectstring(long ne, char *x);
                    231: void    rectclip(long rect);
                    232:
                    233: /* architecture-dependent plot file (plotX.c, plotsun.c, plognuplot.c...) */
                    234:
                    235: void    PARI_get_plot(long fatal);
                    236: long    term_set(char *s);
                    237: long    plot_outfile_set(char *s);
                    238: void   set_pointsize(double d);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>