Doxygen Source Code Documentation
coxplot.h File Reference
#include <X11/Intrinsic.h>#include <string.h>#include <stdio.h>#include <math.h>#include <stdlib.h>#include <X11/extensions/Xdbe.h>#include "f2c.h"Go to the source code of this file.
Data Structures | |
| struct | MEM_plotdata |
| struct | MEM_topshell_data |
| struct | X11_colordef |
Defines | |
| #define | MAX(a, b) (((a)<(b)) ? (b) : (a)) |
| #define | MIN(a, b) (((a)>(b)) ? (b) : (a)) |
| #define | INC_MEMPLOT 64 |
| #define | EXP_MEMPLOT 1.1 |
| #define | NXY_MEMPLOT 6 |
| #define | INIT_MEMPLOT(name, id) |
| #define | ADDTO_MEMPLOT(name, x1, y1, x2, y2, col, th) |
| #define | DESTROY_MEMPLOT(name) |
| #define | TRUNC_MEMPLOT(name, num) do{ if( (num) < (name)->nxyline ) (name)->nxyline = (num); } while(0) |
| #define | MEMPLOT_X1(name, ii) ((name)->xyline[NXY_MEMPLOT*ii]) |
| #define | MEMPLOT_Y1(name, ii) ((name)->xyline[NXY_MEMPLOT*ii+1]) |
| #define | MEMPLOT_X2(name, ii) ((name)->xyline[NXY_MEMPLOT*ii+2]) |
| #define | MEMPLOT_Y2(name, ii) ((name)->xyline[NXY_MEMPLOT*ii+3]) |
| #define | MEMPLOT_COL(name, ii) ((name)->xyline[NXY_MEMPLOT*ii+4]) |
| #define | MEMPLOT_TH(name, ii) ((name)->xyline[NXY_MEMPLOT*ii+5]) |
| #define | MEMPLOT_NLINE(name) ((name)->nxyline) |
| #define | MEMPLOT_IDENT(name) ((name)->ident) |
| #define | MEMPLOT_NAME MEMPLOT_IDENT |
| #define | MEMPLOT_ASPECT(name) ((name)->aspect) |
| #define | THCODE_RECT 1 |
| #define | THCODE_CIRC 2 |
| #define | THCODE_OPAC 3 |
| #define | THCODE_INVALID 666 |
| #define | ZO_TO_TFS(x) ((int)(255.99*(x))) |
| #define | TFS_TO_ZO(y) ((y)/255.0f) |
| #define | RGB_TO_COL(r, g, b) ( (ZO_TO_TFS(r)<<16) | (ZO_TO_TFS(g)<<8) | (ZO_TO_TFS(b)) ) |
| #define | COL_TO_RRR(cc) TFS_TO_ZO( (((int)(cc)) & 0xff0000) >> 16 ) |
| #define | COL_TO_GGG(cc) TFS_TO_ZO( (((int)(cc)) & 0x00ff00) >> 8 ) |
| #define | COL_TO_BBB(cc) TFS_TO_ZO( (((int)(cc)) & 0x0000ff) ) |
| #define | FREE_X11_colordef(cd) |
| #define | insert_atend_memplot(mm) insert_at_memplot(-1,mm) |
| #define | MRI_ROT_0 1 |
| #define | MRI_ROT_90 2 |
| #define | MRI_ROT_180 4 |
| #define | MRI_ROT_270 8 |
| #define | MRI_FLMADD 128 |
| #define | memplot_to_ps(fn) memplot_to_postscript( (fn) , get_active_memplot() ) ; |
| #define | MEMPLOT_FREE_ASPECT 1 |
| #define | MEMPLOT_ERASE 2 |
| #define | memplot_to_X11(d, w) memplot_to_X11_sef( (d),(w) , get_active_memplot() , 0,0,0 ) |
| #define | memplot_to_X11_free(d, w) memplot_to_X11_sef( (d),(w) , get_active_memplot() , 0,0,1 ) |
| #define | MTD_PLOTDATA(mpcb) ((mpcb)->mp) |
| #define | MTD_KILLFUNC(mpcb) ((mpcb)->killfunc) |
| #define | MTD_VALID(mpcb) ((mpcb)->valid) |
| #define | MTD_USERDATA(mpcb) ((mpcb)->userdata) |
| #define | MTD_remove_killfunc(mpcb) ((mpcb)->killfunc = NULL) |
| #define | MTD_replace_plotdata(mpcb, mpnew) do{ delete_memplot((mpcb)->mp) ; (mpcb)->mp = (mpnew) ; } while(0) |
| #define | memplot_to_shell(d) memplot_to_topshell( (d),get_active_memplot(),1 ) |
| #define | TSP_SEPARATE_YBOX 1 |
| #define | TSP_SEPARATE_YSCALE 2 |
| #define | plot_ts(a, b, c, d, e) plot_ts_lab((a),(b),(c),(d),(e),NULL,NULL,NULL,NULL,NULL) |
| #define | EXT extern |
Typedefs | |
| typedef void | void_func () |
Functions | |
| void | init_XDBE (Display *) |
| Window | getwin_from_XDBE (Display *, Drawable) |
| MEM_plotdata * | find_memplot (char *) |
| int | create_memplot (char *, float) |
| int | set_active_memplot (char *) |
| MEM_plotdata * | get_active_memplot (void) |
| void | delete_active_memplot (void) |
| void | delete_memplot (MEM_plotdata *) |
| void | plotline_memplot (float, float, float, float) |
| void | set_color_memplot (float, float, float) |
| void | set_thick_memplot (float) |
| float | get_thick_memplot (void) |
| int | nline_active_memplot (void) |
| void | plotrect_memplot (float, float, float, float) |
| void | plotcirc_memplot (float, float, float) |
| int | create_memplot_surely (char *, float) |
| void | set_opacity_memplot (float) |
| float | get_opacity_memplot (void) |
| MEM_plotdata * | copy_memplot (MEM_plotdata *) |
| void | append_to_memplot (MEM_plotdata *, MEM_plotdata *) |
| void | scale_memplot (float, float, float, float, float, MEM_plotdata *) |
| MEM_plotdata * | clip_memplot (float, float, float, float, MEM_plotdata *) |
| void | cutlines_memplot (int, int, MEM_plotdata *) |
| void | insert_at_memplot (int, MEM_plotdata *) |
| void | flip_memplot (int, int, MEM_plotdata *) |
| void | memplot_to_postscript (char *, MEM_plotdata *) |
| unsigned long | rgb_to_pixel (unsigned char, unsigned char, unsigned char, X11_colordef *) |
| X11_colordef * | get_X11_colordef (Display *, Window) |
| void | memplot_to_X11_sef (Display *, Window, MEM_plotdata *, int, int, int) |
| void | set_memplot_X11_box (int, int, int, int) |
| void | set_X11_background (Display *, Window, unsigned char, unsigned char, unsigned char) |
| MEM_topshell_data * | memplot_to_topshell (Display *, MEM_plotdata *, void_func *) |
| void | plotkill_topshell (MEM_topshell_data *) |
| void | redraw_topshell (MEM_topshell_data *) |
| void | plot_ts_xypush (int, int) |
| void | plot_ts_xfix (int, int, float, float) |
| void | plot_ts_yfix (int, int, float, float) |
| void | plot_ts_lab (Display *, int, float *, int, float **, char *, char *, char *, char **, void_func *) |
| MEM_topshell_data * | plot_ts_init (Display *, float, float, int, float, float, char *, char *, char *, char **, void_func *) |
| void | plot_ts_addto (MEM_topshell_data *, int, float *, int, float **) |
| MEM_plotdata * | plot_ts_mem (int, float *, int, int, float **, char *, char *, char *, char **) |
| MEM_topshell_data * | plot_strip_init (Display *, int, float, int, float, float, char *, char *, char *, char **, void_func *) |
| void | plot_strip_addto (MEM_topshell_data *, int, float **) |
| void | plot_strip_clear (MEM_topshell_data *) |
| void | zzmpco_ (float *, float *, float *) |
| void | zzmpli_ (float *, float *, float *, float *) |
| void | ps_move (int, int) |
| void | ps_line (int, int, int, int) |
| void | ps_cont (int, int) |
| void | ps_point (int, int) |
| void | ps_label (char *) |
| void | ps_arc (int, int, int, int, int, int) |
| void | ps_circle (int, int, int) |
| void | ps_erase (void) |
| void | ps_linemod (char *) |
| void | ps_space (int, int, int, int) |
| int | ps_openpl (char *) |
| void | ps_closepl (void) |
| void | ps_setrgb (float, float, float) |
| void | ps_setwidth (float) |
| void | ps_rect (int, int, int, int) |
| int | color_ (integer *ncol) |
| int | fcolor_ (real *cr, real *cg, real *cb) |
| int | curve_ (real *x, real *y, integer *n) |
| int | frame_ (void) |
| int | frstpt_ (real *x, real *y) |
| int | labmod_ (integer *ifmtx, integer *ifmty, integer *numx, integer *numy, integer *jsizx, integer *jsizy, integer *ixdec, integer *iydec, integer *ixor) |
| int | line_ (real *x1, real *y1, real *x2, real *y2) |
| int | memplt_ (real *aspect) |
| int | perim_ (integer *mbx, integer *mlx, integer *mby, integer *mly) |
| int | periml_ (integer *mbx, integer *mlx, integer *mby, integer *mly) |
| int | perimm_ (integer *mbx, integer *mlx, integer *mby, integer *mly, integer *ilab) |
| int | phdot_ (real *x1, real *y1) |
| int | phline_ (real *x1, real *y1, real *x2, real *y2) |
| int | point_ (real *x, real *y) |
| int | points_ (real *x, real *y, integer *n, integer *ichar, integer *ipen) |
| int | pwrit_ (real *x, real *y, char *ch, integer *nch, integer *isiz, integer *ior, integer *icent, ftnlen ch_len) |
| int | pwritf_ (real *x, real *y, char *ch, integer *nch, integer *isiz, integer *ior, integer *icent, ftnlen ch_len) |
| integer | lastnb_ (char *cline, ftnlen cline_len) |
| int | zzstro_ (char *ch, integer *nch, integer *nstr, real *xstr, real *ystr, logical *lbstr, ftnlen ch_len) |
| int | zzconv_ (char *chin, integer *nchin, char *chout, integer *nchout, ftnlen chin_len, ftnlen chout_len) |
| int | set_ (real *xobj1, real *xobj2, real *yobj1, real *yobj2, real *xsub1, real *xsub2, real *ysub1, real *ysub2, integer *ltype) |
| int | setdsh_ (integer *nd, real *xld) |
| int | setfrm_ (real *xobj1, real *xobj2, real *yobj1, real *yobj2) |
| int | setlin_ (integer *ntype) |
| int | setw_ (real *x1, real *y1, real *x2, real *y2) |
| int | srface_ (real *x, real *y, real *z__, integer *m, integer *mx, integer *nx, integer *ny, real *s, real *stereo) |
| int | srfpl_ (integer *n, real *px, real *py) |
| int | clset_ (real *z__, integer *mx, integer *nx, integer *ny, real *chi, real *clo, real *cinc, integer *nla, integer *nlm, real *cl, integer *ncl, integer *icnst, integer *ioffp, real *spval, real *bigest) |
| int | ctcell_ (real *z__, integer *mx, integer *nx, integer *ny, integer *m, integer *i0, integer *j0) |
| int | draws_ (integer *mx1, integer *my1, integer *mx2, integer *my2, integer *idraw, integer *imark) |
| int | setr_ (real *xmin, real *xmax, real *ymin, real *ymax, real *zmin, real *zmax, real *r0) |
| int | trn32s_ (real *x, real *y, real *z__, real *xt, real *yt, real *zt, integer *iflag) |
| int | srfabd_ (void) |
| int | tick4_ (integer *lmajx, integer *lminx, integer *lmajy, integer *lminy) |
| int | vector_ (real *x, real *y) |
| int | zzaxxx_ (real *x1, real *x2, real *y, integer *iside, integer *ilab) |
| int | zzaxyy_ (real *x, real *y1, real *y2, integer *iside, integer *ilab) |
| int | zzchar_ (char *ch, real *xp, real *yp, real *ct, real *st, ftnlen ch_len) |
| int | zzclip_ (real *x1in, real *y1in, real *x2in, real *y2in) |
| int | zzlabl_ (real *val, char *cout, integer *nchar, ftnlen cout_len) |
| int | zzlgin_ (real *xt, real *pwrten, integer *nlog) |
| int | zzline_ (real *x1, real *y1, real *x2, real *y2) |
| int | zzlinx_ (real *x1, real *x2, real *y, integer *majrx, real *tmaj, integer *minrx, real *tmin) |
| int | zzliny_ (real *x, real *y1, real *y2, integer *majry, real *tmaj, integer *minry, real *tmin) |
| int | zzlogx_ (real *x1, real *x2, real *y, integer *ndec, real *tmaj, real *tmin) |
| int | zzlogy_ (real *x, real *y1, real *y2, integer *ndec, real *tmaj, real *tmin) |
| int | zzperi_ (integer *ilab) |
| int | zzphph_ (real *x1, real *y1, real *x2, real *y2) |
| int | zzphys_ (real *x, real *y) |
| void | plotpak_curve (float *x, float *y, int n) |
| void | plotpak_frame (void) |
| void | plotpak_frstpt (float x, float y) |
| void | plotpak_labmod (int jsizx, int jsizy) |
| void | plotpak_line (float x1, float y1, float x2, float y2) |
| void | plotpak_perim (int mbx, int mlx, int mby, int mly) |
| void | plotpak_periml (int mbx, int mlx, int mby, int mly) |
| void | plotpak_perimm (int mbx, int mlx, int mby, int mly, int ilab) |
| void | plotpak_phdot (float x1, float y1) |
| void | plotpak_phline (float x1, float y1, float x2, float y2) |
| void | plotpak_point (float x1, float y1) |
| void | plotpak_points (float *x, float *y, int n, int ipen) |
| void | plotpak_pwrit (float x, float y, char *ch, int isiz, int ior, int icent) |
| void | plotpak_pwritf (float x, float y, char *ch, int isiz, int ior, int icent) |
| void | plotpak_set (float xo1, float xo2, float yo1, float yo2, float xs1, float xs2, float ys1, float ys2, int code) |
| void | plotpak_setdsh (int nd, float *xd) |
| void | plotpak_setfrm (float xo1, float xo2, float yo1, float yo2) |
| void | plotpak_setlin (int code) |
| void | plotpak_setw (float xo1, float xo2, float yo1, float yo2) |
| void | plotpak_tick4 (int mx, int lx, int my, int ly) |
| void | plotpak_vector (float x, float y) |
| void | plotpak_srface (float *, float *, float *, int, int, float, float) |
| void | plotpak_getset (float *xo1, float *xo2, float *yo1, float *yo2, float *xs1, float *xs2, float *ys1, float *ys2) |
| void | plotpak_zzphys (float x1, float y1, float *x2, float *y2) |
| void | plotpak_unphys (float x1, float y1, float *x2, float *y2) |
Variables | |
| int | use_xdbe |
| struct { | |
| real xpgmin | |
| real ypgmin | |
| real xpgmax | |
| real ypgmax | |
| real xclbot | |
| real yclbot | |
| real xcltop | |
| real ycltop | |
| real xbot | |
| real ybot | |
| real xtop | |
| real ytop | |
| real xmin | |
| real ymin | |
| real xmax | |
| real ymax | |
| integer ixcoor | |
| integer iycoor | |
| real alphxx | |
| real betaxx | |
| real alphyy | |
| real betayy | |
| real tmajx | |
| real tminx | |
| real tmajy | |
| real tminy | |
| integer majrx | |
| integer minrx | |
| integer majry | |
| integer minry | |
| integer isizx | |
| integer isizy | |
| real xphold | |
| real yphold | |
| } | zzzplt_ |
| struct { | |
| real xphmax | |
| real yphmax | |
| integer ixpmax | |
| integer iypmax | |
| real xpscal | |
| real ypscal | |
| integer iflip | |
| integer nplotr | |
| char cfile [64] | |
| } | zzpltr_ |
| struct { | |
| integer ndash | |
| real xldash [8] | |
| real xid | |
| } | zzdash_ |
Define Documentation
|
|
Value: do{ int nn , ll=(name)->insert_at ; \ if( ll >= 0 && ll < (name)->nxyline ){ \ nn = NXY_MEMPLOT * ll ; \ (name)->xyline[nn++] = (x1) ; (name)->xyline[nn++] = (y1) ; \ (name)->xyline[nn++] = (x2) ; (name)->xyline[nn++] = (y2) ; \ (name)->xyline[nn++] = (col); (name)->xyline[nn++] = (th) ; break ; \ } \ if( (name)->nxyline == (name)->nxyline_all ){ \ nn = (name)->nxyline_all = EXP_MEMPLOT * (name)->nxyline_all + INC_MEMPLOT ; \ (name)->xyline = (float *) realloc( (name)->xyline , sizeof(float)*NXY_MEMPLOT*nn ) ; \ } \ nn = NXY_MEMPLOT * (name)->nxyline ; \ (name)->xyline[nn++] = (x1) ; (name)->xyline[nn++] = (y1) ; \ (name)->xyline[nn++] = (x2) ; (name)->xyline[nn++] = (y2) ; \ (name)->xyline[nn++] = (col); (name)->xyline[nn++] = (th) ; (name)->nxyline ++ ; \ } while(0) Definition at line 71 of file coxplot/coxplot.h. Referenced by clip_memplot(), create_memplot(), plot_strip_addto(), plot_strip_clear(), plot_strip_init(), plotcirc_memplot(), plotline_memplot(), plotrect_memplot(), and set_opacity_memplot(). |
|
|
Definition at line 131 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 130 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 129 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Value: do{ if( (name) != NULL ){ \ if( (name)->xyline != NULL ) free( (name)->xyline ) ; \ free( (name) ) ; (name) = NULL ; } \ } while(0) Definition at line 91 of file coxplot/coxplot.h. Referenced by AFNI_brick_to_mri(), clip_memplot(), delete_active_memplot(), delete_memplot(), and ISQ_getmemplot(). |
|
|
Definition at line 57 of file coxplot/coxplot.h. |
|
|
Definition at line 399 of file coxplot/coxplot.h. |
|
|
Value: do{ if( (cd) != NULL ){ \ if( (cd)->rr != NULL ){ \ free((cd)->rr) ; free((cd)->gg) ; free((cd)->bb) ; } \ free((cd)) ; (cd) = NULL ; } } while(0) Definition at line 146 of file coxplot/coxplot.h. Referenced by fred_CB(), get_X11_colordef(), and setup_X11_plotting(). |
|
|
Definition at line 56 of file coxplot/coxplot.h. |
|
|
Value: do{ (name) = (MEM_plotdata *) malloc(sizeof(MEM_plotdata)) ; \ (name)->nxyline = 0 ; \ (name)->nxyline_all = INC_MEMPLOT ; \ (name)->xyline = (float *) malloc(sizeof(float)*NXY_MEMPLOT*INC_MEMPLOT) ; \ strncpy( (name)->ident, (id), 255 ) ; (name)->ident[255] = '\0' ; \ (name)->aspect = 1.3 ; (name)->insert_at = -1 ; \ } while(0) Definition at line 60 of file coxplot/coxplot.h. Referenced by create_memplot(). |
|
|
Definition at line 178 of file coxplot/coxplot.h. |
|
|
|
Definition at line 112 of file coxplot/coxplot.h. Referenced by memplot_to_topshell(). |
|
|
Definition at line 106 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 202 of file coxplot/coxplot.h. |
|
|
Definition at line 201 of file coxplot/coxplot.h. |
|
|
Definition at line 110 of file coxplot/coxplot.h. Referenced by plot_strip_addto(), and plot_ts_addto(). |
|
|
Definition at line 111 of file coxplot/coxplot.h. |
|
|
Definition at line 109 of file coxplot/coxplot.h. Referenced by AFNI_brick_to_mri(), AFNI_drive_open_graph_xy(), memplot_to_postscript(), memplot_to_RGB_sef(), memplot_to_X11_sef(), nline_active_memplot(), plot_strip_init(), plot_ts_addto(), and plotline_memplot(). |
|
|
Definition at line 107 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 192 of file coxplot/coxplot.h. |
|
|
Definition at line 244 of file coxplot/coxplot.h. |
|
|
Definition at line 212 of file coxplot/coxplot.h. |
|
|
Definition at line 215 of file coxplot/coxplot.h. |
|
|
Definition at line 102 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 104 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 103 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
Definition at line 105 of file coxplot/coxplot.h. Referenced by memplot_to_postscript(), memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
|
|
|
Definition at line 184 of file coxplot/coxplot.h. |
|
|
Definition at line 180 of file coxplot/coxplot.h. |
|
|
Definition at line 182 of file coxplot/coxplot.h. |
|
|
Definition at line 183 of file coxplot/coxplot.h. |
|
|
Definition at line 181 of file coxplot/coxplot.h. |
|
|
Definition at line 232 of file coxplot/coxplot.h. |
|
|
Definition at line 231 of file coxplot/coxplot.h. |
|
|
Definition at line 235 of file coxplot/coxplot.h. |
|
|
Definition at line 237 of file coxplot/coxplot.h. |
|
|
Definition at line 234 of file coxplot/coxplot.h. |
|
|
Definition at line 233 of file coxplot/coxplot.h. |
|
|
Definition at line 58 of file coxplot/coxplot.h. |
|
|
Definition at line 259 of file coxplot/coxplot.h. |
|
|
Definition at line 127 of file coxplot/coxplot.h. Referenced by set_color_memplot(). |
|
|
Definition at line 125 of file coxplot/coxplot.h. |
|
|
Definition at line 117 of file coxplot/coxplot.h. |
|
|
Definition at line 119 of file coxplot/coxplot.h. |
|
|
Definition at line 118 of file coxplot/coxplot.h. |
|
|
Definition at line 116 of file coxplot/coxplot.h. |
|
|
Definition at line 99 of file coxplot/coxplot.h. Referenced by AFNI_drive_clear_graph_xy(). |
|
|
Definition at line 248 of file coxplot/coxplot.h. |
|
|
Definition at line 249 of file coxplot/coxplot.h. |
|
|
Definition at line 124 of file coxplot/coxplot.h. Referenced by memplot_to_RGB_sef(), and memplot_to_X11_sef(). |
Typedef Documentation
|
|
Definition at line 41 of file coxplot/coxplot.h. |
Function Documentation
|
||||||||||||
|
Definition at line 344 of file plot_cox.c.
00345 {
00346 int nn , nold ;
00347 if( mp == NULL || ap == NULL || ap->nxyline <= 0 ) return ;
00348
00349 nn = mp->nxyline + ap->nxyline ;
00350 mp->xyline = (float *) realloc(mp->xyline,
00351 sizeof(float)*NXY_MEMPLOT*nn) ;
00352
00353 memcpy( mp->xyline + NXY_MEMPLOT*mp->nxyline ,
00354 ap->xyline , sizeof(float)*NXY_MEMPLOT*ap->nxyline ) ;
00355
00356 mp->nxyline = mp->nxyline_all = nn ;
00357 return ;
00358 }
|
|
||||||||||||||||||||||||
|
Definition at line 648 of file plot_cox.c.
00650 {
00651 MEM_plotdata *np ;
00652 char str[256] ;
00653 int nn , ii , qq ;
00654 float x1,y1 , x2,y2 , col,th ;
00655
00656 if( mp == NULL ) return NULL ; /* bad or meaningless stuff */
00657 if( xclbot >= xcltop ) return NULL ;
00658 if( yclbot >= ycltop ) return NULL ;
00659
00660 sprintf(str,"%.240sCopy",mp->ident) ;
00661 nn = create_memplot_surely( str , mp->aspect ) ;
00662 np = find_memplot(NULL) ;
00663 if( np == NULL ) return NULL ; /* shouldn't happen */
00664
00665 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00666 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00667 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00668 col= mp->xyline[nn+4] ; th = mp->xyline[nn+5] ;
00669
00670 if( th < 0.0 ){ /** Not a line! */
00671 int thc = (int)(-th) ;
00672 switch( thc ){
00673 case THCODE_RECT: /* rectangle */
00674 /* both corners inside */
00675 if( INSIDE(x1,y1) && INSIDE(x2,y2) ){
00676 ADDTO_MEMPLOT(np,x1,y1,x2,y2,col,th) ;
00677 }
00678 break ;
00679
00680 case THCODE_CIRC:{ /* circle */
00681 /* +/- 1 radius inside */
00682 float xx,yy , rr=x2 ;
00683 xx = x1+rr ; if( !INSIDE(xx,y1) ) break ;
00684 xx = x1-rr ; if( !INSIDE(xx,y1) ) break ;
00685 yy = y1+rr ; if( !INSIDE(x1,yy) ) break ;
00686 yy = y1-rr ; if( !INSIDE(x1,yy) ) break ;
00687 ADDTO_MEMPLOT(np,x1,y1,x2,y2,col,th) ;
00688 }
00689 break ;
00690 }
00691
00692 } else { /** Truly a line! **/
00693
00694 qq = clip_line_to_rect( xclbot,yclbot , xcltop,ycltop ,
00695 &x1,&y1 , &x2,&y2 ) ;
00696 if( qq == 0 ){
00697 ADDTO_MEMPLOT(np,x1,y1,x2,y2,col,th) ;
00698 }
00699 }
00700 }
00701
00702 if( np->nxyline == 0 ) DESTROY_MEMPLOT(np) ;
00703
00704 return np ;
00705 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 766 of file srface.c.
00770 {
00771 /* Initialized data */
00772
00773 static integer kk = 0;
00774
00775 /* System generated locals */
00776 integer z_dim1, z_offset, i__1, i__2;
00777 real r__1;
00778
00779 /* Builtin functions */
00780 double r_lg10(real *), pow_ri(real *, integer *), r_int(real *);
00781
00782 /* Local variables */
00783 static real fanc, crat;
00784 static integer i__, j, k;
00785 static real p, cc, ha, glo;
00786
00787 /* cc DIMENSION Z(MX,NY) ,CL(NLM) */
00788 /* Parameter adjustments */
00789 z_dim1 = *mx;
00790 z_offset = z_dim1 + 1;
00791 z__ -= z_offset;
00792 --cl;
00793
00794 /* Function Body */
00795 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00796 */
00797 /* CLSET PUTS THE VALUS OF THE CONTOUR LEVELS IN CL */
00798
00799 *icnst = 0;
00800 glo = *clo;
00801 ha = *chi;
00802 fanc = *cinc;
00803 crat = (real) (*nla);
00804 if ((r__1 = ha - glo) < 0.f) {
00805 goto L10;
00806 } else if (r__1 == 0) {
00807 goto L20;
00808 } else {
00809 goto L50;
00810 }
00811 L10:
00812 glo = ha;
00813 ha = *clo;
00814 goto L50;
00815 L20:
00816 glo = *bigest;
00817 ha = -glo;
00818 i__1 = *ny;
00819 for (j = 1; j <= i__1; ++j) {
00820 i__2 = *nx;
00821 for (i__ = 1; i__ <= i__2; ++i__) {
00822 if (*ioffp == 1 && z__[i__ + j * z_dim1] == *spval) {
00823 goto L30;
00824 }
00825 /* Computing MIN */
00826 r__1 = z__[i__ + j * z_dim1];
00827 glo = dmin(r__1,glo);
00828 /* Computing MAX */
00829 r__1 = z__[i__ + j * z_dim1];
00830 ha = dmax(r__1,ha);
00831 L30:
00832 ;
00833 }
00834 /* L40: */
00835 }
00836 L50:
00837 if (fanc < 0.f) {
00838 goto L60;
00839 } else if (fanc == 0) {
00840 goto L70;
00841 } else {
00842 goto L90;
00843 }
00844 L60:
00845 crat = -fanc;
00846 L70:
00847 fanc = (ha - glo) / crat;
00848 if (fanc <= 0.f) {
00849 goto L140;
00850 } else {
00851 goto L80;
00852 }
00853 L80:
00854 i__1 = (integer) (r_lg10(&fanc) + 500.f) - 500;
00855 p = pow_ri(&c_b128, &i__1);
00856 r__1 = fanc / p;
00857 fanc = r_int(&r__1) * p;
00858 L90:
00859 if (*chi - *clo != 0.f) {
00860 goto L110;
00861 } else {
00862 goto L100;
00863 }
00864 L100:
00865 r__1 = glo / fanc;
00866 glo = r_int(&r__1) * fanc;
00867 r__1 = ha / fanc;
00868 ha = r_int(&r__1) * fanc;
00869 L110:
00870 i__1 = *nlm;
00871 for (k = 1; k <= i__1; ++k) {
00872 cc = glo + (real) (k - 1) * fanc;
00873 if (cc > ha) {
00874 goto L130;
00875 }
00876 kk = k;
00877 cl[k] = cc;
00878 /* L120: */
00879 }
00880 L130:
00881 *ncl = kk;
00882 return 0;
00883 L140:
00884 *icnst = 1;
00885 return 0;
00886 } /* clset_ */
|
|
|
Definition at line 34 of file color.c.
00035 {
00036 /* Initialized data */
00037
00038 static real rgb[21] /* was [3][7] */ = { 0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,
00039 1.f,0.f,1.f,0.f,1.f,1.f,0.f,1.f,0.f,1.f,0.f,1.f,1.f };
00040
00041 /* System generated locals */
00042 integer i__1, i__2;
00043
00044 /* Local variables */
00045 static integer ic;
00046 extern /* Subroutine */ int zzmpco_(real *, real *, real *);
00047
00048
00049 /* Set the color of subsequent lines */
00050 /* .......................................................................
00051 */
00052
00053
00054 /* Internal Data for PLOTPAK */
00055
00056 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00057 */
00058 /* cc IF( NPLOTR.EQ.1 .OR. NPLOTR.EQ.2 )THEN */
00059 /* cc IF( NCOL .LE. 1 .OR. NCOL .GT. 7 )THEN */
00060 /* cc CALL GCOLOR( 5Hclear ) */
00061 /* cc ELSEIF( NCOL .EQ. 2 )THEN */
00062 /* cc CALL GCOLOR( 3Hred ) */
00063 /* cc ELSEIF( NCOL .EQ. 3 )THEN */
00064 /* cc CALL GCOLOR( 4Hblue ) */
00065 /* cc ELSEIF( NCOL .EQ. 4 )THEN */
00066 /* cc CALL GCOLOR( 5Hgreen ) */
00067 /* cc ELSEIF( NCOL .EQ. 5 )THEN */
00068 /* cc CALL GCOLOR( 6Hyellow ) */
00069 /* cc ELSEIF( NCOL .EQ. 6 )THEN */
00070 /* cc CALL GCOLOR( 7Hmagenta ) */
00071 /* cc ELSEIF( NCOL .EQ. 7 )THEN */
00072 /* cc CALL GCOLOR( 4Hcyan ) */
00073 /* cc ENDIF */
00074
00075 /* cc IF( NPLOTR.EQ.5 )THEN */
00076 /* cc CALL ZZPCOL( NCOL ) */
00077 /* cc ENDIF */
00078
00079 /* cc IF( NPLOTR .EQ. 6 )THEN */
00080 /* cc IC = MAX( 1 , MIN( 7 , NCOL ) ) */
00081 /* cc CALL ZZPSCO( RGB(1,IC) , RGB(2,IC) , RGB(3,IC) ) */
00082 /* cc ENDIF */
00083 if (zzpltr_1.nplotr == 7) {
00084 /* Computing MAX */
00085 i__1 = 1, i__2 = min(7,*ncol);
00086 ic = max(i__1,i__2);
00087 zzmpco_(&rgb[ic * 3 - 3], &rgb[ic * 3 - 2], &rgb[ic * 3 - 1]);
00088 }
00089
00090 return 0;
00091 } /* color_ */
|
|
|
Definition at line 365 of file plot_cox.c.
00366 {
00367 MEM_plotdata * np ;
00368 char str[256] ; int nn ;
00369
00370 if( mp == NULL ) return NULL ;
00371
00372 /* make a new ID string */
00373
00374 for( nn=1 ; nn <= 9999 ; nn++ ){
00375 sprintf(str,"%.240sCopy%04d",mp->ident,nn) ;
00376 if( find_memplot(str) == NULL ) break ;
00377 }
00378 if( nn == 1000 ) return NULL ; /* this is bad (but unlikely) */
00379
00380 /* make the new memplot */
00381
00382 nn = create_memplot( str , mp->aspect ) ;
00383 if( nn ) return NULL ; /* this is real bad */
00384
00385 np = find_memplot(NULL) ; /* is the new one */
00386 if( np == NULL ) return NULL ; /* shouldn't happen */
00387
00388 /* copy data from old one into new one */
00389
00390 nn = np->nxyline = np->nxyline_all = mp->nxyline ;
00391 np->xyline = (float *) realloc(np->xyline,
00392 sizeof(float)*NXY_MEMPLOT*nn) ;
00393 memcpy( np->xyline , mp->xyline , sizeof(float)*NXY_MEMPLOT*nn ) ;
00394
00395 return np ;
00396 }
|
|
||||||||||||
|
Definition at line 49 of file plot_cox.c.
00050 {
00051 MEM_plotdata * pd ;
00052 static int plotpak_framed = 0 ;
00053 real asp ;
00054
00055 if( find_memplot(id) != NULL ) return 1 ;
00056
00057 INIT_MEMPLOT(pd,id) ;
00058
00059 if( plotar == NULL ){
00060 plotar = (MEM_plotdata **) malloc( sizeof(MEM_plotdata *) ) ;
00061 num_plotar = 0 ;
00062 } else {
00063 plotar = (MEM_plotdata **)
00064 realloc( plotar , sizeof(MEM_plotdata *)*(num_plotar+1) ) ;
00065 }
00066
00067 active_plot = num_plotar ;
00068 plotar[num_plotar++] = pd ;
00069
00070 ADDTO_MEMPLOT( pd , 1.0,0.0,0.0,0.0 , 0.0 , -THCODE_OPAC ) ; /* 22 Jul 2004 */
00071
00072 if( aspect <= 0.0 ) aspect = 1.3 ;
00073 asp = aspect ;
00074 pd->aspect = aspect ;
00075 memplt_( &asp ) ; /* setup PLOTPAK */
00076
00077 return 0 ;
00078 }
|
|
||||||||||||
|
Definition at line 84 of file plot_cox.c.
00085 {
00086 int ii , jj ;
00087 char str[256] ;
00088
00089 if( aspect <= 0.0 ) aspect = 1.0 ; /* backup for stupid users */
00090
00091 if( id != NULL && id[0] != '\0'){
00092 ii = create_memplot(id,aspect) ;
00093 if( ii == 0 ) return 0 ;
00094 } else {
00095 id = "ElvisWalksTheEarth" ;
00096 }
00097
00098 for( jj=0 ; ; jj++ ){
00099 sprintf(str,"%.240s_%d",id,jj) ;
00100 ii = create_memplot(str,aspect) ;
00101 if( ii == 0 ) return 0 ;
00102 }
00103
00104 return 1 ; /* actually, unreachable */
00105 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 891 of file srface.c.
00893 {
00894 /* Initialized data */
00895
00896 static integer idub = 0;
00897
00898 /* System generated locals */
00899 integer z_dim1, z_offset, m_dim2, m_offset, i__1, i__2;
00900 real r__1;
00901
00902 /* Builtin functions */
00903 double r_sign(real *, real *);
00904
00905 /* Local variables */
00906 static integer jump, k;
00907 extern /* Subroutine */ int color_(integer *), draws_(integer *, integer *
00908 , integer *, integer *, integer *, integer *);
00909 static integer i1, j1;
00910 static real h1, h2, h3, h4;
00911 static integer k1, k2, k3, k4;
00912 static real ra, rb, cv;
00913 static logical lcolor;
00914 static integer i1p1, j1p1, mua, mva, mub, mvb;
00915
00916
00917 /* CC DIMENSION Z(MX,NY) ,M(2,NX,NY) */
00918
00919 /* Parameter adjustments */
00920 m_dim2 = *nx;
00921 m_offset = (m_dim2 + 1 << 1) + 1;
00922 m -= m_offset;
00923 z_dim1 = *mx;
00924 z_offset = z_dim1 + 1;
00925 z__ -= z_offset;
00926
00927 /* Function Body */
00928 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00929 */
00930 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00931 */
00932 i1 = *i0;
00933 i1p1 = i1 + 1;
00934 j1 = *j0;
00935 j1p1 = j1 + 1;
00936 h1 = z__[i1 + j1 * z_dim1];
00937 h2 = z__[i1 + j1p1 * z_dim1];
00938 h3 = z__[i1p1 + j1p1 * z_dim1];
00939 h4 = z__[i1p1 + j1 * z_dim1];
00940 if (srfblk_1.ioffp != 1) {
00941 goto L10;
00942 }
00943 if (h1 == srfblk_1.spval || h2 == srfblk_1.spval || h3 == srfblk_1.spval
00944 || h4 == srfblk_1.spval) {
00945 return 0;
00946 }
00947 L10:
00948 /* Computing MIN */
00949 r__1 = min(h1,h2), r__1 = min(r__1,h3);
00950 if (dmin(r__1,h4) > srfblk_1.cl[srfblk_1.ncl - 1]) {
00951 return 0;
00952 }
00953
00954 lcolor = FALSE_;
00955 i__1 = srfblk_1.ncl;
00956 for (k = 1; k <= i__1; ++k) {
00957
00958 /* FOR EACH CONTOUR LEVEL, DESIDE WHICH OF THE 16 BASIC SIT- */
00959 /* UATIONS EXISTS, THEN INTERPOLATE IN TWO-SPACE TO FIND THE */
00960 /* END POINTS OF THE CONTOUR LINE SEGMENT WITHIN THIS CELL. */
00961
00962 cv = srfblk_1.cl[k - 1];
00963 r__1 = h1 - cv;
00964 k1 = ((integer) r_sign(&c_b3, &r__1) + 1) / 2;
00965 r__1 = h2 - cv;
00966 k2 = ((integer) r_sign(&c_b3, &r__1) + 1) / 2;
00967 r__1 = h3 - cv;
00968 k3 = ((integer) r_sign(&c_b3, &r__1) + 1) / 2;
00969 r__1 = h4 - cv;
00970 k4 = ((integer) r_sign(&c_b3, &r__1) + 1) / 2;
00971 jump = k1 + 1 + (k2 << 1) + (k3 << 2) + (k4 << 3);
00972
00973 /* 17/Apr/91: plot contours in different colors */
00974
00975 if (jump > 1 && jump < 16) {
00976 i__2 = k % 6 + 2;
00977 color_(&i__2);
00978 }
00979
00980 switch (jump) {
00981 case 1: goto L120;
00982 case 2: goto L30;
00983 case 3: goto L50;
00984 case 4: goto L60;
00985 case 5: goto L70;
00986 case 6: goto L20;
00987 case 7: goto L80;
00988 case 8: goto L90;
00989 case 9: goto L90;
00990 case 10: goto L80;
00991 case 11: goto L40;
00992 case 12: goto L70;
00993 case 13: goto L60;
00994 case 14: goto L50;
00995 case 15: goto L30;
00996 case 16: goto L110;
00997 }
00998
00999 L20:
01000 idub = 1;
01001 L30:
01002 ra = (h1 - cv) / (h1 - h2);
01003 mua = (real) m[(i1 + j1 * m_dim2 << 1) + 1] + ra * (real) (m[(i1 +
01004 j1p1 * m_dim2 << 1) + 1] - m[(i1 + j1 * m_dim2 << 1) + 1]);
01005 mva = (real) m[(i1 + j1 * m_dim2 << 1) + 2] + ra * (real) (m[(i1 +
01006 j1p1 * m_dim2 << 1) + 2] - m[(i1 + j1 * m_dim2 << 1) + 2]);
01007 rb = (h1 - cv) / (h1 - h4);
01008 mub = (real) m[(i1 + j1 * m_dim2 << 1) + 1] + rb * (real) (m[(i1p1 +
01009 j1 * m_dim2 << 1) + 1] - m[(i1 + j1 * m_dim2 << 1) + 1]);
01010 mvb = (real) m[(i1 + j1 * m_dim2 << 1) + 2] + rb * (real) (m[(i1p1 +
01011 j1 * m_dim2 << 1) + 2] - m[(i1 + j1 * m_dim2 << 1) + 2]);
01012 goto L100;
01013 L40:
01014 idub = -1;
01015 L50:
01016 ra = (h2 - cv) / (h2 - h1);
01017 mua = (real) m[(i1 + j1p1 * m_dim2 << 1) + 1] + ra * (real) (m[(i1 +
01018 j1 * m_dim2 << 1) + 1] - m[(i1 + j1p1 * m_dim2 << 1) + 1]);
01019 mva = (real) m[(i1 + j1p1 * m_dim2 << 1) + 2] + ra * (real) (m[(i1 +
01020 j1 * m_dim2 << 1) + 2] - m[(i1 + j1p1 * m_dim2 << 1) + 2]);
01021 rb = (h2 - cv) / (h2 - h3);
01022 mub = (real) m[(i1 + j1p1 * m_dim2 << 1) + 1] + rb * (real) (m[(i1p1
01023 + j1p1 * m_dim2 << 1) + 1] - m[(i1 + j1p1 * m_dim2 << 1) + 1])
01024 ;
01025 mvb = (real) m[(i1 + j1p1 * m_dim2 << 1) + 2] + rb * (real) (m[(i1p1
01026 + j1p1 * m_dim2 << 1) + 2] - m[(i1 + j1p1 * m_dim2 << 1) + 2])
01027 ;
01028 goto L100;
01029 L60:
01030 ra = (h2 - cv) / (h2 - h3);
01031 mua = (real) m[(i1 + j1p1 * m_dim2 << 1) + 1] + ra * (real) (m[(i1p1
01032 + j1p1 * m_dim2 << 1) + 1] - m[(i1 + j1p1 * m_dim2 << 1) + 1])
01033 ;
01034 mva = (real) m[(i1 + j1p1 * m_dim2 << 1) + 2] + ra * (real) (m[(i1p1
01035 + j1p1 * m_dim2 << 1) + 2] - m[(i1 + j1p1 * m_dim2 << 1) + 2])
01036 ;
01037 rb = (h1 - cv) / (h1 - h4);
01038 mub = (real) m[(i1 + j1 * m_dim2 << 1) + 1] + rb * (real) (m[(i1p1 +
01039 j1 * m_dim2 << 1) + 1] - m[(i1 + j1 * m_dim2 << 1) + 1]);
01040 mvb = (real) m[(i1 + j1 * m_dim2 << 1) + 2] + rb * (real) (m[(i1p1 +
01041 j1 * m_dim2 << 1) + 2] - m[(i1 + j1 * m_dim2 << 1) + 2]);
01042 goto L100;
01043 L70:
01044 ra = (h3 - cv) / (h3 - h2);
01045 mua = (real) m[(i1p1 + j1p1 * m_dim2 << 1) + 1] + ra * (real) (m[(i1
01046 + j1p1 * m_dim2 << 1) + 1] - m[(i1p1 + j1p1 * m_dim2 << 1) +
01047 1]);
01048 mva = (real) m[(i1p1 + j1p1 * m_dim2 << 1) + 2] + ra * (real) (m[(i1
01049 + j1p1 * m_dim2 << 1) + 2] - m[(i1p1 + j1p1 * m_dim2 << 1) +
01050 2]);
01051 rb = (h3 - cv) / (h3 - h4);
01052 mub = (real) m[(i1p1 + j1p1 * m_dim2 << 1) + 1] + rb * (real) (m[(
01053 i1p1 + j1 * m_dim2 << 1) + 1] - m[(i1p1 + j1p1 * m_dim2 << 1)
01054 + 1]);
01055 mvb = (real) m[(i1p1 + j1p1 * m_dim2 << 1) + 2] + rb * (real) (m[(
01056 i1p1 + j1 * m_dim2 << 1) + 2] - m[(i1p1 + j1p1 * m_dim2 << 1)
01057 + 2]);
01058 idub = 0;
01059 goto L100;
01060 L80:
01061 ra = (h2 - cv) / (h2 - h1);
01062 mua = (real) m[(i1 + j1p1 * m_dim2 << 1) + 1] + ra * (real) (m[(i1 +
01063 j1 * m_dim2 << 1) + 1] - m[(i1 + j1p1 * m_dim2 << 1) + 1]);
01064 mva = (real) m[(i1 + j1p1 * m_dim2 << 1) + 2] + ra * (real) (m[(i1 +
01065 j1 * m_dim2 << 1) + 2] - m[(i1 + j1p1 * m_dim2 << 1) + 2]);
01066 rb = (h3 - cv) / (h3 - h4);
01067 mub = (real) m[(i1p1 + j1p1 * m_dim2 << 1) + 1] + rb * (real) (m[(
01068 i1p1 + j1 * m_dim2 << 1) + 1] - m[(i1p1 + j1p1 * m_dim2 << 1)
01069 + 1]);
01070 mvb = (real) m[(i1p1 + j1p1 * m_dim2 << 1) + 2] + rb * (real) (m[(
01071 i1p1 + j1 * m_dim2 << 1) + 2] - m[(i1p1 + j1p1 * m_dim2 << 1)
01072 + 2]);
01073 goto L100;
01074 L90:
01075 ra = (h4 - cv) / (h4 - h1);
01076 mua = (real) m[(i1p1 + j1 * m_dim2 << 1) + 1] + ra * (real) (m[(i1 +
01077 j1 * m_dim2 << 1) + 1] - m[(i1p1 + j1 * m_dim2 << 1) + 1]);
01078 mva = (real) m[(i1p1 + j1 * m_dim2 << 1) + 2] + ra * (real) (m[(i1 +
01079 j1 * m_dim2 << 1) + 2] - m[(i1p1 + j1 * m_dim2 << 1) + 2]);
01080 rb = (h4 - cv) / (h4 - h3);
01081 mub = (real) m[(i1p1 + j1 * m_dim2 << 1) + 1] + rb * (real) (m[(i1p1
01082 + j1p1 * m_dim2 << 1) + 1] - m[(i1p1 + j1 * m_dim2 << 1) + 1])
01083 ;
01084 mvb = (real) m[(i1p1 + j1 * m_dim2 << 1) + 2] + rb * (real) (m[(i1p1
01085 + j1p1 * m_dim2 << 1) + 2] - m[(i1p1 + j1 * m_dim2 << 1) + 2])
01086 ;
01087 idub = 0;
01088 L100:
01089 draws_(&mua, &mva, &mub, &mvb, &c__1, &c__0);
01090 lcolor = TRUE_;
01091 if (idub < 0) {
01092 goto L90;
01093 } else if (idub == 0) {
01094 goto L110;
01095 } else {
01096 goto L70;
01097 }
01098 L110:
01099 ;
01100 }
01101
01102 L120:
01103 if (lcolor) {
01104 color_(&c__1);
01105 }
01106 return 0;
01107 } /* ctcell_ */
|
|
||||||||||||||||
|
Definition at line 18 of file curve.c.
00019 {
00020 extern /* Subroutine */ int points_(real *, real *, integer *, integer *,
00021 integer *);
00022
00023
00024 /* Connect N points with N-1 straight lines */
00025
00026 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00027 */
00028 /* Parameter adjustments */
00029 --y;
00030 --x;
00031
00032 /* Function Body */
00033 points_(&x[1], &y[1], n, &c__0, &c__1);
00034 return 0;
00035 } /* curve_ */
|
|
||||||||||||||||
|
Definition at line 514 of file plot_cox.c.
00515 {
00516 if( mp == NULL ) return ; /* bad or meaningless stuff */
00517 if( nbot < 0 ) return ;
00518 if( ntop >= mp->nxyline ) return ;
00519 if( nbot > ntop ) return ;
00520
00521 if( ntop == mp->nxyline-1 ){ /* just set num lines to nbot */
00522
00523 mp->nxyline = nbot ;
00524
00525 } else { /* must move things above ntop down */
00526
00527 memmove( mp->xyline + NXY_MEMPLOT*nbot ,
00528 mp->xyline + NXY_MEMPLOT*(ntop+1) ,
00529 sizeof(float)*NXY_MEMPLOT*(mp->nxyline-1-ntop) ) ;
00530
00531 mp->nxyline -= (ntop-nbot+1) ;
00532
00533 }
00534 return ;
00535 }
|
|
|
Definition at line 271 of file plot_cox.c.
00272 {
00273 int ip ;
00274
00275 if( active_plot < 0 || active_plot >= num_plotar ||
00276 num_plotar == 0 || plotar == NULL ||
00277 plotar[active_plot] == NULL ) return ;
00278
00279 DESTROY_MEMPLOT( plotar[active_plot] ) ;
00280
00281 if( num_plotar == 1 ){
00282 free(plotar) ; plotar = NULL ; num_plotar = 0 ;
00283 } else {
00284 for( ip=active_plot+1 ; ip < num_plotar ; ip++ ) plotar[ip-1] = plotar[ip] ;
00285 num_plotar-- ; plotar[num_plotar] = NULL ;
00286 }
00287
00288 active_plot = -1 ;
00289 return ;
00290 }
|
|
|
Definition at line 294 of file plot_cox.c.
00295 {
00296 int ip ;
00297
00298 if( num_plotar == 0 || plotar == NULL || mp == NULL ) return ;
00299
00300 for( ip=0 ; ip < num_plotar ; ip++ ) if( plotar[ip] == mp ) break ;
00301
00302 if( ip < num_plotar ){
00303 if( active_plot == ip ) active_plot = -1 ;
00304 else if( active_plot > ip ) active_plot-- ;
00305
00306 for( ip++ ; ip < num_plotar ; ip++ ) plotar[ip-1] = plotar[ip] ;
00307
00308 num_plotar-- ; plotar[num_plotar] = NULL ;
00309 }
00310
00311 DESTROY_MEMPLOT( mp ) ;
00312 return ;
00313 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 1112 of file srface.c.
01114 {
01115 /* Initialized data */
01116
01117 static real steep = 5.f;
01118 static integer mx = 0;
01119 static integer my = 0;
01120
01121 /* System generated locals */
01122 integer i__1, i__2;
01123
01124 /* Local variables */
01125 static integer nx1p1, k, ltemp;
01126 extern /* Subroutine */ int srfpl_(integer *, real *, real *);
01127 static real dy;
01128 static integer nx1, ny1, nx2, ny2;
01129 static real pxs[2], pys[2], fny1;
01130 static logical vis1, vis2;
01131 static integer mmx1, mmy1, mmx2, mmy2;
01132
01133
01134 /* THIS ROUTINE DRAWS THE VISIBLE PART OF THE LINE CONNECTING */
01135 /* (MX1,MY1) AND (MX2,MY2). IF IDRAW .NE. 0, THE LINE IS DRAWN. */
01136 /* IF IMARK .NE. 0, THE VISIBILITY ARRAY IS MARKED. */
01137
01138 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01139 */
01140 /* MAKE LINE LEFT TO RIGHT. */
01141
01142 mmx1 = *mx1;
01143 mmy1 = *my1;
01144 mmx2 = *mx2;
01145 mmy2 = *my2;
01146 if (mmx1 == srfblk_1.nspval || mmx2 == srfblk_1.nspval) {
01147 return 0;
01148 }
01149 if (mmx1 > mmx2) {
01150 goto L10;
01151 }
01152 nx1 = mmx1;
01153 ny1 = mmy1;
01154 nx2 = mmx2;
01155 ny2 = mmy2;
01156 goto L20;
01157 L10:
01158 nx1 = mmx2;
01159 ny1 = mmy2;
01160 nx2 = mmx1;
01161 ny2 = mmy1;
01162 L20:
01163 if (srfblk_1.nupper < 0) {
01164 goto L180;
01165 }
01166
01167 /* CHECK UPPER VISIBILITY. */
01168
01169 vis1 = ny1 >= srfblk_1.limu[nx1 - 1] - 1;
01170 vis2 = ny2 >= srfblk_1.limu[nx2 - 1] - 1;
01171
01172 /* VIS1 AND VIS2 TRUE MEANS VISIBLE. */
01173
01174 if (vis1 && vis2) {
01175 goto L120;
01176 }
01177
01178 /* VIS1 AND VIS2 FALSE MEANS INVISIBLE. */
01179
01180 if (! (vis1 || vis2)) {
01181 goto L180;
01182 }
01183
01184 /* FIND CHANGE POINT. */
01185
01186 if (nx1 == nx2) {
01187 goto L110;
01188 }
01189 dy = (real) (ny2 - ny1) / (real) (nx2 - nx1);
01190 nx1p1 = nx1 + 1;
01191 fny1 = (real) ny1;
01192 if (vis1) {
01193 goto L60;
01194 }
01195 i__1 = nx2;
01196 for (k = nx1p1; k <= i__1; ++k) {
01197 mx = k;
01198 my = fny1 + (real) (k - nx1) * dy;
01199 if (my > srfblk_1.limu[k - 1]) {
01200 goto L40;
01201 }
01202 /* L30: */
01203 }
01204 L40:
01205 if (dabs(dy) >= steep) {
01206 goto L90;
01207 }
01208 L50:
01209 nx1 = mx;
01210 ny1 = my;
01211 goto L120;
01212 L60:
01213 i__1 = nx2;
01214 for (k = nx1p1; k <= i__1; ++k) {
01215 mx = k;
01216 my = fny1 + (real) (k - nx1) * dy;
01217 if (my <= srfblk_1.limu[k - 1]) {
01218 goto L80;
01219 }
01220 /* L70: */
01221 }
01222 L80:
01223 if (dabs(dy) >= steep) {
01224 goto L100;
01225 }
01226 nx2 = mx - 1;
01227 ny2 = my;
01228 goto L120;
01229 L90:
01230 if (srfblk_1.limu[mx - 1] == 0) {
01231 goto L50;
01232 }
01233 nx1 = mx;
01234 ny1 = srfblk_1.limu[nx1 - 1];
01235 goto L120;
01236 L100:
01237 nx2 = mx - 1;
01238 ny2 = srfblk_1.limu[nx2 - 1];
01239 goto L120;
01240 L110:
01241 if (vis1) {
01242 /* Computing MIN */
01243 i__1 = srfblk_1.limu[nx1 - 1], i__2 = srfblk_1.limu[nx2 - 1];
01244 ny2 = min(i__1,i__2);
01245 }
01246 if (vis2) {
01247 /* Computing MIN */
01248 i__1 = srfblk_1.limu[nx1 - 1], i__2 = srfblk_1.limu[nx2 - 1];
01249 ny1 = min(i__1,i__2);
01250 }
01251 L120:
01252 if (*idraw == 0) {
01253 goto L150;
01254 }
01255
01256 /* DRAW VISIBLE PART OF LINE. */
01257
01258 if (srfblk_1.irot != 0) {
01259 goto L130;
01260 } else {
01261 goto L140;
01262 }
01263 L130:
01264 pxs[0] = (real) ny1;
01265 pxs[1] = (real) ny2;
01266 pys[0] = (real) (1024 - nx1);
01267 pys[1] = (real) (1024 - nx2);
01268 srfpl_(&c__2, pxs, pys);
01269 goto L150;
01270 L140:
01271 pxs[0] = (real) nx1;
01272 pxs[1] = (real) nx2;
01273 pys[0] = (real) ny1;
01274 pys[1] = (real) ny2;
01275 srfpl_(&c__2, pxs, pys);
01276 L150:
01277 if (*imark == 0) {
01278 goto L180;
01279 }
01280 if (nx1 == nx2) {
01281 goto L170;
01282 }
01283 dy = (real) (ny2 - ny1) / (real) (nx2 - nx1);
01284 fny1 = (real) ny1;
01285 i__1 = nx2;
01286 for (k = nx1; k <= i__1; ++k) {
01287 ltemp = fny1 + (real) (k - nx1) * dy;
01288 if (ltemp > srfblk_1.limu[k - 1]) {
01289 srfblk_1.limu[k - 1] = ltemp;
01290 }
01291 /* L160: */
01292 }
01293 goto L180;
01294 L170:
01295 ltemp = max(ny1,ny2);
01296 if (ltemp > srfblk_1.limu[nx1 - 1]) {
01297 srfblk_1.limu[nx1 - 1] = ltemp;
01298 }
01299 L180:
01300 if (srfblk_1.nupper <= 0) {
01301 goto L190;
01302 } else {
01303 goto L370;
01304 }
01305
01306 /* SAME IDEA AS ABOVE, BUT FOR LOWER SIDE. */
01307
01308 L190:
01309 if (mmx1 > mmx2) {
01310 goto L200;
01311 }
01312 nx1 = mmx1;
01313 ny1 = mmy1;
01314 nx2 = mmx2;
01315 ny2 = mmy2;
01316 goto L210;
01317 L200:
01318 nx1 = mmx2;
01319 ny1 = mmy2;
01320 nx2 = mmx1;
01321 ny2 = mmy1;
01322 L210:
01323 vis1 = ny1 <= srfblk_1.liml[nx1 - 1] + 1;
01324 vis2 = ny2 <= srfblk_1.liml[nx2 - 1] + 1;
01325 if (vis1 && vis2) {
01326 goto L310;
01327 }
01328 if (! (vis1 || vis2)) {
01329 goto L370;
01330 }
01331 if (nx1 == nx2) {
01332 goto L300;
01333 }
01334 dy = (real) (ny2 - ny1) / (real) (nx2 - nx1);
01335 nx1p1 = nx1 + 1;
01336 fny1 = (real) ny1;
01337 if (vis1) {
01338 goto L250;
01339 }
01340 i__1 = nx2;
01341 for (k = nx1p1; k <= i__1; ++k) {
01342 mx = k;
01343 my = fny1 + (real) (k - nx1) * dy;
01344 if (my < srfblk_1.liml[k - 1]) {
01345 goto L230;
01346 }
01347 /* L220: */
01348 }
01349 L230:
01350 if (dabs(dy) >= steep) {
01351 goto L280;
01352 }
01353 L240:
01354 nx1 = mx;
01355 ny1 = my;
01356 goto L310;
01357 L250:
01358 i__1 = nx2;
01359 for (k = nx1p1; k <= i__1; ++k) {
01360 mx = k;
01361 my = fny1 + (real) (k - nx1) * dy;
01362 if (my >= srfblk_1.liml[k - 1]) {
01363 goto L270;
01364 }
01365 /* L260: */
01366 }
01367 L270:
01368 if (dabs(dy) >= steep) {
01369 goto L290;
01370 }
01371 nx2 = mx - 1;
01372 ny2 = my;
01373 goto L310;
01374 L280:
01375 if (srfblk_1.liml[mx - 1] == 1024) {
01376 goto L240;
01377 }
01378 nx1 = mx;
01379 ny1 = srfblk_1.liml[nx1 - 1];
01380 goto L310;
01381 L290:
01382 nx2 = mx - 1;
01383 ny2 = srfblk_1.liml[nx2 - 1];
01384 goto L310;
01385 L300:
01386 if (vis1) {
01387 /* Computing MAX */
01388 i__1 = srfblk_1.liml[nx1 - 1], i__2 = srfblk_1.liml[nx2 - 1];
01389 ny2 = max(i__1,i__2);
01390 }
01391 if (vis2) {
01392 /* Computing MAX */
01393 i__1 = srfblk_1.liml[nx1 - 1], i__2 = srfblk_1.liml[nx2 - 1];
01394 ny1 = max(i__1,i__2);
01395 }
01396 L310:
01397 if (*idraw == 0) {
01398 goto L340;
01399 }
01400 if (srfblk_1.irot != 0) {
01401 goto L320;
01402 } else {
01403 goto L330;
01404 }
01405 L320:
01406 pxs[0] = (real) ny1;
01407 pxs[1] = (real) ny2;
01408 pys[0] = (real) (1024 - nx1);
01409 pys[1] = (real) (1024 - nx2);
01410 srfpl_(&c__2, pxs, pys);
01411 goto L340;
01412 L330:
01413 pxs[0] = (real) nx1;
01414 pxs[1] = (real) nx2;
01415 pys[0] = (real) ny1;
01416 pys[1] = (real) ny2;
01417 srfpl_(&c__2, pxs, pys);
01418 L340:
01419 if (*imark == 0) {
01420 goto L370;
01421 }
01422 if (nx1 == nx2) {
01423 goto L360;
01424 }
01425 dy = (real) (ny2 - ny1) / (real) (nx2 - nx1);
01426 fny1 = (real) ny1;
01427 i__1 = nx2;
01428 for (k = nx1; k <= i__1; ++k) {
01429 ltemp = fny1 + (real) (k - nx1) * dy;
01430 if (ltemp < srfblk_1.liml[k - 1]) {
01431 srfblk_1.liml[k - 1] = ltemp;
01432 }
01433 /* L350: */
01434 }
01435 return 0;
01436 L360:
01437 ltemp = min(ny1,ny2);
01438 if (ltemp < srfblk_1.liml[nx1 - 1]) {
01439 srfblk_1.liml[nx1 - 1] = ltemp;
01440 }
01441 L370:
01442 return 0;
01443 } /* draws_ */
|
|
||||||||||||||||
|
Definition at line 96 of file color.c.
00097 {
00098 extern /* Subroutine */ int zzmpco_(real *, real *, real *);
00099
00100
00101 /* Set the color of subsequent lines */
00102 /* .......................................................................
00103 */
00104 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00105 */
00106
00107 /* Internal Data for PLOTPAK */
00108
00109 if (zzpltr_1.nplotr == 7) {
00110 zzmpco_(cr, cg, cb);
00111 }
00112 return 0;
00113 } /* fcolor_ */
|
|
|
Definition at line 26 of file plot_cox.c.
00027 {
00028 int ip ;
00029
00030 if( num_plotar == 0 || plotar == NULL ) return NULL ;
00031
00032 if( id == NULL || id[0] == '\0' ){
00033 if( active_plot < 0 || active_plot >= num_plotar ) return NULL ;
00034 return plotar[active_plot] ;
00035 }
00036
00037 for( ip=0 ; ip < num_plotar ; ip++ )
00038 if( strcmp(plotar[ip]->ident,id) == 0 ) return plotar[ip] ;
00039
00040 return NULL ;
00041 }
|
|
||||||||||||||||
|
Definition at line 404 of file plot_cox.c.
00405 {
00406 int fopt , ii,nn ;
00407 float xtop , ytop=1.0 , x1,y1,x2,y2 ;
00408
00409 if( mp == NULL ) return ; /* nothing in */
00410 if( rot == MRI_ROT_0 && mirror == FALSE ) return ; /* do nothing */
00411
00412 xtop = mp->aspect ;
00413
00414 fopt = (mirror) ? (rot+MRI_FLMADD) : (rot) ;
00415 switch( fopt ){
00416
00417 default: return ; /* should never happen */
00418
00419 case MRI_ROT_90:
00420 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00421 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00422 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00423 mp->xyline[nn ] = ytop - y1 ;
00424 mp->xyline[nn+1] = x1 ;
00425 mp->xyline[nn+2] = ytop - y2 ;
00426 mp->xyline[nn+3] = x2 ;
00427 }
00428 break ;
00429
00430 case MRI_ROT_180:
00431 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00432 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00433 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00434 mp->xyline[nn ] = xtop - x1 ;
00435 mp->xyline[nn+1] = ytop - y1 ;
00436 mp->xyline[nn+2] = xtop - x2 ;
00437 mp->xyline[nn+3] = ytop - y2 ;
00438 }
00439 break ;
00440
00441 case MRI_ROT_270:
00442 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00443 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00444 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00445 mp->xyline[nn ] = y1 ;
00446 mp->xyline[nn+1] = xtop - x1 ;
00447 mp->xyline[nn+2] = y2 ;
00448 mp->xyline[nn+3] = xtop - x2 ;
00449 }
00450 break ;
00451
00452 case (MRI_ROT_0+MRI_FLMADD):
00453 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00454 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00455 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00456 mp->xyline[nn ] = xtop - x1 ;
00457 mp->xyline[nn+1] = y1 ;
00458 mp->xyline[nn+2] = xtop - x2 ;
00459 mp->xyline[nn+3] = y2 ;
00460 }
00461 break ;
00462
00463 case (MRI_ROT_90+MRI_FLMADD):
00464 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00465 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00466 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00467 mp->xyline[nn ] = y1 ;
00468 mp->xyline[nn+1] = x1 ;
00469 mp->xyline[nn+2] = y2 ;
00470 mp->xyline[nn+3] = x2 ;
00471 }
00472 break ;
00473
00474 case (MRI_ROT_180+MRI_FLMADD):
00475 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00476 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00477 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00478 mp->xyline[nn ] = x1 ;
00479 mp->xyline[nn+1] = ytop - y1 ;
00480 mp->xyline[nn+2] = x2 ;
00481 mp->xyline[nn+3] = ytop - y2 ;
00482 }
00483 break ;
00484
00485 case (MRI_ROT_270+MRI_FLMADD):
00486 for( nn=ii=0 ; ii < mp->nxyline ; ii++,nn+=NXY_MEMPLOT ){
00487 x1 = mp->xyline[nn ] ; y1 = mp->xyline[nn+1] ;
00488 x2 = mp->xyline[nn+2] ; y2 = mp->xyline[nn+3] ;
00489 mp->xyline[nn ] = ytop - y1 ;
00490 mp->xyline[nn+1] = xtop - x1 ;
00491 mp->xyline[nn+2] = ytop - y2 ;
00492 mp->xyline[nn+3] = xtop - x2 ;
00493 }
00494 break ;
00495 }
00496
00497 return ;
00498 }
|
|
|
Definition at line 36 of file coxplot/frame.c.
00037 {
00038
00039 /* Stop plotting in the current window (or frame). */
00040 /* .......................................................................
00041 */
00042 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00043 */
00044 /* cc IF( NPLOTR.EQ.1 .OR. NPLOTR.EQ.2 )THEN */
00045 /* cc CALL GPAGE */
00046 /* cc ENDIF */
00047
00048 /* cc IF( NPLOTR .EQ. 3 )THEN */
00049 /* cc CLOSE( UNIT=99 ) */
00050 /* cc ENDIF */
00051
00052 /* cc IF( NPLOTR .EQ. 4 )THEN */
00053 /* cc CALL ZZUPFR */
00054 /* cc ENDIF */
00055
00056 /* cc IF( NPLOTR .EQ. 5 )THEN */
00057 /* cc CALL ZZPCFR */
00058 /* cc ENDIF */
00059
00060 /* cc IF( NPLOTR .EQ. 6 )THEN */
00061 /* cc CALL ZZPSFR */
00062 /* cc ENDIF */
00063
00064
00065 /* Internal Data for PLOTPAK */
00066
00067 return 0;
00068 } /* frame_ */
|
|
||||||||||||
|
Definition at line 34 of file frstpt.c.
00035 {
00036 static real xx, yy;
00037 extern /* Subroutine */ int zzphys_(real *, real *);
00038
00039
00040 /* Set the first point ("pen up move") */
00041 /* .......................................................................
00042 */
00043 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00044 */
00045
00046 /* Internal Data for PLOTPAK */
00047
00048 xx = *x;
00049 yy = *y;
00050 zzphys_(&xx, &yy);
00051 zzzplt_1.xphold = xx;
00052 zzzplt_1.yphold = yy;
00053 return 0;
00054 } /* frstpt_ */
|
|
|
Definition at line 130 of file plot_cox.c.
00131 {
00132 return find_memplot(NULL) ;
00133 }
|
|
|
Definition at line 201 of file plot_cox.c.
00202 {
00203 return active_opacity ;
00204 }
|
|
|
Definition at line 177 of file plot_cox.c.
00178 {
00179 return active_thick ;
00180 }
|
|
||||||||||||
|
Definition at line 479 of file plot_x11.c.
00480 {
00481 Status sss ;
00482 XWindowAttributes xwat ;
00483 XColor * xcol ;
00484 XVisualInfo vinfo , * vin ;
00485 X11_colordef * cd ; /* will be the output */
00486 int count , ii ;
00487 xhandler old_handler ; /* 13 Mar 2002 */
00488
00489 /*--- sanity check ---*/
00490
00491 if( display == NULL || w == (Window) 0 ) return NULL ;
00492
00493 /*--- get window attributes ---*/
00494
00495 /* 13 Mar 2002: deal with the error that occurs
00496 when the Window is really a Pixmap */
00497
00498 xwat.depth = 0 ;
00499 old_handler = XSetErrorHandler(qhandler) ; xwasbad = 0 ;
00500
00501 XGetWindowAttributes( display, getwin_from_XDBE(display,w), &xwat ) ;
00502
00503 (void) XSetErrorHandler(old_handler) ;
00504
00505 if( xwasbad ){
00506 int xx,yy ; unsigned int ww,hh,bb,dd ; Window rr ;
00507 XGetGeometry( display,w , &rr,&xx,&yy,&ww,&hh,&bb,&dd ) ;
00508 XGetWindowAttributes( display, rr , &xwat ) ;
00509 }
00510 if( xwat.depth == 0 ) return NULL ; /* bad news */
00511
00512 /*--- get information about the window's Visual ---*/
00513
00514 vinfo.visualid = XVisualIDFromVisual(xwat.visual) ;
00515 vin = XGetVisualInfo( display , VisualIDMask , &vinfo , &count ) ;
00516 if( count == 0 || vin == NULL ) return NULL ;
00517
00518 /*--- PseudoColor case ---*/
00519 #if defined(__cplusplus) || defined(c_plusplus)
00520 if( vin->c_class == PseudoColor ){
00521 #else
00522 if( vin->class == PseudoColor ){
00523 #endif
00524 int iz ;
00525
00526 /* create output */
00527
00528 cd = (X11_colordef *) malloc( sizeof(X11_colordef) ) ;
00529 cd->classKRH = PseudoColor ;
00530 cd->depth = vin->depth ;
00531
00532 /* get all the colors in the colormap */
00533
00534 count = vin->colormap_size ;
00535 xcol = (XColor *) malloc( sizeof(XColor) * count ) ;
00536 for( ii=0 ; ii < count ; ii++ ) xcol[ii].pixel = ii ;
00537
00538 XQueryColors( display , xwat.colormap , xcol , count ) ;
00539
00540 /* store them in the output, truncated to 8 bits */
00541
00542 cd->ncolors = count ;
00543 cd->rr = (unsigned char *) malloc( count ) ;
00544 cd->gg = (unsigned char *) malloc( count ) ;
00545 cd->bb = (unsigned char *) malloc( count ) ;
00546
00547 for( ii=0 ; ii < count ; ii++ ){
00548 cd->rr[ii] = xcol[ii].red >> 8 ;
00549 cd->gg[ii] = xcol[ii].green >> 8 ;
00550 cd->bb[ii] = xcol[ii].blue >> 8 ;
00551 }
00552
00553 /* find first all zero color; discard others at end of colormap */
00554
00555 for( iz=0 ; iz < count ; iz++ )
00556 if( cd->rr[iz] == 0 && cd->gg[iz] == 0 && cd->bb[iz] == 0 ) break ;
00557
00558 if( iz < count-1 ){ /* if found one before the end */
00559
00560 for( ii=count-1 ; ii > iz ; ii-- ) /* scan backwards */
00561 if( cd->rr[ii] != 0 || cd->gg[ii] != 0 || cd->bb[ii] != 0 ) break ;
00562
00563 count = ii+1 ; /* number of colors left */
00564
00565 if( count == 1 ){ /* colormap is all black?! */
00566 free(xcol) ; XFree(vin) ; FREE_X11_colordef(cd) ; return NULL ;
00567 }
00568
00569 cd->ncolors = count ;
00570 }
00571
00572 free(xcol) ; XFree(vin) ; return cd ;
00573 }
00574
00575 /*--- TrueColor case ---*/
00576 #if defined(__cplusplus) || defined(c_plusplus)
00577 if( vin->c_class == TrueColor ){
00578 #else
00579 if( vin->class == TrueColor ){
00580 #endif
00581
00582 /* create output */
00583
00584 cd = (X11_colordef *) malloc( sizeof(X11_colordef) ) ;
00585 cd->classKRH = TrueColor ;
00586 cd->depth = vin->depth ;
00587
00588 cd->rrmask = vin->red_mask ; /* bit masks for color */
00589 cd->ggmask = vin->green_mask ; /* storage inside pixel */
00590 cd->bbmask = vin->blue_mask ;
00591 cd->rrshift = 7 - highbit(cd->rrmask) ; /* shift puts high bit of */
00592 cd->ggshift = 7 - highbit(cd->ggmask) ; /* a color byte into place */
00593 cd->bbshift = 7 - highbit(cd->bbmask) ; /* +shift == >> ; - == << */
00594
00595 cd->rr = cd->gg = cd->bb = NULL ; /* not used */
00596
00597 XFree(vin) ; return cd ;
00598 }
00599
00600 /*--- Illegal Visual class! ---*/
00601
00602 XFree(vin) ; return NULL ;
00603 }
|
|
||||||||||||
|
Definition at line 624 of file plot_x11.c.
00625 {
00626 XdbeBackBufferAttributes * bat ;
00627 Window bw ;
00628
00629 if( w == (Window) 0 || use_xdbe <= 0 ) return w ;
00630
00631 bat = XdbeGetBackBufferAttributes( dpy , w ) ;
00632 bw = bat->window ; XFree(bat) ;
00633 if( bw == (Window) 0 ) bw = w ;
00634 return bw ;
00635 }
|
|
|
Definition at line 607 of file plot_x11.c.
00608 {
00609 int sss , ii , jj ;
00610 char * ec ;
00611
00612 if( use_xdbe >= 0 ) return ;
00613
00614 ec = getenv("AFNI_NO_XDBE") ; /* 28 Jan 2000 - add this environment variable */
00615 if( ec != NULL && (ec[0]=='Y' || ec[0]=='y') ){
00616 use_xdbe = 0 ;
00617 } else {
00618 sss = (int) XdbeQueryExtension( dpy , &ii , &jj ) ;
00619 use_xdbe = (sss != 0 ) ;
00620 }
00621 return ;
00622 }
|
|
||||||||||||
|
Definition at line 504 of file plot_cox.c.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 34 of file labmod.c.
00037 {
00038
00039 /* Modify the labels for the axes. Note that only the JSIZX and JSIZY */
00040 /* arguments are used in this call. The other arguments are retained */
00041 /* for compatibility with NCAR. */
00042 /* .......................................................................
00043 */
00044 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00045 */
00046
00047 /* Internal Data for PLOTPAK */
00048
00049 zzzplt_1.isizx = *jsizx;
00050 if (zzzplt_1.isizx <= 0) {
00051 zzzplt_1.isizx = 8;
00052 } else if (zzzplt_1.isizx == 1) {
00053 zzzplt_1.isizx = 12;
00054 } else if (zzzplt_1.isizx == 2) {
00055 zzzplt_1.isizx = 16;
00056 } else if (zzzplt_1.isizx == 3) {
00057 zzzplt_1.isizx = 24;
00058 }
00059
00060 zzzplt_1.isizy = *jsizy;
00061 if (zzzplt_1.isizy <= 0) {
00062 zzzplt_1.isizy = 8;
00063 } else if (zzzplt_1.isizy == 1) {
00064 zzzplt_1.isizy = 12;
00065 } else if (zzzplt_1.isizy == 2) {
00066 zzzplt_1.isizy = 16;
00067 } else if (zzzplt_1.isizy == 3) {
00068 zzzplt_1.isizy = 24;
00069 }
00070
00071 return 0;
00072 } /* labmod_ */
|
|
||||||||||||
|
Definition at line 195 of file pwritf.c.
00196 {
00197 /* System generated locals */
00198 integer ret_val;
00199
00200 /* Builtin functions */
00201 integer i_len(char *, ftnlen);
00202
00203 /* Local variables */
00204 static integer npos;
00205
00206
00207 /* Return the position of the last nonblank character in the input */
00208 /* character string. CLINE is CHARACTER*(*). Even if CLINE is all */
00209 /* blanks, LASTNB will be returned as 1 so that operations of the */
00210 /* form CLINE(1:LASTNB) won't be garbage. */
00211
00212
00213 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00214 */
00215
00216 /* Start at the end and work backwards until a nonblank is found. */
00217 /* Loop back to 100 to check position # NPOS each time. */
00218
00219 npos = i_len(cline, cline_len);
00220 L100:
00221 /* quit if at the beginning */
00222 if (npos <= 1) {
00223 goto L200;
00224 }
00225 /* quit if not a blank or a null */
00226 if (*(unsigned char *)&cline[npos - 1] != ' ' && *(unsigned char *)&cline[
00227 npos - 1] != '\0') {
00228 goto L200;
00229 }
00230 /* move back one position and try again */
00231 --npos;
00232 goto L100;
00233 /* .......................................................................
00234 */
00235 L200:
00236 ret_val = npos;
00237 return ret_val;
00238 } /* lastnb_ */
|
|
||||||||||||||||||||
|
Definition at line 11 of file line.c.
00012 {
00013 extern /* Subroutine */ int zzline_(real *, real *, real *, real *);
00014 static real xx1, xx2, yy1, yy2;
00015 extern /* Subroutine */ int zzphys_(real *, real *);
00016
00017
00018 /* Draw one line between given user coordinates. */
00019 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00020 */
00021 xx1 = *x1;
00022 yy1 = *y1;
00023 zzphys_(&xx1, &yy1);
00024 xx2 = *x2;
00025 yy2 = *y2;
00026 zzphys_(&xx2, &yy2);
00027
00028 zzline_(&xx1, &yy1, &xx2, &yy2);
00029
00030 return 0;
00031 } /* line_ */
|
|
||||||||||||
|
Definition at line 18 of file plot_ps2.c.
00019 {
00020 int ii , nline ;
00021 float old_thick , old_color , new_color , new_thick ;
00022 int x1,y1 , x2,y2 ;
00023 int skip ;
00024
00025 /*-- sanity checks --*/
00026
00027 if( fname == NULL || fname[0] == '\0' || mp == NULL ) return ;
00028
00029 nline = MEMPLOT_NLINE(mp) ; if( nline < 1 ) return ;
00030
00031 /*-- open the output file --*/
00032
00033 if( ! ps_openpl(fname) ) return ;
00034 ps_space( 0,0,PSIZE,PSIZE ) ;
00035
00036 old_color = -1.0 ;
00037 old_thick = -THCODE_INVALID ;
00038
00039 /*-- loop over lines, scale and plot --*/
00040
00041 for( ii=0 ; ii < nline ; ii++ ){
00042
00043 skip = 0 ;
00044
00045 /* check if need to change color or thickness of line */
00046
00047 new_color = MEMPLOT_COL(mp,ii) ;
00048 if( new_color != old_color ){
00049 float rr=COL_TO_RRR(new_color) ,
00050 gg=COL_TO_GGG(new_color) , bb=COL_TO_BBB(new_color) ;
00051 ps_setrgb( rr , gg , bb ) ;
00052 old_color = new_color ;
00053 }
00054 new_thick = MEMPLOT_TH(mp,ii) ;
00055 if( new_thick < 0.0 ){ /* 21 Mar 2001: negative thickness codes */
00056 int thc = (int)(-new_thick) ;
00057 switch( thc ){
00058 case THCODE_RECT:{ /* rectangle */
00059 x1 = 0.499 + PSIZE * (1.0 - MEMPLOT_Y1(mp,ii)) ;
00060 x2 = 0.499 + PSIZE * (1.0 - MEMPLOT_Y2(mp,ii)) ;
00061 y1 = 0.499 + PSIZE * MEMPLOT_X1(mp,ii) ;
00062 y2 = 0.499 + PSIZE * MEMPLOT_X2(mp,ii) ;
00063 ps_rect( x1,y1 , x2,y2 ) ;
00064 skip = 1 ;
00065 }
00066 break ;
00067
00068 case THCODE_CIRC:{ /* circle */
00069 x1 = 0.499 + PSIZE * (1.0 - MEMPLOT_Y1(mp,ii)) ;
00070 y1 = 0.499 + PSIZE * MEMPLOT_X1(mp,ii) ;
00071 x2 = 0.499 + PSIZE * MEMPLOT_X2(mp,ii) ;
00072 ps_circle( x1,y1 , x2 ) ;
00073 skip = 1 ;
00074 }
00075 break ;
00076 }
00077 } else if( new_thick != old_thick ){ /* old code to change line thickness */
00078 float th = PSIZE * new_thick ;
00079 if( th <= 0.0 ) th = 1.0 ;
00080 ps_setwidth( th ) ;
00081 old_thick = new_thick ;
00082 }
00083
00084 if( !skip ){
00085 /* scale coords (also see zzphph.f) */
00086
00087 x1 = 0.499 + PSIZE * (1.0 - MEMPLOT_Y1(mp,ii)) ;
00088 x2 = 0.499 + PSIZE * (1.0 - MEMPLOT_Y2(mp,ii)) ;
00089 y1 = 0.499 + PSIZE * MEMPLOT_X1(mp,ii) ;
00090 y2 = 0.499 + PSIZE * MEMPLOT_X2(mp,ii) ;
00091
00092 ps_line( x1,y1 , x2,y2 ) ;
00093 }
00094 }
00095
00096 /*-- done --*/
00097
00098 ps_closepl() ;
00099 return ;
00100 }
|
|
||||||||||||||||
|
Definition at line 437 of file coxplot/plot_motif.c.
00439 {
00440 Widget topshell , drawing , donebut , form , psfilebut , psprintbut ;
00441 MEM_topshell_data * mpcb ;
00442 int hmin=400 , wmin , ibut=0 , hh,ww,xx,yy ;
00443 char * prc , * ept ;
00444
00445 /* sanity check */
00446
00447 if( dpy == NULL || mp == NULL ) return NULL ;
00448
00449 mpcb = (MEM_topshell_data *) malloc( sizeof(MEM_topshell_data) ) ;
00450 mpcb->valid = 0 ;
00451
00452 #ifdef HAVE_XDBE
00453 init_XDBE(dpy) ; mpcb->have_xdbe = 0 ;
00454 #endif
00455
00456 wmin = MEMPLOT_ASPECT(mp) * hmin ;
00457
00458 /* 12 Oct 2000: a crude way to set the geometry of the popup */
00459
00460 decode_geom( getenv("AFNI_tsplotgeom") , &ww,&hh,&xx,&yy ) ;
00461 if( ww < wmin ) ww = wmin ;
00462 if( hh < hmin ) hh = hmin ;
00463
00464 /* shell to hold it all */
00465
00466 topshell = XtVaAppCreateShell(
00467 "AFNI" , "AFNI" , topLevelShellWidgetClass , dpy ,
00468 XmNborderWidth , 0 ,
00469 XmNminHeight , hmin , XmNheight , hh ,
00470 XmNminWidth , wmin , XmNwidth , ww ,
00471 XmNallowShellResize , False ,
00472 XmNinitialResourcesPersistent , False ,
00473 XmNdeleteResponse , XmDO_NOTHING , /* deletion handled below */
00474 NULL ) ;
00475
00476 XmAddWMProtocolCallback(
00477 topshell , XmInternAtom(dpy,"WM_DELETE_WINDOW",False) ,
00478 donebut_CB , (XtPointer) mpcb ) ;
00479
00480 mpcb->top = topshell ;
00481 mpcb->mp = mp ;
00482 mpcb->dial= NULL ;
00483 mpcb->wtf = NULL ;
00484
00485 mpcb->killfunc = kfun ;
00486
00487 /* form to manage it all */
00488
00489 #undef TIG
00490 #undef NBUT
00491 #define TIG 20
00492 #define NBUT 3
00493
00494 mpcb->form = form =
00495 XtVaCreateWidget( "dialog" , xmFormWidgetClass , topshell ,
00496 XmNborderWidth , 0 ,
00497 XmNfractionBase , TIG*NBUT - 1 ,
00498 XmNinitialResourcesPersistent , False ,
00499 NULL ) ;
00500
00501 /* buttons across the top */
00502
00503 if( redcolor == NULL ){ HOTCOLOR(form,redcolor) ; }
00504
00505 ibut = 0 ;
00506 psfilebut = XtVaCreateManagedWidget(
00507 "dialog" , xmPushButtonWidgetClass , form ,
00508 LABEL_ARG("PS->file") ,
00509 XmNtopAttachment , XmATTACH_FORM ,
00510
00511 XmNleftAttachment ,
00512 (ibut!=0) ? XmATTACH_POSITION : XmATTACH_FORM ,
00513 XmNleftPosition , ibut*TIG ,
00514
00515 XmNrightAttachment ,
00516 (ibut==NBUT-1) ? XmATTACH_FORM : XmATTACH_POSITION ,
00517 XmNrightPosition , ibut*TIG + (TIG-1) ,
00518
00519 XmNrecomputeSize , False ,
00520 XmNtraversalOn , False ,
00521 XmNinitialResourcesPersistent , False ,
00522 NULL ) ;
00523 XtAddCallback( psfilebut , XmNactivateCallback , psfile_CB , (XtPointer) mpcb ) ;
00524
00525 ibut++ ;
00526 psprintbut = XtVaCreateManagedWidget(
00527 "dialog" , xmPushButtonWidgetClass , form ,
00528 LABEL_ARG("->printer") ,
00529 XmNtopAttachment , XmATTACH_FORM ,
00530
00531 XmNleftAttachment ,
00532 (ibut!=0) ? XmATTACH_POSITION : XmATTACH_FORM ,
00533 XmNleftPosition , ibut*TIG ,
00534
00535 XmNrightAttachment ,
00536 (ibut==NBUT-1) ? XmATTACH_FORM : XmATTACH_POSITION ,
00537 XmNrightPosition , ibut*TIG + (TIG-1) ,
00538
00539 XmNrecomputeSize , False ,
00540 XmNtraversalOn , False ,
00541 XmNinitialResourcesPersistent , False ,
00542 NULL ) ;
00543 prc = getenv( "AFNI_PSPRINT" ) ;
00544 if( prc != NULL ){
00545 sprintf( print_command , "|%.250s" , prc ) ;
00546 XtAddCallback( psprintbut , XmNactivateCallback , psprint_CB , (XtPointer) mpcb ) ;
00547 } else {
00548 #if 0
00549 XtAddCallback( psprintbut , XmNactivateCallback , beep_CB ,
00550 (XtPointer) "*** AFNI_PSPRINT not defined - see README.environment" ) ;
00551 #else
00552 XtSetSensitive( psprintbut , False ) ; /* 05 Nov 2001 */
00553 #endif
00554 }
00555
00556 ibut++ ;
00557 donebut = XtVaCreateManagedWidget(
00558 "dialog" , xmPushButtonWidgetClass , form ,
00559 LABEL_ARG("Done") ,
00560 #if 1
00561 BGCOLOR_ARG(redcolor) ,
00562 #endif
00563
00564 XmNtopAttachment , XmATTACH_FORM ,
00565
00566 XmNleftAttachment ,
00567 (ibut!=0) ? XmATTACH_POSITION : XmATTACH_FORM ,
00568 XmNleftPosition , ibut*TIG ,
00569
00570 XmNrightAttachment ,
00571 (ibut==NBUT-1) ? XmATTACH_FORM : XmATTACH_POSITION ,
00572 XmNrightPosition , ibut*TIG + (TIG-1) ,
00573
00574 XmNrecomputeSize , False ,
00575 XmNtraversalOn , False ,
00576 XmNinitialResourcesPersistent , False ,
00577 NULL ) ;
00578 XtAddCallback( donebut , XmNactivateCallback , donebut_CB , (XtPointer) mpcb ) ;
00579
00580 /* drawing area to receive the picture */
00581
00582 drawing = XtVaCreateManagedWidget( "dialog" , xmDrawingAreaWidgetClass , form ,
00583 XmNtopAttachment , XmATTACH_WIDGET ,
00584 XmNtopWidget , donebut ,
00585 XmNleftAttachment , XmATTACH_FORM ,
00586 XmNrightAttachment , XmATTACH_FORM ,
00587 XmNbottomAttachment , XmATTACH_FORM ,
00588 XmNinitialResourcesPersistent , False ,
00589 NULL ) ;
00590
00591 XtAddCallback( drawing , XmNexposeCallback , expose_CB , (XtPointer) mpcb ) ;
00592 XtAddCallback( drawing , XmNresizeCallback , resize_CB , (XtPointer) mpcb ) ;
00593 XtAddCallback( drawing , XmNinputCallback , input_CB , (XtPointer) mpcb ) ;
00594
00595 /* finish the job */
00596
00597 XtVaSetValues( form , BGCOLOR_ARG("white") , NULL ) ;
00598
00599 if( xx >= 0 && yy >= 0 )
00600 XtVaSetValues( topshell , XmNx,xx , XmNy,yy , NULL ) ;
00601
00602 XtManageChild(form) ;
00603 XtRealizeWidget(topshell);
00604
00605 mpcb->valid = 1 ; mpcb->userdata = NULL ; mpcb->drawing = drawing ;
00606 return mpcb ;
00607 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 121 of file plot_x11.c.
00123 {
00124 int ii , nline , same ;
00125 float old_thick , old_color , new_color , new_thick ;
00126 float scal,xscal,yscal , xoff,yoff ;
00127 short x1,y1 , x2,y2 ; /* X11 screen coords are shorts */
00128 int skip ;
00129 int w_width, w_height, w_depth ; /* 12 Mar 2002 */
00130 XGCValues gcv ;
00131
00132 int freee = (mask & MEMPLOT_FREE_ASPECT) != 0 ; /* 16 Nov 2001 */
00133 int erase = (mask & MEMPLOT_ERASE ) != 0 ;
00134
00135 /*--- check for madness ---*/
00136
00137 if( dpy == NULL || w == (Window) 0 || mp == NULL ) return ;
00138 if( start < 0 ) start = 0 ;
00139
00140 nline = MEMPLOT_NLINE(mp) ;
00141 if( nline < 1 || start >= nline ) return ;
00142
00143 if( end <= start || end > nline ) end = nline ;
00144
00145 /*-- if we have a new X11 Display, get its coloring
00146 (note the tacit assumption that all windows on the same
00147 display in the same program will use the same visual and colormap!) --*/
00148
00149 setup_X11_plotting( dpy , w ) ;
00150
00151 /*-- 12 Mar 2002: replace use of XGetWindowAttributes with XGetGeometry --*/
00152
00153 drawable_geom( dpy, getwin_from_XDBE(dpy,w), &w_width,&w_height,&w_depth ) ;
00154
00155 if( w_depth != old_cd->depth ) return ; /* this is bad */
00156
00157 /*--- compute scaling from memplot objective
00158 coordinates to X11 window coordinates, maintaining aspect ---*/
00159
00160 if( box_xbot >= box_xtop || box_ybot >= box_ytop ){
00161
00162 xscal = (w_width -0.001) / mp->aspect ; /* aspect = x-axis objective size */
00163 yscal = (w_height-0.001) / 1.0 ; /* 1.0 = y-axis objective size */
00164 xoff = yoff = 0.0 ;
00165
00166 } else { /* 26 Feb 2001: scale to a given sub-box in the window */
00167
00168 xscal = box_xtop - box_xbot ;
00169 yscal = box_ytop - box_ybot ;
00170 xoff = box_xbot + 0.0 ;
00171 yoff = box_ybot + 0.0 ;
00172 }
00173
00174 if( !freee ){ /* no aspect freedom ==> */
00175 if( yscal < xscal ) xscal = yscal ; /* use smaller scaling */
00176 else yscal = xscal ;
00177 }
00178 scal = sqrt(fabs(xscal*yscal)) ;
00179
00180 old_color = -1.0 ; /* these don't occur naturally */
00181 old_thick = -THCODE_INVALID ;
00182
00183 if( erase ){ /* 16 Nov 2001: erase to white */
00184 float rr=1.0 , gg=1.0 , bb=1.0 ;
00185 unsigned long pix ;
00186 pix = rgb_to_pixel( ZO_TO_TFS(rr), ZO_TO_TFS(gg), ZO_TO_TFS(bb), old_cd ) ;
00187 XSetForeground( old_dpy , old_GC , pix ) ;
00188 }
00189
00190 /* 23 Feb 2003: initialize line width to 0 for each entry
00191 (in case a special case [box,circle, ...] comes first */
00192
00193 gcv.line_width = 0 ;
00194 gcv.join_style = JoinBevel ;
00195 XChangeGC( old_dpy , old_GC , GCLineWidth | GCJoinStyle , &gcv ) ;
00196
00197 /*--- loop over lines, scale and plot ---*/
00198
00199 for( ii=start ; ii < end ; ii++ ){
00200
00201 skip = 0 ;
00202
00203 /* check if need to change color or thickness of line */
00204
00205 new_color = MEMPLOT_COL(mp,ii) ;
00206 if( !erase && new_color != old_color ){
00207 float rr=COL_TO_RRR(new_color) ,
00208 gg=COL_TO_GGG(new_color) , bb=COL_TO_BBB(new_color) ;
00209 unsigned long pix ;
00210
00211 #if 0
00212 fprintf(stderr,"Changing color to %f %f %f\n",rr,gg,bb) ;
00213 #endif
00214
00215 draw_xseg() ; /* must draw before changing GC */
00216
00217 pix = rgb_to_pixel( ZO_TO_TFS(rr), ZO_TO_TFS(gg), ZO_TO_TFS(bb), old_cd ) ;
00218 XSetForeground( old_dpy , old_GC , pix ) ;
00219 old_color = new_color ;
00220 }
00221
00222 new_thick = MEMPLOT_TH(mp,ii) ;
00223 if( new_thick < 0.0 ){ /* 21 Mar 2001: negative thickness codes */
00224 int thc = (int)(-new_thick) ;
00225 switch( thc ){ /* default is to do nothing (e.g., thd = THCODE_INVALID) */
00226
00227 case THCODE_RECT:{ /* rectangle */
00228 short xb,yb , xt,yt ;
00229 unsigned short w,h ;
00230 x1 = (short)( xoff + xscal * MEMPLOT_X1(mp,ii) ) ;
00231 x2 = (short)( xoff + xscal * MEMPLOT_X2(mp,ii) ) ;
00232 y1 = (short)( yoff + yscal * (1.0 - MEMPLOT_Y1(mp,ii)) ) ;
00233 y2 = (short)( yoff + yscal * (1.0 - MEMPLOT_Y2(mp,ii)) ) ;
00234 if( x1 < x2 ){ xb=x1; xt=x2; } else { xb=x2; xt=x1; }
00235 if( y1 < y2 ){ yb=y1; yt=y2; } else { yb=y2; yt=y1; }
00236 w = xt-xb ; h = yt-yb ;
00237 if( w || h )
00238 #if 0
00239 XFillRectangle( old_dpy,old_w,old_GC , xb,yb,w,h ) ;
00240 #else
00241 XDrawRectangle( old_dpy,old_w,old_GC , xb,yb,w,h ) ;
00242 #endif
00243 else
00244 XDrawPoint( old_dpy,old_w,old_GC , xb,yb ) ;
00245 skip = 1 ;
00246 }
00247 break ;
00248
00249 case THCODE_CIRC:{ /* circle */
00250 int xcor,ycor , xcen,ycen , xrad,yrad ;
00251 unsigned int ww, hh ;
00252 xcen = (int)(xoff + xscal * MEMPLOT_X1(mp,ii) );
00253 ycen = (int)(yoff + yscal * (1.0 - MEMPLOT_Y1(mp,ii)) );
00254 xrad = (int)( xscal * MEMPLOT_X2(mp,ii) );
00255 yrad = (int)( yscal * MEMPLOT_X2(mp,ii) );
00256 xcor = xcen - xrad ; ww = 2*xrad ;
00257 ycor = ycen - yrad ; hh = 2*yrad ;
00258 if( ww || hh )
00259 XDrawArc( old_dpy,old_w,old_GC , xcor,ycor,ww,hh , 0,360*64 ) ;
00260 else
00261 XDrawPoint( old_dpy,old_w,old_GC , xcor,ycor ) ;
00262 skip = 1 ;
00263 }
00264 break ;
00265 }
00266
00267 } else if( new_thick != old_thick ){ /* normal case: change line thickness */
00268 int lw = scal * new_thick ;
00269 if( lw < 0 ) lw = 0 ;
00270 #if 0
00271 fprintf(stderr,"Changing thickness: old=%f new=%f\n",old_thick,new_thick) ;
00272 #endif
00273
00274 draw_xseg() ; /* must draw before changing GC */
00275
00276 gcv.line_width = lw ;
00277 gcv.join_style = JoinBevel ;
00278 XChangeGC( old_dpy , old_GC , GCLineWidth | GCJoinStyle , &gcv ) ;
00279 old_thick = new_thick ;
00280 }
00281
00282 if( nseg == LMAX ) draw_xseg() ; /* draw if list is full */
00283
00284 /* scale coords to X11 shorts (also see zzphph.f) */
00285 /* 26 Feb 2001: xoff,yoff are now variables, instead of 0.499 */
00286
00287 if( !skip ){
00288 x1 = (short)( xoff + xscal * MEMPLOT_X1(mp,ii) ) ;
00289 x2 = (short)( xoff + xscal * MEMPLOT_X2(mp,ii) ) ;
00290 y1 = (short)( yoff + yscal * (1.0 - MEMPLOT_Y1(mp,ii)) ) ;
00291 y2 = (short)( yoff + yscal * (1.0 - MEMPLOT_Y2(mp,ii)) ) ;
00292
00293 /* add to segment list */
00294
00295 xseg[nseg].x1 = x1 ; xseg[nseg].y1 = y1 ;
00296 xseg[nseg].x2 = x2 ; xseg[nseg].y2 = y2 ; nseg++ ;
00297 }
00298 }
00299
00300 /*-- process any segments left over --*/
00301
00302 draw_xseg() ;
00303 set_memplot_X11_box(0,0,0,0) ; /* 26 Feb 2001: clear box */
00304 return ;
00305 }
|
|
|
Definition at line 38 of file memplt.c.
00039 {
00040 extern /* Subroutine */ int setfrm_(real *, real *, real *, real *);
00041
00042
00043 /* Set the plotter to be the "memplot" C routines */
00044 /* .......................................................................
00045 */
00046 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00047 */
00048
00049 /* Internal Data for PLOTPAK */
00050
00051 zzpltr_1.xpscal = 1.f;
00052 zzpltr_1.ypscal = 1.f;
00053 zzpltr_1.iflip = 0;
00054 zzpltr_1.nplotr = 7;
00055 if (*aspect <= 0.f) {
00056 zzpltr_1.xphmax = 1.3f;
00057 } else {
00058 zzpltr_1.xphmax = *aspect;
00059 }
00060 zzpltr_1.yphmax = 1.f;
00061 setfrm_(&c_b2, &zzpltr_1.xphmax, &c_b2, &zzpltr_1.yphmax);
00062
00063 return 0;
00064 } /* memplt_ */
|
|
|
Definition at line 135 of file plot_cox.c.
00136 {
00137 MEM_plotdata * mp ;
00138 mp = find_memplot(NULL) ;
00139 if( mp == NULL ) return 0 ;
00140 return MEMPLOT_NLINE(mp) ;
00141 }
|
|
||||||||||||||||||||
|
Definition at line 38 of file perim.c.
00040 {
00041 extern /* Subroutine */ int zzperi_(integer *);
00042
00043
00044 /* Perimeter along the SET lines -- draw 4 axes -- no labels. */
00045 /* .......................................................................
00046 */
00047 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00048 */
00049
00050 /* Internal Data for PLOTPAK */
00051
00052 zzzplt_1.majrx = *mbx;
00053 zzzplt_1.minrx = *mlx;
00054 zzzplt_1.majry = *mby;
00055 zzzplt_1.minry = *mly;
00056
00057 /* Call perimeter routine with no labels. */
00058
00059 zzperi_(&c__0);
00060 return 0;
00061 } /* perim_ */
|
|
||||||||||||||||||||
|
Definition at line 38 of file periml.c.
00040 {
00041 extern /* Subroutine */ int zzperi_(integer *);
00042
00043
00044 /* Perimeter along the SET lines -- draw 4 axes -- with labels. */
00045 /* .......................................................................
00046 */
00047 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00048 */
00049
00050 /* Internal Data for PLOTPAK */
00051
00052 zzzplt_1.majrx = *mbx;
00053 zzzplt_1.minrx = *mlx;
00054 zzzplt_1.majry = *mby;
00055 zzzplt_1.minry = *mly;
00056
00057 /* Call perimeter routine with labels. */
00058
00059 zzperi_(&c__1);
00060 return 0;
00061 } /* periml_ */
|
|
||||||||||||||||||||||||
|
Definition at line 66 of file periml.c.
00068 {
00069 extern /* Subroutine */ int zzperi_(integer *);
00070
00071
00072 /* Perimeter along the SET lines -- draw 4 axes -- maybe with labels */
00073 /* .......................................................................
00074 */
00075 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00076 */
00077
00078 /* Internal Data for PLOTPAK */
00079
00080 zzzplt_1.majrx = *mbx;
00081 zzzplt_1.minrx = *mlx;
00082 zzzplt_1.majry = *mby;
00083 zzzplt_1.minry = *mly;
00084 zzperi_(ilab);
00085 return 0;
00086 } /* perimm_ */
|
|
||||||||||||
|
Definition at line 11 of file phdot.c.
00012 {
00013 extern /* Subroutine */ int zzphph_(real *, real *, real *, real *);
00014
00015
00016 /* Plot a physical coordinate dot (the cheap way). */
00017 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00018 */
00019 zzphph_(x1, y1, x1, y1);
00020 return 0;
00021 } /* phdot_ */
|
|
||||||||||||||||||||
|
Definition at line 20 of file phline.c.
00021 {
00022 /* System generated locals */
00023 real r__1, r__2;
00024
00025 /* Local variables */
00026 static real xleft;
00027 static integer id;
00028 static real dx1, dy1, dx2, dy2, dx3, dy3;
00029 extern /* Subroutine */ int zzphph_(real *, real *, real *, real *);
00030 static real fac, xyl;
00031
00032
00033 /* Draw a dashed line between 2 internal coordinate points; */
00034 /* replaces old PHLINE, which is now renamed ZZPHPH */
00035
00036 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00037 */
00038
00039 dx1 = *x1;
00040 dy1 = *y1;
00041 dx2 = *x2;
00042 dy2 = *y2;
00043
00044 if (zzdash_1.ndash <= 1) {
00045 zzphph_(&dx1, &dy1, &dx2, &dy2);
00046 goto L9000;
00047 }
00048
00049 L100:
00050 /* Computing 2nd power */
00051 r__1 = dx2 - dx1;
00052 /* Computing 2nd power */
00053 r__2 = dy2 - dy1;
00054 xyl = sqrt(r__1 * r__1 + r__2 * r__2);
00055 if (xyl <= 1e-5f) {
00056 goto L9000;
00057 }
00058 id = (integer) zzdash_1.xid + 1;
00059 xleft = (id - zzdash_1.xid) * (r__1 = zzdash_1.xldash[id - 1], dabs(r__1))
00060 ;
00061 if (xyl <= xleft) {
00062 if (zzdash_1.xldash[id - 1] > 0.f) {
00063 zzphph_(&dx1, &dy1, &dx2, &dy2);
00064 }
00065 zzdash_1.xid += xyl / (r__1 = zzdash_1.xldash[id - 1], dabs(r__1));
00066 goto L9000;
00067 } else {
00068 fac = xleft / xyl;
00069 dx3 = dx1 + fac * (dx2 - dx1);
00070 dy3 = dy1 + fac * (dy2 - dy1);
00071 if (zzdash_1.xldash[id - 1] > 0.f) {
00072 zzphph_(&dx1, &dy1, &dx3, &dy3);
00073 }
00074 dx1 = dx3;
00075 dy1 = dy3;
00076 zzdash_1.xid = (real) (id % zzdash_1.ndash);
00077 goto L100;
00078 }
00079
00080 L9000:
00081 return 0;
00082 } /* phline_ */
|
|
||||||||||||||||
|
Definition at line 229 of file plot_strip.c.
00230 {
00231 int ii , jj , yall , start , xx , nx , ny ;
00232 float pbot,ptop , xobot,xotop,yobot,yotop , yll,yhh ;
00233 float xbot,xtop , ybot,ytop ;
00234 float dxx , dyy ;
00235 float * ud ;
00236 MEM_plotdata *mplot ;
00237
00238 if( mp == NULL || mp->userdata == NULL ||
00239 !mp->valid || nadd <= 0 || y == NULL ) return ;
00240
00241 ud = (float *) mp->userdata ;
00242 xobot = ud[0] ; xotop = ud[1] ; yobot = ud[2] ; yotop = ud[3] ;
00243 xbot = ud[4] ; xtop = ud[5] ; ybot = ud[6] ; ytop = ud[7] ;
00244 ny = ud[8] ; yall = ud[9] ; start = ud[10]; xx = ud[11];
00245 nx = xtop ;
00246
00247 if( nadd > nx ) nadd = nx ; /* can't add too many points */
00248
00249 mplot = mp->mp ;
00250 ii = set_active_memplot( MEMPLOT_IDENT(mplot) ) ;
00251 if( ii != 0 ) return ;
00252
00253 dxx = 0.01*nx ;
00254
00255 /* last x-value plotted was at xx */
00256
00257 if( yall ){ /*-- all in one big happy box --*/
00258
00259 dyy = 0.01*(ytop-ybot) ;
00260
00261 plotpak_set( xobot,xotop , yobot,yotop , xbot,xtop , ybot,ytop , 1 ) ;
00262 set_thick_memplot( THIK ) ;
00263
00264 if( xx >= 0 ){ /* connect to last time in */
00265 for( jj=0 ; jj < ny ; jj++ ){
00266 insert_at_memplot( start + xx + jj*nx , mplot ) ;
00267 if( ud[12+jj] < WAY_BIG && y[jj][0] < WAY_BIG ){
00268 set_color_memplot( ccc[jj%NCLR][0], ccc[jj%NCLR][1], ccc[jj%NCLR][2] ) ;
00269 plotpak_line( xx , ud[12+jj] , xx+1 , y[jj][0] ) ;
00270 } else {
00271 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00272 }
00273 }
00274 xx++ ; if( xx == nx ) xx = 0 ; /* start plotting at next point */
00275
00276 } else { /* only happens 1st time in */
00277 xx = 0 ;
00278 }
00279
00280 for( ii=1 ; ii < nadd ; ii++ ){
00281 for( jj=0 ; jj < ny ; jj++ ){
00282 insert_at_memplot( start + xx + jj*nx , mplot ) ;
00283 if( y[jj][ii-1] < WAY_BIG && y[jj][ii] < WAY_BIG ){
00284 set_color_memplot( ccc[jj%NCLR][0],ccc[jj%NCLR][1],ccc[jj%NCLR][2] );
00285 plotpak_line( xx , y[jj][ii-1] , xx+1 , y[jj][ii] ) ;
00286 } else {
00287 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00288 }
00289 }
00290 xx++ ; if( xx == nx ) xx = 0 ;
00291 }
00292
00293 /* 16 Nov 2001: add X at the end */
00294
00295 set_thick_memplot( 2*THIK ) ;
00296
00297 ii = nadd-1 ;
00298 for( jj=0 ; jj < ny ; jj++ ){
00299 if( y[jj][ii] < WAY_BIG ){
00300 set_color_memplot( ccc[jj%NCLR][0],ccc[jj%NCLR][1],ccc[jj%NCLR][2] );
00301 insert_at_memplot( start + nx*ny + 2*jj , mplot ) ;
00302 plotpak_line( xx-dxx , y[jj][ii]-dyy , xx+dxx , y[jj][ii]+dyy ) ;
00303 insert_at_memplot( start + nx*ny + 2*jj+1 , mplot ) ;
00304 plotpak_line( xx-dxx , y[jj][ii]+dyy , xx+dxx , y[jj][ii]-dyy ) ;
00305 } else {
00306 insert_at_memplot( start + nx*ny + 2*jj , mplot ) ;
00307 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00308 insert_at_memplot( start + nx*ny + 2*jj+1 , mplot ) ;
00309 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00310 }
00311 }
00312
00313 } else { /*-- each in its own little sad box --*/
00314
00315 float dyo = (yotop-yobot) / ( (1.0+SY) * ny - SY ) ;
00316
00317 dyy = 0.01*(ytop-ybot)*ny ;
00318
00319 set_thick_memplot( THIK ) ;
00320
00321 if( xx >= 0 ){ /* connect to last time in */
00322 for( jj=0 ; jj < ny ; jj++ ){
00323 insert_at_memplot( start + xx + jj*nx , mplot ) ;
00324 if( ud[12+jj] < WAY_BIG && y[jj][0] < WAY_BIG ){
00325 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00326 plotpak_set( xobot,xotop , yll,yhh , xbot,xtop , ybot,ytop , 1 ) ;
00327 set_color_memplot( ccc[jj%NCLR][0], ccc[jj%NCLR][1], ccc[jj%NCLR][2] ) ;
00328 plotpak_line( xx , ud[12+jj] , xx+1 , y[jj][0] ) ;
00329 } else {
00330 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00331 }
00332 }
00333 xx++ ; if( xx == nx ) xx = 0 ; /* start plotting at next point */
00334
00335 } else { /* only happens 1st time in */
00336 xx = 0 ;
00337 }
00338
00339 for( ii=1 ; ii < nadd ; ii++ ){
00340 for( jj=0 ; jj < ny ; jj++ ){
00341 insert_at_memplot( start + xx + jj*nx , mplot ) ;
00342 if( y[jj][ii-1] < WAY_BIG && y[jj][ii] < WAY_BIG ){
00343 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00344 plotpak_set( xobot,xotop , yll,yhh , xbot,xtop , ybot,ytop , 1 ) ;
00345 set_color_memplot( ccc[jj%NCLR][0],ccc[jj%NCLR][1],ccc[jj%NCLR][2] );
00346 plotpak_line( xx , y[jj][ii-1] , xx+1 , y[jj][ii] ) ;
00347 } else {
00348 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00349 }
00350 }
00351 xx++ ; if( xx == nx ) xx = 0 ;
00352 }
00353
00354 /* 16 Nov 2001: add X at the end */
00355
00356 set_thick_memplot( 2*THIK ) ;
00357
00358 ii = nadd-1 ;
00359 for( jj=0 ; jj < ny ; jj++ ){
00360 if( y[jj][ii] < WAY_BIG ){
00361 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00362 plotpak_set( xobot,xotop , yll,yhh , xbot,xtop , ybot,ytop , 1 ) ;
00363 set_color_memplot( ccc[jj%NCLR][0],ccc[jj%NCLR][1],ccc[jj%NCLR][2] );
00364 insert_at_memplot( start + nx*ny + 2*jj , mplot ) ;
00365 plotpak_line( xx-dxx , y[jj][ii]-dyy , xx+dxx , y[jj][ii]+dyy ) ;
00366 insert_at_memplot( start + nx*ny + 2*jj+1 , mplot ) ;
00367 plotpak_line( xx-dxx , y[jj][ii]+dyy , xx+dxx , y[jj][ii]-dyy ) ;
00368 } else {
00369 insert_at_memplot( start + nx*ny + 2*jj , mplot ) ;
00370 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00371 insert_at_memplot( start + nx*ny + 2*jj+1 , mplot ) ;
00372 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00373 }
00374 }
00375
00376 }
00377
00378 /*- reset plot parameters -*/
00379
00380 insert_at_memplot( -1 , mplot ) ;
00381 set_thick_memplot( 0.0 ) ;
00382 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00383
00384 /*- redisplay the plot (all of it, Frank) -*/
00385
00386 redraw_topshell( mp ) ;
00387
00388 /*- save some stuff for next time in -*/
00389
00390 ud[11] = xx ; /* last x index plotted */
00391 for( jj=0 ; jj < ny ; jj++ ) /* last y values plotted */
00392 ud[12+jj] = y[jj][nadd-1] ;
00393
00394 return ;
00395 }
|
|
|
Definition at line 402 of file plot_strip.c.
00403 {
00404 int ii , jj , start , nx , ny ;
00405 float * ud ;
00406 MEM_plotdata *mplot ;
00407
00408 if( mp == NULL || mp->userdata == NULL || !mp->valid ) return ;
00409
00410 ud = (float *) mp->userdata ;
00411 nx = ud[5] ; ny = ud[8] ; start = ud[10] ;
00412
00413 mplot = mp->mp ;
00414
00415 for( jj=0 ; jj < ny ; jj++ ){
00416
00417 for( ii=0 ; ii < nx ; ii++ ){ /* clear graph lines */
00418 insert_at_memplot( start + ii + jj*nx , mplot ) ;
00419 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00420 }
00421 /* clear X */
00422 insert_at_memplot( start + nx*ny + 2*jj , mplot ) ;
00423 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00424 insert_at_memplot( start + nx*ny + 2*jj+1 , mplot ) ;
00425 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00426 }
00427
00428 insert_at_memplot( -1 , mplot ) ; /* reset to normal insertion */
00429 redraw_topshell( mp ) ;
00430
00431 ud[11] = -1 ; /* reset current x index */
00432 return ;
00433 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 45 of file plot_strip.c.
00051 {
00052 int ii , jj , np , nnax,nnay , mmax,mmay , yall ;
00053 float pbot,ptop , xobot,xotop,yobot,yotop , yll,yhh ;
00054 char str[32] ;
00055 float *ud ;
00056 MEM_topshell_data * mp ;
00057 MEM_plotdata * mplot ;
00058
00059 /*-- sanity check --*/
00060
00061 if( dpy == NULL || ny == 0 || nx < 9 || ybot >= ytop ) return NULL ;
00062
00063 if( dx <= 0.0 ) dx = 1.0 ;
00064
00065 yall = (ny > 0) ; if( !yall ) ny = -ny ; if( ny == 1 ) yall = 1 ;
00066
00067 /*-- data ranges --*/
00068
00069 ptop = p10(nx) ;
00070 nnax = rint(nx/ptop) ;
00071 if( nnax == 1 ) nnax = 10 ;
00072 mmax = (nnax < 3) ? 10
00073 : (nnax < 6) ? 5 : 2 ;
00074
00075 pbot = p10(ybot) ; ptop = p10(ytop) ; if( ptop < pbot ) ptop = pbot ;
00076 nnay = rint((ytop-ybot)/ptop) ;
00077 if( nnay == 1 ) nnay = 10 ;
00078 mmay = (nnay < 3) ? 10
00079 : (nnay < 6) ? 5 : 2 ;
00080
00081 /*-- setup to plot --*/
00082
00083 create_memplot_surely( "Striplot" , 1.3 ) ;
00084 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00085 set_thick_memplot( 0.0 ) ;
00086 mplot = get_active_memplot() ;
00087
00088 /*-- plot labels, if any --*/
00089
00090 xobot = 0.15 ; xotop = 1.27 ; /* set objective size of plot */
00091 yobot = 0.1 ; yotop = 0.95 ;
00092
00093 if( STGOOD(lab_top) ){ yotop -= 0.02 ; yobot -= 0.01 ; }
00094 if( nam_yyy != NULL ){ xotop -= 0.16 ; xobot -= 0.02 ; }
00095
00096 /* x-axis label? */
00097
00098 if( STGOOD(lab_xxx) )
00099 plotpak_pwritf( 0.5*(xobot+xotop) , yobot-0.06 , lab_xxx , 16 , 0 , 0 ) ;
00100
00101 /* y-axis label? */
00102
00103 if( STGOOD(lab_yyy) )
00104 plotpak_pwritf( xobot-0.10 , 0.5*(yobot+yotop) , lab_yyy , 16 , 90 , 0 ) ;
00105
00106 /* label at top? */
00107
00108 if( STGOOD(lab_top) )
00109 plotpak_pwritf( xobot+0.01 , yotop+0.01 , lab_top , 18 , 0 , -2 ) ;
00110
00111 /*-- plot all on same vertical scale --*/
00112
00113 if( yall ){
00114
00115 /* do name labels at right? */
00116
00117 if( nam_yyy != NULL ){
00118 float yv = yotop ; int sz ;
00119
00120 for( jj=0 ; jj < ny ; jj++ ){
00121 if( STGOOD(nam_yyy[jj]) ){
00122 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00123 set_thick_memplot( 2*THIK ) ;
00124 plotpak_line( xotop+0.008 , yv , xotop+0.042 , yv ) ;
00125 set_thick_memplot( 0.0 ) ;
00126 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00127 sz = (strlen(nam_yyy[jj]) <= 10) ? 12 : 10 ;
00128 plotpak_pwritf( xotop+0.048 , yv , nam_yyy[jj] , sz , 0 , -1 ) ;
00129 yv -= 0.05 ;
00130 }
00131 }
00132 }
00133
00134 /* plot axes */
00135
00136 plotpak_set( xobot,xotop , yobot,yotop , 0.0,nx*dx , ybot,ytop , 1 ) ;
00137 plotpak_periml( nnax,mmax , nnay,mmay ) ;
00138
00139 } else { /*-- plot each on separate vertical scale --*/
00140
00141 float dyo = (yotop-yobot) / ( (1.0+SY) * ny - SY ) ;
00142
00143 /* name labels at right? */
00144
00145 if( nam_yyy != NULL ){
00146 float yv = yotop ; int sz ;
00147
00148 for( jj=0 ; jj < ny ; jj++ ){
00149 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00150 if( STGOOD(nam_yyy[jj]) ){
00151 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00152 set_thick_memplot( 2*THIK ) ;
00153 yv = 0.7*yhh + 0.3*yll ;
00154 plotpak_line( xotop+0.008 , yv , xotop+0.042 , yv ) ;
00155 set_thick_memplot( 0.0 ) ;
00156 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00157 sz = (strlen(nam_yyy[jj]) <= 10) ? 12 : 10 ;
00158 plotpak_pwritf( xotop+0.048 , yv , nam_yyy[jj] , sz , 0 , -1 ) ;
00159 }
00160 }
00161 }
00162
00163 /* data each in its own box */
00164
00165 nnay = 1 ;
00166 pbot = p10(ybot) ; ptop = p10(ytop) ;
00167 if( ptop > pbot && pbot > 0.0 ) ptop = pbot ;
00168 if( ptop != 0.0 ) mmay = floor( (ytop-ybot) / ptop + 0.5 ) ;
00169 else mmay = 5 ; /* shouldn't happen */
00170
00171 if( mmay == 1 ) mmay = 5 ;
00172 else if( mmay == 2 ) mmay = 4 ;
00173 else if( mmay == 3 ) mmay = 6 ;
00174
00175 for( jj=ny-1 ; jj >= 0 ; jj-- ){
00176 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00177
00178 plotpak_set( xobot,xotop , yll,yhh , 0.0,nx*dx , ybot,ytop , 1 ) ;
00179
00180 plotpak_perimm( nnax,mmax , nnay,mmay , (jj==0) ? 1 : 3 ) ;
00181 if( ybot < 0.0 && ytop > 0.0 ){
00182 plotpak_setlin(5) ;
00183 plotpak_line( 0.0,0.0 , nx*dx,0.0 ) ;
00184 plotpak_setlin(1) ;
00185 }
00186 }
00187 }
00188
00189 /*-- open display for this plot --*/
00190
00191 mp = memplot_to_topshell( dpy , mplot , killfunc ) ;
00192 if( mp == NULL ) return NULL ;
00193
00194 /*-- auxiliary data needed by addto --*/
00195
00196 ud = (float *) calloc( (12+ny) , sizeof(float) ) ;
00197 ud[0] = xobot ; ud[1] = xotop ; ud[2] = yobot ; ud[3] = yotop ;
00198 ud[4] = 0.0 ; ud[5] = nx ; ud[6] = ybot ; ud[7] = ytop ;
00199 ud[8] = ny ; ud[9] = yall ;
00200
00201 ud[10] = MEMPLOT_NLINE(mplot) ; /* number of init lines */
00202 ud[11] = -1 ; /* current x position */
00203
00204 mp->userdata = ud ;
00205
00206 /*-- plot invalid lines, to be replaced later with valid lines --*/
00207
00208 /* line connecting ii to ii+1 at the jj-th y level
00209 is number ud[10] + ii + jj*nx in the memplot structure */
00210
00211 for( jj=0 ; jj < ny ; jj++ )
00212 for( ii=0 ; ii < nx ; ii++ )
00213 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00214
00215 /* and two more for each y (an X at the current point):
00216 X for the jj-th y level is the two lines numbered
00217 ud[10] + nx*ny + 2*jj and ud[10] + nx*ny + 2*jj+1 */
00218
00219 for( jj=0 ; jj < 2*ny ; jj++ )
00220 ADDTO_MEMPLOT( mplot , 0.0,0.0,0.0,0.0,0.0,-THCODE_INVALID ) ;
00221
00222 /*-- exit, stage left --*/
00223
00224 return mp ;
00225 }
|
|
||||||||||||||||||||||||
|
Definition at line 639 of file plot_ts.c.
00641 {
00642 int ii , jj , yall , start ;
00643 float pbot,ptop , xobot,xotop,yobot,yotop , yll,yhh ;
00644 float xbot,xtop , ybot,ytop ;
00645 float * yy , * xx ;
00646 float * ud ;
00647
00648 if( mp == NULL || mp->userdata == NULL || ! mp->valid ||
00649 nx <= 1 || ny == 0 || x == NULL || y == NULL ) return ;
00650
00651 init_colors() ;
00652
00653 ud = (float *) mp->userdata ;
00654 xobot = ud[0] ; xotop = ud[1] ; yobot = ud[2] ; yotop = ud[3] ;
00655 xbot = ud[4] ; xtop = ud[5] ; ybot = ud[6] ; ytop = ud[7] ;
00656
00657 yall = (ny > 0) ; if( !yall ) ny = -ny ;
00658
00659 ii = set_active_memplot( MEMPLOT_IDENT(mp->mp) ) ;
00660 if( ii != 0 ) return ;
00661
00662 start = MEMPLOT_NLINE(mp->mp) ;
00663 xx = x ;
00664
00665 if( yall ){ /*-- all in one big happy box --*/
00666
00667 plotpak_set( xobot,xotop , yobot,yotop , xbot,xtop , ybot,ytop , 1 ) ;
00668 set_thick_memplot( THIK ) ;
00669
00670 /* plot data */
00671
00672 for( jj=0 ; jj < ny ; jj++ ){
00673 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00674
00675 yy = y[jj] ;
00676 for( ii=1 ; ii < nx ; ii++ ){
00677 if( xx[ii-1] < WAY_BIG && xx[ii] < WAY_BIG &&
00678 yy[ii-1] < WAY_BIG && yy[ii] < WAY_BIG )
00679
00680 plotpak_line( xx[ii-1] , yy[ii-1] , xx[ii] , yy[ii] ) ;
00681 }
00682 }
00683 set_thick_memplot( 0.0 ) ;
00684 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00685
00686 } else { /*-- each in its own little sad box --*/
00687
00688 float dyo = (yotop-yobot) / ( (1.0+SY) * ny - SY ) ;
00689
00690 set_thick_memplot( THIK ) ;
00691
00692 for( jj=ny-1 ; jj >= 0 ; jj-- ){
00693 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00694 plotpak_set( xobot,xotop , yll,yhh , xbot,xtop , ybot,ytop , 1 ) ;
00695 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00696
00697 yy = y[jj] ;
00698 for( ii=1 ; ii < nx ; ii++ ){
00699 if( xx[ii-1] < WAY_BIG && xx[ii] < WAY_BIG &&
00700 yy[ii-1] < WAY_BIG && yy[ii] < WAY_BIG )
00701
00702 plotpak_line( xx[ii-1] , yy[ii-1] , xx[ii] , yy[ii] ) ;
00703 }
00704 }
00705 set_thick_memplot( 0.0 ) ;
00706 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00707 }
00708
00709 memplot_to_X11_sef( XtDisplay(mp->drawing) , XtWindow(mp->drawing) ,
00710 mp->mp , start,0,MEMPLOT_FREE_ASPECT ) ;
00711
00712 return ;
00713 }
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 448 of file plot_ts.c.
00454 {
00455 int ii , jj , np , nnax,nnay , mmax,mmay , yall ;
00456 float pbot,ptop , xobot,xotop,yobot,yotop , yll,yhh ;
00457 char str[32] ;
00458 float * ud ;
00459 MEM_topshell_data * mp ;
00460
00461 /*-- sanity check --*/
00462
00463 if( dpy == NULL || ny == 0 || xbot >= xtop || ybot >= ytop ) return NULL ;
00464
00465 init_colors() ;
00466
00467 /*-- push range of x outwards --*/
00468
00469 pbot = p10(xbot) ; ptop = p10(xtop) ; if( ptop < pbot ) ptop = pbot ;
00470 if( ptop != 0.0 && xpush ){
00471 np = (xtop-xbot) / ptop ;
00472 switch( np ){
00473 case 1: ptop *= 0.1 ; break ;
00474 case 2: ptop *= 0.2 ; break ;
00475 case 3: ptop *= 0.25 ; break ;
00476 case 4:
00477 case 5: ptop *= 0.5 ; break ;
00478 }
00479 xbot = floor( xbot/ptop ) * ptop ;
00480 xtop = ceil( xtop/ptop ) * ptop ;
00481 nnax = floor( (xtop-xbot) / ptop + 0.5 ) ;
00482 mmax = (nnax < 3) ? 10
00483 : (nnax < 6) ? 5 : 2 ;
00484 } else {
00485 nnax = 1 ; mmax = 10 ;
00486 ii = (int)rint(xtop-xbot) ;
00487 if( fabs(xtop-xbot-ii) < 0.01 && ii <= 200 ) mmax = ii ;
00488 }
00489
00490 /*-- push range of y outwards --*/
00491
00492 yall = (ny > 0) ; if( !yall ) ny = -ny ;
00493
00494 pbot = p10(ybot) ; ptop = p10(ytop) ; if( ptop < pbot ) ptop = pbot ;
00495 if( ptop != 0.0 && ypush ){
00496 np = (ytop-ybot) / ptop ;
00497 switch( np ){
00498 case 1: ptop *= 0.1 ; break ;
00499 case 2: ptop *= 0.2 ; break ;
00500 case 3: ptop *= 0.25 ; break ;
00501 case 4:
00502 case 5: ptop *= 0.5 ; break ;
00503 }
00504 ybot = floor( ybot/ptop ) * ptop ;
00505 ytop = ceil( ytop/ptop ) * ptop ;
00506 nnay = floor( (ytop-ybot) / ptop + 0.5 ) ;
00507 mmay = (nnay < 3) ? 10
00508 : (nnay < 6) ? 5 : 2 ;
00509 } else {
00510 nnay = 1 ; mmay = 10 ;
00511 }
00512
00513 /*-- setup to plot --*/
00514
00515 create_memplot_surely( "Tsplot" , 1.3 ) ;
00516 set_thick_memplot( 0.5*THIK ) ;
00517
00518 /*-- plot labels, if any --*/
00519
00520 xobot = 0.15 ; xotop = 1.27 ; /* set objective size of plot */
00521 yobot = 0.1 ; yotop = 0.95 ;
00522
00523 if( STGOOD(lab_top) ){ yotop -= 0.02 ; yobot -= 0.01 ; }
00524 if( nam_yyy != NULL ){ xotop -= 0.16 ; xobot -= 0.02 ; }
00525
00526 /* x-axis label? */
00527
00528 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00529 if( STGOOD(lab_xxx) )
00530 plotpak_pwritf( 0.5*(xobot+xotop) , yobot-0.06 , lab_xxx , 16 , 0 , 0 ) ;
00531
00532 /* y-axis label? */
00533
00534 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00535 if( STGOOD(lab_yyy) )
00536 plotpak_pwritf( xobot-0.10 , 0.5*(yobot+yotop) , lab_yyy , 16 , 90 , 0 ) ;
00537
00538 /* label at top? */
00539
00540 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00541 if( STGOOD(lab_top) )
00542 plotpak_pwritf( xobot+0.01 , yotop+0.01 , lab_top , 18 , 0 , -2 ) ;
00543
00544 /*-- plot all on same vertical scale --*/
00545
00546 ud = (float *) malloc( sizeof(float) * 8 ) ;
00547 ud[0] = xobot ; ud[1] = xotop ; ud[2] = yobot ; ud[3] = yotop ;
00548 ud[4] = xbot ; ud[5] = xtop ; ud[6] = ybot ; ud[7] = ytop ;
00549
00550 if( yall ){
00551
00552 /* do name labels at right? */
00553
00554 if( nam_yyy != NULL ){
00555 float yv = yotop ; int sz ;
00556
00557 for( jj=0 ; jj < ny ; jj++ ){
00558 if( STGOOD(nam_yyy[jj]) ){
00559 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00560 set_thick_memplot( 2*THIK ) ;
00561 plotpak_line( xotop+0.008 , yv , xotop+0.042 , yv ) ;
00562 set_thick_memplot( 0.5*THIK ) ;
00563 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00564 sz = (strlen(nam_yyy[jj]) <= 10) ? 12 : 10 ;
00565 plotpak_pwritf( xotop+0.048 , yv , nam_yyy[jj] , sz , 0 , -1 ) ;
00566 yv -= 0.05 ;
00567 }
00568 }
00569 }
00570
00571 /* plot axes */
00572
00573 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00574 plotpak_set( xobot,xotop , yobot,yotop , xbot,xtop , ybot,ytop , 1 ) ;
00575 plotpak_perimm( nnax,mmax , nnay,mmay , ilab[(nnax>0)+2*(nnay>0)] ) ;
00576
00577 } else { /*-- plot each on separate vertical scale --*/
00578
00579 float dyo = (yotop-yobot) / ( (1.0+SY) * ny - SY ) ;
00580
00581 /* name labels at right? */
00582
00583 if( nam_yyy != NULL ){
00584 float yv = yotop ; int sz ;
00585
00586 for( jj=0 ; jj < ny ; jj++ ){
00587 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00588 if( STGOOD(nam_yyy[jj]) ){
00589 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00590 set_thick_memplot( 2*THIK ) ;
00591 yv = 0.7*yhh + 0.3*yll ;
00592 plotpak_line( xotop+0.008 , yv , xotop+0.042 , yv ) ;
00593 set_thick_memplot( 0.5*THIK ) ;
00594 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00595 sz = (strlen(nam_yyy[jj]) <= 10) ? 12 : 10 ;
00596 plotpak_pwritf( xotop+0.048 , yv , nam_yyy[jj] , sz , 0 , -1 ) ;
00597 }
00598 }
00599 }
00600
00601 /* data each in its own box */
00602
00603 nnay = 1 ;
00604 pbot = p10(ybot) ; ptop = p10(ytop) ;
00605 if( ptop > pbot && pbot > 0.0 ) ptop = pbot ;
00606 if( ptop != 0.0 ) mmay = floor( (ytop-ybot) / ptop + 0.5 ) ;
00607 else mmay = 5 ; /* shouldn't happen */
00608
00609 if( mmay == 1 ) mmay = 5 ;
00610 else if( mmay == 2 ) mmay = 4 ;
00611 else if( mmay == 3 ) mmay = 6 ;
00612
00613 for( jj=ny-1 ; jj >= 0 ; jj-- ){
00614 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00615 plotpak_set( xobot,xotop , yll,yhh , xbot,xtop , ybot,ytop , 1 ) ;
00616 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00617 plotpak_perimm( nnax,mmax , nnay,mmay , ilab[(nnax>0)*(jj==0)+2*(nnay>0)] ) ;
00618 if( ybot < 0.0 && ytop > 0.0 ){
00619 plotpak_setlin(5) ;
00620 plotpak_line( xbot,0.0 , xtop,0.0 ) ;
00621 plotpak_setlin(1) ;
00622 }
00623 }
00624 }
00625
00626 /*-- display --*/
00627
00628 mp = memplot_to_topshell( dpy , get_active_memplot() , killfunc ) ;
00629 if( mp == NULL ){ free(ud) ; return NULL; }
00630 mp->userdata = ud ;
00631
00632 /*-- exit, stage left --*/
00633
00634 return mp ;
00635 }
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Definition at line 411 of file plot_ts.c.
00415 {
00416 MEM_plotdata * mp ;
00417 int ymask = 0 ;
00418
00419 if( dpy == NULL ) return ;
00420
00421 if( ny < 0 ){ ymask = TSP_SEPARATE_YBOX ; ny = -ny ; }
00422
00423 mp = plot_ts_mem( nx,x , ny,ymask,y , lab_xxx , lab_yyy , lab_top , nam_yyy ) ;
00424 if( mp != NULL )
00425 (void) memplot_to_topshell( dpy , mp , killfunc ) ;
00426
00427 return ;
00428 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
21 Apr 2005: check alternatives * Definition at line 112 of file plot_ts.c.
00115 {
00116 int ii , jj , np , nnax,nnay , mmax,mmay ;
00117 float *xx , *yy ;
00118 float xbot,xtop , ybot,ytop , pbot,ptop , xobot,xotop,yobot,yotop ;
00119 char str[32] ;
00120 int yall , ysep ;
00121 float *ylo , *yhi , yll,yhh ;
00122 MEM_plotdata *mp ;
00123
00124 /*-- sanity check --*/
00125
00126 if( nx <= 1 || ny == 0 || y == NULL ) return NULL ;
00127
00128 init_colors() ;
00129
00130 /*-- make up an x-axis if none given --*/
00131
00132 if( x == NULL ){
00133 xx = (float *) malloc( sizeof(float) * nx ) ;
00134 for( ii=0 ; ii < nx ; ii++ ) xx[ii] = ii ;
00135 xbot = 0 ; xtop = nx-1 ;
00136 } else {
00137 xx = x ;
00138 xbot = WAY_BIG ; xtop = -WAY_BIG ;
00139 for( ii=0 ; ii < nx ; ii++ ){
00140 if( xx[ii] < xbot && xx[ii] < WAY_BIG ) xbot = xx[ii] ;
00141 if( xx[ii] > xtop && xx[ii] < WAY_BIG ) xtop = xx[ii] ;
00142 }
00143 if( xbot >= xtop ) return NULL ;
00144 }
00145
00146 /*-- push range of x outwards --*/
00147
00148 pbot = p10(xbot) ; ptop = p10(xtop) ; if( ptop < pbot ) ptop = pbot ;
00149 if( nnaxx >= 0 ){
00150 nnax = nnaxx ; nnaxx = -1 ;
00151 mmax = mmaxx ;
00152 xbot = xxbot ;
00153 xtop = xxtop ;
00154 } else if( ptop != 0.0 && xpush ){
00155 np = (xtop-xbot) / ptop ;
00156 switch( np ){
00157 case 1: ptop *= 0.1 ; break ;
00158 case 2: ptop *= 0.2 ; break ;
00159 case 3: ptop *= 0.25 ; break ;
00160 case 4:
00161 case 5: ptop *= 0.5 ; break ;
00162 }
00163 xbot = floor( xbot/ptop ) * ptop ;
00164 xtop = ceil( xtop/ptop ) * ptop ;
00165 nnax = floor( (xtop-xbot) / ptop + 0.5 ) ;
00166 mmax = (nnax < 3) ? 10
00167 : (nnax < 6) ? 5 : 2 ;
00168 } else {
00169 nnax = 1 ; mmax = 10 ;
00170 ii = (int)rint(xtop-xbot) ;
00171 if( fabs(xtop-xbot-ii) < 0.01 && ii <= 200 ) mmax = ii ;
00172 }
00173
00174 /*-- find range of y --*/
00175
00176 yall = (ny == 1) || ((ymask & TSP_SEPARATE_YBOX) == 0) ;
00177 ysep = (ymask & TSP_SEPARATE_YSCALE) != 0 ;
00178 /* Nov 1998: find range of */
00179 ylo = (float *) malloc(sizeof(float)*ny) ; /* each array separately. */
00180 yhi = (float *) malloc(sizeof(float)*ny) ;
00181
00182 ybot = WAY_BIG ; ytop = -WAY_BIG ;
00183 for( jj=0 ; jj < ny ; jj++ ){
00184 yy = y[jj] ; yll = WAY_BIG ; yhh = -WAY_BIG ;
00185 for( ii=0 ; ii < nx ; ii++ ){
00186 if( yy[ii] < yll && yy[ii] < WAY_BIG ) yll = yy[ii] ;
00187 if( yy[ii] > yhh && yy[ii] < WAY_BIG ) yhh = yy[ii] ;
00188 }
00189 ylo[jj] = yll ; yhi[jj] = yhh ;
00190 if( ybot > yll ) ybot = yll ;
00191 if( ytop < yhh ) ytop = yhh ;
00192 if( yll >= yhh ){ /* shouldn't happen */
00193 yhh = yll + 0.05*fabs(yll) + 0.5 ;
00194 yll = yll - 0.05*fabs(yll) - 0.5 ;
00195 ylo[jj] = yll ; yhi[jj] = yhh ;
00196 }
00197 }
00198 if( ybot >= ytop ){ /* shouldn't happen */
00199 ytop = ybot + 0.05*fabs(ybot) + 0.5 ;
00200 ybot = ybot - 0.05*fabs(ybot) - 0.5 ;
00201 }
00202
00203 /* 30 Dec 1998 */
00204
00205 if( !ysep ){
00206 for( jj=0 ; jj < ny ; jj++ ){ ylo[jj] = ybot ; yhi[jj] = ytop ; }
00207 }
00208
00209 /*-- push range of y outwards --*/
00210
00211 pbot = p10(ybot) ; ptop = p10(ytop) ; if( ptop < pbot ) ptop = pbot ;
00212 if( nnayy >= 0 ){
00213 nnay = nnayy ; nnayy = -1 ;
00214 mmay = mmayy ;
00215 ybot = yybot ;
00216 ytop = yytop ;
00217 for( jj=0 ; jj < ny ; jj++ ){ ylo[jj] = ybot ; yhi[jj] = ytop ; }
00218 } else if( ptop != 0.0 && ypush ){
00219 np = (ytop-ybot) / ptop ;
00220 switch( np ){
00221 case 1: ptop *= 0.1 ; break ;
00222 case 2: ptop *= 0.2 ; break ;
00223 case 3: ptop *= 0.25 ; break ;
00224 case 4:
00225 case 5: ptop *= 0.5 ; break ;
00226 }
00227 ybot = floor( ybot/ptop ) * ptop ;
00228 ytop = ceil( ytop/ptop ) * ptop ;
00229 nnay = floor( (ytop-ybot) / ptop + 0.5 ) ;
00230 mmay = (nnay < 3) ? 10
00231 : (nnay < 6) ? 5 : 2 ;
00232 } else {
00233 nnay = 1 ; mmay = 10 ;
00234 }
00235
00236 for( jj=0 ; jj < ny ; jj++ ){
00237 pbot = p10(ylo[jj]) ; ptop = p10(yhi[jj]) ; if( ptop < pbot ) ptop = pbot ;
00238 if( ptop != 0.0 ){
00239 np = (yhi[jj]-ylo[jj]) / ptop ;
00240 switch( np ){
00241 case 1: ptop *= 0.1 ; break ;
00242 case 2: ptop *= 0.2 ; break ;
00243 case 3: ptop *= 0.25 ; break ;
00244 case 4:
00245 case 5: ptop *= 0.5 ; break ;
00246 }
00247 ylo[jj] = floor( ylo[jj]/ptop ) * ptop ;
00248 yhi[jj] = ceil( yhi[jj]/ptop ) * ptop ;
00249 }
00250 }
00251
00252 /*-- setup to plot --*/
00253
00254 create_memplot_surely( "tsplot" , 1.3 ) ;
00255 set_thick_memplot( 0.2*THIK ) ;
00256
00257 /*-- plot labels, if any --*/
00258
00259 xobot = 0.15 ; xotop = 1.27 ; /* set objective size of plot */
00260 yobot = 0.1 ; yotop = 0.95 ;
00261
00262 if( STGOOD(lab_top) ){ yotop -= 0.02 ; yobot -= 0.01 ; }
00263 if( nam_yyy != NULL ){ xotop -= 0.16 ; xobot -= 0.02 ; }
00264
00265 /* x-axis label? */
00266
00267 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00268 if( STGOOD(lab_xxx) )
00269 plotpak_pwritf( 0.5*(xobot+xotop) , yobot-0.06 , lab_xxx , 16 , 0 , 0 ) ;
00270
00271 /* y-axis label? */
00272
00273 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00274 if( STGOOD(lab_yyy) )
00275 plotpak_pwritf( xobot-0.10 , 0.5*(yobot+yotop) , lab_yyy , 16 , 90 , 0 ) ;
00276
00277 /* label at top? */
00278
00279 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00280 if( STGOOD(lab_top) )
00281 plotpak_pwritf( xobot+0.01 , yotop+0.01 , lab_top , 18 , 0 , -2 ) ;
00282
00283 /*-- plot all on same vertical scale --*/
00284
00285 if( yall ){
00286
00287 /* do name labels at right? */
00288
00289 if( nam_yyy != NULL ){
00290 float yv = yotop ; int sz ;
00291
00292 for( jj=0 ; jj < ny ; jj++ ){
00293 if( STGOOD(nam_yyy[jj]) ){
00294 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00295 set_thick_memplot( THIK ) ;
00296 plotpak_line( xotop+0.008 , yv , xotop+0.042 , yv ) ;
00297 set_thick_memplot( 0.2*THIK ) ;
00298 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00299 sz = (strlen(nam_yyy[jj]) <= 10) ? 12 : 10 ;
00300 plotpak_pwritf( xotop+0.048 , yv , nam_yyy[jj] , sz , 0 , -1 ) ;
00301 yv -= 0.05 ;
00302 }
00303 }
00304 }
00305
00306 /* plot axes */
00307
00308 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00309 set_thick_memplot( 0.0 ) ;
00310 plotpak_set( xobot,xotop , yobot,yotop , xbot,xtop , ybot,ytop , 1 ) ;
00311 plotpak_perimm( nnax,mmax , nnay,mmay , ilab[(nnax>0)+2*(nnay>0)] ) ;
00312
00313 /* plot data */
00314
00315 for( jj=0 ; jj < ny ; jj++ ){
00316 set_thick_memplot( THIK ) ;
00317 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00318
00319 yy = y[jj] ;
00320 for( ii=1 ; ii < nx ; ii++ ){
00321 if( xx[ii-1] < WAY_BIG && xx[ii] < WAY_BIG &&
00322 yy[ii-1] < WAY_BIG && yy[ii] < WAY_BIG )
00323
00324 plotpak_line( xx[ii-1] , yy[ii-1] , xx[ii] , yy[ii] ) ;
00325 }
00326 }
00327 set_thick_memplot( 0.0 ) ;
00328 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00329
00330 } else { /*-- plot each on separate vertical scale --*/
00331
00332 float dyo = (yotop-yobot) / ( (1.0+SY) * ny - SY ) ;
00333
00334 /* name labels at right? */
00335
00336 if( nam_yyy != NULL ){
00337 float yv = yotop ; int sz ;
00338
00339 for( jj=0 ; jj < ny ; jj++ ){
00340 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00341 if( STGOOD(nam_yyy[jj]) ){
00342 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00343 set_thick_memplot( 2*THIK ) ;
00344 yv = 0.7*yhh + 0.3*yll ;
00345 plotpak_line( xotop+0.008 , yv , xotop+0.042 , yv ) ;
00346 set_thick_memplot( 0.5*THIK ) ;
00347 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00348 sz = (strlen(nam_yyy[jj]) <= 10) ? 12 : 10 ;
00349 plotpak_pwritf( xotop+0.048 , yv , nam_yyy[jj] , sz , 0 , -1 ) ;
00350 }
00351 }
00352 }
00353
00354 /* data each in its own box */
00355
00356 for( jj=ny-1 ; jj >= 0 ; jj-- ){
00357 yll = yobot + jj*(1.0+SY)*dyo ; yhh = yll + dyo ;
00358 plotpak_set( xobot,xotop , yll,yhh , xbot,xtop , ylo[jj],yhi[jj] , 1 ) ;
00359
00360 if( nnay > 0 ){
00361 nnay = 1 ;
00362 pbot = p10(ylo[jj]) ; ptop = p10(yhi[jj]) ;
00363 if( ptop > pbot && pbot > 0.0 ) ptop = pbot ;
00364 if( ptop != 0.0 ) mmay = floor( (yhi[jj]-ylo[jj]) / ptop + 0.5 ) ;
00365 else mmay = 5 ; /* shouldn't happen */
00366
00367 if( mmay == 1 ) mmay = 5 ;
00368 else if( mmay == 2 ) mmay = 4 ;
00369 else if( mmay == 3 ) mmay = 6 ;
00370 }
00371
00372 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00373 plotpak_perimm( nnax,mmax , nnay,mmay , ilab[(nnax>0)*(jj==0)+2*(nnay>0)] ) ;
00374 if( ylo[jj] < 0.0 && yhi[jj] > 0.0 ){
00375 plotpak_setlin(5) ;
00376 plotpak_line( xbot,0.0 , xtop,0.0 ) ;
00377 plotpak_setlin(1) ;
00378 }
00379
00380 set_color_memplot( ccc[jj%NCLR][0] , ccc[jj%NCLR][1] , ccc[jj%NCLR][2] ) ;
00381 set_thick_memplot( THIK ) ;
00382
00383 yy = y[jj] ;
00384 for( ii=1 ; ii < nx ; ii++ ){
00385 if( xx[ii-1] < WAY_BIG && xx[ii] < WAY_BIG &&
00386 yy[ii-1] < WAY_BIG && yy[ii] < WAY_BIG )
00387
00388 plotpak_line( xx[ii-1] , yy[ii-1] , xx[ii] , yy[ii] ) ;
00389 }
00390 set_thick_memplot( 0.0 ) ;
00391 set_color_memplot( 0.0 , 0.0 , 0.0 ) ;
00392 }
00393 }
00394
00395 /*-- exit, stage left --*/
00396
00397 if( xx != x ) free(xx) ;
00398 free(ylo) ; free(yhi) ;
00399
00400 mp = get_active_memplot() ;
00401 return mp ;
00402 }
|
|
||||||||||||||||||||
|
Definition at line 42 of file plot_ts.c.
|
|
||||||||||||
|
Definition at line 37 of file plot_ts.c.
|
|
||||||||||||||||||||
|
Definition at line 47 of file plot_ts.c.
|
|
||||||||||||||||
|
Definition at line 244 of file plot_cox.c.
00245 {
00246 MEM_plotdata * mp ;
00247
00248 if( active_plot < 0 || active_plot >= num_plotar ||
00249 num_plotar == 0 || plotar == NULL ||
00250 plotar[active_plot] == NULL ) return ;
00251
00252 mp = plotar[active_plot] ;
00253
00254 ADDTO_MEMPLOT( mp , x1,y1,rad,0.0 , active_color , -THCODE_CIRC ) ;
00255 return ;
00256 }
|
|
|
Definition at line 391 of file coxplot/plot_motif.c.
00392 {
00393 if( mpcb == NULL || ! MTD_VALID(mpcb) ) return ;
00394
00395 donebut_CB( NULL , (XtPointer) mpcb , NULL ) ;
00396 return ;
00397 }
|
|
||||||||||||||||||||
|
Definition at line 211 of file plot_cox.c.
00212 {
00213 MEM_plotdata * mp ;
00214
00215 if( active_plot < 0 || active_plot >= num_plotar ||
00216 num_plotar == 0 || plotar == NULL ||
00217 plotar[active_plot] == NULL ) return ;
00218
00219 mp = plotar[active_plot] ;
00220
00221 #if 0
00222 fprintf(stderr,"** plotline_memplot %d: (%f,%f) to (%f,%f)\n",
00223 MEMPLOT_NLINE(mp) , x1,y1,x2,y2) ;
00224 #endif
00225
00226 ADDTO_MEMPLOT( mp , x1,y1,x2,y2 , active_color , active_thick ) ;
00227 return ;
00228 }
|
|
||||||||||||||||
|
Definition at line 719 of file plot_cox.c.
00720 {
00721 integer nn = n ;
00722 curve_( (real *) x , (real *) y , &nn ) ;
00723 }
|
|
|
Truly a line! * Definition at line 714 of file plot_cox.c.
00714 { frame_() ; }
|
|
||||||||||||
|
Definition at line 729 of file plot_cox.c.
00730 {
00731 real xx = x , yy = y ;
00732 frstpt_( &xx , &yy ) ;
00733 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 803 of file plot_cox.c.
00805 {
00806 if( xo1 != NULL ) *xo1 = (float) zzzplt_.xbot ;
00807 if( xo2 != NULL ) *xo2 = (float) zzzplt_.xtop ;
00808 if( yo1 != NULL ) *yo1 = (float) zzzplt_.ybot ;
00809 if( yo1 != NULL ) *yo2 = (float) zzzplt_.ytop ;
00810
00811 if( xs1 != NULL ) *xs1 = (float) zzzplt_.xmin ;
00812 if( xs2 != NULL ) *xs2 = (float) zzzplt_.xmax ;
00813 if( ys1 != NULL ) *ys1 = (float) zzzplt_.ymin ;
00814 if( ys1 != NULL ) *ys2 = (float) zzzplt_.ymax ;
00815
00816 return ;
00817 }
|
|
||||||||||||
|
Definition at line 35 of file ppak_perim.c.
00036 {
00037 integer zero = 0 , jx = jsizx , jy = jsizy ;
00038 labmod_( &zero , &zero , &zero , &zero , &jx , &jy , &zero , &zero , &zero ) ;
00039 }
|
|
||||||||||||||||||||
|
Definition at line 747 of file plot_cox.c.
|
|
||||||||||||||||||||
|
Definition at line 9 of file ppak_perim.c.
00010 {
00011 integer mmbx=mbx , mmlx=mlx , mmby=mby , mmly=mly ;
00012 perim_( &mmbx,&mmlx,&mmby,&mmly ) ;
00013 }
|
|
||||||||||||||||||||
|
Definition at line 18 of file ppak_perim.c.
00019 {
00020 integer mmbx=mbx , mmlx=mlx , mmby=mby , mmly=mly ;
00021 periml_( &mmbx,&mmlx,&mmby,&mmly ) ;
00022 }
|
|
||||||||||||||||||||||||
|
Definition at line 23 of file ppak_perim.c.
00024 {
00025 integer mmbx=mbx , mmlx=mlx , mmby=mby , mmly=mly , ill=ilab ;
00026 perimm_( &mmbx,&mmlx,&mmby,&mmly,&ill ) ;
00027 }
|
|
||||||||||||
|
Definition at line 856 of file plot_cox.c.
|
|
||||||||||||||||||||
|
Definition at line 862 of file plot_cox.c.
|
|
||||||||||||
|
Definition at line 868 of file plot_cox.c.
|
|
||||||||||||||||||||
|
Definition at line 874 of file plot_cox.c.
00875 {
00876 integer nn=n , nipen=ipen , zero=0 ;
00877 points_( (real *)x , (real *)y , &nn , &zero , &nipen ) ;
00878 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 15 of file ppak_pwrit.c.
00016 {
00017 real xx=x , yy=y ;
00018 integer nch=strlen(ch) , iisiz=isiz , iior=ior , iicent=icent ;
00019 ftnlen ch_len = nch ;
00020 pwrit_( &xx , &yy , ch , &nch , &iisiz , &iior , &iicent , ch_len ) ;
00021 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 6 of file ppak_pwritf.c.
00007 {
00008 real xx=x , yy=y ;
00009 integer nch=strlen(ch) , iisiz=isiz , iior=ior , iicent=icent ;
00010 ftnlen ch_len = nch ;
00011 pwritf_( &xx , &yy , ch , &nch , &iisiz , &iior , &iicent , ch_len ) ;
00012 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 794 of file plot_cox.c.
00796 {
00797 real xobj1=xo1, xobj2=xo2, yobj1=yo1, yobj2=yo2;
00798 real xsub1=xs1, xsub2=xs2, ysub1=ys1, ysub2=ys2 ;
00799 integer ltype = code ;
00800 set_(&xobj1, &xobj2, &yobj1, &yobj2, &xsub1, &xsub2, &ysub1, &ysub2, <ype);
00801 }
|
|
||||||||||||
|
Definition at line 844 of file plot_cox.c.
00845 {
00846 integer nnd = nd ;
00847 setdsh_( &nnd , (real *) xd ) ;
00848 }
|
|
||||||||||||||||||||
|
Definition at line 850 of file plot_cox.c.
00851 {
00852 real xobj1=xo1, xobj2=xo2, yobj1=yo1, yobj2=yo2;
00853 setfrm_( &xobj1, &xobj2, &yobj1, &yobj2 ) ;
00854 }
|
|
|
Definition at line 826 of file plot_cox.c.
00827 {
00828 integer ntype=code ;
00829 setlin_(&ntype);
00830 }
|
|
||||||||||||||||||||
|
Definition at line 835 of file plot_cox.c.
00836 {
00837 real xobj1=xo1, xobj2=xo2, yobj1=yo1, yobj2=yo2;
00838 setw_( &xobj1, &xobj2, &yobj1, &yobj2 ) ;
00839 }
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 19 of file ppak_srface.c.
00022 {
00023 integer * m ;
00024 float * xx , * yy ;
00025 integer mx , nnx , nny ;
00026 float s[6] , stereo=0.0 , zbot,ztop , rad , cth,sth,cph,sph ;
00027 int ii , nxy=nx*ny ;
00028
00029 if( nx <= 1 || ny <= 1 || z == NULL ) return ;
00030
00031 mx = nnx = (integer) nx ; nny = (integer) ny ;
00032
00033 zbot = ztop = z[0] ;
00034 for( ii=1 ; ii < nxy ; ii++ ){
00035 if( z[ii] < zbot ) zbot = z[ii] ;
00036 else if( z[ii] > ztop ) ztop = z[ii] ;
00037 }
00038
00039 xx = x ;
00040 if( xx == NULL ){
00041 xx = (float *) malloc( sizeof(float) * nx ) ;
00042 for( ii=0 ; ii < nx ; ii++ ) xx[ii] = ii ;
00043 }
00044
00045 yy = y ;
00046 if( yy == NULL ){
00047 yy = (float *) malloc( sizeof(float) * ny ) ;
00048 for( ii=0 ; ii < ny ; ii++ ) yy[ii] = ii ;
00049 }
00050
00051 s[3] = 0.5 * (xx[0] + xx[nx-1]) ;
00052 s[4] = 0.5 * (yy[0] + yy[ny-1]) ;
00053 s[5] = 0.5 * (zbot + ztop ) ;
00054
00055 rad = 100.0 * ( fabs(xx[nx-1]-xx[0]) + fabs(yy[ny-1]-yy[0]) + (ztop-zbot) ) ;
00056 cth = cos( theta * 3.1416/180.0 ) ; sth = sin( theta * 3.1416/180.0 ) ;
00057 cph = cos( phi * 3.1416/180.0 ) ; sph = sin( phi * 3.1416/180.0 ) ;
00058
00059 s[0] = s[3] + rad * sth * cph ;
00060 s[1] = s[4] + rad * sth * sph ;
00061 s[2] = s[5] + rad * cth ;
00062
00063 m = (integer *) malloc( sizeof(integer) * 2*nx*ny ) ; /* workspace */
00064
00065 srface_( xx , yy , z , m , &mx , &nnx , &nny , s , &stereo ) ;
00066
00067 free(m) ;
00068 if( yy != y ) free(yy) ;
00069 if( xx != x ) free(xx) ;
00070 return ;
00071 }
|
|
||||||||||||||||||||
|
Definition at line 29 of file ppak_perim.c.
00030 {
00031 integer lmajx=mx , lminx=lx , lmajy=my , lminy=ly ;
00032 tick4_(&lmajx, &lminx, &lmajy, &lminy);
00033 }
|
|
||||||||||||||||||||
|
Definition at line 769 of file plot_cox.c.
00770 {
00771 double rr ;
00772 if( x2 != NULL ){
00773 rr = (x1 - zzzplt_.betaxx) / zzzplt_.alphxx ;
00774 if( zzzplt_.ixcoor < 0 ) rr = pow(10.0,rr) ;
00775 *x2 = rr ;
00776 }
00777 if( y2 != NULL ){
00778 rr = (y1 - zzzplt_.betayy) / zzzplt_.alphyy ;
00779 if( zzzplt_.iycoor < 0 ) rr = pow(10.0,rr) ;
00780 *y2 = rr ;
00781 }
00782 }
|
|
||||||||||||
|
Definition at line 738 of file plot_cox.c.
00739 {
00740 real xx=x , yy=y ;
00741 vector_( &xx , &yy ) ;
00742 }
|
|
||||||||||||||||||||
|
Definition at line 757 of file plot_cox.c.
|
|
||||||||||||||||||||
|
Definition at line 230 of file plot_cox.c.
00231 {
00232 MEM_plotdata * mp ;
00233
00234 if( active_plot < 0 || active_plot >= num_plotar ||
00235 num_plotar == 0 || plotar == NULL ||
00236 plotar[active_plot] == NULL ) return ;
00237
00238 mp = plotar[active_plot] ;
00239
00240 ADDTO_MEMPLOT( mp , x1,y1,x2,y2 , active_color , -THCODE_RECT ) ;
00241 return ;
00242 }
|
|
||||||||||||
|
Definition at line 34 of file point.c.
00035 {
00036 extern /* Subroutine */ int phdot_(real *, real *);
00037 static real xx, yy;
00038 extern /* Subroutine */ int zzphys_(real *, real *);
00039
00040 /* .......................................................................
00041 */
00042 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00043 */
00044
00045 /* Internal Data for PLOTPAK */
00046
00047 xx = *x;
00048 yy = *y;
00049 zzphys_(&xx, &yy);
00050 zzzplt_1.xphold = xx;
00051 zzzplt_1.yphold = yy;
00052
00053 if (xx >= zzzplt_1.xclbot && xx <= zzzplt_1.xcltop && yy >=
00054 zzzplt_1.yclbot && yy <= zzzplt_1.ycltop) {
00055 phdot_(&xx, &yy);
00056 }
00057
00058 phdot_(&xx, &yy);
00059
00060 return 0;
00061 } /* point_ */
|
|
||||||||||||||||||||||||
|
Definition at line 11 of file points.c.
00013 {
00014 /* System generated locals */
00015 integer i__1;
00016
00017 /* Local variables */
00018 static integer i__;
00019 extern /* Subroutine */ int point_(real *, real *), vector_(real *, real *
00020 ), frstpt_(real *, real *);
00021
00022
00023 /* Note that ICHAR is ignored in this version (argument retained for */
00024 /* compatibility with NCAR). */
00025 /* .......................................................................
00026 */
00027 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00028 */
00029 /* Parameter adjustments */
00030 --y;
00031 --x;
00032
00033 /* Function Body */
00034 if (*ipen != 1) {
00035 i__1 = *n;
00036 for (i__ = 1; i__ <= i__1; ++i__) {
00037 point_(&x[i__], &y[i__]);
00038 /* L100: */
00039 }
00040 } else {
00041 frstpt_(&x[1], &y[1]);
00042 i__1 = *n;
00043 for (i__ = 2; i__ <= i__1; ++i__) {
00044 vector_(&x[i__], &y[i__]);
00045 /* L200: */
00046 }
00047 }
00048 return 0;
00049 } /* points_ */
|
|