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  

pwrit.c File Reference

#include "f2c.h"

Go to the source code of this file.


Defines

#define zzzplt_1   zzzplt_
#define zzpltr_1   zzpltr_

Functions

int pwrit_ (real *x, real *y, char *ch, integer *nch, integer *isiz, integer *ior, integer *icent, ftnlen ch_len)

Variables

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_

Define Documentation

#define zzpltr_1   zzpltr_
 

Definition at line 29 of file pwrit.c.

#define zzzplt_1   zzzplt_
 

Definition at line 19 of file pwrit.c.

Referenced by pwrit_().


Function Documentation

int pwrit_ real   x,
real   y,
char *    ch,
integer   nch,
integer   isiz,
integer   ior,
integer   icent,
ftnlen    ch_len
 

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_ */

Variable Documentation

real alphxx
 

Definition at line 14 of file pwrit.c.

real alphyy
 

Definition at line 14 of file pwrit.c.

real betaxx
 

Definition at line 14 of file pwrit.c.

real betayy
 

Definition at line 14 of file pwrit.c.

char cfile[64]
 

Definition at line 26 of file pwrit.c.

integer iflip
 

Definition at line 25 of file pwrit.c.

integer isizx
 

Definition at line 15 of file pwrit.c.

integer isizy
 

Definition at line 15 of file pwrit.c.

integer ixcoor
 

Definition at line 13 of file pwrit.c.

integer ixpmax
 

Definition at line 23 of file pwrit.c.

integer iycoor
 

Definition at line 13 of file pwrit.c.

integer iypmax
 

Definition at line 23 of file pwrit.c.

integer majrx
 

Definition at line 15 of file pwrit.c.

integer majry
 

Definition at line 15 of file pwrit.c.

integer minrx
 

Definition at line 15 of file pwrit.c.

integer minry
 

Definition at line 15 of file pwrit.c.

integer nplotr
 

Definition at line 25 of file pwrit.c.

real tmajx
 

Definition at line 14 of file pwrit.c.

real tmajy
 

Definition at line 14 of file pwrit.c.

real tminx
 

Definition at line 14 of file pwrit.c.

real tminy
 

Definition at line 14 of file pwrit.c.

real xbot
 

Definition at line 11 of file pwrit.c.

real xclbot
 

Definition at line 11 of file pwrit.c.

real xcltop
 

Definition at line 11 of file pwrit.c.

real xmax
 

Definition at line 11 of file pwrit.c.

real xmin
 

Definition at line 11 of file pwrit.c.

real xpgmax
 

Definition at line 11 of file pwrit.c.

real xpgmin
 

Definition at line 11 of file pwrit.c.

real xphmax
 

Definition at line 22 of file pwrit.c.

real xphold
 

Definition at line 16 of file pwrit.c.

real xpscal
 

Definition at line 24 of file pwrit.c.

real xtop
 

Definition at line 11 of file pwrit.c.

real ybot
 

Definition at line 11 of file pwrit.c.

real yclbot
 

Definition at line 11 of file pwrit.c.

real ycltop
 

Definition at line 11 of file pwrit.c.

real ymax
 

Definition at line 11 of file pwrit.c.

real ymin
 

Definition at line 11 of file pwrit.c.

real ypgmax
 

Definition at line 11 of file pwrit.c.

real ypgmin
 

Definition at line 11 of file pwrit.c.

real yphmax
 

Definition at line 22 of file pwrit.c.

real yphold
 

Definition at line 16 of file pwrit.c.

real ypscal
 

Definition at line 24 of file pwrit.c.

real ytop
 

Definition at line 11 of file pwrit.c.

struct { ... } zzpltr_
 

struct { ... } zzzplt_
 

 

Powered by Plone

This site conforms to the following standards: