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) |
|
|
|
|
|
|
|
|
|
|
|
Value: |
|
|
|
|
|
|
|
|
Value: |
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Typedef Documentation
|
|
|
Function Documentation
|
||||||||||||
|
Definition at line 344 of file plot_cox.c. References mp, MEM_plotdata::nxyline, MEM_plotdata::nxyline_all, realloc, and MEM_plotdata::xyline. Referenced by ISQ_getmemplot(), ISQ_make_image(), and ISQ_make_montage().
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. References ADDTO_MEMPLOT, MEM_plotdata::aspect, clip_line_to_rect(), create_memplot_surely(), DESTROY_MEMPLOT, find_memplot(), MEM_plotdata::ident, INSIDE, mp, MEM_plotdata::nxyline, x2, MEM_plotdata::xyline, and y1. Referenced by ISQ_getmemplot().
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. References c_b128, dmax, dmin, p, pow_ri(), r_int(), and r_lg10(). Referenced by srface_().
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. References max, min, ncol, zzmpco_(), and zzpltr_1. Referenced by ctcell_(), and pwritf_().
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. References MEM_plotdata::aspect, create_memplot(), find_memplot(), MEM_plotdata::ident, mp, MEM_plotdata::nxyline, MEM_plotdata::nxyline_all, realloc, and MEM_plotdata::xyline. Referenced by ISQ_record_addim(), and ISQ_record_getim().
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. References active_plot, ADDTO_MEMPLOT, MEM_plotdata::aspect, find_memplot(), INIT_MEMPLOT, malloc, memplt_(), num_plotar, and realloc. Referenced by copy_memplot(), create_memplot_surely(), and make_plot().
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. References create_memplot(). Referenced by AFNI_brick_to_mri(), clip_memplot(), ISQ_getmemplot(), ISQ_plot_label(), ISQ_show_image(), plot_image_surface(), PLOT_scatterellipse(), plot_strip_init(), plot_ts_init(), plot_ts_mem(), PLOT_tsgray(), PLUTO_scatterplot(), and SPLASH_imseq_getim().
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. References c__0, c__1, c_b3, color_(), dmin, draws_(), i1, min, r_sign(), and srfblk_1. Referenced by srface_().
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. References c__0, c__1, and points_(). Referenced by plotpak_curve().
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. References mp, MEM_plotdata::nxyline, and MEM_plotdata::xyline.
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. References active_plot, DESTROY_MEMPLOT, free, and num_plotar.
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. References active_plot, DESTROY_MEMPLOT, mp, and num_plotar. Referenced by donebut_CB(), ISQ_free_alldata(), ISQ_getmemplot(), ISQ_graymap_draw(), ISQ_make_image(), ISQ_make_montage(), ISQ_record_addim(), ISQ_record_kill_CB(), ISQ_record_send_CB(), ISQ_rowgraph_draw(), ISQ_saver_CB(), ISQ_surfgraph_draw(), and PLOT_matrix_gray().
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. References c__2, dabs, max, min, srfblk_1, and srfpl_(). Referenced by ctcell_(), and srface_().
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. References zzmpco_(), and zzpltr_1.
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. References active_plot, and num_plotar. Referenced by clip_memplot(), copy_memplot(), create_memplot(), get_active_memplot(), and nline_active_memplot().
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. References MEM_plotdata::aspect, mp, MEM_plotdata::nxyline, x2, MEM_plotdata::xyline, and y1. Referenced by ISQ_make_image(), ISQ_make_montage(), and ISQ_saver_CB().
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. References zzphys_(), and zzzplt_1. Referenced by plotpak_frstpt(), and points_().
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. References find_memplot().
00131 {
00132 return find_memplot(NULL) ;
00133 }
|
|
|
Definition at line 201 of file plot_cox.c. References active_opacity.
00202 {
00203 return active_opacity ;
00204 }
|
|
|
Definition at line 177 of file plot_cox.c. References active_thick.
00178 {
00179 return active_thick ;
00180 }
|
|
||||||||||||
|
Definition at line 479 of file plot_x11.c. References X11_colordef::bb, X11_colordef::bbmask, X11_colordef::bbshift, X11_colordef::classKRH, X11_colordef::depth, display, free, FREE_X11_colordef, getwin_from_XDBE(), X11_colordef::gg, X11_colordef::ggmask, X11_colordef::ggshift, highbit(), malloc, X11_colordef::ncolors, qhandler(), X11_colordef::rr, X11_colordef::rrmask, X11_colordef::rrshift, xhandler, and xwasbad. Referenced by fred_CB(), and setup_X11_plotting().
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. References dpy. Referenced by get_X11_colordef(), memplot_to_X11_sef(), set_X11_background(), and setup_X11_plotting().
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. Referenced by memplot_to_topshell().
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. References MEM_plotdata::insert_at, and mp. Referenced by plot_strip_addto(), and plot_strip_clear().
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 34 of file labmod.c. References zzzplt_1. Referenced by plotpak_labmod().
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. References i_len(). Referenced by pwritf_().
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. References x2, y1, zzline_(), and zzphys_(). Referenced by plotpak_line(), and srfpl_().
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. References COL_TO_BBB, COL_TO_GGG, COL_TO_RRR, MEMPLOT_COL, MEMPLOT_NLINE, MEMPLOT_TH, MEMPLOT_X1, MEMPLOT_X2, MEMPLOT_Y1, MEMPLOT_Y2, mp, ps_circle(), ps_closepl(), ps_line(), ps_openpl(), ps_rect(), ps_setrgb(), ps_setwidth(), ps_space(), PSIZE, skip, x2, and y1. Referenced by main(), psfinalize_CB(), and psprint_CB().
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 367 of file plot_motif.c. References beep_CB(), BGCOLOR_ARG, MEM_topshell_data::dial, donebut_CB(), dpy, MEM_topshell_data::drawing, expose_CB(), MEM_topshell_data::form, getenv(), MEM_topshell_data::have_xdbe, HOTCOLOR, init_XDBE(), MEM_topshell_data::killfunc, LABEL_ARG, malloc, MEMPLOT_ASPECT, mp, MEM_topshell_data::mp, print_command, psfile_CB(), psprint_CB(), redcolor, resize_CB(), MEM_topshell_data::top, MEM_topshell_data::userdata, MEM_topshell_data::valid, wmin, and MEM_topshell_data::wtf. Referenced by ISQ_graymap_draw(), ISQ_rowgraph_draw(), ISQ_surfgraph_draw(), plot_strip_init(), plot_ts_init(), plot_ts_lab(), plot_ts_qqq(), PLUTO_scatterplot(), ROIPLOT_main(), and startup_timeout_CB().
00369 {
00370 Widget topshell , drawing , donebut , form , psfilebut , psprintbut ;
00371 MEM_topshell_data * mpcb ;
00372 int hmin=200 , wmin , ibut=0 ;
00373 char * prc ;
00374
00375 /* sanity check */
00376
00377 if( dpy == NULL || mp == NULL ) return NULL ;
00378
00379 mpcb = (MEM_topshell_data *) malloc( sizeof(MEM_topshell_data) ) ;
00380 mpcb->valid = 0 ;
00381
00382 #ifdef HAVE_XDBE
00383 init_XDBE(dpy) ; mpcb->have_xdbe = 0 ;
00384 #endif
00385
00386 wmin = MEMPLOT_ASPECT(mp) * hmin ;
00387
00388 /* shell to hold it all */
00389
00390 topshell = XtVaAppCreateShell(
00391 "AFNI" , "AFNI" , topLevelShellWidgetClass , dpy ,
00392 XmNborderWidth , 0 ,
00393 XmNminHeight , hmin , XmNheight , hmin ,
00394 XmNminWidth , wmin , XmNwidth , wmin ,
00395 XmNallowShellResize , False ,
00396 XmNinitialResourcesPersistent , False ,
00397 XmNdeleteResponse , XmDO_NOTHING , /* deletion handled below */
00398 NULL ) ;
00399
00400 XmAddWMProtocolCallback(
00401 topshell , XmInternAtom(dpy,"WM_DELETE_WINDOW",False) ,
00402 donebut_CB , (XtPointer) mpcb ) ;
00403
00404 mpcb->top = topshell ;
00405 mpcb->mp = mp ;
00406 mpcb->dial= NULL ;
00407 mpcb->wtf = NULL ;
00408
00409 mpcb->killfunc = kfun ;
00410
00411 /* form to manage it all */
00412
00413 #undef TIG
00414 #undef NBUT
00415 #define TIG 20
00416 #define NBUT 3
00417
00418 mpcb->form = form =
00419 XtVaCreateWidget( "dialog" , xmFormWidgetClass , topshell ,
00420 XmNborderWidth , 0 ,
00421 XmNfractionBase , TIG*NBUT - 1 ,
00422 XmNinitialResourcesPersistent , False ,
00423 NULL ) ;
00424
00425 /* buttons across the top */
00426
00427 if( redcolor == NULL ){ HOTCOLOR(form,redcolor) ; }
00428
00429 ibut = 0 ;
00430 psfilebut = XtVaCreateManagedWidget(
00431 "dialog" , xmPushButtonWidgetClass , form ,
00432 LABEL_ARG("PS->file") ,
00433 XmNtopAttachment , XmATTACH_FORM ,
00434
00435 XmNleftAttachment ,
00436 (ibut!=0) ? XmATTACH_POSITION : XmATTACH_FORM ,
00437 XmNleftPosition , ibut*TIG ,
00438
00439 XmNrightAttachment ,
00440 (ibut==NBUT-1) ? XmATTACH_FORM : XmATTACH_POSITION ,
00441 XmNrightPosition , ibut*TIG + (TIG-1) ,
00442
00443 XmNrecomputeSize , False ,
00444 XmNtraversalOn , False ,
00445 XmNinitialResourcesPersistent , False ,
00446 NULL ) ;
00447 XtAddCallback( psfilebut , XmNactivateCallback , psfile_CB , (XtPointer) mpcb ) ;
00448
00449 ibut++ ;
00450 psprintbut = XtVaCreateManagedWidget(
00451 "dialog" , xmPushButtonWidgetClass , form ,
00452 LABEL_ARG("->printer") ,
00453 XmNtopAttachment , XmATTACH_FORM ,
00454
00455 XmNleftAttachment ,
00456 (ibut!=0) ? XmATTACH_POSITION : XmATTACH_FORM ,
00457 XmNleftPosition , ibut*TIG ,
00458
00459 XmNrightAttachment ,
00460 (ibut==NBUT-1) ? XmATTACH_FORM : XmATTACH_POSITION ,
00461 XmNrightPosition , ibut*TIG + (TIG-1) ,
00462
00463 XmNrecomputeSize , False ,
00464 XmNtraversalOn , False ,
00465 XmNinitialResourcesPersistent , False ,
00466 NULL ) ;
00467 prc = getenv( "AFNI_PSPRINT" ) ;
00468 if( prc != NULL ){
00469 sprintf( print_command , "|%.250s" , prc ) ;
00470 XtAddCallback( psprintbut , XmNactivateCallback , psprint_CB , (XtPointer) mpcb ) ;
00471 } else {
00472 XtAddCallback( psprintbut , XmNactivateCallback , beep_CB ,
00473 (XtPointer) "*** AFNI_PSPRINT not defined - see README.environment" ) ;
00474 }
00475
00476 ibut++ ;
00477 donebut = XtVaCreateManagedWidget(
00478 "dialog" , xmPushButtonWidgetClass , form ,
00479 LABEL_ARG("Done") ,
00480 #if 1
00481 BGCOLOR_ARG(redcolor) ,
00482 #endif
00483
00484 XmNtopAttachment , XmATTACH_FORM ,
00485
00486 XmNleftAttachment ,
00487 (ibut!=0) ? XmATTACH_POSITION : XmATTACH_FORM ,
00488 XmNleftPosition , ibut*TIG ,
00489
00490 XmNrightAttachment ,
00491 (ibut==NBUT-1) ? XmATTACH_FORM : XmATTACH_POSITION ,
00492 XmNrightPosition , ibut*TIG + (TIG-1) ,
00493
00494 XmNrecomputeSize , False ,
00495 XmNtraversalOn , False ,
00496 XmNinitialResourcesPersistent , False ,
00497 NULL ) ;
00498 XtAddCallback( donebut , XmNactivateCallback , donebut_CB , (XtPointer) mpcb ) ;
00499
00500 /* drawing area to receive the picture */
00501
00502 drawing = XtVaCreateManagedWidget( "dialog" , xmDrawingAreaWidgetClass , form ,
00503 XmNtopAttachment , XmATTACH_WIDGET ,
00504 XmNtopWidget , donebut ,
00505 XmNleftAttachment , XmATTACH_FORM ,
00506 XmNrightAttachment , XmATTACH_FORM ,
00507 XmNbottomAttachment , XmATTACH_FORM ,
00508 XmNinitialResourcesPersistent , False ,
00509 NULL ) ;
00510
00511 XtAddCallback( drawing , XmNexposeCallback , expose_CB , (XtPointer) mpcb ) ;
00512 XtAddCallback( drawing , XmNresizeCallback , resize_CB , (XtPointer) mpcb ) ;
00513
00514 /* finish the job */
00515
00516 XtVaSetValues( form , BGCOLOR_ARG("white") , NULL ) ;
00517
00518 XtManageChild(form) ;
00519 XtRealizeWidget(topshell);
00520
00521 mpcb->valid = 1 ; mpcb->userdata = NULL ; mpcb->drawing = drawing ;
00522 return mpcb ;
00523 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 121 of file plot_x11.c. References MEM_plotdata::aspect, box_xbot, box_xtop, box_ybot, box_ytop, COL_TO_BBB, COL_TO_GGG, COL_TO_RRR, X11_colordef::depth, dpy, draw_xseg(), drawable_geom(), getwin_from_XDBE(), LMAX, MEMPLOT_COL, MEMPLOT_NLINE, MEMPLOT_TH, MEMPLOT_X1, MEMPLOT_X2, MEMPLOT_Y1, MEMPLOT_Y2, mp, nseg, old_dpy, old_GC, old_w, rgb_to_pixel(), set_memplot_X11_box(), setup_X11_plotting(), skip, x2, xseg, y1, and ZO_TO_TFS. Referenced by expose_CB(), ISQ_show_image(), ISQ_show_zoom(), and plot_ts_addto().
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. References c_b2, setfrm_(), and zzpltr_1. Referenced by create_memplot(), and set_active_memplot().
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. References find_memplot(), MEMPLOT_NLINE, and mp.
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. References c__0, zzperi_(), and zzzplt_1. Referenced by plotpak_perim().
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. References c__1, zzperi_(), and zzzplt_1. Referenced by plotpak_periml().
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. References zzperi_(), and zzzplt_1. Referenced by plotpak_perimm().
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. Referenced by plotpak_phdot(), and point_().
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. References dabs, x2, y1, zzdash_1, and zzphph_(). Referenced by plotpak_phline(), and zzline_().
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. References ADDTO_MEMPLOT, ccc, insert_at_memplot(), MEMPLOT_IDENT, MEM_topshell_data::mp, mp, NCLR, plotpak_line(), plotpak_set(), redraw_topshell(), set_active_memplot(), set_color_memplot(), set_thick_memplot(), SY, THIK, MEM_topshell_data::userdata, MEM_topshell_data::valid, and WAY_BIG. Referenced by AFNI_drive_addto_graph_1D().
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. References ADDTO_MEMPLOT, insert_at_memplot(), MEM_topshell_data::mp, mp, redraw_topshell(), MEM_topshell_data::userdata, and MEM_topshell_data::valid. Referenced by AFNI_drive_clear_graph_1D().
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. References ADDTO_MEMPLOT, calloc, ccc, create_memplot_surely(), dpy, get_active_memplot(), MEMPLOT_NLINE, memplot_to_topshell(), mp, NCLR, p10(), plotpak_line(), plotpak_periml(), plotpak_perimm(), plotpak_pwritf(), plotpak_set(), plotpak_setlin(), set_color_memplot(), set_thick_memplot(), STGOOD, SY, THIK, and MEM_topshell_data::userdata. Referenced by AFNI_drive_open_graph_1D().
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. References ccc, MEM_topshell_data::drawing, init_colors(), MEMPLOT_IDENT, MEMPLOT_NLINE, memplot_to_X11_sef(), MEM_topshell_data::mp, mp, NCLR, plotpak_line(), plotpak_set(), set_active_memplot(), set_color_memplot(), set_thick_memplot(), SY, THIK, MEM_topshell_data::userdata, MEM_topshell_data::valid, and WAY_BIG. Referenced by AFNI_drive_addto_graph_xy(), and RT_registration_3D_realtime().
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. References ccc, create_memplot_surely(), dpy, free, get_active_memplot(), ilab, init_colors(), malloc, memplot_to_topshell(), mp, NCLR, p10(), plotpak_line(), plotpak_perimm(), plotpak_pwritf(), plotpak_set(), plotpak_setlin(), set_color_memplot(), set_thick_memplot(), STGOOD, SY, THIK, MEM_topshell_data::userdata, xpush, and ypush. Referenced by AFNI_drive_open_graph_xy(), and RT_registration_3D_realtime().
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. References dpy, memplot_to_topshell(), mp, and plot_ts_mem(). Referenced by MCW_choose_CB(), PLUTO_histoplot(), RT_finish_dataset(), startup_timeout_CB(), T3D_check_outliers(), and VOLREG_main().
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. References ccc, create_memplot_surely(), free, get_active_memplot(), ilab, init_colors(), malloc, mmaxx, mmayy, mp, NCLR, nnaxx, nnayy, p10(), plotpak_line(), plotpak_perimm(), plotpak_pwritf(), plotpak_set(), plotpak_setlin(), set_color_memplot(), set_thick_memplot(), STGOOD, SY, THIK, WAY_BIG, xpush, xxbot, xxtop, ypush, yybot, and yytop. Referenced by ISQ_graymap_draw(), ISQ_rowgraph_draw(), main(), plot_ts_lab(), plot_ts_qqq(), and ROIPLOT_main().
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. References mmaxx, nnaxx, xxbot, and xxtop. Referenced by main().
|
|
||||||||||||
|
Definition at line 37 of file plot_ts.c. References a, xpush, and ypush. Referenced by main(), and RT_process_info().
|
|
||||||||||||||||||||
|
Definition at line 47 of file plot_ts.c. References mmayy, nnayy, yybot, and yytop. Referenced by main().
|
|
||||||||||||||||
|
Definition at line 244 of file plot_cox.c. References active_color, active_plot, ADDTO_MEMPLOT, mp, num_plotar, and y1.
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 343 of file plot_motif.c. References donebut_CB(), and MTD_VALID. Referenced by AFNI_drive_close_graph_xy(), ISQ_drawing_EV(), ISQ_free_alldata(), ISQ_rowgraph_draw(), and ISQ_surfgraph_draw().
00344 {
00345 if( mpcb == NULL || ! MTD_VALID(mpcb) ) return ;
00346
00347 donebut_CB( NULL , (XtPointer) mpcb , NULL ) ;
00348 return ;
00349 }
|
|
||||||||||||||||||||
|
Definition at line 211 of file plot_cox.c. References active_color, active_plot, active_thick, ADDTO_MEMPLOT, MEMPLOT_NLINE, mp, num_plotar, x2, and y1. Referenced by AFNI_brick_to_mri(), PLOT_tsgray(), and zzmpli_().
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. References curve_().
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. References frame_().
00714 { frame_() ; }
|
|
||||||||||||
|
Definition at line 729 of file plot_cox.c. References frstpt_(). Referenced by make_plot().
00730 {
00731 real xx = x , yy = y ;
00732 frstpt_( &xx , &yy ) ;
00733 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 803 of file plot_cox.c. Referenced by ISQ_rowgraph_draw().
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. References labmod_().
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. References line_(), x2, and y1. Referenced by ISQ_getmemplot(), ISQ_rowgraph_draw(), ISQ_show_image(), plot_image_surface(), PLOT_scatterellipse(), plot_strip_addto(), plot_strip_init(), plot_ts_addto(), plot_ts_init(), plot_ts_mem(), and PLUTO_scatterplot().
|
|
||||||||||||||||||||
|
Definition at line 9 of file ppak_perim.c. References perim_().
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. References periml_(). Referenced by make_plot(), PLOT_scatterellipse(), plot_strip_init(), and PLUTO_scatterplot().
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. References perimm_(). Referenced by plot_strip_init(), plot_ts_init(), and plot_ts_mem().
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. References phline_(), x2, and y1.
|
|
||||||||||||
|
Definition at line 868 of file plot_cox.c.
|
|
||||||||||||||||||||
|
Definition at line 874 of file plot_cox.c. References points_().
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. References pwrit_().
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. References pwritf_(). Referenced by ISQ_plot_label(), ISQ_show_image(), make_plot(), plot_image_surface(), PLOT_scatterellipse(), plot_strip_init(), plot_ts_init(), plot_ts_mem(), PLUTO_scatterplot(), and SPLASH_imseq_getim().
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. References set_(). Referenced by make_plot(), plot_image_surface(), PLOT_scatterellipse(), plot_strip_addto(), plot_strip_init(), plot_ts_addto(), plot_ts_init(), plot_ts_mem(), and PLUTO_scatterplot().
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. References setdsh_().
00845 {
00846 integer nnd = nd ;
00847 setdsh_( &nnd , (real *) xd ) ;
00848 }
|
|
||||||||||||||||||||
|
Definition at line 850 of file plot_cox.c. References setfrm_().
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. References setlin_(). Referenced by plot_strip_init(), plot_ts_init(), and plot_ts_mem().
00827 {
00828 integer ntype=code ;
00829 setlin_(&ntype);
00830 }
|
|
||||||||||||||||||||
|
Definition at line 835 of file plot_cox.c. References setw_().
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. References free, malloc, and srface_(). Referenced by make_plot(), and plot_image_surface().
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. References tick4_().
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. References vector_(). Referenced by make_plot().
00739 {
00740 real xx=x , yy=y ;
00741 vector_( &xx , &yy ) ;
00742 }
|
|
||||||||||||||||||||
|
Definition at line 757 of file plot_cox.c. References x2, y1, and zzphys_().
|
|
||||||||||||||||||||
|
Definition at line 230 of file plot_cox.c. References active_color, active_plot, ADDTO_MEMPLOT, mp, num_plotar, x2, and y1. Referenced by AFNI_brick_to_mri(), and PLOT_tsgray().
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. References phdot_(), zzphys_(), and zzzplt_1. Referenced by plotpak_point(), and points_().
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. References frstpt_(), point_(), and vector_(). Referenced by curve_(), and plotpak_points().
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_ */
|
|
||||||||||||||||||||||||||||
|
|
|
||||||||||||||||
|
Referenced by memplot_to_postscript(). |
|
|
|
|
||||||||||||
|
Referenced by ps_line(). |
|
|
|
|
|
|
|
||||||||||||||||||||
|
Referenced by memplot_to_postscript(), and zzpsli_(). |
|
|
Referenced by ps_space(). |
|
||||||||||||
|
Referenced by ps_cont(), ps_line(), and ps_point(). |
|
|
Referenced by memplot_to_postscript(), and zzpsop_(). |
|
||||||||||||
|
|
|
||||||||||||||||||||
|
Referenced by memplot_to_postscript(). |
|
||||||||||||||||
|
Referenced by memplot_to_postscript(), and zzpsco_(). |
|
|
Referenced by memplot_to_postscript(). |
|
||||||||||||||||||||
|
Referenced by memplot_to_postscript(), and zzpsop_(). |
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 34 of file pwrit.c. References abs, L, zzchar_(), zzphys_(), and zzzplt_1. Referenced by plotpak_pwrit().
00036 {
00037 /* System generated locals */
00038 integer i__1;
00039
00040 /* Local variables */
00041 static integer i__, nchar;
00042 static real width;
00043 static integer isize;
00044 static real ct, dx, dy, oor, st, xx, yy;
00045 extern /* Subroutine */ int zzchar_(char *, real *, real *, real *, real *
00046 , ftnlen), zzphys_(real *, real *);
00047
00048
00049 /* Additional options besides NCAR's choices: */
00050
00051 /* NCH < 0 ==> use absolute coordinates rather than user coords. */
00052 /* [this is because the use of integer absolute ] */
00053 /* [coordinates is not implemented in this package] */
00054
00055 /* ABS(NCH) = 999 ==> find length of string by looking for a 0 byte. */
00056
00057 /* ICENT = -2 ==> (X,Y) is lower left corner of string to plot. */
00058
00059 /* .......................................................................
00060 */
00061
00062 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00063 */
00064 /* Calculate character width in terms of 1/1000 of the x-width. */
00065
00066
00067 /* Internal Data for PLOTPAK */
00068
00069 /* Parameter adjustments */
00070 --ch;
00071
00072 /* Function Body */
00073 isize = *isiz;
00074 if (isize <= 0) {
00075 isize = 8;
00076 } else if (isize == 1) {
00077 isize = 12;
00078 } else if (isize == 2) {
00079 isize = 16;
00080 } else if (isize == 3) {
00081 isize = 24;
00082 }
00083
00084 width = isize * .001f * (zzzplt_1.xpgmax - zzzplt_1.xpgmin);
00085
00086 /* Rotation/scaling factors for digitization. Include factor of 1/6 */
00087 /* to allow for digitization scale in ZZCHAR. */
00088
00089 oor = *ior * .017453292f;
00090 dx = width * cos(oor);
00091 dy = width * sin(oor);
00092 ct = dx * .1666667f;
00093 st = dy * .1666667f;
00094
00095 /* Starting location for first character. */
00096
00097 xx = *x;
00098 yy = *y;
00099 if (*nch > 0) {
00100 zzphys_(&xx, &yy);
00101 }
00102
00103 /* Get no. of characters in string. Special option 999 must be checked.
00104 */
00105
00106 nchar = abs(*nch);
00107 if (nchar == 999) {
00108 i__1 = nchar;
00109 for (i__ = 1; i__ <= i__1; ++i__) {
00110 if (*(unsigned char *)&ch[i__] == '\0') {
00111 goto L20;
00112 }
00113 /* L10: */
00114 }
00115 L20:
00116 nchar = i__ - 1;
00117 }
00118
00119 /* If centering option is not lower-left corner, must calculate */
00120 /* location of lower left corner. */
00121
00122 if (*icent != -2) {
00123 /* Move from center of character down to bottom (aspect ratio = 7/6)
00124 */
00125 xx += dy * .5833333f;
00126 yy -= dx * .5833333f;
00127 if (*icent == 0) {
00128 xx -= nchar * .5f * dx;
00129 yy -= nchar * .5f * dy;
00130 } else if (*icent == 1) {
00131 xx -= nchar * dx;
00132 yy -= nchar * dy;
00133 }
00134 }
00135 /* .......................................................................
00136 */
00137 i__1 = nchar;
00138 for (i__ = 1; i__ <= i__1; ++i__) {
00139 zzchar_(ch + i__, &xx, &yy, &ct, &st, 1L);
00140 xx += dx;
00141 yy += dy;
00142 /* L100: */
00143 }
00144 /* .......................................................................
00145 */
00146 zzzplt_1.xphold = xx;
00147 zzzplt_1.yphold = yy;
00148 return 0;
00149 } /* pwrit_ */
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 34 of file pwritf.c. References abs, color_(), dmax, dmin, L, lastnb_(), zzconv_(), zzline_(), zzphys_(), zzstro_(), and zzzplt_1. Referenced by plotpak_pwritf(), zzaxxx_(), and zzaxyy_().
00036 {
00037 /* System generated locals */
00038 integer i__1, i__2;
00039 real r__1, r__2;
00040
00041 /* Local variables */
00042 static real xold, yold, size, xorg, yorg;
00043 static integer lstr[69999], nstr;
00044 static real xstr[69999], ystr[69999];
00045 static integer i__;
00046 static char chloc[6666];
00047 static integer nchar;
00048 extern /* Subroutine */ int color_(integer *);
00049 static integer isize;
00050 static real ct;
00051 static integer nchloc;
00052 static real st, xr, yr, xx, yy;
00053 extern integer lastnb_(char *, ftnlen);
00054 extern /* Subroutine */ int zzline_(real *, real *, real *, real *),
00055 zzconv_(char *, integer *, char *, integer *, ftnlen, ftnlen),
00056 zzphys_(real *, real *), zzstro_(char *, integer *, integer *,
00057 real *, real *, integer *, ftnlen);
00058 static real orr;
00059
00060
00061
00062
00063 /* .......................................................................
00064 */
00065
00066 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00067 */
00068 /* Calculate character width in terms of 1/1000 of the x-width. */
00069
00070
00071 /* Internal Data for PLOTPAK */
00072
00073 isize = *isiz;
00074 if (isize <= 0) {
00075 isize = 8;
00076 } else if (isize == 1) {
00077 isize = 12;
00078 } else if (isize == 2) {
00079 isize = 16;
00080 } else if (isize == 3) {
00081 isize = 24;
00082 }
00083
00084 size = isize * .001f * (zzzplt_1.xpgmax - zzzplt_1.xpgmin);
00085
00086 /* Rotation/scaling factors for digitization */
00087
00088 orr = *ior * .017453292f;
00089 ct = size * cos(orr);
00090 st = size * sin(orr);
00091
00092 /* Base location, in internal coordinates */
00093
00094 xx = *x;
00095 yy = *y;
00096 if (*nch >= 0) {
00097 zzphys_(&xx, &yy);
00098 }
00099
00100 /* Get no. of characters in string. Special option 999 must be checked.
00101 */
00102
00103 nchar = abs(*nch);
00104 if (nchar == 999) {
00105 i__1 = nchar;
00106 for (i__ = 1; i__ <= i__1; ++i__) {
00107 if (*(unsigned char *)&ch[i__ - 1] == '\0') {
00108 goto L20;
00109 }
00110 /* L10: */
00111 }
00112 L20:
00113 nchar = i__ - 1;
00114 } else if (nchar == 0) {
00115 nchar = lastnb_(ch, ch_len);
00116 }
00117
00118 /* Digitize string into line segments */
00119
00120 zzconv_(ch, &nchar, chloc, &nchloc, ch_len, 6666L);
00121 zzstro_(chloc, &nchloc, &nstr, xstr, ystr, lstr, 6666L);
00122 if (nstr <= 0) {
00123 return 0;
00124 }
00125
00126 /* Find min, max of x and y */
00127
00128 zzzplt_1.xbot = xstr[0];
00129 zzzplt_1.ybot = ystr[0];
00130 zzzplt_1.xtop = zzzplt_1.xbot;
00131 zzzplt_1.ytop = zzzplt_1.ybot;
00132 i__1 = nstr;
00133 for (i__ = 2; i__ <= i__1; ++i__) {
00134 /* Computing MIN */
00135 r__1 = zzzplt_1.xbot, r__2 = xstr[i__ - 1];
00136 zzzplt_1.xbot = dmin(r__1,r__2);
00137 /* Computing MAX */
00138 r__1 = zzzplt_1.xtop, r__2 = xstr[i__ - 1];
00139 zzzplt_1.xtop = dmax(r__1,r__2);
00140 /* Computing MIN */
00141 r__1 = zzzplt_1.ybot, r__2 = ystr[i__ - 1];
00142 zzzplt_1.ybot = dmin(r__1,r__2);
00143 /* Computing MAX */
00144 r__1 = zzzplt_1.ytop, r__2 = ystr[i__ - 1];
00145 zzzplt_1.ytop = dmax(r__1,r__2);
00146 /* L100: */
00147 }
00148
00149 /* Now compute origin of string, based on centering option; */
00150 /* the origin of the string goes at (XX,YY) */
00151
00152 if (*icent == -1) {
00153 xorg = zzzplt_1.xbot;
00154 yorg = (zzzplt_1.ybot + zzzplt_1.ytop) * .5f;
00155 } else if (*icent == 0) {
00156 xorg = (zzzplt_1.xbot + zzzplt_1.xtop) * .5f;
00157 yorg = (zzzplt_1.ybot + zzzplt_1.ytop) * .5f;
00158 } else if (*icent == 1) {
00159 xorg = zzzplt_1.xtop;
00160 yorg = (zzzplt_1.ybot + zzzplt_1.ytop) * .5f;
00161 } else {
00162 xorg = zzzplt_1.xbot;
00163 yorg = zzzplt_1.ybot;
00164 }
00165
00166 /* Now draw the strokes */
00167
00168 i__1 = nstr;
00169 for (i__ = 1; i__ <= i__1; ++i__) {
00170 if (lstr[i__ - 1] <= 1) {
00171 xr = xx + ct * (xstr[i__ - 1] - xorg) - st * (ystr[i__ - 1] -
00172 yorg);
00173 yr = yy + st * (xstr[i__ - 1] - xorg) + ct * (ystr[i__ - 1] -
00174 yorg);
00175 if (lstr[i__ - 1] == 1) {
00176 zzline_(&xold, &yold, &xr, &yr);
00177 }
00178 xold = xr;
00179 yold = yr;
00180 } else if (lstr[i__ - 1] > 100 && lstr[i__ - 1] <= 107) {
00181 i__2 = lstr[i__ - 1] - 100;
00182 color_(&i__2);
00183 }
00184 /* L200: */
00185 }
00186
00187 zzzplt_1.xphold = xold;
00188 zzzplt_1.yphold = yold;
00189 return 0;
00190 } /* pwritf_ */
|
|
|
Definition at line 322 of file plot_motif.c. References MEM_topshell_data::drawing, and expose_CB(). Referenced by AFNI_drive_clear_graph_xy(), ISQ_graymap_draw(), ISQ_rowgraph_draw(), ISQ_surfgraph_draw(), plot_strip_addto(), and plot_strip_clear().
00323 {
00324 if( mpcb == NULL ) return ;
00325 expose_CB( mpcb->drawing , mpcb , NULL ) ;
00326 return ;
00327 }
|
|
||||||||||||||||||||
|
Definition at line 409 of file plot_x11.c. References abs, X11_colordef::bb, X11_colordef::bbmask, X11_colordef::bbshift, X11_colordef::classKRH, X11_colordef::gg, X11_colordef::ggmask, X11_colordef::ggshift, X11_colordef::ncolors, r, X11_colordef::rr, X11_colordef::rrmask, and X11_colordef::rrshift. Referenced by memplot_to_X11_sef(), and set_X11_background().
00411 {
00412 /*--- TrueColor case: make color by appropriate bit twiddling ---*/
00413
00414 if( cd->classKRH == TrueColor ){
00415 unsigned long r , g , b , rgb ;
00416
00417 r = (cd->rrshift<0) ? (rr<<(-cd->rrshift))
00418 : (rr>>cd->rrshift) ; r = r & cd->rrmask ;
00419
00420 g = (cd->ggshift<0) ? (gg<<(-cd->ggshift))
00421 : (gg>>cd->ggshift) ; g = g & cd->ggmask ;
00422
00423 b = (cd->bbshift<0) ? (bb<<(-cd->bbshift))
00424 : (bb>>cd->bbshift) ; b = b & cd->bbmask ;
00425
00426 rgb = r | g | b ; /* assemble color from components */
00427 return rgb ;
00428 }
00429
00430 /*--- PseudoColor case: find closest match in colormap.
00431 Red, green, and blue are weighted according
00432 to their importance to the human visual system. ---*/
00433
00434 #define RW 2 /* the weights alluded to above */
00435 #define GW 4
00436 #define BW 1
00437
00438 if( cd->classKRH == PseudoColor ){
00439 int ii , rdif,gdif,bdif,dif , ibest,dbest ;
00440
00441 rdif = cd->rr[0] - rr ;
00442 gdif = cd->gg[0] - gg ;
00443 bdif = cd->bb[0] - bb ; dif = RW*abs(rdif)+GW*abs(gdif)+BW*abs(bdif) ;
00444 if( dif == 0 ) return 0 ;
00445
00446 ibest = 0 ; dbest = dif ;
00447 for( ii=1 ; ii < cd->ncolors ; ii++ ){
00448 rdif = cd->rr[ii] - rr ;
00449 gdif = cd->gg[ii] - gg ;
00450 bdif = cd->bb[ii] - bb ; dif = RW*abs(rdif)+GW*abs(gdif)+BW*abs(bdif) ;
00451 if( dif == 0 ) return ii ;
00452 if( dif < dbest ){ ibest = ii ; dbest = dif ; }
00453 }
00454 return ibest ;
00455 }
00456
00457 /*--- Illegal case! ---*/
00458
00459 return 0 ; /* always valid */
00460 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 322 of file plot_cox.c. References mp, MEM_plotdata::nxyline, and MEM_plotdata::xyline. Referenced by ISQ_getmemplot(), and ISQ_make_montage().
00324 {
00325 int ii,nn ;
00326 if( mp == NULL ) return ;
00327
00328 for( nn=ii=0 ; ii < mp->nxyline ; ii++ ){
00329 mp->xyline[nn] = mp->xyline[nn] * sx + tx ; nn++ ; /* x1 */
00330 mp->xyline[nn] = mp->xyline[nn] * sy + ty ; nn++ ; /* y1 */
00331 mp->xyline[nn] = mp->xyline[nn] * sx + tx ; nn++ ; /* x2 */
00332 mp->xyline[nn] = mp->xyline[nn] * sy + ty ; nn++ ; /* y2 */
00333 nn++ ; /* color */
00334 if( mp->xyline[nn] > 0.0 )
00335 mp->xyline[nn] = mp->xyline[nn] * st ; nn++ ; /* thick */
00336 }
00337 return ;
00338 }
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 41 of file set.c. References c__1, do_fio(), e_wsfe(), r_lg10(), s_wsfe(), and zzzplt_1. Referenced by plotpak_set(), and srface_().
00043 {
00044 /* Initialized data */
00045
00046 static shortint ixc[4] = { 1,1,-1,-1 };
00047 static shortint iyc[4] = { 1,-1,1,-1 };
00048
00049 /* Format strings */
00050 static char fmt_9001[] = "(//\002 ********** Illegal parameters in SET *"
00051 "*********\002/4(1x,1pg12.5)/4(1x,1pg12.5),i6)";
00052
00053 /* Builtin functions */
00054 double r_lg10(real *);
00055 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00056
00057 /* Local variables */
00058 static real sxmin, sxmax, symin, symax;
00059
00060 /* Fortran I/O blocks */
00061 static cilist io___7 = { 0, 6, 0, fmt_9001, 0 };
00062
00063
00064
00065 /* Set the relationship between the physical space and the user space. */
00066 /* .......................................................................
00067 */
00068
00069
00070 /* Internal Data for PLOTPAK */
00071
00072 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00073 */
00074 /* Check entry values for reasonableness. */
00075
00076 if (*xobj1 < zzzplt_1.xpgmin || *xobj1 >= *xobj2 || *xobj2 >
00077 zzzplt_1.xpgmax || *xsub1 == *xsub2 || *yobj1 < zzzplt_1.ypgmin ||
00078 *yobj1 >= *yobj2 || *yobj2 > zzzplt_1.ypgmax || *ysub1 == *ysub2
00079 || *ltype <= 0 || *ltype > 4) {
00080 goto L9000;
00081 }
00082 /* .......................................................................
00083 */
00084 zzzplt_1.xbot = *xobj1;
00085 zzzplt_1.ybot = *yobj1;
00086 zzzplt_1.xtop = *xobj2;
00087 zzzplt_1.ytop = *yobj2;
00088
00089 zzzplt_1.xmin = *xsub1;
00090 zzzplt_1.xmax = *xsub2;
00091 zzzplt_1.ymin = *ysub1;
00092 zzzplt_1.ymax = *ysub2;
00093
00094 zzzplt_1.ixcoor = ixc[*ltype - 1];
00095 zzzplt_1.iycoor = iyc[*ltype - 1];
00096
00097 if (zzzplt_1.ixcoor >= 0) {
00098 sxmin = *xsub1;
00099 sxmax = *xsub2;
00100 } else {
00101 if (*xsub1 <= 0.f || *xsub2 <= 0.f) {
00102 goto L9000;
00103 }
00104 sxmin = r_lg10(xsub1);
00105 sxmax = r_lg10(xsub2);
00106 }
00107
00108 if (zzzplt_1.iycoor >= 0) {
00109 symin = *ysub1;
00110 symax = *ysub2;
00111 } else {
00112 if (*ysub1 <= 0.f || *ysub2 <= 0.f) {
00113 goto L9000;
00114 }
00115 symin = r_lg10(ysub1);
00116 symax = r_lg10(ysub2);
00117 }
00118
00119 /* Calculate the alpha and beta scaling factors to map user space */
00120 /* into physical space. */
00121
00122 zzzplt_1.alphxx = (zzzplt_1.xtop - zzzplt_1.xbot) / (sxmax - sxmin);
00123 zzzplt_1.betaxx = zzzplt_1.xbot - zzzplt_1.alphxx * sxmin;
00124
00125 zzzplt_1.alphyy = (zzzplt_1.ytop - zzzplt_1.ybot) / (symax - symin);
00126 zzzplt_1.betayy = zzzplt_1.ybot - zzzplt_1.alphyy * symin;
00127
00128 return 0;
00129 /* .......................................................................
00130 */
00131 L9000:
00132 /* CC OPEN( 98 , FILE='PLOTPAK.ERR' , STATUS='NEW' ) */
00133 /* CC WRITE(98,9001) XOBJ1,XOBJ2 , YOBJ1,YOBJ2 , */
00134 /* CC X XSUB1,XSUB2 , YSUB1,YSUB2 , LTYPE */
00135 /* L9001: */
00136 /* cc CLOSE( 98 ) */
00137
00138 s_wsfe(&io___7);
00139 do_fio(&c__1, (char *)&(*xobj1), (ftnlen)sizeof(real));
00140 do_fio(&c__1, (char *)&(*xobj2), (ftnlen)sizeof(real));
00141 do_fio(&c__1, (char *)&(*yobj1), (ftnlen)sizeof(real));
00142 do_fio(&c__1, (char *)&(*yobj2), (ftnlen)sizeof(real));
00143 do_fio(&c__1, (char *)&(*xsub1), (ftnlen)sizeof(real));
00144 do_fio(&c__1, (char *)&(*xsub2), (ftnlen)sizeof(real));
00145 do_fio(&c__1, (char *)&(*ysub1), (ftnlen)sizeof(real));
00146 do_fio(&c__1, (char *)&(*ysub2), (ftnlen)sizeof(real));
00147 do_fio(&c__1, (char *)&(*ltype), (ftnlen)sizeof(integer));
00148 e_wsfe();
00149 exit(0) ;
00150 return 0;
00151 } /* set_ */
|
|
|
Definition at line 112 of file plot_cox.c. References active_plot, MEM_plotdata::aspect, memplt_(), and num_plotar. Referenced by elvis_CB(), plot_strip_addto(), and plot_ts_addto().
00113 {
00114 int ip ;
00115
00116 if( id == NULL || id[0] == '\0' || num_plotar == 0 || plotar == NULL )
00117 return 1 ;
00118
00119 for( ip=0 ; ip < num_plotar ; ip++ )
00120 if( strcmp(plotar[ip]->ident,id) == 0 ){
00121 real asp = plotar[ip]->aspect ;
00122 active_plot = ip ;
00123 memplt_( &asp ) ; /* re-setup PLOTPAK */
00124 return 0 ;
00125 }
00126
00127 return 1 ;
00128 }
|
|
||||||||||||||||
|
Definition at line 149 of file plot_cox.c. References active_color, r, and RGB_TO_COL. Referenced by AFNI_brick_to_mri(), ISQ_getmemplot(), ISQ_plot_label(), ISQ_rowgraph_draw(), ISQ_show_image(), make_plot(), plot_image_surface(), PLOT_scatterellipse(), plot_strip_addto(), plot_strip_init(), plot_ts_addto(), plot_ts_init(), plot_ts_mem(), PLOT_tsgray(), PLUTO_scatterplot(), SPLASH_imseq_getim(), and zzmpco_().
00150 {
00151 if( r > 1.0 || g > 1.0 || b > 1.0 ){ /* 22 Mar 2002: */
00152 r /= 255.0 ; g /= 255.0 ; b /= 255.0 ; /* allow for 0..255 */
00153 }
00154 if( r < 0.0 ) r = 0.0 ; else if ( r > 1.0 ) r = 1.0 ;
00155 if( g < 0.0 ) g = 0.0 ; else if ( g > 1.0 ) g = 1.0 ;
00156 if( b < 0.0 ) b = 0.0 ; else if ( b > 1.0 ) b = 1.0 ;
00157
00158 active_color = (float) RGB_TO_COL(r,g,b) ;
00159 return ;
00160 }
|
|
||||||||||||||||||||
|
Definition at line 70 of file plot_x11.c. References box_xbot, box_xtop, box_ybot, and box_ytop. Referenced by memplot_to_X11_sef().
|
|
|
Definition at line 182 of file plot_cox.c. References active_opacity, active_plot, ADDTO_MEMPLOT, mp, and num_plotar. Referenced by PLOT_tsgray().
00183 {
00184 MEM_plotdata *mp ;
00185
00186 if( th < 0.0 ) th = 0.0 ;
00187 else if( th > 1.0 ) th = 1.0 ;
00188 active_opacity = th ;
00189
00190 /* Set opacity for further drawing [22 Jul 2004] */
00191
00192 if( active_plot < 0 || active_plot >= num_plotar ||
00193 num_plotar == 0 || plotar == NULL ||
00194 plotar[active_plot] == NULL ) return ;
00195
00196 mp = plotar[active_plot] ;
00197 ADDTO_MEMPLOT( mp , th,0.0,0.0,0.0 , 0.0 , -THCODE_OPAC ) ;
00198 return ;
00199 }
|
|
|
Definition at line 170 of file plot_cox.c. References active_thick. Referenced by AFNI_brick_to_mri(), ISQ_getmemplot(), ISQ_plot_label(), ISQ_rowgraph_draw(), ISQ_show_image(), make_plot(), plot_image_surface(), PLOT_scatterellipse(), plot_strip_addto(), plot_strip_init(), plot_ts_addto(), plot_ts_init(), plot_ts_mem(), PLOT_tsgray(), PLUTO_scatterplot(), and SPLASH_imseq_getim().
00171 {
00172 if( th < 0.0 ) th = 0.0 ;
00173 active_thick = th ;
00174 return ;
00175 }
|
|
||||||||||||||||||||||||
|
Definition at line 47 of file plot_x11.c. References dpy, getwin_from_XDBE(), rgb_to_pixel(), and setup_X11_plotting(). Referenced by elvis_CB(), and expose_CB().
00049 {
00050 unsigned long pix ;
00051
00052 if( dpy == NULL || w == (Window) 0 ) return ;
00053
00054 setup_X11_plotting( dpy , w ) ;
00055 pix = rgb_to_pixel( rr,gg,bb , old_cd ) ;
00056 XSetWindowBackground( dpy , getwin_from_XDBE(dpy,w) , pix ) ;
00057 return ;
00058 }
|
|
||||||||||||
|
Definition at line 20 of file setdsh.c. Referenced by plotpak_setdsh(), and setlin_().
00021 {
00022 /* System generated locals */
00023 integer i__1;
00024
00025 /* Local variables */
00026 static integer i__;
00027
00028
00029 /* Set dash lengths (in internal units) */
00030
00031 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00032 */
00033 /* Parameter adjustments */
00034 --xld;
00035
00036 /* Function Body */
00037 zzdash_1.ndash = min(*nd,8);
00038 zzdash_1.xid = 0.f;
00039 i__1 = zzdash_1.ndash;
00040 for (i__ = 1; i__ <= i__1; ++i__) {
00041 zzdash_1.xldash[i__ - 1] = xld[i__];
00042 /* L10: */
00043 }
00044 return 0;
00045 } /* setdsh_ */
|
|
||||||||||||||||||||
|
Definition at line 38 of file setfrm.c. References c__1, setlin_(), and zzzplt_1. Referenced by memplt_(), and plotpak_setfrm().
00040 {
00041 extern /* Subroutine */ int setlin_(integer *);
00042
00043
00044 /* This routine has no analog in NCAR. It is called once before all */
00045 /* plots to set various parameters that define a "frame". */
00046
00047 /* The entries are the minimum and maximum "physical" x and y values */
00048 /* allowed. In NCAR they would always be 0,1,0,1. Here they can be */
00049 /* anything to allow for various output device aspect ratios. However,
00050 */
00051 /* for plots to look reasonable, 1 unit in the x-direction should be the
00052 */
00053 /* same physical size as 1 unit in the y-direction. */
00054 /* .......................................................................
00055 */
00056 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00057 */
00058 /* Set size of physical page. */
00059
00060
00061 /* Internal Data for PLOTPAK */
00062
00063 zzzplt_1.xpgmin = *xobj1;
00064 zzzplt_1.xpgmax = *xobj2;
00065 zzzplt_1.ypgmin = *yobj1;
00066 zzzplt_1.ypgmax = *yobj2;
00067
00068 /* Initialize the clipping region in case SETW is never called. */
00069
00070 zzzplt_1.xclbot = zzzplt_1.xpgmin;
00071 zzzplt_1.xcltop = zzzplt_1.xpgmax;
00072 zzzplt_1.yclbot = zzzplt_1.ypgmin;
00073 zzzplt_1.ycltop = zzzplt_1.ypgmax;
00074
00075 /* Initialize various parameters in case SET is never called. */
00076 /* Physical coordinate range: */
00077
00078 zzzplt_1.xbot = zzzplt_1.xpgmin;
00079 zzzplt_1.xtop = zzzplt_1.xpgmax;
00080 zzzplt_1.ybot = zzzplt_1.ypgmin;
00081 zzzplt_1.ytop = zzzplt_1.ypgmax;
00082
00083 /* User coordinate range: */
00084
00085 zzzplt_1.xmin = zzzplt_1.xpgmin;
00086 zzzplt_1.xmax = zzzplt_1.xpgmax;
00087 zzzplt_1.ymin = zzzplt_1.ypgmin;
00088 zzzplt_1.ymax = zzzplt_1.ypgmax;
00089
00090 /* Last plotting location (lower left of page): */
00091
00092 zzzplt_1.xphold = zzzplt_1.xpgmin;
00093 zzzplt_1.yphold = zzzplt_1.ypgmin;
00094
00095 /* Axis types (linear): */
00096
00097 zzzplt_1.ixcoor = 1;
00098 zzzplt_1.iycoor = 1;
00099
00100 /* Axis scalings from user to physical coordinates: */
00101
00102 zzzplt_1.alphxx = 1.f;
00103 zzzplt_1.alphyy = 1.f;
00104 zzzplt_1.betaxx = 0.f;
00105 zzzplt_1.betayy = 0.f;
00106
00107 /* Grid parameters: */
00108
00109 zzzplt_1.tmajx = (zzzplt_1.xpgmax - zzzplt_1.xpgmin) * .01f;
00110 zzzplt_1.tminx = zzzplt_1.tmajx * .6f;
00111 zzzplt_1.tmajy = zzzplt_1.tmajx;
00112 zzzplt_1.tminy = zzzplt_1.tminx;
00113
00114 zzzplt_1.majrx = 5;
00115 zzzplt_1.minrx = 10;
00116 zzzplt_1.majry = 5;
00117 zzzplt_1.minry = 10;
00118 zzzplt_1.isizx = 12;
00119 zzzplt_1.isizy = 12;
00120
00121 /* Dashed line type (solid) */
00122
00123 setlin_(&c__1);
00124
00125 return 0;
00126 } /* setfrm_ */
|
|
|
Definition at line 11 of file setlin.c. References setdsh_(). Referenced by plotpak_setlin(), and setfrm_().
00012 {
00013 /* Initialized data */
00014
00015 static integer ndash[5] = { 1,2,2,6,2 };
00016 static real xdash[40] /* was [8][5] */ = { 1.f,1.f,1.f,1.f,1.f,1.f,
00017 1.f,1.f,.007f,-.007f,1.f,1.f,1.f,1.f,1.f,1.f,.002f,-.003f,1.f,1.f,
00018 1.f,1.f,1.f,1.f,.007f,-.004f,.002f,-.004f,.002f,-.004f,1.f,1.f,
00019 2e-4f,-.005f,1.f,1.f,1.f,1.f,1.f,1.f };
00020
00021 static integer nd;
00022 extern /* Subroutine */ int setdsh_(integer *, real *);
00023
00024
00025 /* Set default dash types */
00026 /* 1 = solid */
00027 /* 2 = long dash */
00028 /* 3 = short */
00029 /* 4 = long - short - short */
00030 /* 5 = very short */
00031 /* Outside this range ==> solid */
00032
00033
00034
00035 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00036 */
00037
00038 nd = *ntype;
00039 if (*ntype <= 0 || *ntype > 5) {
00040 nd = 1;
00041 }
00042
00043 setdsh_(&ndash[nd - 1], &xdash[(nd << 3) - 8]);
00044 return 0;
00045 } /* setlin_ */
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 1448 of file srface.c. References c__0, c__1, dummy, pwrz1s_1, srfblk_1, trn32s_(), zmax, and zmin.
01450 {
01451 /* System generated locals */
01452 real r__1, r__2, r__3;
01453
01454 /* Local variables */
01455 static real yeye, xeye, zeye, alpha;
01456 extern /* Subroutine */ int trn32s_(real *, real *, real *, real *, real *
01457 , real *, integer *);
01458 static real dummy, dummie, xat, yat, zat, umn, vmn, xmn, ymn, zmn, umx,
01459 vmx, xmx, ymx, zmx;
01460
01461
01462 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01463 */
01464 if (*r0 <= 0.f) {
01465 goto L10;
01466 } else {
01467 goto L20;
01468 }
01469 L10:
01470 srfblk_1.nrswt = 0;
01471 return 0;
01472 L20:
01473 srfblk_1.nrswt = 1;
01474 pwrz1s_1.xxmin = *xmin;
01475 pwrz1s_1.xxmax = *xmax;
01476 pwrz1s_1.yymin = *ymin;
01477 pwrz1s_1.yymax = *ymax;
01478 pwrz1s_1.zzmin = *zmin;
01479 pwrz1s_1.zzmax = *zmax;
01480 srfblk_1.rzero = *r0;
01481 srfblk_1.ll = 0;
01482 xat = (pwrz1s_1.xxmax + pwrz1s_1.xxmin) * .5f;
01483 yat = (pwrz1s_1.yymax + pwrz1s_1.yymin) * .5f;
01484 zat = (pwrz1s_1.zzmax + pwrz1s_1.zzmin) * .5f;
01485 alpha = -(pwrz1s_1.yymin - yat) / (pwrz1s_1.xxmin - xat);
01486 yeye = -srfblk_1.rzero / sqrt(alpha * alpha + 1.f);
01487 xeye = yeye * alpha;
01488 yeye += yat;
01489 xeye += xat;
01490 zeye = zat;
01491 trn32s_(&xat, &yat, &zat, &xeye, &yeye, &zeye, &c__0);
01492 xmn = pwrz1s_1.xxmin;
01493 xmx = pwrz1s_1.xxmax;
01494 ymn = pwrz1s_1.yymin;
01495 ymx = pwrz1s_1.yymax;
01496 zmn = pwrz1s_1.zzmin;
01497 zmx = pwrz1s_1.zzmax;
01498 trn32s_(&xmn, &ymn, &zat, &umn, &dummy, &dummie, &c__1);
01499 trn32s_(&xmx, &ymn, &zmn, &dummy, &vmn, &dummie, &c__1);
01500 trn32s_(&xmx, &ymx, &zat, &umx, &dummy, &dummie, &c__1);
01501 trn32s_(&xmx, &ymn, &zmx, &dummy, &vmx, &dummie, &c__1);
01502 srfblk_1.umin = umn;
01503 srfblk_1.umax = umx;
01504 srfblk_1.vmin = vmn;
01505 srfblk_1.vmax = vmx;
01506 /* Computing 2nd power */
01507 r__1 = pwrz1s_1.xxmax - pwrz1s_1.xxmin;
01508 /* Computing 2nd power */
01509 r__2 = pwrz1s_1.yymax - pwrz1s_1.yymin;
01510 /* Computing 2nd power */
01511 r__3 = pwrz1s_1.zzmax - pwrz1s_1.zzmin;
01512 srfblk_1.bigd = sqrt(r__1 * r__1 + r__2 * r__2 + r__3 * r__3) * .5f;
01513 return 0;
01514 } /* setr_ */
|
|
||||||||||||||||||||
|
Definition at line 34 of file setw.c. References dmax, dmin, x2, y1, and zzzplt_1. Referenced by plotpak_setw().
00035 {
00036
00037 /* Set the clipping rectangle (physical coords). */
00038 /* .......................................................................
00039 */
00040 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00041 */
00042
00043 /* Internal Data for PLOTPAK */
00044
00045 if (*x1 >= *x2) {
00046 zzzplt_1.xclbot = zzzplt_1.xpgmin;
00047 zzzplt_1.xcltop = zzzplt_1.xpgmax;
00048 } else {
00049 zzzplt_1.xclbot = dmax(*x1,zzzplt_1.xpgmin);
00050 zzzplt_1.xcltop = dmin(*x2,zzzplt_1.xpgmax);
00051 }
00052
00053 if (*y1 >= *y2) {
00054 zzzplt_1.yclbot = zzzplt_1.ypgmin;
00055 zzzplt_1.ycltop = zzzplt_1.ypgmax;
00056 } else {
00057 zzzplt_1.yclbot = dmax(*y1,zzzplt_1.ypgmin);
00058 zzzplt_1.ycltop = dmin(*y2,zzzplt_1.ypgmax);
00059 }
00060
00061 return 0;
00062 } /* setw_ */
|
|
|
Definition at line 1709 of file srface.c.
01710 {
01711
01712 /* INITIALIZATION OF INTERNAL PARAMETERS */
01713
01714
01715 return 0;
01716 } /* srfabd_ */
|
|
||||||||||||||||||||||||||||||||||||||||
|
Definition at line 71 of file srface.c. References abs, c__0, c__1, c__40, c_b2, c_b3, c_b7, clset_(), ctcell_(), dabs, dmax, dmin, draws_(), dummy, frame_(), l, min, pwrz1s_1, set_(), srfabd_(), srfblk_1, srfip1_1, and trn32s_(). Referenced by plotpak_srface().
00073 {
00074 /* Initialized data */
00075
00076 static integer jf = 1;
00077 static integer if__ = 1;
00078 static integer ly = 2;
00079 static integer lx = 2;
00080 static integer icnst = 0;
00081
00082 /* System generated locals */
00083 integer z_dim1, z_offset, m_dim2, m_offset, i__1, i__2, i__3, i__4, i__5,
00084 i__6, i__7, i__8, i__9, i__10;
00085
00086 /* Local variables */
00087 static integer ipic, npic, ipli, jplj;
00088 static real ster, poix, poiy, poiz, xeye;
00089 static integer mmxx, nnxx;
00090 static real yeye;
00091 static integer nnyy;
00092 static real zeye, ynow, xnow, sign1;
00093 static integer i__, j, k, l;
00094 extern /* Subroutine */ int frame_(void);
00095 static real hight;
00096 extern /* Subroutine */ int clset_(real *, integer *, integer *, integer *
00097 , real *, real *, real *, integer *, integer *, real *, integer *,
00098 integer *, integer *, real *, real *);
00099 static real width;
00100 extern /* Subroutine */ int draws_(integer *, integer *, integer *,
00101 integer *, integer *, integer *);
00102 static integer jpass, ipass;
00103 static real d1, d2;
00104 extern /* Subroutine */ int trn32s_(real *, real *, real *, real *, real *
00105 , real *, integer *);
00106 static real dummy;
00107 static integer nxstp, nystp, ii, jj, li, mi, in, jn, ni, lj;
00108 static real dx, dy;
00109 static integer mj, nj;
00110 extern /* Subroutine */ int srfabd_(void);
00111 static real ctheta, rx, ry, rz, ut, vt, qu, qv, ru, zz, rv;
00112 extern /* Subroutine */ int ctcell_(real *, integer *, integer *, integer
00113 *, integer *, integer *, integer *);
00114 static real stheta;
00115 static integer nxpass, nypass;
00116 static real ux1, vx1, ux2, vx2, uy1, vy1, uy2, vy2, dif, agl;
00117 static integer nla, mxf[2], myf[2];
00118 extern /* Subroutine */ int set_(real *, real *, real *, real *, real *,
00119 real *, real *, real *, integer *);
00120 static integer mxj[2], myj[2], mxs[2], mys[2], nxp1, nyp1;
00121
00122
00123 /* Surface plotting package from NCAR -- the only high level NCAR */
00124 /* routine in this library at present (Aug 17, 1990). */
00125
00126 /*cc DIMENSION X(NX) ,Y(NY) ,Z(MX,NY) ,M(2,NX,NY) ,
00127 */
00128 /* cc 1 S(6) */
00129 /* Parameter adjustments */
00130 --x;
00131 m_dim2 = *nx;
00132 m_offset = (m_dim2 + 1 << 1) + 1;
00133 m -= m_offset;
00134 z_dim1 = *mx;
00135 z_offset = z_dim1 + 1;
00136 z__ -= z_offset;
00137 --y;
00138 --s;
00139
00140 /* Function Body */
00141 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00142 */
00143 srfabd_();
00144 set_(&c_b2, &c_b3, &c_b2, &c_b3, &c_b3, &c_b7, &c_b3, &c_b7, &c__1);
00145 srfblk_1.bigest = 1e38f;
00146 /* CC BIGEST = R1MACH(2) */
00147 mmxx = *mx;
00148 nnxx = *nx;
00149 nnyy = *ny;
00150 ster = *stereo;
00151 nxp1 = nnxx + 1;
00152 nyp1 = nnyy + 1;
00153 nla = srfip1_1.ncla;
00154 srfblk_1.nspval = srfip1_1.ispval;
00155 srfblk_1.ndrz = srfip1_1.idrz;
00156 if (srfip1_1.idrz != 0) {
00157 clset_(&z__[z_offset], &mmxx, &nnxx, &nnyy, &srfip1_1.chi, &
00158 srfip1_1.clo, &srfip1_1.cinc, &nla, &c__40, srfblk_1.cl, &
00159 srfblk_1.ncl, &icnst, &srfblk_1.ioffp, &srfblk_1.spval, &
00160 srfblk_1.bigest);
00161 }
00162 if (srfip1_1.idrz != 0) {
00163 srfblk_1.ndrz = 1 - icnst;
00164 }
00165 stheta = sin(ster * srfip1_1.theta);
00166 ctheta = cos(ster * srfip1_1.theta);
00167 rx = s[1] - s[4];
00168 ry = s[2] - s[5];
00169 rz = s[3] - s[6];
00170 d1 = sqrt(rx * rx + ry * ry + rz * rz);
00171 d2 = sqrt(rx * rx + ry * ry);
00172 dx = 0.f;
00173 dy = 0.f;
00174 if (*stereo == 0.f) {
00175 goto L20;
00176 }
00177 d1 = d1 * *stereo * srfip1_1.theta;
00178 if (d2 > 0.f) {
00179 goto L10;
00180 }
00181 dx = d1;
00182 goto L20;
00183 L10:
00184 agl = atan2(rx, -ry);
00185 dx = d1 * cos(agl);
00186 dy = d1 * sin(agl);
00187 L20:
00188 srfblk_1.irot = srfip1_1.irots;
00189 npic = 1;
00190 if (ster != 0.f) {
00191 npic = 2;
00192 }
00193 srfblk_1.fact = 1.f;
00194 if (srfblk_1.nrswt != 0) {
00195 srfblk_1.fact = srfblk_1.rzero / d1;
00196 }
00197 if (srfip1_1.istp == 0 && ster != 0.f) {
00198 srfblk_1.irot = 1;
00199 }
00200 i__1 = npic;
00201 for (ipic = 1; ipic <= i__1; ++ipic) {
00202 srfblk_1.nupper = srfip1_1.iupper;
00203 if (srfip1_1.ifr < 0) {
00204 frame_();
00205 }
00206
00207 /* SET UP MAPING FROM FLOATING POINT 3-SPACE TO CRT SPACE. */
00208
00209 sign1 = (real) ((ipic << 1) - 3);
00210 pwrz1s_1.eyex = s[1] + sign1 * dx;
00211 poix = s[4] + sign1 * dx;
00212 pwrz1s_1.eyey = s[2] + sign1 * dy;
00213 poiy = s[5] + sign1 * dy;
00214 pwrz1s_1.eyez = s[3];
00215 poiz = s[6];
00216 srfblk_1.ll = 0;
00217 xeye = pwrz1s_1.eyex;
00218 yeye = pwrz1s_1.eyey;
00219 zeye = pwrz1s_1.eyez;
00220 trn32s_(&poix, &poiy, &poiz, &xeye, &yeye, &zeye, &c__0);
00221 srfblk_1.ll = ipic + (srfip1_1.istp << 1) + 3;
00222 if (ster == 0.f) {
00223 srfblk_1.ll = 1;
00224 }
00225 if (srfblk_1.nrswt != 0) {
00226 goto L100;
00227 }
00228 pwrz1s_1.xxmin = x[1];
00229 pwrz1s_1.xxmax = x[nnxx];
00230 pwrz1s_1.yymin = y[1];
00231 pwrz1s_1.yymax = y[nnyy];
00232 srfblk_1.umin = srfblk_1.bigest;
00233 srfblk_1.vmin = srfblk_1.bigest;
00234 pwrz1s_1.zzmin = srfblk_1.bigest;
00235 srfblk_1.umax = -srfblk_1.umin;
00236 srfblk_1.vmax = -srfblk_1.vmin;
00237 pwrz1s_1.zzmax = -pwrz1s_1.zzmin;
00238 i__2 = nnyy;
00239 for (j = 1; j <= i__2; ++j) {
00240 i__3 = nnxx;
00241 for (i__ = 1; i__ <= i__3; ++i__) {
00242 zz = z__[i__ + j * z_dim1];
00243 if (srfblk_1.ioffp == 1 && zz == srfblk_1.spval) {
00244 goto L30;
00245 }
00246 pwrz1s_1.zzmax = dmax(pwrz1s_1.zzmax,zz);
00247 pwrz1s_1.zzmin = dmin(pwrz1s_1.zzmin,zz);
00248 trn32s_(&x[i__], &y[j], &z__[i__ + j * z_dim1], &ut, &vt, &
00249 dummy, &c__1);
00250 srfblk_1.umax = dmax(srfblk_1.umax,ut);
00251 srfblk_1.umin = dmin(srfblk_1.umin,ut);
00252 srfblk_1.vmax = dmax(srfblk_1.vmax,vt);
00253 srfblk_1.vmin = dmin(srfblk_1.vmin,vt);
00254 L30:
00255 ;
00256 }
00257 /* L40: */
00258 }
00259 if (srfip1_1.iskirt != 1) {
00260 goto L70;
00261 }
00262 nxstp = nnxx - 1;
00263 nystp = nnyy - 1;
00264 i__2 = nnyy;
00265 i__3 = nystp;
00266 for (j = 1; i__3 < 0 ? j >= i__2 : j <= i__2; j += i__3) {
00267 i__4 = nnxx;
00268 i__5 = nxstp;
00269 for (i__ = 1; i__5 < 0 ? i__ >= i__4 : i__ <= i__4; i__ += i__5) {
00270 trn32s_(&x[i__], &y[j], &srfip1_1.hskirt, &ut, &vt, &dummy, &
00271 c__1);
00272 srfblk_1.umax = dmax(srfblk_1.umax,ut);
00273 srfblk_1.umin = dmin(srfblk_1.umin,ut);
00274 srfblk_1.vmax = dmax(srfblk_1.vmax,vt);
00275 srfblk_1.vmin = dmin(srfblk_1.vmin,vt);
00276 /* L50: */
00277 }
00278 /* L60: */
00279 }
00280 L70:
00281 width = srfblk_1.umax - srfblk_1.umin;
00282 hight = srfblk_1.vmax - srfblk_1.vmin;
00283 dif = (width - hight) * .5f;
00284 if (dif < 0.f) {
00285 goto L80;
00286 } else if (dif == 0) {
00287 goto L100;
00288 } else {
00289 goto L90;
00290 }
00291 L80:
00292 srfblk_1.umin += dif;
00293 srfblk_1.umax -= dif;
00294 goto L100;
00295 L90:
00296 srfblk_1.vmin -= dif;
00297 srfblk_1.vmax += dif;
00298 L100:
00299 xeye = pwrz1s_1.eyex;
00300 yeye = pwrz1s_1.eyey;
00301 zeye = pwrz1s_1.eyez;
00302 trn32s_(&poix, &poiy, &poiz, &xeye, &yeye, &zeye, &c__0);
00303 i__3 = nnyy;
00304 for (j = 1; j <= i__3; ++j) {
00305 i__2 = nnxx;
00306 for (i__ = 1; i__ <= i__2; ++i__) {
00307 trn32s_(&x[i__], &y[j], &z__[i__ + j * z_dim1], &ut, &vt, &
00308 dummy, &c__1);
00309 m[(i__ + j * m_dim2 << 1) + 1] = ut;
00310 m[(i__ + j * m_dim2 << 1) + 2] = vt;
00311 /* L110: */
00312 }
00313 /* L120: */
00314 }
00315
00316 /* INITIALIZE UPPER AND LOWER VISIBILITY ARRAYS */
00317
00318 for (k = 1; k <= 1024; ++k) {
00319 srfblk_1.limu[k - 1] = 0;
00320 srfblk_1.liml[k - 1] = 1024;
00321 /* L130: */
00322 }
00323
00324 /* FIND ORDER TO DRAW LINES */
00325
00326 nxpass = 1;
00327 if (s[1] >= x[nnxx]) {
00328 goto L160;
00329 }
00330 if (s[1] <= x[1]) {
00331 goto L170;
00332 }
00333 i__3 = nnxx;
00334 for (i__ = 2; i__ <= i__3; ++i__) {
00335 lx = i__;
00336 if (s[1] <= x[i__]) {
00337 goto L150;
00338 }
00339 /* L140: */
00340 }
00341 L150:
00342 mxs[0] = lx - 1;
00343 mxj[0] = -1;
00344 mxf[0] = 1;
00345 mxs[1] = lx;
00346 mxj[1] = 1;
00347 mxf[1] = nnxx;
00348 nxpass = 2;
00349 goto L180;
00350 L160:
00351 mxs[0] = nnxx;
00352 mxj[0] = -1;
00353 mxf[0] = 1;
00354 goto L180;
00355 L170:
00356 mxs[0] = 1;
00357 mxj[0] = 1;
00358 mxf[0] = nnxx;
00359 L180:
00360 nypass = 1;
00361 if (s[2] >= y[nnyy]) {
00362 goto L210;
00363 }
00364 if (s[2] <= y[1]) {
00365 goto L220;
00366 }
00367 i__3 = nnyy;
00368 for (j = 2; j <= i__3; ++j) {
00369 ly = j;
00370 if (s[2] <= y[j]) {
00371 goto L200;
00372 }
00373 /* L190: */
00374 }
00375 L200:
00376 mys[0] = ly - 1;
00377 myj[0] = -1;
00378 myf[0] = 1;
00379 mys[1] = ly;
00380 myj[1] = 1;
00381 myf[1] = nnyy;
00382 nypass = 2;
00383 goto L230;
00384 L210:
00385 mys[0] = nnyy;
00386 myj[0] = -1;
00387 myf[0] = 1;
00388 goto L230;
00389 L220:
00390 mys[0] = 1;
00391 myj[0] = 1;
00392 myf[0] = nnyy;
00393
00394 /* PUT ON SKIRT ON FRONT SIDE IF WANTED */
00395
00396 L230:
00397 if (nxpass == 2 && nypass == 2) {
00398 goto L490;
00399 }
00400 if (srfip1_1.iskirt == 0) {
00401 goto L290;
00402 }
00403 in = mxs[0];
00404 if__ = mxf[0];
00405 jn = mys[0];
00406 jf = myf[0];
00407 if (nypass != 1) {
00408 goto L260;
00409 }
00410 trn32s_(&x[1], &y[jn], &srfip1_1.hskirt, &ux1, &vx1, &dummy, &c__1);
00411 trn32s_(&x[nnxx], &y[jn], &srfip1_1.hskirt, &ux2, &vx2, &dummy, &c__1)
00412 ;
00413 qu = (ux2 - ux1) / (x[nnxx] - x[1]);
00414 qv = (vx2 - vx1) / (x[nnxx] - x[1]);
00415 ynow = y[jn];
00416 i__3 = nnxx;
00417 for (i__ = 1; i__ <= i__3; ++i__) {
00418 trn32s_(&x[i__], &ynow, &srfip1_1.hskirt, &ru, &rv, &dummy, &c__1)
00419 ;
00420 i__2 = (integer) ru;
00421 i__5 = (integer) rv;
00422 draws_(&i__2, &i__5, &m[(i__ + jn * m_dim2 << 1) + 1], &m[(i__ +
00423 jn * m_dim2 << 1) + 2], &c__1, &c__0);
00424 /* L240: */
00425 }
00426 i__3 = (integer) ux1;
00427 i__2 = (integer) vx1;
00428 i__5 = (integer) ux2;
00429 i__4 = (integer) vx2;
00430 draws_(&i__3, &i__2, &i__5, &i__4, &c__1, &c__1);
00431 if (srfip1_1.idry != 0) {
00432 goto L260;
00433 }
00434 i__3 = nnxx;
00435 for (i__ = 2; i__ <= i__3; ++i__) {
00436 draws_(&m[(i__ - 1 + jn * m_dim2 << 1) + 1], &m[(i__ - 1 + jn *
00437 m_dim2 << 1) + 2], &m[(i__ + jn * m_dim2 << 1) + 1], &m[(
00438 i__ + jn * m_dim2 << 1) + 2], &c__1, &c__1);
00439 /* L250: */
00440 }
00441 L260:
00442 if (nxpass != 1) {
00443 goto L290;
00444 }
00445 trn32s_(&x[in], &y[1], &srfip1_1.hskirt, &uy1, &vy1, &dummy, &c__1);
00446 trn32s_(&x[in], &y[nnyy], &srfip1_1.hskirt, &uy2, &vy2, &dummy, &c__1)
00447 ;
00448 qu = (uy2 - uy1) / (y[nnyy] - y[1]);
00449 qv = (vy2 - vy1) / (y[nnyy] - y[1]);
00450 xnow = x[in];
00451 i__3 = nnyy;
00452 for (j = 1; j <= i__3; ++j) {
00453 trn32s_(&xnow, &y[j], &srfip1_1.hskirt, &ru, &rv, &dummy, &c__1);
00454 i__2 = (integer) ru;
00455 i__5 = (integer) rv;
00456 draws_(&i__2, &i__5, &m[(in + j * m_dim2 << 1) + 1], &m[(in + j *
00457 m_dim2 << 1) + 2], &c__1, &c__0);
00458 /* L270: */
00459 }
00460 i__3 = (integer) uy1;
00461 i__2 = (integer) vy1;
00462 i__5 = (integer) uy2;
00463 i__4 = (integer) vy2;
00464 draws_(&i__3, &i__2, &i__5, &i__4, &c__1, &c__1);
00465 if (srfip1_1.idrx != 0) {
00466 goto L290;
00467 }
00468 i__3 = nnyy;
00469 for (j = 2; j <= i__3; ++j) {
00470 draws_(&m[(in + (j - 1) * m_dim2 << 1) + 1], &m[(in + (j - 1) *
00471 m_dim2 << 1) + 2], &m[(in + j * m_dim2 << 1) + 1], &m[(in
00472 + j * m_dim2 << 1) + 2], &c__1, &c__1);
00473 /* L280: */
00474 }
00475
00476 /* PICK PROPER ALGORITHM */
00477
00478 L290:
00479 li = mxj[0];
00480 mi = mxs[0] - li;
00481 ni = (i__3 = mi - mxf[0], abs(i__3));
00482 lj = myj[0];
00483 mj = mys[0] - lj;
00484 nj = (i__3 = mj - myf[0], abs(i__3));
00485
00486 /* WHEN LINE OF SIGHT IS NEARER TO PARALLEL TO THE X AXIS, */
00487 /* HAVE J LOOP OUTER-MOST, OTHERWISE HAVE I LOOP OUTER-MOST. */
00488
00489 if (dabs(rx) <= dabs(ry)) {
00490 goto L360;
00491 }
00492 if (srfip1_1.iskirt != 0 || nypass != 1) {
00493 goto L310;
00494 }
00495 i__ = mxs[0];
00496 i__3 = nnyy;
00497 for (j = 2; j <= i__3; ++j) {
00498 draws_(&m[(i__ + (j - 1) * m_dim2 << 1) + 1], &m[(i__ + (j - 1) *
00499 m_dim2 << 1) + 2], &m[(i__ + j * m_dim2 << 1) + 1], &m[(
00500 i__ + j * m_dim2 << 1) + 2], &c__0, &c__1);
00501 /* L300: */
00502 }
00503 L310:
00504 i__3 = nnxx;
00505 for (ii = 1; ii <= i__3; ++ii) {
00506 i__ = mi + ii * li;
00507 ipli = i__ + li;
00508 if (nypass == 1) {
00509 goto L320;
00510 }
00511 k = mys[0];
00512 l = mys[1];
00513 if (srfip1_1.idrx != 0) {
00514 draws_(&m[(i__ + k * m_dim2 << 1) + 1], &m[(i__ + k * m_dim2
00515 << 1) + 2], &m[(i__ + l * m_dim2 << 1) + 1], &m[(i__
00516 + l * m_dim2 << 1) + 2], &c__1, &c__1);
00517 }
00518 if (srfblk_1.ndrz != 0 && ii != ni) {
00519 /* Computing MIN */
00520 i__5 = i__, i__4 = i__ + li;
00521 i__2 = min(i__5,i__4);
00522 ctcell_(&z__[z_offset], &mmxx, &nnxx, &nnyy, &m[m_offset], &
00523 i__2, &k);
00524 }
00525 L320:
00526 i__2 = nypass;
00527 for (jpass = 1; jpass <= i__2; ++jpass) {
00528 lj = myj[jpass - 1];
00529 mj = mys[jpass - 1] - lj;
00530 nj = (i__5 = mj - myf[jpass - 1], abs(i__5));
00531 i__5 = nj;
00532 for (jj = 1; jj <= i__5; ++jj) {
00533 j = mj + jj * lj;
00534 jplj = j + lj;
00535 if (srfip1_1.idrx != 0 && jj != nj) {
00536 draws_(&m[(i__ + j * m_dim2 << 1) + 1], &m[(i__ + j *
00537 m_dim2 << 1) + 2], &m[(i__ + jplj * m_dim2 <<
00538 1) + 1], &m[(i__ + jplj * m_dim2 << 1) + 2], &
00539 c__1, &c__1);
00540 }
00541 if (i__ != mxf[0] && srfip1_1.idry != 0) {
00542 draws_(&m[(ipli + j * m_dim2 << 1) + 1], &m[(ipli + j
00543 * m_dim2 << 1) + 2], &m[(i__ + j * m_dim2 <<
00544 1) + 1], &m[(i__ + j * m_dim2 << 1) + 2], &
00545 c__1, &c__1);
00546 }
00547 if (srfblk_1.ndrz != 0 && jj != nj && ii != nnxx) {
00548 /* Computing MIN */
00549 i__6 = i__, i__7 = i__ + li;
00550 i__4 = min(i__6,i__7);
00551 /* Computing MIN */
00552 i__9 = j, i__10 = j + lj;
00553 i__8 = min(i__9,i__10);
00554 ctcell_(&z__[z_offset], &mmxx, &nnxx, &nnyy, &m[
00555 m_offset], &i__4, &i__8);
00556 }
00557 /* L330: */
00558 }
00559 /* L340: */
00560 }
00561 /* L350: */
00562 }
00563 goto L430;
00564 L360:
00565 if (srfip1_1.iskirt != 0 || nxpass != 1) {
00566 goto L380;
00567 }
00568 j = mys[0];
00569 i__3 = nnxx;
00570 for (i__ = 2; i__ <= i__3; ++i__) {
00571 draws_(&m[(i__ - 1 + j * m_dim2 << 1) + 1], &m[(i__ - 1 + j *
00572 m_dim2 << 1) + 2], &m[(i__ + j * m_dim2 << 1) + 1], &m[(
00573 i__ + j * m_dim2 << 1) + 2], &c__0, &c__1);
00574 /* L370: */
00575 }
00576 L380:
00577 i__3 = nnyy;
00578 for (jj = 1; jj <= i__3; ++jj) {
00579 j = mj + jj * lj;
00580 jplj = j + lj;
00581 if (nxpass == 1) {
00582 goto L390;
00583 }
00584 k = mxs[0];
00585 l = mxs[1];
00586 if (srfip1_1.idry != 0) {
00587 draws_(&m[(k + j * m_dim2 << 1) + 1], &m[(k + j * m_dim2 << 1)
00588 + 2], &m[(l + j * m_dim2 << 1) + 1], &m[(l + j *
00589 m_dim2 << 1) + 2], &c__1, &c__1);
00590 }
00591 if (srfblk_1.ndrz != 0 && jj != nj) {
00592 /* Computing MIN */
00593 i__5 = j, i__4 = j + lj;
00594 i__2 = min(i__5,i__4);
00595 ctcell_(&z__[z_offset], &mmxx, &nnxx, &nnyy, &m[m_offset], &k,
00596 &i__2);
00597 }
00598 L390:
00599 i__2 = nxpass;
00600 for (ipass = 1; ipass <= i__2; ++ipass) {
00601 li = mxj[ipass - 1];
00602 mi = mxs[ipass - 1] - li;
00603 ni = (i__5 = mi - mxf[ipass - 1], abs(i__5));
00604 i__5 = ni;
00605 for (ii = 1; ii <= i__5; ++ii) {
00606 i__ = mi + ii * li;
00607 ipli = i__ + li;
00608 if (srfip1_1.idry != 0 && ii != ni) {
00609 draws_(&m[(i__ + j * m_dim2 << 1) + 1], &m[(i__ + j *
00610 m_dim2 << 1) + 2], &m[(ipli + j * m_dim2 << 1)
00611 + 1], &m[(ipli + j * m_dim2 << 1) + 2], &
00612 c__1, &c__1);
00613 }
00614 if (j != myf[0] && srfip1_1.idrx != 0) {
00615 draws_(&m[(i__ + jplj * m_dim2 << 1) + 1], &m[(i__ +
00616 jplj * m_dim2 << 1) + 2], &m[(i__ + j *
00617 m_dim2 << 1) + 1], &m[(i__ + j * m_dim2 << 1)
00618 + 2], &c__1, &c__1);
00619 }
00620 if (srfblk_1.ndrz != 0 && ii != ni && jj != nnyy) {
00621 /* Computing MIN */
00622 i__6 = i__, i__7 = i__ + li;
00623 i__4 = min(i__6,i__7);
00624 /* Computing MIN */
00625 i__9 = j, i__10 = j + lj;
00626 i__8 = min(i__9,i__10);
00627 ctcell_(&z__[z_offset], &mmxx, &nnxx, &nnyy, &m[
00628 m_offset], &i__4, &i__8);
00629 }
00630 /* L400: */
00631 }
00632 /* L410: */
00633 }
00634 /* L420: */
00635 }
00636 L430:
00637 if (srfip1_1.iskirt == 0) {
00638 goto L520;
00639 }
00640
00641 /* FIX UP IF SKIRT IS USED WITH LINES ONE WAY. */
00642
00643 if (srfip1_1.idrx != 0) {
00644 goto L460;
00645 }
00646 i__3 = nxpass;
00647 for (ipass = 1; ipass <= i__3; ++ipass) {
00648 if (nxpass == 2) {
00649 if__ = (ipass - 1) * (nnxx - 1) + 1;
00650 }
00651 i__2 = nnyy;
00652 for (j = 2; j <= i__2; ++j) {
00653 draws_(&m[(if__ + (j - 1) * m_dim2 << 1) + 1], &m[(if__ + (j
00654 - 1) * m_dim2 << 1) + 2], &m[(if__ + j * m_dim2 << 1)
00655 + 1], &m[(if__ + j * m_dim2 << 1) + 2], &c__1, &c__0);
00656 /* L440: */
00657 }
00658 /* L450: */
00659 }
00660 L460:
00661 if (srfip1_1.idry != 0) {
00662 goto L520;
00663 }
00664 i__3 = nypass;
00665 for (jpass = 1; jpass <= i__3; ++jpass) {
00666 if (nypass == 2) {
00667 jf = (jpass - 1) * (nnyy - 1) + 1;
00668 }
00669 i__2 = nnxx;
00670 for (i__ = 2; i__ <= i__2; ++i__) {
00671 draws_(&m[(i__ - 1 + jf * m_dim2 << 1) + 1], &m[(i__ - 1 + jf
00672 * m_dim2 << 1) + 2], &m[(i__ + jf * m_dim2 << 1) + 1],
00673 &m[(i__ + jf * m_dim2 << 1) + 2], &c__1, &c__0);
00674 /* L470: */
00675 }
00676 /* L480: */
00677 }
00678 goto L520;
00679
00680 /* ALL VISIBLE IF VIEWED FROM DIRECTLY ABOVE OR BELOW. */
00681
00682 L490:
00683 if (srfblk_1.nupper > 0 && s[3] < s[6]) {
00684 goto L520;
00685 }
00686 if (srfblk_1.nupper < 0 && s[3] > s[6]) {
00687 goto L520;
00688 }
00689 srfblk_1.nupper = 1;
00690 if (s[3] < s[6]) {
00691 srfblk_1.nupper = -1;
00692 }
00693 i__3 = nnxx;
00694 for (i__ = 1; i__ <= i__3; ++i__) {
00695 i__2 = nnyy;
00696 for (j = 1; j <= i__2; ++j) {
00697 if (srfip1_1.idrx != 0 && j != nnyy) {
00698 draws_(&m[(i__ + j * m_dim2 << 1) + 1], &m[(i__ + j *
00699 m_dim2 << 1) + 2], &m[(i__ + (j + 1) * m_dim2 <<
00700 1) + 1], &m[(i__ + (j + 1) * m_dim2 << 1) + 2], &
00701 c__1, &c__0);
00702 }
00703 if (srfip1_1.idry != 0 && i__ != nnxx) {
00704 draws_(&m[(i__ + j * m_dim2 << 1) + 1], &m[(i__ + j *
00705 m_dim2 << 1) + 2], &m[(i__ + 1 + j * m_dim2 << 1)
00706 + 1], &m[(i__ + 1 + j * m_dim2 << 1) + 2], &c__1,
00707 &c__0);
00708 }
00709 if (srfip1_1.idrz != 0 && i__ != nnxx && j != nnyy) {
00710 ctcell_(&z__[z_offset], &mmxx, &nnxx, &nnyy, &m[m_offset],
00711 &i__, &j);
00712 }
00713 /* L500: */
00714 }
00715 /* L510: */
00716 }
00717 L520:
00718 if (ster == 0.f) {
00719 goto L560;
00720 }
00721 if (srfip1_1.istp < 0) {
00722 goto L540;
00723 } else if (srfip1_1.istp == 0) {
00724 goto L530;
00725 } else {
00726 goto L550;
00727 }
00728 L530:
00729 frame_();
00730 L540:
00731 frame_();
00732 goto L570;
00733 L550:
00734 if (ipic != 2) {
00735 goto L570;
00736 }
00737 L560:
00738 if (srfip1_1.ifr > 0) {
00739 frame_();
00740 }
00741 L570:
00742 ;
00743 }
00744 return 0;
00745 } /* srface_ */
|
|
||||||||||||||||
|
Definition at line 750 of file srface.c. References line_(). Referenced by draws_().
|
|
||||||||||||||||||||
|
Definition at line 34 of file tick4.c. References scale, and zzzplt_1. Referenced by plotpak_tick4().
00036 {
00037 static real scale;
00038
00039
00040 /* Set the tick marks in units of 1/1000 the x-width */
00041 /* .......................................................................
00042 */
00043 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00044 */
00045
00046 /* Internal Data for PLOTPAK */
00047
00048 scale = (zzzplt_1.xpgmax - zzzplt_1.xpgmin) * .001f;
00049 zzzplt_1.tmajx = scale * *lmajx;
00050 zzzplt_1.tminx = scale * *lminx;
00051 zzzplt_1.tmajy = scale * *lmajy;
00052 zzzplt_1.tminy = scale * *lminy;
00053 return 0;
00054 } /* tick4_ */
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 1519 of file srface.c. References dmax, dmin, pwrz1s_1, q, srfblk_1, and v1. Referenced by plot_image_surface(), setr_(), and srface_().
01521 {
01522 /* Initialized data */
01523
01524 static integer nlu[7] = { 10,10,100,10,10,10,512 };
01525 static integer nru[7] = { 1014,924,1014,1014,1014,512,1014 };
01526 static integer nbv[7] = { 10,50,50,10,10,256,256 };
01527 static integer ntv[7] = { 1014,964,964,1014,1014,758,758 };
01528
01529 /* Format strings */
01530 static char fmt_60[] = "";
01531 static char fmt_50[] = "";
01532 static char fmt_120[] = "";
01533 static char fmt_100[] = "";
01534 static char fmt_70[] = "";
01535 static char fmt_80[] = "";
01536
01537 /* System generated locals */
01538 real r__1, r__2, r__3, r__4;
01539
01540 /* Local variables */
01541 static integer jump, jump2, jump3;
01542 static real d__, q, r__, cosbe, cosga, sinbe, cosal, singa, u0, v0, u1,
01543 v1, u2, v2, u3, v3, u4, v4, ax, ay, az, dx, ex, ey, ez, dy, dz,
01544 xx, yy, zz;
01545
01546 /* Assigned format variables */
01547 static char *jump3_fmt, *jump2_fmt, *jump_fmt;
01548
01549
01550
01551 /* PICTURE CORNER COORDINATES FOR LL=1 */
01552
01553
01554 /* PICTURE CORNER COORDINATES FOR LL=2 */
01555
01556
01557 /* PICTURE CORNER COORDINATES FOR LL=3 */
01558
01559
01560 /* PICTURE CORNER COORDINATES FOR LL=4 */
01561
01562
01563 /* PICTURE CORNER COORDINATES FOR LL=5 */
01564
01565
01566 /* PICTURE CORNER COORDINATES FOR LL=6 */
01567
01568
01569 /* PICTURE CORNER COORDINATES FOR LL=7 */
01570
01571 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01572 */
01573 /* STORE THE PARAMETERS OF THE SET32 CALL FOR USE WHEN */
01574 /* TRN32 IS CALLED. */
01575
01576 if (*iflag != 0) {
01577 goto L40;
01578 } else {
01579 goto L10;
01580 }
01581 L10:
01582 jump3 = 0;
01583 jump3_fmt = fmt_60;
01584 if (srfblk_1.ioffp == 1) {
01585 jump3 = 1;
01586 jump3_fmt = fmt_50;
01587 }
01588 ax = *x;
01589 ay = *y;
01590 az = *z__;
01591 ex = *xt;
01592 ey = *yt;
01593 ez = *zt;
01594
01595 /* AS MUCH COMPUTATION AS POSSIBLE IS DONE DURING EXECUTION */
01596 /* THIS ROUTINE WHEN IFLAG=0 BECAUSE CALLS IN THAT MODE ARE INFREQUENT. */
01597
01598 dx = ax - ex;
01599 dy = ay - ey;
01600 dz = az - ez;
01601 d__ = sqrt(dx * dx + dy * dy + dz * dz);
01602 cosal = dx / d__;
01603 cosbe = dy / d__;
01604 cosga = dz / d__;
01605 singa = sqrt(1.f - cosga * cosga);
01606 jump2 = 0;
01607 jump2_fmt = fmt_120;
01608 if (srfblk_1.ll == 0) {
01609 goto L20;
01610 }
01611 jump2 = 1;
01612 jump2_fmt = fmt_100;
01613 pwrz1s_1.delcrt = (real) (nru[srfblk_1.ll - 1] - nlu[srfblk_1.ll - 1]);
01614 u0 = srfblk_1.umin;
01615 v0 = srfblk_1.vmin;
01616 u1 = (real) nlu[srfblk_1.ll - 1];
01617 v1 = (real) nbv[srfblk_1.ll - 1];
01618 u2 = (real) (nru[srfblk_1.ll - 1] - nlu[srfblk_1.ll - 1]);
01619 v2 = (real) (ntv[srfblk_1.ll - 1] - nbv[srfblk_1.ll - 1]);
01620 u3 = u2 / (srfblk_1.umax - srfblk_1.umin);
01621 v3 = v2 / (srfblk_1.vmax - srfblk_1.vmin);
01622 u4 = (real) nru[srfblk_1.ll - 1];
01623 v4 = (real) ntv[srfblk_1.ll - 1];
01624 if (srfblk_1.nrswt == 0) {
01625 goto L20;
01626 }
01627 u0 = -srfblk_1.bigd;
01628 v0 = -srfblk_1.bigd;
01629 u3 = u2 / (srfblk_1.bigd * 2.f);
01630 v3 = v2 / (srfblk_1.bigd * 2.f);
01631
01632 /* THE 3-SPACE POINT LOOKED AT IS TRANSFORMED INTO (0,0) OF */
01633 /* THE 2-SPACE. THE 3-SPACE Z AXIS IS TRANSFORMED INTO THE */
01634 /* 2-SPACE Y AXIS. IF THE LINE OF SIGHT IS CLOSE TO PARALLEL */
01635 /* TO THE 3-SPACE Z AXIS, THE 3-SPACE Y AXIS IS CHOSEN (IN- */
01636 /* STEAD OF THE 3-SPACE Z AXIS) TO BE TRANSFORMED INTO THE */
01637 /* 2-SPACE Y AXIS. */
01638
01639 L20:
01640 if (singa < 1e-4f) {
01641 goto L30;
01642 }
01643 r__ = 1.f / singa;
01644 jump = 0;
01645 jump_fmt = fmt_70;
01646 return 0;
01647 L30:
01648 sinbe = sqrt(1.f - cosbe * cosbe);
01649 r__ = 1.f / sinbe;
01650 jump = 1;
01651 jump_fmt = fmt_80;
01652 return 0;
01653 L40:
01654 xx = *x;
01655 yy = *y;
01656 zz = *z__;
01657 switch (jump3) {
01658 case 0: goto L60;
01659 case 1: goto L50;
01660 }
01661 L50:
01662 if (zz == srfblk_1.spval) {
01663 goto L110;
01664 }
01665 L60:
01666 q = d__ / ((xx - ex) * cosal + (yy - ey) * cosbe + (zz - ez) * cosga);
01667 switch (jump) {
01668 case 0: goto L70;
01669 case 1: goto L80;
01670 }
01671 L70:
01672 xx = ((ex + q * (xx - ex) - ax) * cosbe - (ey + q * (yy - ey) - ay) *
01673 cosal) * r__;
01674 yy = (ez + q * (zz - ez) - az) * r__;
01675 goto L90;
01676 L80:
01677 xx = ((ez + q * (zz - ez) - az) * cosal - (ex + q * (xx - ex) - ax) *
01678 cosga) * r__;
01679 yy = (ey + q * (yy - ey) - ay) * r__;
01680 L90:
01681 switch (jump2) {
01682 case 0: goto L120;
01683 case 1: goto L100;
01684 }
01685 L100:
01686 /* Computing MIN */
01687 /* Computing MAX */
01688 r__3 = u1, r__4 = u1 + u3 * (srfblk_1.fact * xx - u0);
01689 r__1 = u4, r__2 = dmax(r__3,r__4);
01690 xx = dmin(r__1,r__2);
01691 /* Computing MIN */
01692 /* Computing MAX */
01693 r__3 = v1, r__4 = v1 + v3 * (srfblk_1.fact * yy - v0);
01694 r__1 = v4, r__2 = dmax(r__3,r__4);
01695 yy = dmin(r__1,r__2);
01696 goto L120;
01697 L110:
01698 xx = (real) srfblk_1.nspval;
01699 yy = (real) srfblk_1.nspval;
01700
01701 L120:
01702 *xt = xx;
01703 *yt = yy;
01704 return 0;
01705 } /* trn32s_ */
|
|
||||||||||||
|
Definition at line 34 of file vector.c. References zzline_(), zzphys_(), and zzzplt_1. Referenced by plotpak_vector(), and points_().
00035 {
00036 static real xx, yy;
00037 extern /* Subroutine */ int zzline_(real *, real *, real *, real *),
00038 zzphys_(real *, real *);
00039
00040
00041 /* "Pen down move" (from last plotted location) */
00042 /* .......................................................................
00043 */
00044 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00045 */
00046
00047 /* Internal Data for PLOTPAK */
00048
00049 xx = *x;
00050 yy = *y;
00051 zzphys_(&xx, &yy);
00052 zzline_(&zzzplt_1.xphold, &zzzplt_1.yphold, &xx, &yy);
00053 return 0;
00054 } /* vector_ */
|
|
||||||||||||||||||||||||
|
Definition at line 41 of file zzaxxx.c. References abs, c__0, c__1, dabs, dmax, dmin, do_fio(), e_wsfi(), L, pwritf_(), s_wsfi(), x2, zzlabl_(), zzlgin_(), zzlinx_(), zzlogx_(), zzphys_(), and zzzplt_1. Referenced by zzperi_().
00043 {
00044 /* Format strings */
00045 static char fmt_101[] = "(\0021.E\002,i2)";
00046 static char fmt_102[] = "(\0021.E\002,i3)";
00047
00048 /* System generated locals */
00049 integer i__1, i__2;
00050 real r__1, r__2;
00051 static char equiv_0[10];
00052
00053 /* Builtin functions */
00054 integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
00055 ;
00056
00057 /* Local variables */
00058 static integer ndec, nlab;
00059 #define buf10 (equiv_0)
00060 static real ylab, temp, dxlab;
00061 static integer nchar, il;
00062 static real xv, xx, yy;
00063 extern /* Subroutine */ int zzlgin_(real *, real *, integer *);
00064 static integer nl1, nl2;
00065 extern /* Subroutine */ int zzlabl_(real *, char *, integer *, ftnlen);
00066 static integer npower;
00067 extern /* Subroutine */ int pwritf_(real *, real *, char *, integer *,
00068 integer *, integer *, integer *, ftnlen), zzlogx_(real *, real *,
00069 real *, integer *, real *, real *), zzlinx_(real *, real *, real *
00070 , integer *, real *, integer *, real *);
00071 static real xv1, xv2, xx1, xx2;
00072 extern /* Subroutine */ int zzphys_(real *, real *);
00073 #define buf (equiv_0)
00074 static real dxv;
00075
00076 /* Fortran I/O blocks */
00077 static icilist io___20 = { 0, buf10, 0, fmt_101, 10, 1 };
00078 static icilist io___21 = { 0, buf10, 0, fmt_102, 10, 1 };
00079
00080
00081
00082 /* Draw an axis in the x-direction from (X1,Y) to (X2,Y) [user coords]
00083 */
00084 /* with the specified divisions and tics. If ISIDE is positive, the */
00085 /* tic marks appear in the +y direction and the labels in the -y */
00086 /* direction from the axis. If ILAB = 0, no labels are drawn. */
00087 /* .......................................................................
00088 */
00089
00090 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00091 */
00092
00093 /* Internal Data for PLOTPAK */
00094
00095 if (*x1 == *x2) {
00096 goto L8000;
00097 }
00098
00099 xv1 = dmin(*x1,*x2);
00100 xv2 = dmax(*x1,*x2);
00101
00102 /* For log x-axis, must push lower value of X down and upper value of */
00103 /* X up to powers of 10. */
00104
00105 if (zzzplt_1.ixcoor < 0) {
00106 zzlgin_(&xv1, &xv1, &nl1);
00107 temp = xv2;
00108 zzlgin_(&temp, &xv2, &nl2);
00109 if (xv2 <= temp * .999f) {
00110 xv2 *= 10.f;
00111 ++nl2;
00112 }
00113 ndec = nl2 - nl1;
00114 if (ndec <= 0) {
00115 goto L8000;
00116 }
00117 }
00118 /* .......................................................................
00119 */
00120 /* Convert to physical coordinates and plot axes */
00121
00122 xx1 = xv1;
00123 xx2 = xv2;
00124 yy = *y;
00125 zzphys_(&xx1, &temp);
00126 zzphys_(&xx2, &yy);
00127
00128 if (zzzplt_1.ixcoor >= 0) {
00129 r__1 = *iside * zzzplt_1.tmajx;
00130 r__2 = *iside * zzzplt_1.tminx;
00131 zzlinx_(&xx1, &xx2, &yy, &zzzplt_1.majrx, &r__1, &zzzplt_1.minrx, &
00132 r__2);
00133 } else {
00134 r__1 = *iside * zzzplt_1.tmajx;
00135 r__2 = *iside * zzzplt_1.tminx;
00136 zzlogx_(&xx1, &xx2, &yy, &ndec, &r__1, &r__2);
00137 }
00138 /* .......................................................................
00139 */
00140 /* Plot labels */
00141
00142 if (*ilab == 0) {
00143 goto L8000;
00144 }
00145
00146 if (zzzplt_1.ixcoor >= 0) {
00147 nlab = zzzplt_1.majrx;
00148 } else {
00149 nlab = ndec;
00150 }
00151
00152 dxlab = (xx2 - xx1) / nlab;
00153 ylab = yy - *iside * .0011f * zzzplt_1.isizx * (zzzplt_1.xpgmax -
00154 zzzplt_1.xpgmin);
00155
00156 if (zzzplt_1.ixcoor >= 0) {
00157 dxv = (xv2 - xv1) / nlab;
00158 }
00159
00160 i__1 = nlab;
00161 for (il = 0; il <= i__1; ++il) {
00162 if (zzzplt_1.ixcoor >= 0) {
00163 xv = xv1 + il * dxv;
00164 /* Computing MIN */
00165 r__1 = dabs(xv1), r__2 = dabs(xv2);
00166 if (dabs(xv) <= dmin(r__1,r__2) * 1e-5f) {
00167 xv = 0.f;
00168 }
00169 zzlabl_(&xv, buf, &nchar, 1L);
00170 } else {
00171 npower = nl1 + il;
00172 if (abs(npower) < 10) {
00173 s_wsfi(&io___20);
00174 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
00175 e_wsfi();
00176 nchar = 5;
00177 } else {
00178 s_wsfi(&io___21);
00179 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
00180 e_wsfi();
00181 nchar = 6;
00182 }
00183 if (*(unsigned char *)&buf[3] == ' ') {
00184 *(unsigned char *)&buf[3] = '+';
00185 }
00186 }
00187 xx = xx1 + il * dxlab;
00188 i__2 = -nchar;
00189 pwritf_(&xx, &ylab, buf, &i__2, &zzzplt_1.isizx, &c__0, &c__0, 1L);
00190 /* L100: */
00191 }
00192 /* .......................................................................
00193 */
00194 L8000:
00195 return 0;
00196 } /* zzaxxx_ */
|
|
||||||||||||||||||||||||
|
Definition at line 39 of file zzaxyy.c. References abs, c__0, c__1, dabs, dmax, dmin, do_fio(), e_wsfi(), L, max, pwritf_(), s_wsfi(), y1, zzlabl_(), zzlgin_(), zzliny_(), zzlogy_(), zzphys_(), and zzzplt_1. Referenced by zzperi_().
00041 {
00042 /* Format strings */
00043 static char fmt_101[] = "(\0021.E\002,i2)";
00044 static char fmt_102[] = "(\0021.E\002,i3)";
00045
00046 /* System generated locals */
00047 integer i__1, i__2, i__3;
00048 real r__1, r__2;
00049 static char equiv_0[10];
00050
00051 /* Builtin functions */
00052 integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
00053 ;
00054
00055 /* Local variables */
00056 static integer ndec, nlab;
00057 #define buf10 (equiv_0)
00058 static real xlab, temp;
00059 static integer nchar;
00060 static real dylab, csize, dycsz;
00061 static integer il;
00062 static real yv, xx, yy;
00063 extern /* Subroutine */ int zzlgin_(real *, real *, integer *);
00064 static integer nl1, nl2, npower, nshift;
00065 extern /* Subroutine */ int zzlabl_(real *, char *, integer *, ftnlen),
00066 pwritf_(real *, real *, char *, integer *, integer *, integer *,
00067 integer *, ftnlen), zzlogy_(real *, real *, real *, integer *,
00068 real *, real *), zzliny_(real *, real *, real *, integer *, real *
00069 , integer *, real *);
00070 static real yv1, yv2, yy1, yy2;
00071 extern /* Subroutine */ int zzphys_(real *, real *);
00072 #define buf (equiv_0)
00073 static real dyv;
00074
00075 /* Fortran I/O blocks */
00076 static icilist io___23 = { 0, buf10, 0, fmt_101, 10, 1 };
00077 static icilist io___24 = { 0, buf10, 0, fmt_102, 10, 1 };
00078
00079
00080
00081 /* Draw an axis in the y-direction from (X,Y1) to (X,Y2) [user coords]
00082 */
00083 /* with the specified divisions and tics. If ISIDE is positive, the */
00084 /* tic marks appear in the +x direction and the labels in the -x */
00085 /* direction from the axis. If ILAB = 0, no labels are drawn. */
00086 /* .......................................................................
00087 */
00088
00089 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00090 */
00091
00092 /* Internal Data for PLOTPAK */
00093
00094 if (*y1 == *y2) {
00095 goto L8000;
00096 }
00097
00098 yv1 = dmin(*y1,*y2);
00099 yv2 = dmax(*y1,*y2);
00100
00101 /* For log y-axis, must push lower value of Y down and upper value of */
00102 /* Y up to powers of 10. */
00103
00104 if (zzzplt_1.iycoor < 0) {
00105 zzlgin_(&yv1, &yv1, &nl1);
00106 temp = yv2;
00107 zzlgin_(&temp, &yv2, &nl2);
00108 if (yv2 <= temp * .999f) {
00109 yv2 *= 10.f;
00110 ++nl2;
00111 }
00112 ndec = nl2 - nl1;
00113 if (ndec <= 0) {
00114 goto L8000;
00115 }
00116 }
00117 /* .......................................................................
00118 */
00119 /* Convert to physical coordinates and plot axes */
00120
00121 yy1 = yv1;
00122 yy2 = yv2;
00123 xx = *x;
00124 zzphys_(&temp, &yy1);
00125 zzphys_(&xx, &yy2);
00126
00127 if (zzzplt_1.iycoor >= 0) {
00128 r__1 = *iside * zzzplt_1.tmajy;
00129 r__2 = *iside * zzzplt_1.tminy;
00130 zzliny_(&xx, &yy1, &yy2, &zzzplt_1.majry, &r__1, &zzzplt_1.minry, &
00131 r__2);
00132 } else {
00133 r__1 = *iside * zzzplt_1.tmajy;
00134 r__2 = *iside * zzzplt_1.tminy;
00135 zzlogy_(&xx, &yy1, &yy2, &ndec, &r__1, &r__2);
00136 }
00137 /* .......................................................................
00138 */
00139 /* Plot labels */
00140
00141 if (*ilab == 0) {
00142 goto L8000;
00143 }
00144
00145 if (zzzplt_1.iycoor >= 0) {
00146 nlab = zzzplt_1.majry;
00147 } else {
00148 nlab = ndec;
00149 }
00150
00151 /* Calculate the max number of characters needed for labels into NSHIFT.
00152 */
00153
00154 if (zzzplt_1.iycoor < 0) {
00155 /* Log-axis: 1.E+x or 1.E+xx are the possibilities */
00156 /* Computing MAX */
00157 i__1 = abs(nl1), i__2 = abs(nl2);
00158 npower = max(i__1,i__2);
00159 if (npower < 10) {
00160 nshift = 5;
00161 } else {
00162 nshift = 6;
00163 }
00164 } else {
00165 /* Linear-axis: calculate all labels and find the longest */
00166 nshift = 1;
00167 dyv = (yv2 - yv1) / nlab;
00168 i__1 = nlab;
00169 for (il = 0; il <= i__1; ++il) {
00170 yv = yv1 + il * dyv;
00171 /* Computing MIN */
00172 r__1 = dabs(yv1), r__2 = dabs(yv2);
00173 if (dabs(yv) <= dmin(r__1,r__2) * 1e-5f) {
00174 yv = 0.f;
00175 }
00176 zzlabl_(&yv, buf, &nchar, 1L);
00177 nshift = max(nshift,nchar);
00178 /* L50: */
00179 }
00180 }
00181
00182 dylab = (yy2 - yy1) / nlab;
00183 csize = zzzplt_1.isizy * .0011f * (zzzplt_1.xpgmax - zzzplt_1.xpgmin);
00184 xlab = xx - csize * *iside * nshift;
00185 dycsz = csize * .5f;
00186 if (dylab < 0.f) {
00187 dycsz = -dycsz;
00188 }
00189
00190 i__1 = nlab;
00191 for (il = 0; il <= i__1; ++il) {
00192 if (zzzplt_1.iycoor >= 0) {
00193 yv = yv1 + il * dyv;
00194 /* Computing MIN */
00195 r__1 = dabs(yv1), r__2 = dabs(yv2);
00196 if (dabs(yv) <= dmin(r__1,r__2) * 1e-5f) {
00197 yv = 0.f;
00198 }
00199 zzlabl_(&yv, buf, &nchar, 1L);
00200 } else {
00201 npower = nl1 + il;
00202 if (abs(npower) < 10) {
00203 s_wsfi(&io___23);
00204 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
00205 e_wsfi();
00206 nchar = 5;
00207 } else {
00208 s_wsfi(&io___24);
00209 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
00210 e_wsfi();
00211 nchar = 6;
00212 }
00213 if (*(unsigned char *)&buf[3] == ' ') {
00214 *(unsigned char *)&buf[3] = '+';
00215 }
00216 }
00217 if (il == 0) {
00218 yy = yy1 + dycsz;
00219 } else {
00220 yy = yy1 + il * dylab;
00221 if (il == nlab) {
00222 yy -= dycsz;
00223 }
00224 }
00225 i__2 = -nchar;
00226 i__3 = -(*iside);
00227 pwritf_(&xlab, &yy, buf, &i__2, &zzzplt_1.isizy, &c__0, &i__3, 1L);
00228 /* L100: */
00229 }
00230 /* .......................................................................
00231 */
00232 L8000:
00233 return 0;
00234 } /* zzaxyy_ */
|
|
||||||||||||||||||||||||||||
|
Definition at line 11 of file zzchar.c. References stl, and zzline_(). Referenced by pwrit_().
00013 {
00014 /* Initialized data */
00015
00016 static integer ia[128] = { 473,473,473,473,473,473,473,473,473,473,473,
00017 473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,473,
00018 473,473,473,473,473,473,473,473,473,473,473,473,473,448,456,429,
00019 414,476,423,486,444,143,286,296,308,326,339,352,368,378,398,473,
00020 473,473,464,473,473,473,1,13,28,40,49,60,68,82,92,104,113,123,130,
00021 137,273,157,166,182,194,210,219,229,236,245,252,262,448,473,456,
00022 473,474,473,1,13,28,40,49,60,68,82,92,104,113,123,130,137,273,157,
00023 166,182,194,210,219,229,236,245,252,262,473,473,473,473,473 };
00024 static integer ku[494] = { 0,4,7,0,0,1,3,4,4,7,6,7,0,3,4,4,3,0,7,3,4,4,3,
00025 0,7,6,7,7,4,3,1,0,0,1,3,4,7,6,7,0,3,4,4,3,0,7,6,7,0,4,7,3,0,7,0,4,
00026 7,6,7,0,4,7,0,3,7,6,7,7,4,3,1,0,0,1,3,4,4,3,7,6,7,0,7,0,4,7,4,4,7,
00027 6,7,7,1,3,7,2,2,7,1,3,7,6,7,7,0,1,3,4,4,7,6,7,0,7,0,4,7,2,4,7,6,7,
00028 7,0,0,4,7,6,7,0,2,4,4,7,6,7,0,4,4,7,6,7,4,7,4,4,3,1,0,0,1,3,4,7,6,
00029 7,0,3,4,4,3,0,7,6,7,7,0,0,1,3,4,4,3,1,0,7,2,4,7,6,7,0,3,4,4,3,0,7,
00030 2,4,7,6,7,7,0,1,3,4,4,3,1,0,0,1,3,4,7,6,7,7,0,4,7,2,2,7,6,7,7,0,0,
00031 1,3,4,4,7,6,7,7,0,2,4,7,6,7,7,0,0,2,4,4,7,6,7,4,7,0,4,7,6,7,7,0,2,
00032 4,7,2,2,7,6,7,7,3,1,7,0,4,0,4,7,6,7,7,4,3,1,0,0,1,3,4,4,7,6,7,7,1,
00033 2,2,7,1,3,7,6,7,7,0,1,3,4,4,0,0,4,7,6,7,7,0,1,3,4,4,3,1,7,3,4,4,3,
00034 1,0,7,6,7,7,3,3,2,0,0,4,7,2,4,7,6,7,7,0,1,3,4,4,3,0,0,4,7,6,7,7,4,
00035 3,1,0,0,1,3,4,4,3,1,0,7,6,7,7,0,0,4,4,2,2,7,6,7,7,2,0,0,1,3,4,4,2,
00036 2,0,0,1,3,4,4,2,7,6,7,7,0,1,3,4,4,3,1,0,0,1,3,4,7,6,7,7,0,4,7,2,2,
00037 7,6,7,7,0,4,7,6,7,7,0,4,7,2,2,7,4,0,7,0,4,7,6,7,4,7,6,7,7,3,2,2,3,
00038 7,6,7,7,1,2,2,1,7,6,7,7,4,0,7,0,4,7,6,7,7,6,7,7,1,2,2,1,1,2,7,6,7,
00039 7,2,1,1,2,2,7,6,7 };
00040 static integer kv[494] = { 3,3,0,3,6,7,7,6,0,0,0,7,7,7,6,5,4,4,0,4,3,1,0,
00041 0,0,0,7,0,6,7,7,6,1,0,0,1,0,0,7,7,7,6,1,0,0,0,0,7,7,7,0,4,4,0,0,0,
00042 0,0,7,7,7,0,4,4,0,0,7,0,6,7,7,6,1,0,0,1,3,3,0,0,7,7,0,4,4,0,7,0,0,
00043 0,7,0,7,7,0,7,0,0,0,0,0,0,7,0,1,0,0,1,7,0,0,7,7,0,3,7,0,5,0,0,0,7,
00044 0,7,0,0,0,0,7,7,3,7,0,0,0,7,7,0,7,0,0,7,7,0,1,6,7,7,6,1,0,0,1,0,0,
00045 7,7,7,6,5,4,4,0,0,7,0,1,6,7,7,6,1,0,0,1,0,2,0,0,0,7,7,7,6,5,4,4,0,
00046 4,0,0,0,7,0,1,0,0,1,3,4,4,5,6,7,7,6,0,0,7,0,7,7,0,7,0,0,0,7,0,7,1,
00047 0,0,1,7,0,0,7,0,7,0,7,0,0,7,0,7,0,4,0,7,0,0,7,7,0,7,0,0,0,7,0,7,4,
00048 7,0,4,0,0,0,7,0,4,4,0,7,7,0,0,0,0,7,0,1,0,0,1,6,7,7,6,1,0,0,7,0,6,
00049 7,0,0,0,0,0,0,7,0,6,7,7,6,5,1,0,0,0,0,7,0,7,7,7,6,5,4,4,0,4,3,1,0,
00050 0,1,0,0,7,0,0,7,7,4,3,3,0,0,0,0,0,7,0,1,0,0,1,3,4,4,7,7,0,0,7,0,7,
00051 7,7,6,1,0,0,1,3,4,4,3,0,0,7,0,6,7,7,6,1,0,0,0,7,0,4,5,6,7,7,6,5,4,
00052 4,2,1,0,0,1,2,4,0,0,7,0,1,0,0,1,6,7,7,6,4,3,3,4,0,0,7,0,3,3,0,5,1,
00053 0,0,7,0,3,3,0,0,7,0,1,5,0,5,1,0,3,3,0,5,1,0,0,7,7,0,0,7,1,7,6,1,0,
00054 0,0,7,0,7,6,1,0,0,0,7,0,5,5,0,2,2,0,0,7,0,0,7,0,0,1,2,2,1,1,0,0,7,
00055 0,0,0,1,1,0,0,0,7 };
00056
00057 static real xold, yold, xnew, ynew;
00058 static integer nu, nv, ipoint;
00059 extern /* Subroutine */ int zzline_(real *, real *, real *, real *);
00060 static real ctl, stl;
00061
00062
00063 /* Plot one character in CH with lower left corner at XP,YP physical */
00064 /* coordinates, with CT and ST the cosine and sine scaling/rotation */
00065 /* factors. */
00066
00067 /* .......................................................................
00068 */
00069 /* The following digitization stuff is stolen from the NCAR metacode */
00070 /* interpreter MCVAX. Various minor changes have been made. Most */
00071 /* notable of these is the interchange of the '0' and 'O' characters --
00072 */
00073 /* I just couldn't stand the slash going through the 'O' as the CDC */
00074 /* custom has it. */
00075
00076
00077 /* The following pointers relate standard FORTRAN characters to their */
00078 /* digitizations. Note the plethora of 473's. That location does */
00079 /* nothing. */
00080
00081 /* <control characters> */
00082 /* <ctrls> */
00083 /* <ctrls> */
00084 /* <ctrls> */
00085 /* <ctrls> */
00086 /* <ctrls> */
00087 /* <ctrl><ctrl><space>!" */
00088 /* #$%&' */
00089 /* ()*+, */
00090 /* -./01 */
00091 /* 23456 */
00092 /* 789:; */
00093 /* <=>?@ */
00094 /* ABCDE */
00095 /* FGHIJ */
00096 /* KLMNO */
00097 /* PQRST */
00098 /* UVWXY */
00099 /* Z[\]^ */
00100 /* _` */
00101 /* abcde */
00102 /* fghij */
00103 /* klmno */
00104 /* pqrst */
00105 /* uvwxy */
00106 /* z */
00107 /* {| */
00108 /* }~<DEL> */
00109
00110 /* The following DATA statements contain the digitizations of the */
00111 /* characters. The characters are digitized on a box 6 units wide and */
00112 /* 7 units tall. This includes 2 units of white space to the right of */
00113 /* each character. If KU=7, KV is a flag: */
00114 /* KV=0 ==> the next KU and KV are a pen up move */
00115 /* (normal coordinates are pen down moves) */
00116 /* KV=7 ==> the end of the digitization for a particular character */
00117 /* has been reached. */
00118
00119 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00120 */
00121 /* Select digitization for this character. */
00122
00123 xold = *xp;
00124 yold = *yp;
00125 ipoint = ia[*(unsigned char *)ch];
00126
00127 /* Scale lower case letters to be slightly smaller */
00128
00129 if (*(unsigned char *)ch >= 'a' && *(unsigned char *)ch <= 'z') {
00130 ctl = *ct * .8f;
00131 stl = *st * .8f;
00132 } else {
00133 ctl = *ct;
00134 stl = *st;
00135 }
00136
00137 L100:
00138 nu = ku[ipoint - 1];
00139 nv = kv[ipoint - 1];
00140 ++ipoint;
00141 /* .......................................................................
00142 */
00143 /* Test for op-code stored in NV. This is flagged by a 7 in NU. */
00144
00145 if (nu == 7) {
00146
00147 /* Op-codes are: NV = 7 ==> end of character */
00148 /* anything else ==> pen up move to next location
00149 */
00150
00151 if (nv == 7) {
00152 return 0;
00153 } else {
00154 xold = *xp + ctl * ku[ipoint - 1] - stl * kv[ipoint - 1];
00155 yold = *yp + stl * ku[ipoint - 1] + ctl * kv[ipoint - 1];
00156 ++ipoint;
00157 }
00158 /* ...................................................................
00159 .... */
00160 /* Here, plot the next stroke. */
00161
00162 } else {
00163 xnew = *xp + ctl * nu - stl * nv;
00164 ynew = *yp + stl * nu + ctl * nv;
00165 zzline_(&xold, &yold, &xnew, &ynew);
00166 xold = xnew;
00167 yold = ynew;
00168 }
00169 /* .......................................................................
00170 */
00171 /* Loopback to get next plotting order from KU, KV. */
00172
00173 goto L100;
00174 } /* zzchar_ */
|
|
||||||||||||||||||||
|
Definition at line 34 of file zzclip.c. References dmax, dmin, x2, y1, and zzzplt_1. Referenced by zzline_().
00035 {
00036 static real temp, slope, x1, x2, y1, y2, dx, dy;
00037 static logical linter;
00038
00039
00040 /* Clip the input line to the predefined plotting region. */
00041
00042 /* INPUTS */
00043 /* ------ */
00044 /* X1IN = start X-coordinate of line (physical coordinates) */
00045 /* Y1IN = start Y-coordinate of line */
00046 /* X2IN = end X-coordinate of line */
00047 /* Y2IN = end Y-coordinate of line */
00048
00049 /* OUTPUTS */
00050 /* ------- */
00051 /* same as above but clipped so that the line fits into the plotting */
00052 /* region defined by calling SETW. */
00053
00054 /* If the line falls entirely outside of the plotting region, then */
00055 /* X1IN is returned as -1.E+38. */
00056 /* .......................................................................
00057 */
00058
00059 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00060 */
00061 /* Check to see if line can be thrown out as being totally out of */
00062 /* the plotting region. */
00063
00064
00065 /* Internal Data for PLOTPAK */
00066
00067 if (dmax(*x1in,*x2in) < zzzplt_1.xclbot || dmin(*x1in,*x2in) >
00068 zzzplt_1.xcltop || dmax(*y1in,*y2in) < zzzplt_1.yclbot || dmin(*
00069 y1in,*y2in) > zzzplt_1.ycltop) {
00070
00071 *x1in = -1e38f;
00072 goto L8000;
00073 }
00074
00075 /* Copy input coordinates to local variables, making sure */
00076 /* that X1 .LE. X2 by interchanging the points if necessary. */
00077
00078 linter = *x1in > *x2in;
00079 if (linter) {
00080 x1 = *x2in;
00081 x2 = *x1in;
00082 y1 = *y2in;
00083 y2 = *y1in;
00084 } else {
00085 x1 = *x1in;
00086 x2 = *x2in;
00087 y1 = *y1in;
00088 y2 = *y2in;
00089 }
00090
00091 /* Clip line in X direction */
00092
00093 dx = x2 - x1;
00094 if (dx > 0.f) {
00095 /* only clip if line has some X range */
00096 slope = (y2 - y1) / dx;
00097 if (x1 < zzzplt_1.xclbot) {
00098 /* intercept of line at left side */
00099 y1 += slope * (zzzplt_1.xclbot - x1);
00100 x1 = zzzplt_1.xclbot;
00101 }
00102 if (x2 > zzzplt_1.xcltop) {
00103 /* intercept at right */
00104 y2 += slope * (zzzplt_1.xcltop - x2);
00105 x2 = zzzplt_1.xcltop;
00106 }
00107 }
00108
00109 /* Check line again to see if it falls outside of plot region. */
00110
00111 if (dmax(y1,y2) < zzzplt_1.yclbot || dmin(y1,y2) > zzzplt_1.ycltop) {
00112 *x1in = -1e38f;
00113 goto L8000;
00114 }
00115
00116 /* Clip Y-direction. To do this, must have Y1 .LE. Y2 */
00117
00118 if (y1 > y2) {
00119 temp = x1;
00120 x1 = x2;
00121 x2 = temp;
00122 temp = y1;
00123 y1 = y2;
00124 y2 = temp;
00125
00126 linter = ! linter;
00127 }
00128
00129 dy = y2 - y1;
00130 if (dy > 0.f) {
00131 /* only clip if line has some Y range */
00132 slope = (x2 - x1) / dy;
00133 if (y1 < zzzplt_1.yclbot) {
00134 /* intercept of line at bottom */
00135 x1 += slope * (zzzplt_1.yclbot - y1);
00136 y1 = zzzplt_1.yclbot;
00137 }
00138 if (y2 > zzzplt_1.ycltop) {
00139 /* intercept at top */
00140 x2 += slope * (zzzplt_1.ycltop - y2);
00141 y2 = zzzplt_1.ycltop;
00142 }
00143 }
00144
00145 /* Line is now guaranteed to be totally inside the plot region. */
00146 /* Copy local clipped coordinates to output values and return. */
00147 /* Note that we must restore points to original input order. */
00148
00149 if (linter) {
00150 *x1in = x2;
00151 *x2in = x1;
00152 *y1in = y2;
00153 *y2in = y1;
00154 } else {
00155 *x1in = x1;
00156 *y1in = y1;
00157 *x2in = x2;
00158 *y2in = y2;
00159 }
00160
00161 L8000:
00162 return 0;
00163 } /* zzclip_ */
|
|
||||||||||||||||||||||||||||
|
Definition at line 924 of file pwritf.c. References L, s_cmp(), and s_copy(). Referenced by pwritf_().
00926 {
00927 /* Initialized data */
00928
00929 static char chesc[15] = "\\esc ";
00930 static char chnesc[15] = "\\noesc ";
00931 static char chtex[15*113] = "\\Plus " "\\Cross " "\\Dia"
00932 "mond " "\\Box " "\\FDiamond " "\\FBox "
00933 " " "\\FPlus " "\\FCross " "\\Burst "
00934 "\\Octagon " "\\alpha " "\\beta " "\\gamm"
00935 "a " "\\delta " "\\epsilon " "\\zeta "
00936 " " "\\eta " "\\theta " "\\iota "
00937 "\\kappa " "\\lambda " "\\mu " "\\nu "
00938 " " "\\xi " "\\omicron " "\\pi "
00939 " " "\\rho " "\\sigma " "\\tau "
00940 "\\upsilon " "\\phi " "\\chi " "\\psi "
00941 " " "\\omega " "\\Alpha " "\\Beta "
00942 " " "\\Gamma " "\\Delta " "\\Epsilon "
00943 "\\Zeta " "\\Eta " "\\Theta " "\\Iota"
00944 " " "\\Kappa " "\\Lambda " "\\Mu "
00945 " " "\\Nu " "\\Xi " "\\Omicron "
00946 "\\Pi " "\\Rho " "\\Sigma " "\\Tau "
00947 " " "\\Upsilon " "\\Phi " "\\Chi "
00948 " " "\\Psi " "\\Omega " "\\propto "
00949 "\\int " "\\times " "\\div " "\\appr"
00950 "ox " "\\partial " "\\cap " "\\? "
00951 " " "\\langle " "\\rangle " "\\ddagger "
00952 "\\pm " "\\leq " "\\S " "\\hbar"
00953 " " "\\lambar " "\\cup " "\\degree "
00954 " " "\\nabla " "\\downarrow " "\\leftarrow "
00955 "\\rightarrow " "\\leftrightarrow" "\\oint " "\\in "
00956 " " "\\notin " "\\surd " "\\_ "
00957 " " "\\bar " "\\exists " "\\geq "
00958 "\\forall " "\\subset " "\\oplus " "\\otim"
00959 "es " "\\dagger " "\\neq " "\\supset "
00960 " " "\\infty " "\\uparrow " "\\# "
00961 "\\$ " "\\% " "\\& " "\\{ "
00962 " " "\\} " "\\\\ " "\\cents "
00963 " " "\\black " "\\red " "\\blue "
00964 "\\green " "\\yellow " "\\magenta " "\\cyan"
00965 " ";
00966 static integer ichext[113] = { 176,177,178,179,180,181,182,183,184,185,
00967 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,
00968 241,242,243,244,245,246,247,248,193,194,195,196,197,198,199,200,
00969 201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,
00970 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
00971 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
00972 186,187,188,189,190,191,255,96,35,36,37,38,123,125,92,94,148,149,
00973 150,151,152,153,154 };
00974
00975 /* System generated locals */
00976 integer i__1;
00977
00978 /* Builtin functions */
00979 integer s_cmp(char *, char *, ftnlen, ftnlen);
00980 /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00981
00982 /* Local variables */
00983 static logical lesc;
00984 static integer itop;
00985 static logical lout;
00986 static integer i__, nused, nsupb;
00987 static char chcont[15];
00988 static integer ntsupb[10], inc;
00989
00990
00991 /* Convert input string (using TeX-like escapes) to extended character */
00992 /* set, for plotting with ZZSTRO. */
00993
00994 /* .......................................................................
00995 */
00996
00997 /* super/subscript control characters */
00998
00999 /* .......................................................................
01000 */
01001 /* INC = input character being scanned */
01002 /* NUSED = no. of input characters consumed by this operation */
01003 /* NSUPB = super/subscript level */
01004 /* NTSUPB = super/subscript type at each level: */
01005 /* 1 = single character superscript -- like a^b */
01006 /* 2 = multi-character superscript -- like a^{b+c} */
01007 /* -1,-2 = similar for subscripts */
01008 /* LOUT = .TRUE. if we just output something to CHOUT, */
01009 /* otherwise .FALSE. */
01010
01011
01012 /* Table of Tex-like escapes */
01013
01014
01015 /* Corresponding extended character set bytes */
01016
01017 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01018 */
01019 /* Test if a character is alphabetic */
01020
01021 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01022 */
01023 *nchout = 0;
01024 nsupb = 0;
01025 inc = 1;
01026 /* -----------------------------------------------------------------------
01027 */
01028 /* Process input character no. INC */
01029
01030 lesc = TRUE_;
01031 L100:
01032
01033 /* CC WRITE(*,666) 'ZZCONV at: ' // CHIN(INC:INC) */
01034 /* CC666 FORMAT(A) */
01035
01036 lout = FALSE_;
01037
01038 /* Superscript: ^{ starts a multi-character superscript, otherwise */
01039 /* ^ starts a single-character superscript */
01040
01041 if (lesc && *(unsigned char *)&chin[inc - 1] == '^' && inc < *nchin) {
01042 ++nsupb;
01043 i__1 = inc;
01044 if (s_cmp(chin + i__1, "{", inc + 1 - i__1, 1L) == 0) {
01045 ntsupb[nsupb - 1] = 2;
01046 nused = 2;
01047 } else {
01048 ntsupb[nsupb - 1] = 1;
01049 nused = 1;
01050 }
01051 ++(*nchout);
01052 *(unsigned char *)&chout[*nchout - 1] = 144;
01053 /* CC WRITE(*,666) ' start superscript' */
01054 /* ...................................................................
01055 .... */
01056 /* Subscript: similar to above code */
01057
01058 } else if (lesc && *(unsigned char *)&chin[inc - 1] == '_' && inc < *
01059 nchin) {
01060 ++nsupb;
01061 i__1 = inc;
01062 if (s_cmp(chin + i__1, "{", inc + 1 - i__1, 1L) == 0) {
01063 ntsupb[nsupb - 1] = -2;
01064 nused = 2;
01065 } else {
01066 ntsupb[nsupb - 1] = -1;
01067 nused = 1;
01068 }
01069 ++(*nchout);
01070 *(unsigned char *)&chout[*nchout - 1] = 146;
01071 /* CC WRITE(*,666) ' start subscript' */
01072 /* ...................................................................
01073 .... */
01074 /* If in super/subscript mode and we have a '}', then this terminates
01075 */
01076 /* the current level of super/subscripts */
01077
01078 } else if (lesc && *(unsigned char *)&chin[inc - 1] == '}' && nsupb > 0) {
01079 nused = 1;
01080 ++(*nchout);
01081 if (ntsupb[nsupb - 1] > 0) {
01082 *(unsigned char *)&chout[*nchout - 1] = 145;
01083 } else {
01084 *(unsigned char *)&chout[*nchout - 1] = 147;
01085 }
01086 --nsupb;
01087 /* CC WRITE(*,666) ' end compound super/subscript' */
01088 /* ...................................................................
01089 .... */
01090 /* Anything else that doesn't start with a \ is passed straight throu
01091 gh */
01092
01093 } else if (! lesc || *(unsigned char *)&chin[inc - 1] != '\\') {
01094 lout = TRUE_;
01095 nused = 1;
01096 ++(*nchout);
01097 *(unsigned char *)&chout[*nchout - 1] = *(unsigned char *)&chin[inc -
01098 1];
01099 /* CC WRITE(*,666) ' passthru' */
01100 /* ...................................................................
01101 .... */
01102 /* If it started with a \ but we are at the last character, quit */
01103
01104 } else if (inc == *nchin) {
01105 /* CC WRITE(*,666) ' end of input' */
01106 goto L8000;
01107 /* ...................................................................
01108 .... */
01109 /* TeX-like escapes -- there are 2 possibilities: */
01110 /* 1) \asciistring */
01111 /* 2) \specialcharacter */
01112
01113 } else {
01114 itop = inc + 1;
01115
01116 /* If the next character is alphabetic, then scan until end-of-input
01117 */
01118 /* or a non-alphabetic character is found. This will be the end */
01119 /* of the escape sequence. */
01120
01121 i__1 = *(unsigned char *)&chin[itop - 1];
01122 if (i__1 >= 'A' && i__1 <= 'Z' || i__1 >= 'a' && i__1 <= 'z') {
01123 L200:
01124 ++itop;
01125 if (itop > *nchin) {
01126 goto L300;
01127 }
01128 i__1 = *(unsigned char *)&chin[itop - 1];
01129 if (i__1 >= 'A' && i__1 <= 'Z' || i__1 >= 'a' && i__1 <= 'z') {
01130 goto L200;
01131 }
01132 L300:
01133 --itop;
01134
01135 /* If the character following the \asciistring is a blank, skip i
01136 t also */
01137
01138 if (itop < *nchin) {
01139 i__1 = itop;
01140 if (s_cmp(chin + i__1, " ", itop + 1 - i__1, 1L) == 0) {
01141 ++itop;
01142 }
01143 }
01144 }
01145
01146 /* At this point, characters INC thru ITOP are the escape sequence.
01147 */
01148 /* Check for a match with the table. */
01149
01150 nused = itop - inc + 1;
01151 s_copy(chcont, chin + (inc - 1), 15L, itop - (inc - 1));
01152
01153 for (i__ = 1; i__ <= 113; ++i__) {
01154 if (s_cmp(chcont, chtex + (i__ - 1) * 15, 15L, 15L) == 0) {
01155 goto L410;
01156 }
01157 /* L400: */
01158 }
01159 i__ = 0;
01160 L410:
01161
01162 /* If a match, enter the control character into the output; */
01163 /* if no match, just ignore it */
01164
01165 if (i__ > 0) {
01166 lout = TRUE_;
01167 ++(*nchout);
01168 *(unsigned char *)&chout[*nchout - 1] = (char) ichext[i__ - 1];
01169 /* CC WRITE(*,666) ' TeX escape: ' // CHCONT */
01170 /* CC ELSE */
01171 /* CC WRITE(*,666) ' unknown TeX escape: ' // CHCONT
01172 */
01173 } else if (s_cmp(chcont, chnesc, 15L, 15L) == 0) {
01174 lesc = FALSE_;
01175 } else if (s_cmp(chcont, chesc, 15L, 15L) == 0) {
01176 lesc = TRUE_;
01177 }
01178 }
01179 /* .......................................................................
01180 */
01181 /* If we are in single-character super/subscript mode, we must drop */
01182 /* out of it after outputting something */
01183
01184 if (lout && nsupb > 0) {
01185 if (ntsupb[nsupb - 1] == 1) {
01186 --nsupb;
01187 ++(*nchout);
01188 *(unsigned char *)&chout[*nchout - 1] = 145;
01189 /* CC WRITE(*,666) ' end single-character superscript'
01190 */
01191 } else if (ntsupb[nsupb - 1] == -1) {
01192 --nsupb;
01193 ++(*nchout);
01194 *(unsigned char *)&chout[*nchout - 1] = 147;
01195 /* CC WRITE(*,666) ' end single-character subscript' */
01196 }
01197 }
01198
01199 /* "Use up" the appropriate number of characters, and go on to */
01200 /* the next bunch */
01201
01202 inc += nused;
01203 if (inc <= *nchin) {
01204 goto L100;
01205 }
01206 /* -----------------------------------------------------------------------
01207 */
01208 L8000:
01209 return 0;
01210 } /* zzconv_ */
|
|
||||||||||||||||||||
|
Definition at line 15 of file zzlabl.c. References c__1, dabs, do_fio(), e_wsfi(), L, s_copy(), and s_wsfi(). Referenced by zzaxxx_(), and zzaxyy_().
00017 {
00018 /* Format strings */
00019 static char fmt_101[] = "(f9.3)";
00020 static char fmt_301[] = "(1pe9.2)";
00021
00022 /* System generated locals */
00023 integer i__1;
00024
00025 /* Builtin functions */
00026 /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00027 integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
00028 ;
00029
00030 /* Local variables */
00031 static integer nbot, ntop, n, nch;
00032 static char buf[10];
00033
00034 /* Fortran I/O blocks */
00035 static icilist io___3 = { 0, buf, 0, fmt_101, 10, 1 };
00036 static icilist io___6 = { 0, buf, 0, fmt_301, 10, 1 };
00037
00038
00039
00040 /* Generate a character string for a label for a linear axis in DRAXES */
00041 /* .......................................................................
00042 */
00043 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00044 */
00045 /* Parameter adjustments */
00046 --cout;
00047
00048 /* Function Body */
00049 if (*val == 0.f) {
00050 s_copy(buf, "0", 10L, 1L);
00051 nch = 1;
00052 /* ...................................................................
00053 .... */
00054 /* Intermediate values get an F format. */
00055
00056 } else if (dabs(*val) >= .01f && dabs(*val) <= 9999.99f) {
00057 s_wsfi(&io___3);
00058 do_fio(&c__1, (char *)&(*val), (ftnlen)sizeof(real));
00059 e_wsfi();
00060
00061 /* Strip off leading blanks */
00062
00063 nbot = 1;
00064 L100:
00065 if (*(unsigned char *)&buf[nbot - 1] != ' ') {
00066 goto L200;
00067 }
00068 ++nbot;
00069 if (nbot < 9) {
00070 goto L100;
00071 }
00072 L200:
00073
00074 /* Strip off trailing zeroes */
00075
00076 ntop = 9;
00077 L300:
00078 if (*(unsigned char *)&buf[ntop - 1] != '0') {
00079 goto L400;
00080 }
00081 --ntop;
00082 if (ntop > nbot) {
00083 goto L300;
00084 }
00085 L400:
00086
00087 /* Store desired part of string in first part of BUF */
00088
00089 nch = ntop - nbot + 1;
00090 s_copy(buf, buf + (nbot - 1), nch, ntop - (nbot - 1));
00091 /* ...................................................................
00092 .... */
00093 /* Large or small values get an E format. */
00094
00095 } else {
00096 s_wsfi(&io___6);
00097 do_fio(&c__1, (char *)&(*val), (ftnlen)sizeof(real));
00098 e_wsfi();
00099 if (*(unsigned char *)buf == ' ') {
00100 s_copy(buf, buf + 1, 8L, 8L);
00101 nch = 8;
00102 } else {
00103 nch = 9;
00104 }
00105 }
00106 /* .......................................................................
00107 */
00108 i__1 = nch;
00109 for (n = 1; n <= i__1; ++n) {
00110 *(unsigned char *)&cout[n] = *(unsigned char *)&buf[n - 1];
00111 /* L900: */
00112 }
00113 *nchar = nch;
00114
00115 return 0;
00116 } /* zzlabl_ */
|
|
||||||||||||||||
|
Definition at line 15 of file zzlgin.c. References c_b2, max, pow_ri(), and r_lg10(). Referenced by zzaxxx_(), and zzaxyy_().
00016 {
00017 /* System generated locals */
00018 integer i__1;
00019
00020 /* Builtin functions */
00021 double r_lg10(real *), pow_ri(real *, integer *);
00022
00023 /* Local variables */
00024 static integer nl;
00025 static real xl;
00026
00027
00028 /* Return PWRTEN and NTEN such that */
00029
00030 /* PWRTEN .LE. XT .LT. 10*PWRTEN AND PWRTEN = 10**NLOG */
00031 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00032 */
00033 xl = r_lg10(xt) + 1e-5f;
00034 /* Computing MAX */
00035 i__1 = (integer) xl;
00036 nl = max(i__1,-36);
00037 if (xl < 0.f) {
00038 --nl;
00039 }
00040 *pwrten = pow_ri(&c_b2, &nl);
00041 *nlog = nl;
00042 return 0;
00043 } /* zzlgin_ */
|
|
||||||||||||||||||||
|
Definition at line 34 of file zzline.c. References phline_(), x2, y1, zzclip_(), and zzzplt_1. Referenced by line_(), pwritf_(), vector_(), zzchar_(), zzlinx_(), zzliny_(), zzlogx_(), and zzlogy_().
00035 {
00036 extern /* Subroutine */ int phline_(real *, real *, real *, real *),
00037 zzclip_(real *, real *, real *, real *);
00038 static real xx1, xx2, yy1, yy2;
00039
00040
00041 /* Draw a line between 2 physical coordinates points. */
00042 /* .......................................................................
00043 */
00044 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00045 */
00046
00047 /* Internal Data for PLOTPAK */
00048
00049 xx1 = *x1;
00050 yy1 = *y1;
00051 xx2 = *x2;
00052 yy2 = *y2;
00053 zzclip_(&xx1, &yy1, &xx2, &yy2);
00054 if (xx1 >= zzzplt_1.xpgmin) {
00055 phline_(&xx1, &yy1, &xx2, &yy2);
00056 }
00057 zzzplt_1.xphold = *x2;
00058 zzzplt_1.yphold = *y2;
00059
00060 return 0;
00061 } /* zzline_ */
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 11 of file zzlinx.c. Referenced by zzaxxx_().
00013 {
00014 /* System generated locals */
00015 integer i__1, i__2;
00016
00017 /* Local variables */
00018 static integer imaj, imin;
00019 static real ymajr, yminr, dx, xx;
00020 extern /* Subroutine */ int zzline_(real *, real *, real *, real *);
00021
00022
00023 /* Draw a linear axis from (X1,Y) to (X2,Y) [physical coordinates], */
00024 /* with MAJRX major divisions (tic mark size = TMAJ) and MINRX minor */
00025 /* divisions (tic mark size = TMIN). */
00026 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00027 */
00028 zzline_(x1, y, x2, y);
00029 if (*tmaj == 0.f && *tmin == 0.f) {
00030 goto L8000;
00031 }
00032
00033 ymajr = *y + *tmaj;
00034 yminr = *y + *tmin;
00035 dx = (*x2 - *x1) / (*majrx * *minrx);
00036 xx = *x1;
00037 zzline_(&xx, y, &xx, &ymajr);
00038 i__1 = *majrx;
00039 for (imaj = 1; imaj <= i__1; ++imaj) {
00040 i__2 = *minrx - 1;
00041 for (imin = 1; imin <= i__2; ++imin) {
00042 xx += dx;
00043 if (*tmin != 0.f) {
00044 zzline_(&xx, y, &xx, &yminr);
00045 }
00046 /* L100: */
00047 }
00048 xx += dx;
00049 zzline_(&xx, y, &xx, &ymajr);
00050 /* L200: */
00051 }
00052
00053 L8000:
00054 return 0;
00055 } /* zzlinx_ */
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 11 of file zzliny.c. Referenced by zzaxyy_().
00013 {
00014 /* System generated locals */
00015 integer i__1, i__2;
00016
00017 /* Local variables */
00018 static integer imaj, imin;
00019 static real xmajr, xminr, dy, yy;
00020 extern /* Subroutine */ int zzline_(real *, real *, real *, real *);
00021
00022
00023 /* Draw a linear axis from (X,Y1) to (X,Y2) [physical coordinates], */
00024 /* with MAJRY major divisions (tic mark size = TMAJ) and MINRY minor */
00025 /* divisions (tic mark size = TMIN). */
00026 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00027 */
00028 zzline_(x, y1, x, y2);
00029 if (*tmaj == 0.f && *tmin == 0.f) {
00030 goto L8000;
00031 }
00032
00033 xmajr = *x + *tmaj;
00034 xminr = *x + *tmin;
00035 dy = (*y2 - *y1) / (*majry * *minry);
00036 yy = *y1;
00037 zzline_(x, &yy, &xmajr, &yy);
00038 i__1 = *majry;
00039 for (imaj = 1; imaj <= i__1; ++imaj) {
00040 i__2 = *minry - 1;
00041 for (imin = 1; imin <= i__2; ++imin) {
00042 yy += dy;
00043 if (*tmin != 0.f) {
00044 zzline_(x, &yy, &xminr, &yy);
00045 }
00046 /* L100: */
00047 }
00048 yy += dy;
00049 zzline_(x, &yy, &xmajr, &yy);
00050 /* L200: */
00051 }
00052
00053 L8000:
00054 return 0;
00055 } /* zzliny_ */
|
|
||||||||||||||||||||||||||||
|
Definition at line 11 of file zzlogx.c. Referenced by zzaxxx_().
00013 {
00014 /* Initialized data */
00015
00016 static real tmlog[8] = { .30103f,.47712f,.60206f,.69897f,.77815f,.84509f,
00017 .90309f,.95424f };
00018
00019 /* System generated locals */
00020 integer i__1;
00021
00022 /* Local variables */
00023 static integer idec, imin;
00024 static real dxmaj, xmajr, ymajr, yminr, xx;
00025 extern /* Subroutine */ int zzline_(real *, real *, real *, real *);
00026
00027
00028 /* Draw a log axis from (X1,Y) to (X2,Y) [physical coordinates], */
00029 /* with NDEC decades and the major and minor tic mark lengths in */
00030 /* TMAJ and TMIN, respectively. */
00031
00032 /* This array is LOG10 of 2,3,...,9; it is used to space the */
00033 /* minor divisions. */
00034
00035 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00036 */
00037 zzline_(x1, y, x2, y);
00038 if (*tmaj == 0.f || *tmin == 0.f) {
00039 goto L8000;
00040 }
00041 ymajr = *y + *tmaj;
00042 yminr = *y + *tmin;
00043 dxmaj = (*x2 - *x1) / *ndec;
00044 xmajr = *x1;
00045 zzline_(&xmajr, y, &xmajr, &ymajr);
00046
00047 i__1 = *ndec;
00048 for (idec = 1; idec <= i__1; ++idec) {
00049 if (*tmin != 0.f) {
00050 for (imin = 1; imin <= 8; ++imin) {
00051 xx = xmajr + tmlog[imin - 1] * dxmaj;
00052 zzline_(&xx, y, &xx, &yminr);
00053 /* L100: */
00054 }
00055 }
00056 xmajr += dxmaj;
00057 zzline_(&xmajr, y, &xmajr, &ymajr);
00058 /* L200: */
00059 }
00060
00061 L8000:
00062 return 0;
00063 } /* zzlogx_ */
|
|
||||||||||||||||||||||||||||
|
Definition at line 11 of file zzlogy.c. Referenced by zzaxyy_().
00013 {
00014 /* Initialized data */
00015
00016 static real tmlog[8] = { .30103f,.47712f,.60206f,.69897f,.77815f,.84509f,
00017 .90309f,.95424f };
00018
00019 /* System generated locals */
00020 integer i__1;
00021
00022 /* Local variables */
00023 static integer idec, imin;
00024 static real dymaj, xmajr, ymajr, xminr, yy;
00025 extern /* Subroutine */ int zzline_(real *, real *, real *, real *);
00026
00027
00028 /* Draw a log axis from (X,Y1) to (X,Y2) [physical coordinates], */
00029 /* with NDEC decades and the major and minor tic mark lengths in */
00030 /* TMAJ and TMIN, respectively. */
00031
00032 /* This array is LOG10 of 2,3,...,9; it is used to space the */
00033 /* minor divisions. */
00034
00035 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00036 */
00037 zzline_(x, y1, x, y2);
00038 if (*tmaj == 0.f || *tmin == 0.f) {
00039 goto L8000;
00040 }
00041 xmajr = *x + *tmaj;
00042 xminr = *x + *tmin;
00043 dymaj = (*y2 - *y1) / *ndec;
00044 ymajr = *y1;
00045 zzline_(x, &ymajr, &xmajr, &ymajr);
00046
00047 i__1 = *ndec;
00048 for (idec = 1; idec <= i__1; ++idec) {
00049 if (*tmin != 0.f) {
00050 for (imin = 1; imin <= 8; ++imin) {
00051 yy = ymajr + tmlog[imin - 1] * dymaj;
00052 zzline_(x, &yy, &xminr, &yy);
00053 /* L100: */
00054 }
00055 }
00056 ymajr += dymaj;
00057 zzline_(x, &ymajr, &xmajr, &ymajr);
00058 /* L200: */
00059 }
00060
00061 L8000:
00062 return 0;
00063 } /* zzlogy_ */
|
|
||||||||||||||||
|
Definition at line 164 of file plot_cox.c. References r, and set_color_memplot(). Referenced by color_(), and fcolor_().
00165 {
00166 set_color_memplot( *r , *g , *b ) ;
00167 return ;
00168 }
|
|
||||||||||||||||||||
|
Definition at line 260 of file plot_cox.c. References plotline_memplot(), x2, and y1. Referenced by zzphph_().
00261 {
00262 plotline_memplot( *x1 , *y1 , *x2 , *y2 ) ;
00263 return ;
00264 }
|
|
|
Definition at line 38 of file zzperi.c. References c__0, zzaxxx_(), zzaxyy_(), and zzzplt_1. Referenced by perim_(), periml_(), and perimm_().
00039 {
00040 /* System generated locals */
00041 integer i__1;
00042
00043 /* Local variables */
00044 static integer xlab, ylab;
00045 static real sxmin, sxmax, symin, symax;
00046 static integer isidex, isidey;
00047 extern /* Subroutine */ int zzaxxx_(real *, real *, real *, integer *,
00048 integer *), zzaxyy_(real *, real *, real *, integer *, integer *);
00049
00050
00051 /* Do the perimeter axes. */
00052 /* ILAB = 0 --> no labels on axes */
00053 /* = 1 --> labels on x and y */
00054 /* = 2 --> labels on x only */
00055 /* = 3 --> labels on y only */
00056 /* .......................................................................
00057 */
00058
00059 /* Internal Data for PLOTPAK */
00060
00061 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00062 */
00063 if (zzzplt_1.xmin < zzzplt_1.xmax) {
00064 isidey = 1;
00065 sxmin = zzzplt_1.xmin;
00066 sxmax = zzzplt_1.xmax;
00067 } else {
00068 isidey = -1;
00069 sxmin = zzzplt_1.xmax;
00070 sxmax = zzzplt_1.xmin;
00071 }
00072
00073 if (zzzplt_1.ymin < zzzplt_1.ymax) {
00074 isidex = 1;
00075 symin = zzzplt_1.ymin;
00076 symax = zzzplt_1.ymax;
00077 } else {
00078 isidex = -1;
00079 symin = zzzplt_1.ymax;
00080 symax = zzzplt_1.ymin;
00081 }
00082
00083 xlab = 0;
00084 ylab = 0;
00085 if (*ilab == 1 || *ilab == 2) {
00086 xlab = 1;
00087 }
00088 if (*ilab == 1 || *ilab == 3) {
00089 ylab = 1;
00090 }
00091
00092 zzaxxx_(&sxmin, &sxmax, &symin, &isidex, &xlab);
00093 i__1 = -isidex;
00094 zzaxxx_(&sxmin, &sxmax, &symax, &i__1, &c__0);
00095
00096 zzaxyy_(&sxmin, &symin, &symax, &isidey, &ylab);
00097 i__1 = -isidey;
00098 zzaxyy_(&sxmax, &symin, &symax, &i__1, &c__0);
00099
00100 return 0;
00101 } /* zzperi_ */
|
|
||||||||||||||||||||
|
Definition at line 34 of file zzphph.c. References x2, y1, zzmpli_(), and zzpltr_1. Referenced by phdot_(), and phline_().
00035 {
00036 extern /* Subroutine */ int zzmpli_(real *, real *, real *, real *);
00037 static real px1, px2, py1, py2;
00038
00039
00040 /* Plot a physical coordinate line. */
00041
00042 /* Everything in this package eventually funnels into this routine, */
00043 /* which depends on the hardware being drawn upon. The device */
00044 /* is chosen by the NPLOTR variable (in 'plotpak.inc' COMMON /ZZPLTR/):
00045 */
00046
00047 /* 1 = Los Alamos CGS SunView window */
00048 /* 2 = Los Alamos CGS Metafile */
00049 /* 3 = Write all line coordinates to an ASCII file for later work */
00050 /* 4 = Write all line coordinates to a Unix plot format file */
00051 /* 5 = Use Microsoft GRAPHICS.LIB */
00052 /* 6 = Write PostScript code to an output file */
00053 /* 7 = Call the C "memplot" routine */
00054 /* .......................................................................
00055 */
00056 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00057 */
00058
00059 /* Internal Data for PLOTPAK */
00060
00061 if (zzpltr_1.iflip == 1) {
00062 /* Flipped coordinates */
00063 px1 = zzpltr_1.xpscal * (zzpltr_1.yphmax - *y1);
00064 px2 = zzpltr_1.xpscal * (zzpltr_1.yphmax - *y2);
00065 py1 = zzpltr_1.ypscal * (zzpltr_1.xphmax - *x1);
00066 py2 = zzpltr_1.ypscal * (zzpltr_1.xphmax - *x2);
00067 } else if (zzpltr_1.iflip == 2) {
00068 /* Flipped coordinates */
00069 px1 = zzpltr_1.xpscal * (zzpltr_1.yphmax - *y1);
00070 px2 = zzpltr_1.xpscal * (zzpltr_1.yphmax - *y2);
00071 py1 = zzpltr_1.xpscal * *x1;
00072 py2 = zzpltr_1.xpscal * *x2;
00073 } else {
00074 /* Normal coordinates */
00075 px1 = zzpltr_1.xpscal * *x1;
00076 px2 = zzpltr_1.xpscal * *x2;
00077 py1 = zzpltr_1.ypscal * *y1;
00078 py2 = zzpltr_1.ypscal * *y2;
00079 }
00080
00081 /* Plot it! */
00082
00083 /* cc IF( NPLOTR.EQ.1 .OR. NPLOTR.EQ.2 )THEN */
00084 /* cc CALL GMOVA2( PX1 , PY1 ) */
00085 /* cc CALL GLINA2( PX2 , PY2 ) */
00086 /* cc ENDIF */
00087
00088 /* cc IF( NPLOTR .EQ. 3 )THEN */
00089 /* cc WRITE(99,101) PX1,PY1,PX2,PY2 */
00090 /* cc101 FORMAT(4(F6.4,',')) */
00091 /* cc ENDIF */
00092
00093 /* cc IF( NPLOTR .EQ. 4 )THEN */
00094 /* cc CALL ZZUPLI( NINT(PX1),NINT(PY1) , NINT(PX2),NINT(PY2) ) */
00095 /* cc ENDIF */
00096
00097 /* cc IF( NPLOTR .EQ. 5 )THEN */
00098 /* cc CALL ZZPCLI( PX1,PY1 , PX2,PY2 ) */
00099 /* cc ENDIF */
00100
00101 /* cc IF( NPLOTR .EQ. 6 )THEN */
00102 /* cc CALL ZZPSLI( NINT(PX1),NINT(PY1) , NINT(PX2),NINT(PY2) ) */
00103 /* cc ENDIF */
00104
00105 if (zzpltr_1.nplotr == 7) {
00106 zzmpli_(&px1, &py1, &px2, &py2);
00107 }
00108
00109 /* cc WRITE(*,999) PX1,PY1,PX2,PY2 */
00110 /* cc999 FORMAT('ZZPHPH:',4(1X,1PG10.3)) */
00111
00112 return 0;
00113 } /* zzphph_ */
|
|
||||||||||||
|
Definition at line 34 of file zzphys.c. References dabs, r_lg10(), and zzzplt_1. Referenced by frstpt_(), line_(), plotpak_zzphys(), point_(), pwrit_(), pwritf_(), vector_(), zzaxxx_(), and zzaxyy_().
00035 {
00036 /* System generated locals */
00037 real r__1;
00038
00039 /* Builtin functions */
00040 double r_lg10(real *);
00041
00042
00043 /* Convert user to physical coordinates. */
00044 /* .......................................................................
00045 */
00046 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00047 */
00048
00049 /* Internal Data for PLOTPAK */
00050
00051 if (zzzplt_1.ixcoor < 0) {
00052 r__1 = dabs(*x) + 1e-37f;
00053 *x = r_lg10(&r__1);
00054 }
00055 *x = zzzplt_1.alphxx * *x + zzzplt_1.betaxx;
00056
00057 if (zzzplt_1.iycoor < 0) {
00058 r__1 = dabs(*y) + 1e-37f;
00059 *y = r_lg10(&r__1);
00060 }
00061 *y = zzzplt_1.alphyy * *y + zzzplt_1.betayy;
00062
00063 return 0;
00064 } /* zzphys_ */
|
|
||||||||||||||||||||||||||||||||
|
Referenced by pwritf_(). |
Variable Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|