Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

zzaxxx.c

Go to the documentation of this file.
00001 /* zzaxxx.f -- translated by f2c (version 19961017).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"
00007 
00008 /* Common Block Declarations */
00009 
00010 extern struct {
00011     real xpgmin, ypgmin, xpgmax, ypgmax, xclbot, yclbot, xcltop, ycltop, xbot,
00012              ybot, xtop, ytop, xmin, ymin, xmax, ymax;
00013     integer ixcoor, iycoor;
00014     real alphxx, betaxx, alphyy, betayy, tmajx, tminx, tmajy, tminy;
00015     integer majrx, minrx, majry, minry, isizx, isizy;
00016     real xphold, yphold;
00017 } zzzplt_;
00018 
00019 #define zzzplt_1 zzzplt_
00020 
00021 extern struct {
00022     real xphmax, yphmax;
00023     integer ixpmax, iypmax;
00024     real xpscal, ypscal;
00025     integer iflip, nplotr;
00026     char cfile[64];
00027 } zzpltr_;
00028 
00029 #define zzpltr_1 zzpltr_
00030 
00031 /* Table of constant values */
00032 
00033 static integer c__1 = 1;
00034 static integer c__0 = 0;
00035 
00036 /* ======================================================================= */
00037 /*  Routines that start with ZZ are internal utility routines: */
00038 
00039 
00040 
00041 /* Subroutine */ int zzaxxx_(real *x1, real *x2, real *y, integer *iside, 
00042         integer *ilab)
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_ */
00197 
00198 #undef buf
00199 #undef buf10
00200 
00201 
 

Powered by Plone

This site conforms to the following standards: