diff --git a/books/Makefile.pamphlet b/books/Makefile.pamphlet index cf0e62b..0c28538 100644 --- a/books/Makefile.pamphlet +++ b/books/Makefile.pamphlet @@ -28,21 +28,77 @@ DVIPS=dvips -Ppdf PS2PDF=ps2pdf RM=rm -f -BOOKS=${PDF}/bookvol0.pdf ${PDF}/bookvol1.pdf \ - ${PDF}/bookvol7.1.pdf \ - ${PDF}/bookvol8.pdf ${PDF}/bookvol8.1.pdf ${PDF}/bookvol10.pdf \ +BOOKS=${PDF}/bookvol8.1.pdf ${PDF}/bookvol10.pdf \ ${PDF}/bookvol10.1.pdf ${PDF}/bookvol10.2.pdf ${PDF}/bookvol10.3.pdf \ ${PDF}/bookvol10.4.pdf ${PDF}/bookvol10.5.pdf \ ${PDF}/bookvol11.pdf ${PDF}/bookvolbib.pdf -BUUKS=${PDF}/bookvol2.pdf ${PDF}/bookvol3.pdf \ - ${PDF}/bookvol4.pdf \ - ${PDF}/bookvol5.pdf ${PDF}/bookvol6.pdf ${PDF}/bookvol7.pdf \ - ${PDF}/bookvol9.pdf ${PDF}/bookvol12.pdf +BUUKS=${PDF}/bookvol0.pdf ${PDF}/bookvol1.pdf ${PDF}/bookvol2.pdf \ + ${PDF}/bookvol3.pdf ${PDF}/bookvol4.pdf ${PDF}/bookvol5.pdf \ + ${PDF}/bookvol6.pdf ${PDF}/bookvol7.pdf ${PDF}/bookvol7.1.pdf \ + ${PDF}/bookvol8.pdf ${PDF}/bookvol9.pdf ${PDF}/bookvol12.pdf all: ${PDF}/axiom.sty ${BUUKS} ${BOOKS} ${PDF}/toc.pdf @(cd ${PDF} ; ${RM} *.out *.toc ) +${PDF}/bookvol0.pdf: ${IN}/bookvol0.pamphlet + @echo books/1 making ${PDF}/bookvol0.pdf from ${IN}/bookvol0.pamphlet + @(cd ${PDF} ; \ + cp ${IN}/bookvol0.pamphlet ${PDF}/bookvol0.tex ; \ + cp ${IN}/bookheader.tex ${PDF} ; \ + cp -pr ${IN}/ps ${PDF} ; \ + if [ -z "${NOISE}" ] ; then \ + ${RM} bookvol0.toc ; \ + ${LATEX} bookvol0.tex ; \ + ${MAKEINDEX} bookvol0.idx >/dev/null ; \ + ${LATEX} bookvol0.tex >/dev/null ; \ + ${DVIPDFM} bookvol0.dvi 2>/dev/null ; \ + ${RM} bookvol0.aux bookvol0.dvi bookvol0.log bookvol0.ps ; \ + ${RM} bookvol0.idx bookvol0.tex bookvol0.pamphlet ; \ + ${RM} bookvol0.ilg bookvol0.ind ; \ + ${RM} bookheader.tex ; \ + else \ + ${RM} bookvol0.toc ; \ + ${LATEX} bookvol0.tex >${TMP}/trace ; \ + echo ...first latex complete ; \ + ${MAKEINDEX} bookvol0.idx >${TMP}/trace ; \ + ${LATEX} bookvol0.tex >${TMP}/trace ; \ + ${DVIPDFM} bookvol0.dvi 2>${TMP}/trace ; \ + ${RM} bookvol0.aux bookvol0.dvi bookvol0.log bookvol0.ps ; \ + ${RM} bookvol0.idx bookvol0.tex bookvol0.pamphlet ; \ + ${RM} bookvol0.ilg bookvol0.ind ; \ + ${RM} bookheader.tex ; \ + fi ) + +${PDF}/bookvol1.pdf: ${IN}/bookvol1.pamphlet + @echo books/1 making ${PDF}/bookvol1.pdf from ${IN}/bookvol1.pamphlet + @(cd ${PDF} ; \ + cp ${IN}/bookvol1.pamphlet ${PDF}/bookvol1.tex ; \ + cp ${IN}/bookheader.tex ${PDF} ; \ + cp -pr ${IN}/ps ${PDF} ; \ + if [ -z "${NOISE}" ] ; then \ + ${RM} bookvol1.toc ; \ + ${LATEX} bookvol1.tex ; \ + ${MAKEINDEX} bookvol1.idx >/dev/null ; \ + ${LATEX} bookvol1.tex >/dev/null ; \ + ${DVIPDFM} bookvol1.dvi 2>/dev/null ; \ + ${RM} bookvol1.aux bookvol1.dvi bookvol1.log bookvol1.ps ; \ + ${RM} bookvol1.idx bookvol1.tex bookvol1.pamphlet ; \ + ${RM} bookvol1.ilg bookvol1.ind ; \ + ${RM} bookheader.tex ; \ + else \ + ${RM} bookvol1.toc ; \ + ${LATEX} bookvol1.tex >${TMP}/trace ; \ + echo ...first latex complete ; \ + ${MAKEINDEX} bookvol1.idx >${TMP}/trace ; \ + ${LATEX} bookvol1.tex >${TMP}/trace ; \ + ${DVIPDFM} bookvol1.dvi 2>${TMP}/trace ; \ + ${RM} bookvol1.aux bookvol1.dvi bookvol1.log bookvol1.ps ; \ + ${RM} bookvol1.idx bookvol1.tex bookvol1.pamphlet ; \ + ${RM} bookvol1.ilg bookvol1.ind ; \ + ${RM} bookheader.tex ; \ + fi ) + ${PDF}/bookvol2.pdf: ${IN}/bookvol2.pamphlet @echo books/1 making ${PDF}/bookvol2.pdf from ${IN}/bookvol2.pamphlet @(cd ${PDF} ; \ @@ -217,6 +273,65 @@ ${PDF}/bookvol7.pdf: ${IN}/bookvol7.pamphlet ${RM} bookheader.tex ; \ fi ) +${PDF}/bookvol7.1.pdf: ${IN}/bookvol7.1.pamphlet + @echo books/1 making ${PDF}/bookvol7.1.pdf from \ + ${IN}/bookvol7.1.pamphlet + @(cd ${PDF} ; \ + cp ${IN}/bookvol7.1.pamphlet ${PDF}/bookvol7.1.tex ; \ + cp ${IN}/bookheader.tex ${PDF} ; \ + cp -pr ${IN}/ps ${PDF} ; \ + if [ -z "${NOISE}" ] ; then \ + ${RM} bookvol7.1.toc ; \ + ${LATEX} bookvol7.1.tex ; \ + ${MAKEINDEX} bookvol7.1.idx >/dev/null ; \ + ${LATEX} bookvol7.1.tex >/dev/null ; \ + ${DVIPDFM} bookvol7.1.dvi 2>/dev/null ; \ + ${RM} bookvol7.1.aux bookvol7.1.dvi bookvol7.1.log ; \ + ${RM} bookvol7.1.idx bookvol7.1.tex bookvol7.1.pamphlet ; \ + ${RM} bookvol7.1.ilg bookvol7.1.ind bookvol7.1.ps ; \ + ${RM} bookheader.tex ; \ + else \ + ${RM} bookvol7.1.toc ; \ + ${LATEX} bookvol7.1.tex >${TMP}/trace ; \ + echo ...first latex complete ; \ + ${MAKEINDEX} bookvol7.1.idx >${TMP}/trace ; \ + ${LATEX} bookvol7.1.tex >${TMP}/trace ; \ + ${DVIPDFM} bookvol7.1.dvi 2>${TMP}/trace ; \ + ${RM} bookvol7.1.aux bookvol7.1.dvi bookvol7.1.log ; \ + ${RM} bookvol7.1.idx bookvol7.1.tex bookvol7.1.pamphlet ; \ + ${RM} bookvol7.1.ilg bookvol7.1.ind bookvol7.1.ps ; \ + ${RM} bookheader.tex ; \ + fi ) + +${PDF}/bookvol8.pdf: ${IN}/bookvol8.pamphlet + @echo books/1 making ${PDF}/bookvol8.pdf from ${IN}/bookvol8.pamphlet + @(cd ${PDF} ; \ + cp ${IN}/bookvol8.pamphlet ${PDF}/bookvol8.tex ; \ + cp ${IN}/bookheader.tex ${PDF} ; \ + cp -pr ${IN}/ps ${PDF} ; \ + if [ -z "${NOISE}" ] ; then \ + ${RM} bookvol8.toc ; \ + ${LATEX} bookvol8.tex ; \ + ${MAKEINDEX} bookvol8.idx >/dev/null ; \ + ${LATEX} bookvol8.tex >/dev/null ; \ + ${DVIPDFM} bookvol8.dvi 2>/dev/null ; \ + ${RM} bookvol8.aux bookvol8.dvi bookvol8.log bookvol8.ps ; \ + ${RM} bookvol8.idx bookvol8.tex bookvol8.pamphlet ; \ + ${RM} bookvol8.ilg bookvol8.ind ; \ + ${RM} bookheader.tex ; \ + else \ + ${RM} bookvol8.toc ; \ + ${LATEX} bookvol8.tex >${TMP}/trace ; \ + echo ...first latex complete ; \ + ${MAKEINDEX} bookvol8.idx >${TMP}/trace ; \ + ${LATEX} bookvol8.tex >${TMP}/trace ; \ + ${DVIPDFM} bookvol8.dvi 2>${TMP}/trace ; \ + ${RM} bookvol8.aux bookvol8.dvi bookvol8.log bookvol8.ps ; \ + ${RM} bookvol8.idx bookvol8.tex bookvol8.pamphlet ; \ + ${RM} bookvol8.ilg bookvol8.ind ; \ + ${RM} bookheader.tex ; \ + fi ) + ${PDF}/bookvol9.pdf: ${IN}/bookvol9.pamphlet @echo books/1 making ${PDF}/bookvol9.pdf from ${IN}/bookvol9.pamphlet @(cd ${PDF} ; \ diff --git a/books/bookvol8.pamphlet b/books/bookvol8.pamphlet index c450241..e7f18a6 100644 --- a/books/bookvol8.pamphlet +++ b/books/bookvol8.pamphlet @@ -859,7 +859,7 @@ copies of this data as there are points in the graph (G) 0.5 0.5 0 2 \end{verbatim} \section{The parabola} -<>= +\begin{chunk}{parabola.view/data} 3 x*x 0 0 400 400 @@ -917,8 +917,8 @@ x*x 0 0 1 1 0 1 0 0 0 0 0 -@ -<>= +\end{chunk} +\begin{chunk}{parabola.view/graph0} -3 0 3 9 0.166667 0.111111 1.49012e-08 -0.5 @@ -976,7 +976,7 @@ x*x 0.458333 0.340278 0 2 0.479167 0.418403 0 2 0.5 0.5 0 2 -@ +\end{chunk} \section{3D graph information} For the 3D graph information we have a table view of this information: @@ -1065,7 +1065,7 @@ A data file, with uninteresting lines snipped is: \chapter{include} \label{include} \section{actions.h} -<>= +\begin{chunk}{include/actions.h} #define makeAViewport -1 @@ -1186,11 +1186,11 @@ A data file, with uninteresting lines snipped is: #define modifyPOINT 114 /* for 3D */ #define hitherPlaneData 116 /* for 3D */ -@ +\end{chunk} \section{colors.h} This include file appears not to be used. However, the moColor macro IS used but not included. -<>= +\begin{chunk}{include/colors.h} /* colors.h created on 25 November 1992, Jim Wen @@ -1198,11 +1198,11 @@ However, the moColor macro IS used but not included. */ /* The Hues */ -#define red0 0 -#define red1 1 -#define red2 2 -#define orange0 3 -#define orange1 4 +#define red0 0 +#define red1 1 +#define red2 2 +#define orange0 3 +#define orange1 4 #define orange2 5 #define tan0 6 #define tan1 7 @@ -1241,19 +1241,19 @@ However, the moColor macro IS used but not included. */ #define moColor(h,s) ((mono)?foregroundColor:XSolidColor(h,s)) #define moColor_BG(h,s) ((mono)?backgroundColor:XSolidColor(h,s)) -@ +\end{chunk} \section{component.h} \index{component.h} -<>= +\begin{chunk}{include/component.h} /* This file contains the definitions for the generalized point structures in 3D. */ -@ +\end{chunk} \index{tube.h} -<>= -<> +\begin{chunk}{include/component.h} +\getchunk{include/tube.h} /* viewman's and viewAlone's refPt */ #define refPt(v,x) ((v).points + (x)) @@ -1264,29 +1264,29 @@ However, the moColor macro IS used but not included. */ #define refPt3D(v,x) ( (x)>(v).numOfPoints?traverse(resMax - ((x)-((v).numOfPoints-1))):(v).points + (x) ) -@ +\end{chunk} \index{componentProp struct} \index{struct!componentProp} -<>= +\begin{chunk}{include/component.h} typedef struct _componentProp { int closed, solid; } componentProp; -@ +\end{chunk} \index{struct!LPoint} \index{LPoint struct} -<>= +\begin{chunk}{include/component.h} typedef struct _LPoint { /* meaning list of points */ componentProp prop; int numOfPoints; int *indices; } LPoint; -@ +\end{chunk} \index{struct!LLPoint} \index{LLPoint struct} -<>= +\begin{chunk}{include/component.h} typedef struct _LLPoint { /* meaning list of list of points */ /* for the current 3D stuff: functions of 2 variables - closed is false (xmax does not close @@ -1299,11 +1299,10 @@ typedef struct _LLPoint { /* meaning list of list of points */ int meshColor; /* not used */ } LLPoint; - -@ +\end{chunk} \index{struct!LLLPoint} \index{LLLPoint struct} -<>= +\begin{chunk}{include/component.h} typedef struct _LLLPoint { /* meaning list of list of list of points */ /* for the current 3D stuff -- that is functions of 2 variables and parametric surfaces of one variable (tubes) -- there would be @@ -1313,11 +1312,10 @@ typedef struct _LLLPoint { /* meaning list of list of list of points */ LLPoint *llp; } LLLPoint; - -@ +\end{chunk} \section{g.h} \index{g.h} -<>= +\begin{chunk}{include/g.h} #define Xoption 0 /* Gdraw routine option */ #define PSoption 1 /* Gdraw routine option */ @@ -1360,29 +1358,29 @@ typedef struct _LLLPoint { /* meaning list of list of list of points */ * This is used to keep track of GC name in character and in unsigned long */ -@ +\end{chunk} \index{struct!GCstruct} \index{GCstruct struct} \index{struct!GCptr} \index{GCptr struct} -<>= +\begin{chunk}{include/g.h} typedef struct _GCstruct { GC GCint; char GCchar[10]; struct _GCstruct *next; } GCstruct, *GCptr; -@ +\end{chunk} \section{nox10.h} \index{nox10.h} -<>= +\begin{chunk}{include/nox10.h} /* Used in XDraw and XDrawFilled */ -@ +\end{chunk} \index{struct!Vertex} \index{Vertex struct} -<>= +\begin{chunk}{include/nox10.h} typedef struct _Vertex { short x, y; unsigned short flags; @@ -1401,13 +1399,13 @@ typedef struct _Vertex { XDrawFilled so it shouldn't be defined. */ -@ +\end{chunk} {\tt XAssoc} - Associations used in the XAssocTable data structure. The associations are used as circular queue entries in the association table which is contains an array of circular queues (buckets). \index{struct!XAssoc} \index{XAssoc struct} -<>= +\begin{chunk}{include/nox10.h} typedef struct _XAssoc { struct _XAssoc *next; /* Next object in this bucket. */ struct _XAssoc *prev; /* Previous obejct in this bucket. */ @@ -1416,7 +1414,7 @@ typedef struct _XAssoc { char *data; /* Pointer to untyped memory. */ } XAssoc; -@ +\end{chunk} {\tt XAssocTable} - X Window System id to data structure pointer association table. An XAssocTable is a hash table whose buckets are circular queues of XAssoc's. The XAssocTable is constructed from an array of @@ -1426,17 +1424,16 @@ bucket in the bucket array and an integer that indicates the number of buckets in the array. \index{struct!XAssocTable} \index{XAssocTable struct} -<>= +\begin{chunk}{include/nox10.h} typedef struct _XAssocTable { XAssoc **buckets; /* Pointer to first bucket in bucket array.*/ int size; /* Table size (number of buckets). */ } XAssocTable; - -@ +\end{chunk} \section{override.h} \index{override.h} -<>= +\begin{chunk}{include/override.h} #define overrideManager False /* override_redirect setting for overriding the window manager's directives. the window manager tends to stick its nose into too much - to the point @@ -1448,36 +1445,36 @@ typedef struct _XAssocTable { do not allow windows to be resized unless they have window manager given title bars. */ -@ +\end{chunk} \section{rgb.h} \index{rgb.h} \index{struct!RGB} \index{RGB struct} -<>= +\begin{chunk}{include/rgb.h} typedef struct _RGB { float r,g,b; } RGB ; -@ +\end{chunk} \index{struct!HSV} \index{HSV struct} -<>= +\begin{chunk}{include/rgb.h} typedef struct _HSV { float h,s,v; } HSV ; -@ +\end{chunk} \index{struct!HLS} \index{HLS struct} -<>= +\begin{chunk}{include/rgb.h} typedef struct _HLS { float h,l,s; } HLS ; -@ +\end{chunk} \section{spadcolors.h} \index{spadcolors.h} -<>= +\begin{chunk}{include/spadcolors.h} #define numOfColors 240 #define totalHuesConst 27 #define totalShadesConst 5 @@ -1506,36 +1503,36 @@ extern int num; #define maxColors DisplayCells(dsply,scrn)-1 -@ +\end{chunk} \index{rgb.h} -<>= -<> -@ +\begin{chunk}{include/spadcolors.h} +\getchunk{include/rgb.h} +\end{chunk} \section{tube.h} \index{tube.h} -<>= +\begin{chunk}{include/tube.h} #define openTube 1 #define closedTube 0 -@ +\end{chunk} \index{struct!triple} \index{triple struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _triple { /* used for normals */ float x,y,z; } triple; -@ +\end{chunk} \index{rgb.h} -<>= -<> +\begin{chunk}{include/tube.h} +\getchunk{include/rgb.h} -@ +\end{chunk} \index{struct!viewTriple} \index{viewTriple struct} \index{struct!viewTriplePtr} \index{viewTriplePtr struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _viewTriple { /* used for points in 3 space */ float x,y,z,c,sc; /* c is color component */ float wx,wy,wz; /* world space coords */ @@ -1555,10 +1552,10 @@ typedef struct _viewTriple { /* used for points in 3 space */ #define polygonComponent 3 #define surfaceComponent 4 -@ +\end{chunk} \index{struct!poly} \index{poly struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _poly { int num, sortNum, split; /* how many times the polygon's been split */ @@ -1580,30 +1577,30 @@ typedef struct _poly { partialClipPz, totalClipPz; } poly; -@ +\end{chunk} \index{struct!polyList} \index{polyList struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _polyList { int numPolys; poly *polyIndx; struct _polyList *next; } polyList; -@ +\end{chunk} \index{struct!slice} \index{slice struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _slice { int keyoffset; viewTriple *points; struct _slice *next; } slice; -@ +\end{chunk} \index{struct!tubeModel} \index{tubeModel struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _tubeModel { /* numslices are the number of pts on the curve */ int numslices, slicepts, numPolygons; @@ -1612,27 +1609,27 @@ typedef struct _tubeModel { poly *polygons; } tubeModel; -@ +\end{chunk} \index{struct!pointInfo} \index{pointInfo struct} -<>= +\begin{chunk}{include/tube.h} typedef struct _pointInfo { viewTriple *theVT; int onVertex,segmentNum; int indexNum; } pointInfo; -@ +\end{chunk} \section{view2d.h} \index{view2d.h} -<>= +\begin{chunk}{include/view2d.h} #include #define maxGraphs 9 -@ +\end{chunk} \index{struct!viewManager} \index{viewManager struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _viewManager { int viewType, /* specifies view3d, view2d, etc... */ PID, /* unique integer greater than zero */ @@ -1643,27 +1640,27 @@ typedef struct _viewManager { struct _viewManager *nextViewport; } viewManager; -@ +\end{chunk} \index{struct!viewWithThisGraph} \index{viewWithThisGraph struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _viewsWithThisGraph { viewManager *viewGr; struct _viewsWithThisGraph *nextViewthing; } viewsWithThisGraph; -@ +\end{chunk} \index{struct!pointStruct} \index{pointStruct struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _pointStruct { float x,y,hue,shade; } pointStruct; -@ +\end{chunk} \index{struct!pointListStruct} \index{pointListStruct struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _pointListStruct { pointStruct *listOfPoints; float hue, shade; @@ -1671,10 +1668,10 @@ typedef struct _pointListStruct { numberOfPoints; } pointListStruct; -@ +\end{chunk} \index{struct!graphStruct} \index{graphStruct struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _graphStruct { int key; float xmin,xmax,ymin,ymax; @@ -1688,10 +1685,10 @@ typedef struct _graphStruct { struct _graphStruct *nextGraph; } graphStruct; -@ +\end{chunk} \index{struct!view2DStruct} \index{view2DStruct struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _view2DStruct { char *title; int vX,vY,vW,vH, @@ -1701,10 +1698,10 @@ typedef struct _view2DStruct { int graphKeyArray[maxGraphs]; } view2DStruct; -@ +\end{chunk} \index{struct!graphStateStruct} \index{graphStateStruct struct} -<>= +\begin{chunk}{include/view2d.h} typedef struct _graphStateStruct { float scaleX, scaleY, deltaX, deltaY, centerX, centerY; int pointsOn, connectOn, splineOn, axesOn, unitsOn, @@ -1714,41 +1711,41 @@ typedef struct _graphStateStruct { } graphStateStruct; /* need spline color, axes color, units color... */ -@ +\end{chunk} \section{view3d.h} \index{view3d.h} \index{component.h} -<>= -<> +\begin{chunk}{include/view3d.h} +\getchunk{include/component.h} /* we now have two substructures (in the union, kind): tubeModel (in tube.h) and fun2VarModel (below) */ #define maxGraphs 9 -@ +\end{chunk} \index{struct!fun2VarModel} \index{fun2VarModel struct} -<>= +\begin{chunk}{include/view3d.h} typedef struct _fun2VarModel { float *zArray,*cArray; viewTriple *pointList; } fun2VarModel; -@ +\end{chunk} \index{union!kindOf} \index{kindOf union} -<>= +\begin{chunk}{include/view3d.h} union kindOf { /* float *zArray; */ fun2VarModel fun2Var; tubeModel tube; }; -@ +\end{chunk} \index{struct!view3DStruct} \index{view3DStruct struct} -<>= +\begin{chunk}{include/view3d.h} typedef struct _view3DStruct { int typeOf3D; float xmin,xmax,ymin,ymax,zmin,zmax; @@ -1789,27 +1786,27 @@ typedef struct _view3DStruct { */ } view3DStruct; -@ +\end{chunk} \index{struct!boxSideStruct} \index{boxSideStruct struct} for drawing the region box -<>= +\begin{chunk}{include/view3d.h} typedef struct _boxSideStruct { viewTriplePtr pointsPtr[4]; /* see notes for definition of box */ int inside; } boxSideStruct; -@ +\end{chunk} \section{viewcommand.h} \index{viewcommand.h} -<>= +\begin{chunk}{include/viewcommand.h} /* Commands that the viewports could send to the viewport manager */ #define viewportClosing 1 -@ +\end{chunk} \section{view.h} \index{view.h} -<>= +\begin{chunk}{include/view.h} /* This file is to be included by all the viewport files */ #define check(code) checker(code,__LINE__,"") @@ -1867,10 +1864,10 @@ fprintf(stderr, \ exitWithAck(RootWindow(dsply,scrn),Window,-1); \ } -@ +\end{chunk} \section{write.h} \index{write.h} -<>= +\begin{chunk}{include/write.h} /* These are types of files that the viewports would be able to write out upon a command from Axiom. Note that the numbers in this list is also the order @@ -1880,10 +1877,10 @@ exitWithAck(RootWindow(dsply,scrn),Window,-1); \ #define aBitmap 2 #define aPostscript 3 #define anImage 4 -@ +\end{chunk} \section{xdefs.h} \index{xdefs.h} -<>= +\begin{chunk}{include/xdefs.h} /*** default fonts ***/ #ifdef RTplatform #define messageFontDefault "Rom14.500" @@ -1916,7 +1913,7 @@ exitWithAck(RootWindow(dsply,scrn),Window,-1); \ #define graphFontDefault "9x15" #endif -@ +\end{chunk} \chapter{viewman} \label{viewman} \index{viewman} @@ -2047,7 +2044,7 @@ cflow --emacs -l -n -b -T --omit-arguments viewman.c \section{Constants and Headers} \subsection{defines} \index{defines} -<>= +\begin{chunk}{viewman} /* Viewport Commands */ #define makeViewport -1 #define makeGraph -1 @@ -2061,9 +2058,9 @@ cflow --emacs -l -n -b -T --omit-arguments viewman.c #define components #define spadActionMode -@ +\end{chunk} \subsection{System includes} -<>= +\begin{chunk}{viewman} #include #ifdef SGIplatform #include @@ -2080,17 +2077,17 @@ cflow --emacs -l -n -b -T --omit-arguments viewman.c #include #include -@ +\end{chunk} \subsection{Local includes} \index{actions.h} \index{view2d.h} \index{view3d.h} \index{viewcommand.h} -<>= -<> -<> -<> -<> +\begin{chunk}{viewman} +\getchunk{include/actions.h} +\getchunk{include/view2d.h} +\getchunk{include/view3d.h} +\getchunk{include/viewcommand.h} #include "bsdsignal.h" #include "bsdsignal.h1" @@ -2098,9 +2095,9 @@ cflow --emacs -l -n -b -T --omit-arguments viewman.c #include "sockio-c.h1" #include "util.h1" -@ +\end{chunk} \subsection{extern references} -<>= +\begin{chunk}{viewman} extern int acknow; extern int checkClosedChild; extern int currentGraph; @@ -2125,9 +2122,9 @@ extern int viewOkay; extern viewManager *viewports; extern int viewType; -@ +\end{chunk} \subsection{forward references} -<>= +\begin{chunk}{viewman} int readViewport(viewManager *viewPort,void *info,int size); void discardGraph(graphStruct *theGraph); void sendGraphToView2D(int i,int there,viewManager *viewport, @@ -2136,9 +2133,9 @@ void makeView2DFromSpadData(view2DStruct *viewdata, graphStateStruct graphState[]); void makeView3DFromSpadData(view3DStruct *viewdata,int typeOfViewport); -@ +\end{chunk} \subsection{global variables} -<>= +\begin{chunk}{viewman} Display *dsply; Window root; XEvent viewmanEvent; @@ -2163,24 +2160,23 @@ graphStateStruct currentGraphState; char *s1, propertyBuffer[256];/* XProperty buffer */ - -@ +\end{chunk} \section{Code} \subsection{endChild} \index{viewman!endChild} \index{endChild viewman} -<>= +\begin{chunk}{viewman} void endChild(int sig) { checkClosedChild = yes; } -@ +\end{chunk} \subsection{rmViewMgr} Given a pointer to a viewManager, this procedure removes it from the viewport list. \index{viewman!rmViewMgr} \index{rmViewMgr viewman} -<>= +\begin{chunk}{viewman} void rmViewMgr(viewManager *slotPtr) { int i,throwAway,code; viewManager *somePort, *someOtherPort; @@ -2254,26 +2250,26 @@ void rmViewMgr(viewManager *slotPtr) { free(slotPtr); } /* rmViewMgr() */ -@ +\end{chunk} \subsection{closeChildViewport} Given a pointer to a viewport structure (viewManager) this procedure first waits for the actual process to die and then removes it from the list of viewports via rmViewMgr(). \index{viewman!closeChildViewport} \index{closeChildViewport viewman} -<>= +\begin{chunk}{viewman} void closeChildViewport(viewManager *slotPtr) { int status; rmViewMgr(slotPtr); wait(&status); } /* closeChildViewport */ -@ +\end{chunk} \subsection{goodbye} Kill all children (how mean) and then kill self. \index{viewman!goodbye} \index{goodbye viewman} -<>= +\begin{chunk}{viewman} void goodbye(int sig) { viewManager *v; v = viewports; @@ -2285,11 +2281,11 @@ void goodbye(int sig) { exit(0); } -@ +\end{chunk} \subsection{funView2D} \index{viewman!funView2D} \index{funView2D viewman} -<>= +\begin{chunk}{viewman} void funView2D(int viewCommand) { int code; int viewPID; @@ -2386,11 +2382,11 @@ void funView2D(int viewCommand) { } } -@ +\end{chunk} \subsection{forkView2D} \index{viewman!forkView2D} \index{forkView2D viewman} -<>= +\begin{chunk}{viewman} void forkView2D(void) { viewManager *viewport; int childPID, code; @@ -2487,11 +2483,11 @@ void forkView2D(void) { } /* switch */ } /* forkView2D() */ -@ +\end{chunk} \subsection{sendGraphToView2D} \index{viewman!sendGraphToView2D} \index{sendGraphToView2D viewman} -<>= +\begin{chunk}{viewman} void sendGraphToView2D(int i,int there,viewManager *viewport, graphStateStruct *doGraphStateArray) { graphStruct *gPtr; @@ -2568,11 +2564,11 @@ void sendGraphToView2D(int i,int there,viewManager *viewport, } /* if graph is there */ } -@ +\end{chunk} \subsection{funView3D} \index{viewman!funView3D} \index{funView3D viewman} -<>= +\begin{chunk}{viewman} void funView3D(int viewCommand) { int code; int viewPID; @@ -2715,11 +2711,11 @@ void funView3D(int viewCommand) { } } -@ +\end{chunk} \subsection{forkView3D} \index{viewman!forkView3D} \index{forkView3D viewman} -<>= +\begin{chunk}{viewman} void forkView3D(int typeOfViewport) { viewManager *viewport; int childPID, code; @@ -2840,11 +2836,11 @@ void forkView3D(int typeOfViewport) { } /* forkView3D() */ -@ +\end{chunk} \subsection{makeView2DFromSpadData} \index{viewman!makeView2DFromSpadData} \index{makeView2DFromSpadData viewman} -<>= +\begin{chunk}{viewman} void makeView2DFromSpadData(view2DStruct *viewdata, graphStateStruct graphState[]) { int i; @@ -2874,11 +2870,11 @@ void makeView2DFromSpadData(view2DStruct *viewdata, } } -@ +\end{chunk} \subsection{makeView3DFromSpadData} \index{viewman!makeView3DFromSpadData} \index{makeView3DFromSpadData viewman} -<>= +\begin{chunk}{viewman} void makeView3DFromSpadData(view3DStruct *viewdata,int typeOfViewport) { int i,j,k; LLPoint *anLLPoint; @@ -2982,11 +2978,11 @@ void makeView3DFromSpadData(view3DStruct *viewdata,int typeOfViewport) { viewdata->scaleDown = yes; } -@ +\end{chunk} \subsection{makeGraphFromSpadData} \index{viewman!makeGraphFromSpadData} \index{makeGraphFromSpadData viewman} -<>= +\begin{chunk}{viewman} graphStruct *makeGraphFromSpadData(void) { graphStruct *graphData; pointListStruct *pL; @@ -3046,11 +3042,11 @@ graphStruct *makeGraphFromSpadData(void) { return(graphData); } -@ +\end{chunk} \subsection{discardGraph} \index{viewman!discardGraph} \index{discardGraph viewman} -<>= +\begin{chunk}{viewman} void discardGraph(graphStruct *theGraph) { pointListStruct *pL; int j; @@ -3061,11 +3057,11 @@ void discardGraph(graphStruct *theGraph) { free(theGraph); } -@ +\end{chunk} \subsection{readViewport} \index{viewman!readViewport} \index{readViewport viewman} -<>= +\begin{chunk}{viewman} int readViewport(viewManager *viewPort,void *info,int size) { int canRead; again: @@ -3074,7 +3070,7 @@ again: return(-1); } -@ +\end{chunk} \subsection{superSelect} The function superselect!, if select returns a -1 due to an interrupt (EINTR), this routine checks to see if it's a @@ -3082,7 +3078,7 @@ child viewport that has closed. Expected global variables: {\tt checkClosedChild} \index{viewman!superSelect} \index{superSelect viewman} -<>= +\begin{chunk}{viewman} int superSelect(int n,int *rd,int *wr,int *ex,char *timeout) { int waiting; viewManager *viewport; @@ -3113,17 +3109,17 @@ int superSelect(int n,int *rd,int *wr,int *ex,char *timeout) { return ret_val; } -@ +\end{chunk} \subsection{brokenPipe} \index{viewman!brokenPipe} \index{brokenPipe viewman} -<>= +\begin{chunk}{viewman} void brokenPipe(int sig) { fprintf(stderr, "The viewport manager tried to write to a non-existing pipe.\n"); } -@ +\end{chunk} \subsection{main} The function superselect!, if select returns a -1 due to an interrupt (EINTR), this routine checks to see if it's a @@ -3131,7 +3127,7 @@ child viewport that has closed. Expected global variables: {\tt checkClosedChild} \index{viewman!main} \index{main viewman} -<>= +\begin{chunk}{viewman} int main(void) { graphStruct *aGraph; int keepLooking,code; @@ -3267,7 +3263,7 @@ int main(void) { } /* while (1) */ } -@ +\end{chunk} \chapter{viewalone} \label{viewalone} \section{viewalone Call Graph} @@ -3347,28 +3343,28 @@ cflow --emacs -l -n -b -T --omit-arguments viewalone.c \end{verbatim} \section{Constants and Headers} \subsection{System includes} -<>= +\begin{chunk}{viewalone} #include #include #include #include -@ +\end{chunk} \subsection{Local includes} \index{view3d.h} \index{view2d.h} \index{actions.h} \index{viewcommand.h} -<>= -<> -<> -<> -<> +\begin{chunk}{viewalone} +\getchunk{include/view3d.h} +\getchunk{include/view2d.h} +\getchunk{include/actions.h} +\getchunk{include/viewcommand.h} #include "util.h1" -@ +\end{chunk} \subsection{defines} -<>= +\begin{chunk}{viewalone} /* Viewport Commands */ #define makeViewport -1 #define makeGraph -1 @@ -3383,9 +3379,9 @@ cflow --emacs -l -n -b -T --omit-arguments viewalone.c #define spadActionMode #define yes 1 -@ +\end{chunk} \subsection{extern references} -<>= +\begin{chunk}{viewalone} extern viewManager viewP; extern view3DStruct doView3D; @@ -3404,9 +3400,9 @@ extern FILE *viewFile; extern char filename[256]; extern char pathname[256]; -@ +\end{chunk} \subsection{global variables} -<>= +\begin{chunk}{viewalone} viewManager viewP; /* note that in viewman, this is called viewports */ @@ -3431,12 +3427,12 @@ FILE *viewFile; int viewOkay = 0; int viewType; -@ +\end{chunk} \section{Code} \subsection{sendGraphToView2D} \index{viewalone!sendGraphToView2D} \index{sendGraphToView2D viewalone} -<>= +\begin{chunk}{viewalone} void sendGraphToView2D(int i,int there,viewManager *viewP) { graphStruct *gPtr; pointListStruct *llPtr; @@ -3491,11 +3487,11 @@ void sendGraphToView2D(int i,int there,viewManager *viewP) { } /* if graph is there */ } -@ +\end{chunk} \subsection{makeView2DFromFileData} \index{viewalone!makeView2DFromFileData} \index{makeView2DFromFileData viewalone} -<>= +\begin{chunk}{viewalone} void makeView2DFromFileData(view2DStruct *doView2D) { int i,j,k; char title[256]; @@ -3652,11 +3648,11 @@ void makeView2DFromFileData(view2DStruct *doView2D) { } /* for i */ } /* makeView2DFromFileData */ -@ +\end{chunk} \subsection{makeView3DFromFileData} \index{viewalone!makeView3DFromFileData} \index{makeView3DFromFileData viewalone} -<>= +\begin{chunk}{viewalone} void makeView3DFromFileData(int type) { int i,j,k; char title[256]; @@ -3754,11 +3750,11 @@ void makeView3DFromFileData(int type) { doView3D.scaleDown = no ; } -@ +\end{chunk} \subsection{spoonView2D} \index{viewalone!spoonView2D} \index{spoonView2D viewalone} -<>= +\begin{chunk}{viewalone} void spoonView2D(void) { int i,code,pipe0[2],pipe1[2],there; char envAXIOM[100],runView[100]; @@ -3838,14 +3834,14 @@ void spoonView2D(void) { } /* switch */ } /* forkView2D() */ -@ +\end{chunk} \subsection{spoonView3D} This file forks a child process and exits the parent. It has the same general form as ../viewman/funView3D() and so changes there may require similar changes here. \index{viewalone!spoonView2D} \index{spoonView2D viewalone} -<>= +\begin{chunk}{viewalone} void spoonView3D(int type) { int i,j,k,code,pipe0[2],pipe1[2]; char envAXIOM[100],runView[100]; @@ -3940,11 +3936,11 @@ void spoonView3D(int type) { } /* switch */ } /* spoonView3D() */ -@ +\end{chunk} \subsection{main} \index{viewalone!main} \index{main viewalone} -<>= +\begin{chunk}{viewalone} int main(int argc,char *argv[]) { printf("viewalone called with argc=%d\n",argc); printf("viewalone called with argv[1]=%s\n",argv[0]); @@ -3982,7 +3978,7 @@ int main(int argc,char *argv[]) printf("range of [1..4]\n"); return(0); } -@ +\end{chunk} The TESTFILE is created in the mnt directory to provide an example file to use for viewalone. The parabola example is detailed in the chapter on Graphics File Formats. The directory parabola.view will @@ -4434,7 +4430,7 @@ cflow --emacs -l -n -b -T --omit-arguments view2d.c \end{verbatim} \section{Constants and Headers} \subsection{System includes} -<>= +\begin{chunk}{view2d} #include #include #include @@ -4453,7 +4449,7 @@ cflow --emacs -l -n -b -T --omit-arguments view2d.c #include #endif -@ +\end{chunk} \subsection{local includes} \index{actions.h} \index{g.h} @@ -4464,7 +4460,7 @@ cflow --emacs -l -n -b -T --omit-arguments view2d.c \index{view2d.h} \index{write.h} \index{xdefs.h} -<>= +\begin{chunk}{view2d} #include "bsdsignal.h" #include "bsdsignal.h1" #include "hash.h" @@ -4473,29 +4469,29 @@ cflow --emacs -l -n -b -T --omit-arguments view2d.c #include "util.h1" #include "xspadfill.h1" -<> -<> -<> -<> -<> -<> -<> -<> -<> - -@ +\getchunk{include/actions.h} +\getchunk{include/g.h} +\getchunk{include/nox10.h} +\getchunk{include/override.h} +\getchunk{include/view.h} +\getchunk{include/viewcommand.h} +\getchunk{include/view2d.h} +\getchunk{include/write.h} +\getchunk{include/xdefs.h} + +\end{chunk} \subsection{static variables} -<>= +\begin{chunk}{view2d} static void drawControlPushButton(int , int ); static int doit=0; /* globish variable for picking/dropping/clearing */ /* - all sorts of 2 button sequence events (command & graph #). */ -@ +\end{chunk} \subsection{structs} \index{struct!buttonStruct} \index{buttonStruct struct} -<>= +\begin{chunk}{view2d} typedef struct _buttonStruct { int buttonKey, pot, mask, graphNum, graphSelect; short buttonX,buttonY,buttonWidth,buttonHeight,xHalf,yHalf; @@ -4504,10 +4500,10 @@ typedef struct _buttonStruct { int textColor, textHue, textShade; } buttonStruct; -@ +\end{chunk} \index{struct!controlPanelStruct} \index{controlPanelStruct struct} -<>= +\begin{chunk}{view2d} typedef struct _controlPanelStruct { int numOfButtons; Window controlWindow,messageWindow,colormapWindow; @@ -4515,18 +4511,18 @@ typedef struct _controlPanelStruct { struct _buttonStruct buttonQueue[maxButtons2D]; } controlPanelStruct; -@ +\end{chunk} \index{struct!mouseCoord} \index{mouseCoord struct} -<>= +\begin{chunk}{view2d} typedef struct _mouseCoord { float x,y; } mouseCoord; -@ +\end{chunk} \index{struct!viewPoints} \index{viewPoints struct} -<>= +\begin{chunk}{view2d} typedef struct _viewPoints { int viewportKey; char title[80]; @@ -4538,27 +4534,27 @@ typedef struct _viewPoints { struct _viewPoints *prevViewport,*nextViewport; } viewPoints; -@ +\end{chunk} \index{struct!controlXY} \index{controlXY struct} -<>= +\begin{chunk}{view2d} typedef struct _controlXY { int putX,putY; } controlXY; -@ +\end{chunk} \index{struct!xPointStruct} \index{xPointStruct struct} -<>= +\begin{chunk}{view2d} typedef struct _xPointStruct { XPoint *xPoint; Vertex *x10Point; XArc *arc; } xPointStruct; -@ +\end{chunk} \subsection{defines} -<>= +\begin{chunk}{view2d} #define numBits (8*sizeof(int)) /* for xdefs */ @@ -4822,9 +4818,9 @@ static XPoint translateArrow[translateArrowN] = { #define isNaN(v) (v != v) -@ +\end{chunk} \subsection{extern references} -<>= +\begin{chunk}{view2d} extern Display *dsply; extern XFontStruct *globalFont,*buttonFont,*headerFont,*titleFont, *graphFont,*unitFont,*serverFont; @@ -4866,9 +4862,9 @@ extern int mono, totalColors, totalHues, totalSolidShades, totalDitheredAndSolids,totalShades; extern float aspectR; -@ +\end{chunk} \subsection{forward references} -<>= +\begin{chunk}{view2d} extern int initButtons(buttonStruct * ); extern void writeControlTitle(void ); extern void makeMessageFromData(int ); @@ -4937,9 +4933,9 @@ static int TrivEqual(Window , Window ); static int TrivHashCode(Window , int ); #endif -@ +\end{chunk} \subsection{global variables} -<>= +\begin{chunk}{view2d} Window rtWindow,viewman; Display *dsply; XFontStruct *globalFont, @@ -5037,7 +5033,7 @@ GCptr GChead=NULL; /* ptr to head of ps GC linked list */ char *PSfilename; /* output file name used in user directory */ char *envAXIOM; /* environment variable AXIOM or DEVE */ -@ +\end{chunk} \section{Code} \subsection{initButtons} Creates the fields for each button window in the @@ -5046,8 +5042,8 @@ number of buttons created. \index{view2d!initButtons} \index{initButtons view2d} \index{gfun.c} -<>= -<> +\begin{chunk}{view2d} +\getchunk{gfun.c} int initButtons(buttonStruct *buttons) { int ii, num = 0; /********** Scale(Zoom) and Translate Potentiometer Buttons **********/ @@ -5657,11 +5653,11 @@ int initButtons(buttonStruct *buttons) { return(num); } -@ +\end{chunk} \subsection{writeControlTitle} \index{view2d!writeControlTitle} \index{writeControlTitle view2d} -<>= +\begin{chunk}{view2d} void writeControlTitle(void) { int strlength; s = viewport->title; @@ -5673,11 +5669,11 @@ void writeControlTitle(void) { 15,s,strlength,Xoption); } /* writeControlTitle() */ -@ +\end{chunk} \subsection{makeMessageFromData} \index{view2d!makeMessageFromData} \index{makeMessageFromData view2d} -<>= +\begin{chunk}{view2d} void makeMessageFromData(int whichGraph) { if (viewport->haveControl) { if ((graphStateArray[whichGraph].scaleX) > 99.0) { @@ -5713,11 +5709,11 @@ void makeMessageFromData(int whichGraph) { } /* if haveControl */ } /* makeMessageFromData() */ -@ +\end{chunk} \subsection{writeControlMessage} \index{view2d!writeControlMessage} \index{writeControlMessage view2d} -<>= +\begin{chunk}{view2d} void writeControlMessage(void) { int strlength; controlPanelStruct *cp; @@ -5731,11 +5727,11 @@ void writeControlMessage(void) { cp->message,strlength,Xoption); } -@ +\end{chunk} \subsection{drawControlPanel} \index{view2d!drawControlPanel} \index{drawControlPanel view2d} -<>= +\begin{chunk}{view2d} void drawControlPanel(void) { controlPanelStruct *cp; int i,strlength; @@ -5916,11 +5912,11 @@ void drawControlPanel(void) { XFlush(dsply); } /*** drawControlPanel ***/ -@ +\end{chunk} \subsection{getControlXY} \index{view2d!getControlXY} \index{getControlXY view2d} -<>= +\begin{chunk}{view2d} controlXY getControlXY(int whereDoYouWantPanel) { XWindowAttributes wAttr, wAttrib; controlXY cXY = {0,0}; @@ -5976,11 +5972,11 @@ controlXY getControlXY(int whereDoYouWantPanel) { return(cXY); } -@ +\end{chunk} \subsection{makeControlPanel} \index{view2d!makeControlPanel} \index{makeControlPanel view2d} -<>= +\begin{chunk}{view2d} controlPanelStruct *makeControlPanel(void) { Window cw; int i,num; @@ -6063,7 +6059,7 @@ controlPanelStruct *makeControlPanel(void) { return(control); } /* makeControlPanel() */ -@ +\end{chunk} \subsection{putControlPanelSomewhere} This routine puts up the control panel associated with the viewport passed in. It first tries to put it to the right of the viewport. If @@ -6073,7 +6069,7 @@ control panel outside of it, it placed the control panel in the bottom right hand corner of the viewport window. \index{view2d!putControlPanelSomewhere} \index{putControlPanelSomewhere view2d} -<>= +\begin{chunk}{view2d} void putControlPanelSomewhere(int whereDoesPanelGo) { controlPanelStruct *control; controlXY whereControl= {0,0}; @@ -6091,24 +6087,24 @@ void putControlPanelSomewhere(int whereDoesPanelGo) { XMapWindow(dsply,control->controlWindow); } -@ +\end{chunk} \subsection{clearControlMessage} \index{view2d!clearControlMessage} \index{clearControlMessage view2d} -<>= +\begin{chunk}{view2d} void clearControlMessage(void) { strcpy(viewport->controlPanel->message,""); XClearArea(dsply,viewport->controlPanel->controlWindow, 0,controlMessageY-2,controlWidth,controlMessageHeight,False); } -@ +\end{chunk} \subsection{getGraphFromViewman} This routine should be called right after a read of the graph key was made from the viewport manager (or defined in some other way). \index{view2d!getGraphFromViewman} \index{getGraphFromViewman view2d} -<>= +\begin{chunk}{view2d} void getGraphFromViewman(int i) { int j,k,xPointsNeeded; pointListStruct *llPtr; @@ -6193,11 +6189,11 @@ void getGraphFromViewman(int i) { } } /* getGraphFromViewman */ -@ +\end{chunk} \subsection{freeGraph} \index{view2d!freeGraph} \index{freeGraph view2d} -<>= +\begin{chunk}{view2d} void freeGraph(int i) { int j; pointListStruct *llPtr; @@ -6212,11 +6208,11 @@ void freeGraph(int i) { } } -@ +\end{chunk} \subsection{mergeDatabases} \index{view2d!mergeDatabases} \index{mergeDatabases view2d} -<>= +\begin{chunk}{view2d} void mergeDatabases(void) { /* using global rDB @@ -6253,11 +6249,11 @@ void mergeDatabases(void) { XrmMergeDatabases(homeDB,&rDB); } -@ +\end{chunk} \subsection{getPotValue} \index{view2d!getPotValue} \index{getPotValue view2d} -<>= +\begin{chunk}{view2d} mouseCoord getPotValue(short eX,short eY,short xH,short yH) { mouseCoord whereMouse; float x,y; @@ -6269,11 +6265,11 @@ mouseCoord getPotValue(short eX,short eY,short xH,short yH) { return(whereMouse); } /* getPotValue() */ -@ +\end{chunk} \subsection{doPick} \index{view2d!doPick} \index{doPick view2d} -<>= +\begin{chunk}{view2d} void doPick(int i,int bKey) { int vCommand=pick2D; picking = no; @@ -6290,11 +6286,11 @@ void doPick(int i,int bKey) { writeControlMessage(); } -@ +\end{chunk} \subsection{doDrop} \index{view2d!doDrop} \index{doDrop view2d} -<>= +\begin{chunk}{view2d} void doDrop(int i,int bKey) { int vCommand=drop2D; int viewGoAhead; @@ -6322,11 +6318,11 @@ void doDrop(int i,int bKey) { } } -@ +\end{chunk} \subsection{clickedOnGraphSelect} \index{view2d!clickedOnGraphSelect} \index{clickedOnGraphSelect view2d} -<>= +\begin{chunk}{view2d} void clickedOnGraphSelect(int i,int bKey) { int strlength; switch (doit) { @@ -6377,11 +6373,11 @@ void clickedOnGraphSelect(int i,int bKey) { } /* switch doit */ } -@ +\end{chunk} \subsection{drawControlPushButton} \index{view2d!drawControlPushButton} \index{drawControlPushButton view2d} -<>= +\begin{chunk}{view2d} static void drawControlPushButton(int isOn, int index) { GDrawPushButton(dsply, processGC, processGC, processGC, control->controlWindow, @@ -6396,11 +6392,11 @@ static void drawControlPushButton(int isOn, int index) { XSync(dsply,False); } -@ +\end{chunk} \subsection{buttonAction} \index{view2d!buttonAction} \index{buttonAction view2d} -<>= +\begin{chunk}{view2d} void buttonAction(int bKey) { int i; switch (bKey) { @@ -6647,11 +6643,11 @@ void buttonAction(int bKey) { } /* switch (action) */ } -@ +\end{chunk} \subsection{processEvents} \index{view2d!processEvents} \index{processEvents view2d} -<>= +\begin{chunk}{view2d} void processEvents(void) { XEvent *event, tempEvent; @@ -6959,11 +6955,11 @@ void processEvents(void) { } /* while */ } /* processEvents() */ -@ +\end{chunk} \subsection{clickedOnGraph} \index{view2d!clickedOnGraph} \index{clickedOnGraph view2d} -<>= +\begin{chunk}{view2d} void clickedOnGraph(int i,int bKey) { switch (doit) { case pick2D: @@ -7020,11 +7016,11 @@ void clickedOnGraph(int i,int bKey) { } /* switch doit */ } -@ +\end{chunk} \subsection{readViewman} \index{view2d!readViewman} \index{readViewman view2d} -<>= +\begin{chunk}{view2d} int readViewman(void * info,int size) { int mold = 0; sprintf(errorStr,"%s %d %s","read of ",size, @@ -7033,11 +7029,11 @@ int readViewman(void * info,int size) { return(mold); } -@ +\end{chunk} \subsection{spadAction} \index{view2d!spadAction} \index{spadAction view2d} -<>= +\begin{chunk}{view2d} int spadAction(void) { int code,viewCommand; float f1,f2; @@ -7231,11 +7227,11 @@ int spadAction(void) { return(0); } -@ +\end{chunk} \subsection{absolute} \index{view2d!absolute} \index{absolute view2d} -<>= +\begin{chunk}{view2d} float absolute(float x) { if (x<0.0) { return(-x); @@ -7244,11 +7240,11 @@ float absolute(float x) { } } -@ +\end{chunk} \subsection{goodbye} \index{view2d!goodbye} \index{goodbye view2d} -<>= +\begin{chunk}{view2d} void goodbye(int sig) { int Command,i; #ifdef DEBUG @@ -7281,11 +7277,11 @@ void goodbye(int sig) { exit(0); } -@ +\end{chunk} \subsection{writeTitle} \index{view2d!writeTitle} \index{writeTitle view2d} -<>= +\begin{chunk}{view2d} void writeTitle(void) { int strlength; XWindowAttributes attribInfo; @@ -7299,11 +7295,11 @@ void writeTitle(void) { 15,viewport->title,strlength,Xoption); } -@ +\end{chunk} \subsection{drawTheViewport} \index{view2d!drawTheViewport} \index{drawTheViewport view2d} -<>= +\begin{chunk}{view2d} void drawTheViewport(int dFlag) { Window vw; XWindowAttributes vwInfo; @@ -7701,11 +7697,11 @@ void drawTheViewport(int dFlag) { } } /* drawViewport() */ -@ +\end{chunk} \subsection{makeViewport} \index{view2d!makeViewport} \index{makeViewport view2d} -<>= +\begin{chunk}{view2d} viewPoints *makeViewport(char *title,int vX,int vY,int vW,int vH,int showCP) { Pixmap spadbits,spadmask; XSetWindowAttributes viewAttrib; @@ -7795,11 +7791,11 @@ viewPoints *makeViewport(char *title,int vX,int vY,int vW,int vH,int showCP) { return(viewport); } -@ +\end{chunk} \subsection{makeView2D} \index{view2d!makeView2D} \index{makeView2D view2d} -<>= +\begin{chunk}{view2d} viewPoints *makeView2D(view2DStruct *viewdata) { viewPoints *vPoints; vPoints = makeViewport(viewdata->title, viewdata->vX,viewdata->vY, @@ -7814,11 +7810,11 @@ viewPoints *makeView2D(view2DStruct *viewdata) { return(vPoints); } /* makeView2D */ -@ +\end{chunk} \subsection{writeViewport} \index{view2d!writeViewport} \index{writeViewport view2d} -<>= +\begin{chunk}{view2d} int writeViewport(int thingsToWrite) { FILE *viewDataFile; char viewDirName[80], @@ -7962,7 +7958,7 @@ int writeViewport(int thingsToWrite) { } /* else create directory okay */ } -@ +\end{chunk} \subsection{main} The main function performs the following steps \begin{enumerate} @@ -7984,7 +7980,7 @@ and the window they control. \end{enumerate} \index{view2d!main} \index{main view2d} -<>= +\begin{chunk}{view2d} int main(void) { XGCValues controlGCVals; int i,code; @@ -8224,7 +8220,7 @@ int main(void) { return(0); /* control never reaches here but compiler complains */ } /* main() */ -@ +\end{chunk} \chapter{view3d} \label{view3d} \section{view3d Call Graph} @@ -8856,7 +8852,7 @@ cflow --emacs -l -n -b -T --omit-arguments view3d.c \end{verbatim} \section{Constants and Headers} \subsection{System includes} -<>= +\begin{chunk}{view3d} #include #include #include @@ -8871,7 +8867,7 @@ cflow --emacs -l -n -b -T --omit-arguments view3d.c #include #include -@ +\end{chunk} \subsection{Local includes} \index{view3d.h} \index{actions.h} @@ -8881,30 +8877,30 @@ cflow --emacs -l -n -b -T --omit-arguments view3d.c \index{viewcommand.h} \index{write.h} \index{xdefs.h} -<>= +\begin{chunk}{view3d} #include "bsdsignal.h" #include "bsdsignal.h1" #include "com.h" #include "hash.h" #include "hash.h1" #include "pixmap.h1" -<> +\getchunk{include/view3d.h} #include "spadcolors.h1" #include "util.h1" #include "xshade.h1" #include "xspadfill.h1" -<> -<> -<> -<> -<> -<> -<> +\getchunk{include/actions.h} +\getchunk{include/g.h} +\getchunk{include/override.h} +\getchunk{include/view.h} +\getchunk{include/viewcommand.h} +\getchunk{include/write.h} +\getchunk{include/xdefs.h} -@ +\end{chunk} \subsection{defines} -<>= +\begin{chunk}{view3d} #define BH 31 /* button window height */ #define PH 80 /* potentiometer window height */ #define XEDGE 5 /* leftmost button starts here */ @@ -9589,7 +9585,7 @@ static char *eyeMess1 = "Eye"; #define numBits (8*sizeof(int)) #define StellarColors 9 -@ +\end{chunk} \subsection{static variables} \begin{verbatim} static char *event_name[] = { @@ -9632,7 +9628,7 @@ static char *event_name[] = { \end{verbatim} This is a description of script character labels for the x, y, and z axes -<>= +\begin{chunk}{view3d} static float axes[3][6] = {{-117,0,0,117,0,0}, /* x axis */ {0,-117,0,0,117,0}, /* y axis */ {0,0,-117,0,0,117}}; /* z axis */ @@ -9659,11 +9655,11 @@ static float labels[basicScreen][7] = { {0,11,103,0,9,102,labelColor}, {0,9,102,0,9,105,labelColor}}; -@ +\end{chunk} \subsection{structs} \index{struct!buttonStruct} \index{buttonStruct struct} -<>= +\begin{chunk}{view3d} typedef struct _buttonStruct { int buttonKey, pot, mask; short buttonX, buttonY, buttonWidth, buttonHeight, xHalf, yHalf; @@ -9672,36 +9668,36 @@ typedef struct _buttonStruct { int textColor,textHue,textShade; } buttonStruct; -@ +\end{chunk} \index{struct!controlPanelStruct} \index{controlPanelStruct struct} -<>= +\begin{chunk}{view3d} typedef struct _controlPanelStruct { Window controlWindow, messageWindow, colormapWindow; char message[40]; buttonStruct buttonQueue[maxButtons3D]; } controlPanelStruct; -@ +\end{chunk} \index{struct!mouseCoord} \index{mouseCoord struct} -<>= +\begin{chunk}{view3d} typedef struct _mouseCoord { float x, y; } mouseCoord; -@ +\end{chunk} \index{struct!meshStruct} \index{meshStruct struct} -<>= +\begin{chunk}{view3d} typedef struct _meshStruct { float N0[4], N1[4]; /* the fourth element is Zmin */ } meshStruct; -@ +\end{chunk} \index{struct!points3D} \index{points3D struct} -<>= +\begin{chunk}{view3d} typedef struct _points3D { float xmin, xmax, ymin, ymax, @@ -9715,25 +9711,25 @@ typedef struct _points3D { meshStruct *normData; /* list of normals */ } points3D; -@ +\end{chunk} \index{struct!colorBuffer} \index{colorBuffer struct} -<>= +\begin{chunk}{view3d} typedef struct _colorBuffer { int indx; char axes; } colorBuffer; -@ +\end{chunk} \index{struct!point} \index{point struct} -<>= +\begin{chunk}{view3d} typedef struct _point { float x, y, z; int flag; } point; -@ +\end{chunk} \index{struct!viewPoints} \index{viewPoints struct} One of the (many) sloppy things that need to be @@ -9741,7 +9737,7 @@ cleaned up is the viewPoints structure. a lot of stuff in it is used solely for the function of two variables stuff. they should be moved to the fun2Var substructure. -<>= +\begin{chunk}{view3d} typedef struct _viewPoints { int viewportKey; char title[80]; @@ -9767,17 +9763,17 @@ typedef struct _viewPoints { struct _viewPoints *prevViewport, *nextViewport; } viewPoints; -@ +\end{chunk} \index{struct!controlXY} \index{controlXY struct} -<>= +\begin{chunk}{view3d} typedef struct _controlXY { int putX, putY; } controlXY; -@ +\end{chunk} \subsection{extern references} -<>= +\begin{chunk}{view3d} extern Display *dsply; extern XFontStruct *globalFont, *buttonFont, *headerFont, *titleFont, *graphFont, @@ -9905,9 +9901,9 @@ extern int smoothHue; extern int smoothConst; extern int smoothError; -@ +\end{chunk} \subsection{forward references} -<>= +\begin{chunk}{view3d} extern viewTriple * traverse(int ); extern float absolute(float ); extern float getRandom(void ); @@ -10064,9 +10060,9 @@ static int TrivEqual(Window , Window ); static int TrivHashCode(Window , int ); #endif -@ +\end{chunk} \subsection{global variables} -<>= +\begin{chunk}{view3d} float A[4][4]; int ack=1; GC anotherGC; @@ -10249,7 +10245,7 @@ float transform1[4][4]; int translated = yes; GC trashGC; -@ +\end{chunk} totalShades is initially set to totalShadesConst. If X cannot allocate 8 shades for each hue, totalShades is decremented. there is currently only a check for @@ -10259,7 +10255,7 @@ file. spadcolors.c has been modified so that it returns the value for totalShades. since the return value had previously been unused, a modification in this way ensures continued support of other routines calling this function (e.g. hypertex stuff). -<>= +\begin{chunk}{view3d} int totalShades; int viewAloned; /** if not connected to Axiom **/ @@ -10298,7 +10294,7 @@ float zClipMaxN; /* normalized values for clip volume */ float zClipMinN; /* normalized values for clip volume */ int zoomed=yes; -@ +\end{chunk} \section{Code} \subsection{initButtons} Creates the fields for each button window in the @@ -10307,8 +10303,8 @@ number of buttons created. \index{view3d!initButtons} \index{initButtons view3d} \index{gfun.c} -<>= -<> +\begin{chunk}{view3d} +\getchunk{gfun.c} int initButtons(buttonStruct *buttons) { int PBY = 297; /* panel button Y coordinate at which buttons appear */ int ii, num = 0; @@ -10634,7 +10630,7 @@ int initButtons(buttonStruct *buttons) { return(num); } /* initButtons() */ -@ +\end{chunk} \subsection{closeViewport} This closes all of the windows created for the control panel window and the viewport window of @@ -10642,7 +10638,7 @@ the current graph being displayed. It does not currently return a specified value. \index{view3d!closeViewport} \index{closeViewport view3d} -<>= +\begin{chunk}{view3d} void closeViewport(void) { int i; /* First, unlink viewport from global list of viewports */ @@ -10668,11 +10664,11 @@ void closeViewport(void) { XFlush(dsply); } /* closeViewport() */ -@ +\end{chunk} \subsection{scaleComponents} \index{view3d!scaleComponents} \index{scaleComponents view3d} -<>= +\begin{chunk}{view3d} void scaleComponents(void) { double xRange,yRange,zRange; int i; @@ -10743,7 +10739,7 @@ void scaleComponents(void) { } } /* scaleComponents() */ -@ +\end{chunk} \subsection{makeTriangle} Given three indices to three points, a triangular polygon is created and inserted into the polygon list of viewData. If two or more of the @@ -10751,7 +10747,7 @@ points are coincidental, no polygon is created since that would be a degenerate (collapsed) polygon. \index{view3d!makeTriangle} \index{makeTriangle view3d} -<>= +\begin{chunk}{view3d} void makeTriangle(int a, int b, int c) { poly *aPoly; if (!(samePoint(a,b) || samePoint(b,c) || samePoint(c,a))) { @@ -10771,7 +10767,7 @@ void makeTriangle(int a, int b, int c) { } /* if all points are unique */ } /* makeTriangle() */ -@ +\end{chunk} \subsection{triangulate} Only if there is more than one list do we triangulate; a single list is used for either a space curve or simply a point. Actually, in that @@ -10785,7 +10781,7 @@ list. It turns out that any distribution of points in the two lists (preserving cyclic order) will produce the same desired polygon. \index{view3d!triangulate} \index{triangulate view3d} -<>= +\begin{chunk}{view3d} void triangulate(void) { int u,l; int uBound,lBound; @@ -10872,11 +10868,11 @@ void triangulate(void) { } /* for LLPoints in LLLPoints (i) */ } /* triangulate */ -@ +\end{chunk} \subsection{readComponentsFromViewman} \index{view3d!readComponentsFromViewman} \index{readComponentsFromViewman view3d} -<>= +\begin{chunk}{view3d} void readComponentsFromViewman(void) { int i,j,k; LLPoint *anLLPoint; @@ -10931,7 +10927,7 @@ void readComponentsFromViewman(void) { quadMesh = (XPoint *)saymem("component.c",maxLength+2,sizeof(XPoint)); } /* readComponentsFromViewman() */ -@ +\end{chunk} \subsection{calcNormData} Calculates the surface normals for the polygons that make up the tube. Also finds the fourth coefficient to the plane equation: @@ -10943,7 +10939,7 @@ Figures out the color as well (from the average of the points) and resets the moved flag \index{view3d!calcNormData} \index{calcNormData view3d} -<>= +\begin{chunk}{view3d} void calcNormData(void) { poly *aPoly; int *index; @@ -10985,7 +10981,7 @@ void calcNormData(void) { } } /* calcNormData() */ -@ +\end{chunk} \subsection{make3DComponents} Read in all the 3D data from the viewport manager and construct the model of it. The model is based upon a list of lists of lists of points. @@ -10998,7 +10994,7 @@ closed boolean for this level is defined by the user from Axiom , (which defaults to False) and the closed boolean for each sublist is True. \index{view3d!make3DComponents} \index{make3DComponents view3d} -<>= +\begin{chunk}{view3d} viewPoints *make3DComponents(void) { viewPoints *graphData; readComponentsFromViewman(); @@ -11039,11 +11035,11 @@ viewPoints *make3DComponents(void) { return(graphData); } /* make3DComponents */ -@ +\end{chunk} \subsection{draw3DComponents} \index{view3d!draw3DComponents} \index{draw3DComponents view3d} -<>= +\begin{chunk}{view3d} void draw3DComponents(int dFlag) { int i, j, k, hue, x1, y1, x2, y2; LLPoint *anLLPoint; @@ -11071,7 +11067,7 @@ void draw3DComponents(int dFlag) { } /* no need to check "keep drawing" for ps */ if (dFlag == Xoption) drawMore = keepDrawingViewport(); -@ +\end{chunk} This is where we interpret the list of lists of lists of points struct. We want to extract the following forms of data: \begin{itemize} @@ -11102,7 +11098,7 @@ Here's the convention used to figure that out: \item surface: \#anLLPoint$\rightarrow$numOfLists was some $m>1$\\ \#anLPoint$\rightarrow$numOfPoints all point lists are the same. \end{itemize} -<>= +\begin{chunk}{view3d} anLLPoint = viewData.lllp.llp; for (i=0; i>= +\begin{chunk}{view3d} void drawColorMap (void) { controlPanelStruct *cp; int i,shadeWidth; @@ -11474,13 +11470,13 @@ void drawColorMap (void) { XSync(dsply,0); } /* drawColorMap() */ -@ +\end{chunk} \subsection{writeControlTitle} We need the window argument here because there are multiple control panels in 3D. \index{view3d!writeControlTitle} \index{writeControlTitle view3d} -<>= +\begin{chunk}{view3d} void writeControlTitle(Window w) { int strlength; s = viewport->title; @@ -11491,11 +11487,11 @@ void writeControlTitle(Window w) { 15,s,strlength,Xoption); } /* writeControlTitle() */ -@ +\end{chunk} \subsection{clearControlMessage} \index{view3d!clearControlMessage} \index{clearControlMessage view3d} -<>= +\begin{chunk}{view3d} void clearControlMessage(void) { int strlength; strcpy(viewport->controlPanel->message," "); @@ -11507,11 +11503,11 @@ void clearControlMessage(void) { viewport->controlPanel->message,strlength,Xoption); } -@ +\end{chunk} \subsection{writeControlMessage} \index{view3d!writeControlMessage} \index{writeControlMessage view3d} -<>= +\begin{chunk}{view3d} void writeControlMessage(void) { int strlength; controlPanelStruct *cp; @@ -11528,11 +11524,11 @@ void writeControlMessage(void) { XFlush(dsply); } -@ +\end{chunk} \subsection{drawControlPanel} \index{view3d!drawControlPanel} \index{drawControlPanel view3d} -<>= +\begin{chunk}{view3d} void drawControlPanel(void) { int offShade=14; controlPanelStruct *cp; @@ -12058,14 +12054,14 @@ void drawControlPanel(void) { XFlush(dsply); } /* drawControlPanel() */ -@ +\end{chunk} \subsection{getControlXY} Determines the x and y coordinate where the control panel is to be placed, based upon where the mouse button was pressed within the graph viewport window. \index{view3d!getControlXY} \index{getControlXY view3d} -<>= +\begin{chunk}{view3d} controlXY getControlXY(int whereDoYouWantPanel) { XWindowAttributes wAttrib; controlXY cXY = {0,0}; @@ -12128,11 +12124,11 @@ controlXY getControlXY(int whereDoYouWantPanel) { return(cXY); } -@ +\end{chunk} \subsection{makeControlPanel} \index{view3d!makeControlPanel} \index{makeControlPanel view3d} -<>= +\begin{chunk}{view3d} controlPanelStruct *makeControlPanel(void) { Window cw; int i, num; @@ -12220,7 +12216,7 @@ controlPanelStruct *makeControlPanel(void) { return(control); } /* makeControlPanel() */ -@ +\end{chunk} \subsection{putControlPanelSomewhere} This routine puts up the control panel associated with the viewport passed in. It first tries to put it to the right of the viewport. If there isn't @@ -12229,7 +12225,7 @@ is too big and there is no room to put the control panel outside of it, the control panel is placed on the bottom right hand corner of the viewport. \index{view3d!putControlPanelSomewhere} \index{putControlPanelSomewhere view3d} -<>= +\begin{chunk}{view3d} void putControlPanelSomewhere(int whereDoesPanelGo) { controlPanelStruct *control; controlXY whereControl = {0,0}; @@ -12249,13 +12245,13 @@ void putControlPanelSomewhere(int whereDoesPanelGo) { XFlush(dsply); } -@ +\end{chunk} \subsection{phong} A general routine for determining the intensity values at a particular point using the Phong illumination model with Phong shading \index{view3d!phong} \index{phong view3d} -<>= +\begin{chunk}{view3d} float phong(triple pt,float N[3]) { float dotLN, dotHN, H[3], E[3], P[3], NM[3], L[3]; float color, diffuse, specular; @@ -12298,11 +12294,11 @@ float phong(triple pt,float N[3]) { return(color); } -@ +\end{chunk} \subsection{hueValue} \index{view3d!hueValue} \index{hueValue view3d} -<>= +\begin{chunk}{view3d} int hueValue(float val) { int hue; hue = floor(absolute(val) * viewport->numberOfHues) + viewport->hueOffset; @@ -12310,11 +12306,11 @@ int hueValue(float val) { return hue; } -@ +\end{chunk} \subsection{getHue} \index{view3d!getHue} \index{getHue view3d} -<>= +\begin{chunk}{view3d} int getHue(float val) { int hue; hue = hueValue(val); @@ -12328,11 +12324,11 @@ int getHue(float val) { return hue; } -@ +\end{chunk} \subsection{Value} \index{view3d!Value} \index{Value view3d} -<>= +\begin{chunk}{view3d} float Value(float n1, float n2, float hue) { float v; if (hue > 360.0) hue -= 360.0; @@ -12353,11 +12349,11 @@ float Value(float n1, float n2, float hue) { return(v); } -@ +\end{chunk} \subsection{hlsTOrgb} \index{view3d!hlsTOrgb} \index{hlsTOrgb view3d} -<>= +\begin{chunk}{view3d} RGB hlsTOrgb(float h,float l,float s) { RGB rgb; float m1, m2; @@ -12374,13 +12370,13 @@ RGB hlsTOrgb(float h,float l,float s) { return(rgb); } -@ +\end{chunk} \subsection{initLightButtons} Creates the fields for each button window in the three dimensional lighting subpanel, and returns the number of buttons created. \index{view3d!initLightButtons} \index{initLightButtons view3d} -<>= +\begin{chunk}{view3d} int initLightButtons(buttonStruct *lightButtons) { int ii; int num = 0; @@ -12467,11 +12463,11 @@ int initLightButtons(buttonStruct *lightButtons) { return(num); } -@ +\end{chunk} \subsection{makeLightingPanel} \index{view3d!makeLightingPanel} \index{makeLightingPanel view3d} -<>= +\begin{chunk}{view3d} int makeLightingPanel(void) { int i; XSetWindowAttributes cwAttrib, controlAttrib; @@ -12549,11 +12545,11 @@ int makeLightingPanel(void) { return(0); } /* makeLightingPanel() */ -@ +\end{chunk} \subsection{drawLightingAxes} \index{view3d!drawLightingAxes} \index{drawLightingAxes view3d} -<>= +\begin{chunk}{view3d} void drawLightingAxes(void) { XWindowAttributes laInfo; int i,xCenter,yCenter; @@ -12632,11 +12628,11 @@ void drawLightingAxes(void) { GDrawLine(lightingGC,lightingAxes,vPx0,vPy0,vPx1,vPy1,Xoption); } /* drawLightingAxes */ -@ +\end{chunk} \subsection{drawLightTransArrow} \index{view3d!drawLightTransArrow} \index{drawLightTransArrow view3d} -<>= +\begin{chunk}{view3d} void drawLightTransArrow(void) { int i; float f; @@ -12706,11 +12702,11 @@ void drawLightTransArrow(void) { arrowHead + 10, i, Xoption); } /* drawLightTransArrow() */ -@ +\end{chunk} \subsection{drawLightingPanel} \index{view3d!drawLightingPanel} \index{drawLightingPanel view3d} -<>= +\begin{chunk}{view3d} void drawLightingPanel(void) { char *s; int i,strlength; @@ -12914,11 +12910,11 @@ void drawLightingPanel(void) { drawLightTransArrow(); } /* drawLightingPanel */ -@ +\end{chunk} \subsection{theHandler} \index{view3d!theHandler} \index{theHandler view3d} -<>= +\begin{chunk}{view3d} int theHandler(Display *display,XErrorEvent *event) { char buffer[512]; XGetErrorText(display,event->error_code,buffer,511); @@ -12926,11 +12922,11 @@ int theHandler(Display *display,XErrorEvent *event) { return(0); } -@ +\end{chunk} \subsection{mergeDatabases} \index{view3d!mergeDatabases} \index{mergeDatabases view3d} -<>= +\begin{chunk}{view3d} void mergeDatabases(void) { XrmDatabase homeDB,serverDB,applicationDB; char filenamebuf[1024]; @@ -12965,11 +12961,11 @@ void mergeDatabases(void) { XrmMergeDatabases(homeDB,&rDB); } -@ +\end{chunk} \subsection{getMeshNormal} \index{view3d!getMeshNormal} \index{getMeshNormal view3d} -<>= +\begin{chunk}{view3d} void getMeshNormal(float x0,float y0,float z0,float x1,float y1,float z1, float x2,float y2,float z2,float zMin,float zRange,float Normal[3]) { float Ax,Ay,Az,Bx,By,Bz, UnitFactor; @@ -12994,11 +12990,11 @@ void getMeshNormal(float x0,float y0,float z0,float x1,float y1,float z1, } } /* getMeshNormal() */ -@ +\end{chunk} \subsection{normalizeVector} \index{view3d!normalizeVector} \index{normalizeVector view3d} -<>= +\begin{chunk}{view3d} void normalizeVector(float *v) { /* v should be a triple (ignoring the rest of the array if necessary) */ float UnitFactor; @@ -13012,11 +13008,11 @@ void normalizeVector(float *v) { } } /* normalizeVector() */ -@ +\end{chunk} \subsection{dotProduct} \index{view3d!dotProduct} \index{dotProduct view3d} -<>= +\begin{chunk}{view3d} float dotProduct(float * a,float *b,int size) { int i; float f=0; @@ -13025,7 +13021,7 @@ float dotProduct(float * a,float *b,int size) { return(f); } /* dotProduct() */ -@ +\end{chunk} This file depends on the file msort.h. There, a data type called linkElement is defined. It is used here and is the main structure being sorted here. You can sort any linked structure, under any name - so long as it has a @@ -13064,7 +13060,7 @@ pointer pointing to a sorted list. \subsection{merge} \index{view3d!merge} \index{merge view3d} -<>= +\begin{chunk}{view3d} linkThing *merge(linkThing *p, linkThing *q, int (*compare)(linkThing *, linkThing *)) { linkThing *returnVal,*current,*pN,*qN; @@ -13098,11 +13094,11 @@ linkThing *merge(linkThing *p, linkThing *q, return(returnVal); } /* merge() */ -@ +\end{chunk} \subsection{msort} \index{view3d!msort} \index{msort view3d} -<>= +\begin{chunk}{view3d} linkThing *msort(linkThing *p,int min,int max, int (*compare)(linkThing *, linkThing *)) { int mid; @@ -13121,11 +13117,11 @@ linkThing *msort(linkThing *p,int min,int max, } } /* msort() */ -@ +\end{chunk} \subsection{getPotValue} \index{view3d!getPotValue} \index{getPotValue view3d} -<>= +\begin{chunk}{view3d} mouseCoord getPotValue(short eX,short eY,short xH,short yH) { mouseCoord whereMouse; float x,y; @@ -13141,11 +13137,11 @@ mouseCoord getPotValue(short eX,short eY,short xH,short yH) { return(whereMouse); } /* getPotValue() */ -@ +\end{chunk} \subsection{getLinearPotValue} \index{view3d!getLinearPotValue} \index{getLinearPotValue view3d} -<>= +\begin{chunk}{view3d} mouseCoord getLinearPotValue(short eX,short eY,short xH,short yH) { mouseCoord whereMouse; whereMouse.x = (float)eX/xH - 1; @@ -13153,11 +13149,11 @@ mouseCoord getLinearPotValue(short eX,short eY,short xH,short yH) { return(whereMouse); } /* getLinearPotValue() */ -@ +\end{chunk} \subsection{buttonAction} \index{view3d!buttonAction} \index{buttonAction view3d} -<>= +\begin{chunk}{view3d} void buttonAction(int bKey) { char *s1, *s2; int strL, strL1, strL2, offShade=14; @@ -13863,12 +13859,12 @@ void buttonAction(int bKey) { } /* switch (action) */ } /* processEvents() */ -@ +\end{chunk} \subsection{processEvents} X Event Processing \index{view3d!processEvents} \index{processEvents view3d} -<>= +\begin{chunk}{view3d} void processEvents(void) { XEvent *event, tempEvent; Window whichWindow; @@ -14582,12 +14578,12 @@ void processEvents(void) { } /* for (until closed) */ } /* processEvents() */ -@ +\end{chunk} \subsection{project} Orthogonal projection for a point setting the ith Xpoint as well. \index{view3d!project} \index{project view3d} -<>= +\begin{chunk}{view3d} void project(viewTriple * aViewTriple,XPoint *someXpoints,int i) { float Vtmp[4], V[4], V1[4]; V[0] = aViewTriple->x; V[1] = aViewTriple->y; @@ -14618,13 +14614,13 @@ void project(viewTriple * aViewTriple,XPoint *someXpoints,int i) { (someXpoints+i)->y = aViewTriple->py = V[1]; } -@ +\end{chunk} \subsection{projectAPoint} Orthogonal projection for a point. sort of like the above, but no Xpoint assignment. \index{view3d!projectAPoint} \index{projectAPoint view3d} -<>= +\begin{chunk}{view3d} void projectAPoint(viewTriple *aViewTriple) { float Vtmp[4], V[4], V1[4]; V[0] = aViewTriple->x; V[1] = aViewTriple->y; @@ -14655,11 +14651,11 @@ void projectAPoint(viewTriple *aViewTriple) { aViewTriple->py = V[1]; } -@ +\end{chunk} \subsection{projectAllPoints} \index{view3d!projectAllPoints} \index{projectAllPoints view3d} -<>= +\begin{chunk}{view3d} void projectAllPoints(void) { int i,j,k; LLPoint *anLLPoint; @@ -14677,7 +14673,7 @@ void projectAllPoints(void) { } /* for LLPoints in LLLPoints (i) */ } /* projectAllPoints() */ -@ +\end{chunk} \subsection{projectAllPolys} Orthogonal projection of all the polygons in a given list in one go. pz holds the projected depth info for hidden surface removal. @@ -14685,7 +14681,7 @@ Polygons totally outside of the window dimensions after projection are discarded from the list. \index{view3d!projectAllPolys} \index{projectAllPolys view3d} -<>= +\begin{chunk}{view3d} void projectAllPolys(poly *pList) { int i,clipped,clippedPz; float x0=0.0; @@ -14741,13 +14737,13 @@ void projectAllPolys(poly *pList) { writeControlMessage(); } /* projectAllPolys */ -@ +\end{chunk} \subsection{projectAPoly} Orthogonal projection of all a polygon. pz holds the projected depth info for hidden surface removal. \index{view3d!projectAPoly} \index{projectAPoly view3d} -<>= +\begin{chunk}{view3d} void projectAPoly(poly *p) { int i,clipped,clippedPz; float Vtmp[4],V[4],V1[4]; @@ -14805,14 +14801,14 @@ void projectAPoly(poly *p) { else p->normalFacingOut = 0; } /* projectAPoly */ -@ +\end{chunk} \subsection{projectStuff} Sort of like the project stuff in tube.c but used exclusively for the functions of two variables. probably will need to be changed later to be more general (i.e. have everybody use the viewTriple point structure). \index{view3d!projectStuff} \index{projectStuff view3d} -<>= +\begin{chunk}{view3d} void projectStuff(float x,float y,float z,int *px,int *py,float *Pz) { float tempx,tempy,tempz,temps,V[4],V1[4],stuffScale=100.0; tempx = viewport->scaleX; @@ -14847,11 +14843,11 @@ void projectStuff(float x,float y,float z,int *px,int *py,float *Pz) { viewScale = temps; } -@ +\end{chunk} \subsection{makeQuitPanel} \index{view3d!makeQuitPanel} \index{makeQuitPanel view3d} -<>= +\begin{chunk}{view3d} int makeQuitPanel(void) { int i; XSetWindowAttributes quitter,QuitterAttrib; @@ -14906,11 +14902,11 @@ int makeQuitPanel(void) { return(0); } /* makeQuitPanel() */ -@ +\end{chunk} \subsection{drawQuitPanel} \index{view3d!drawQuitPanel} \index{drawQuitPanel view3d} -<>= +\begin{chunk}{view3d} void drawQuitPanel(void) { char *s; int i,strlength; @@ -14942,11 +14938,11 @@ void drawQuitPanel(void) { } /* for i in control->buttonQueue */ } /* drawQuitPanel */ -@ +\end{chunk} \subsection{initQuitButtons} \index{view3d!initQuitButtons} \index{initQuitButtons view3d} -<>= +\begin{chunk}{view3d} int initQuitButtons(buttonStruct *quitButtons) { int ii; int num = 0; @@ -14979,11 +14975,11 @@ int initQuitButtons(buttonStruct *quitButtons) { return(num); } -@ +\end{chunk} \subsection{makeSavePanel} \index{view3d!makeSavePanel} \index{makeSavePanel view3d} -<>= +\begin{chunk}{view3d} int makeSavePanel(void) { int i; XSetWindowAttributes saver,SaverAttrib; @@ -15038,11 +15034,11 @@ int makeSavePanel(void) { return(0); } /* makeSavePanel() */ -@ +\end{chunk} \subsection{drawSavePanel} \index{view3d!drawSavePanel} \index{drawSavePanel view3d} -<>= +\begin{chunk}{view3d} void drawSavePanel(void) { char *s; int i,strlength; @@ -15068,11 +15064,11 @@ void drawSavePanel(void) { } /* for i in control->buttonQueue */ } /* drawSavePanel */ -@ +\end{chunk} \subsection{initSaveButtons} \index{view3d!initSaveButtons} \index{initSaveButtons view3d} -<>= +\begin{chunk}{view3d} int initSaveButtons(buttonStruct *saveButtons) { int ii; int num = 0; @@ -15117,78 +15113,78 @@ int initSaveButtons(buttonStruct *saveButtons) { return(num); } -@ +\end{chunk} \subsection{getCBufferAxes} \index{view3d!getCBufferAxes} \index{getCBufferAxes view3d} -<>= +\begin{chunk}{view3d} char getCBufferAxes(int ix) { if( ix >=0 && ix >= +\begin{chunk}{view3d} void putCBufferAxes(int ix,char val) { if( ix >=0 && ix >= +\begin{chunk}{view3d} int getCBufferIndx(int ix) { if( ix >=0 && ix >= +\begin{chunk}{view3d} void putCBufferIndx(int ix,int val) { if( ix >=0 && ix >= +\begin{chunk}{view3d} void putZBuffer(int ix,float val) { if (ix >=0 && ix >= +\begin{chunk}{view3d} float getZBuffer(int ix) { return (zBuffer[ix]); } -@ +\end{chunk} \subsection{putImageX} \index{view3d!putImageX} \index{putImageX view3d} -<>= +\begin{chunk}{view3d} void putImageX(int ix,char val) { if (ix <=0 && ix data[ix] = val; } -@ +\end{chunk} \subsection{drawPhongSpan} This routine sets the buffer values for each span of pixels which intersect the current scanline. \index{view3d!drawPhongSpan} \index{drawPhongSpan view3d} -<>= +\begin{chunk}{view3d} void drawPhongSpan(triple pt,float N[3],int dFlag) { int xpixel,hue,shade; float colorindx, col; @@ -15257,14 +15253,14 @@ void drawPhongSpan(triple pt,float N[3],int dFlag) { } /* while each pixel */ } -@ +\end{chunk} \subsection{scanPhong} This routine takes all polygons that intersect with the current scanline and calculates the intersecting x and z points as well as the color at each point. Interpolation is done according to Phong. \index{view3d!scanPhong} \index{scanPhong view3d} -<>= +\begin{chunk}{view3d} void scanPhong(int dFlag) { viewTriple *p1, *p2; polyList *polygon; @@ -15376,12 +15372,12 @@ void scanPhong(int dFlag) { } /* while still polygons */ } -@ +\end{chunk} \subsection{boxTObuffer} boxTObuffer() writes the projection of the x,y bounding box to the z-buffer. \index{view3d!boxTObuffer} \index{boxTObuffer view3d} -<>= +\begin{chunk}{view3d} void boxTObuffer(void) { int xpix,i,j,k,count,decision; int xA,xB,yA,yB; @@ -15443,13 +15439,13 @@ void boxTObuffer(void) { } } -@ +\end{chunk} \subsection{clipboxTObuffer} clipboxTObuffer() writes the projection of the x,y,z clipping region box to the z-buffer. \index{view3d!clipboxTObuffer} \index{clipboxTObuffer view3d} -<>= +\begin{chunk}{view3d} void clipboxTObuffer(void) { int xpix,i,j,k,count,decision; int xA,xB,yA,yB; @@ -15512,12 +15508,12 @@ void clipboxTObuffer(void) { } } -@ +\end{chunk} \subsection{axesTObuffer} axesTObuffer() writes the projection of the x,y,z axes to the z-buffer. \index{view3d!axesTObuffer} \index{axesTObuffer view3d} -<>= +\begin{chunk}{view3d} void axesTObuffer(void) { int xpix,i,count,decision; int xA,xB,yA,yB; @@ -15576,13 +15572,13 @@ void axesTObuffer(void) { } /* for each axes */ } -@ +\end{chunk} \subsection{scanLines} scanLines() scanline z-buffer algorithm initialize z-buffer and color buffer for all scanlines. \index{view3d!scanLines} \index{scanLines view3d} -<>= +\begin{chunk}{view3d} void scanLines(int dFlag) { unsigned long pixColor; int i; @@ -15733,12 +15729,12 @@ void scanLines(int dFlag) { XDestroyImage(imageX); } -@ +\end{chunk} \subsection{freePolyList} frees up the global scanList l-l \index{view3d!freePolyList} \index{freePolyList view3d} -<>= +\begin{chunk}{view3d} void freePolyList(void) { polyList *P, *nextP; int i; @@ -15752,12 +15748,12 @@ void freePolyList(void) { } } /* freePolyList() */ -@ +\end{chunk} \subsection{showAxesLabels} showAxesLabels() writes the axes labels onto the viewmap of a graph. \index{view3d!showAxesLabels} \index{showAxesLabels view3d} -<>= +\begin{chunk}{view3d} void showAxesLabels(int dFlag) { int xcoord2,ycoord2; if (dFlag == Xoption) @@ -15807,13 +15803,13 @@ void showAxesLabels(int dFlag) { } } -@ +\end{chunk} \subsection{makeTriangle} changeColorMap() modifies the color map for moving in and out of smooth shading. \index{view3d!makeTriangle} \index{makeTriangle view3d} -<>= +\begin{chunk}{view3d} void changeColorMap(void) { int okay, i, hue, *index; poly *cp; @@ -15874,13 +15870,13 @@ void changeColorMap(void) { } /* else hueOffset != hueTop */ } -@ +\end{chunk} \subsection{drawPhong} A general routine for displaying a list of polygons using a simple scanline z-buffer algorithm with phong shading. \index{view3d!drawPhong} \index{drawPhong view3d} -<>= +\begin{chunk}{view3d} void drawPhong(int dFlag) { poly *p, *head; polyList *s; @@ -16012,13 +16008,12 @@ void drawPhong(int dFlag) { writeControlMessage(); } /* drawPhong */ -@ +\end{chunk} -@ \subsection{readViewman} \index{view3d!readViewman} \index{readViewman view3d} -<>= +\begin{chunk}{view3d} int readViewman(void *info,int size) { int m = 0; sprintf(errorStr,"%s","read from viewport manager\n"); @@ -16026,11 +16021,11 @@ int readViewman(void *info,int size) { return(m); } -@ +\end{chunk} \subsection{scalePoint} \index{view3d!scalePoint} \index{scalePoint view3d} -<>= +\begin{chunk}{view3d} void scalePoint(viewTriple *p) { p->x *= viewData.scaleToView; p->y *= viewData.scaleToView; @@ -16041,11 +16036,11 @@ void scalePoint(viewTriple *p) { else if (p->c < 0) p->c = 0.0; } /* scalePoint */ -@ +\end{chunk} \subsection{spadAction} \index{view3d!spadAction} \index{spadAction view3d} -<>= +\begin{chunk}{view3d} int spadAction(void) { int code, viewCommand; float f1, f2, f3; @@ -16322,12 +16317,12 @@ int spadAction(void) { return(0); } -@ +\end{chunk} \subsection{traverse} Returns the nth point in a point resevoir. \index{view3d!traverse} \index{traverse view3d} -<>= +\begin{chunk}{view3d} viewTriple *traverse(int n) { int i; viewTriple *v; @@ -16336,32 +16331,32 @@ viewTriple *traverse(int n) { return(v); } /* traverse */ -@ +\end{chunk} \subsection{absolute} \index{view3d!absolute} \index{absolute view3d} -<>= +\begin{chunk}{view3d} float absolute(float x) { if (x<0.0) return(-x); else return(x); } -@ +\end{chunk} \subsection{getRandom} \index{view3d!getRandom} \index{getRandom view3d} -<>= +\begin{chunk}{view3d} float getRandom(void) { float x; x = (float)(rand() % 100); return(x); } -@ +\end{chunk} \subsection{normDist} \index{view3d!normDist} \index{normDist view3d} -<>= +\begin{chunk}{view3d} triple normDist(void) { float u1, u2, v1, v2, ss, rad; triple pert = {0,0,0}; @@ -16379,11 +16374,11 @@ triple normDist(void) { return(pert); } -@ +\end{chunk} \subsection{goodbye} \index{view3d!goodbye} \index{goodbye view3d} -<>= +\begin{chunk}{view3d} void goodbye(int sig) { int Command; PSClose(); /* free PS file and data structure space */ @@ -16396,11 +16391,11 @@ void goodbye(int sig) { exit(0); } /* goodbye */ -@ +\end{chunk} \subsection{drawLineComponent} \index{view3d!drawLineComponent} \index{drawLineComponent view3d} -<>= +\begin{chunk}{view3d} void drawLineComponent(poly * p, int dFlag) { int i, hue; int *anIndex; @@ -16440,11 +16435,11 @@ void drawLineComponent(poly * p, int dFlag) { } } -@ +\end{chunk} \subsection{drawOpaquePolygon} \index{view3d!drawOpaquePolygon} \index{drawOpaquePolygon view3d} -<>= +\begin{chunk}{view3d} void drawOpaquePolygon(poly *p,GC aGC,GC anotherGC,int dFlag) { int *anIndex, i, hue, isNaN = 0; RGB col_rgb; @@ -16503,12 +16498,12 @@ void drawOpaquePolygon(poly *p,GC aGC,GC anotherGC,int dFlag) { } /* if not totally clipped */ } -@ +\end{chunk} \subsection{copyPolygons} Copies the given list of polygons into a newly allocated list \index{view3d!copyPolygons} \index{copyPolygons view3d} -<>= +\begin{chunk}{view3d} poly *copyPolygons(poly *polygonList) { int i; poly *aPoly,*retval,*prev; @@ -16579,12 +16574,12 @@ poly *copyPolygons(poly *polygonList) { return(retval); } -@ +\end{chunk} \subsection{minMaxPolygons} Sets up the xmin, etc, for each polygon for sorting and extent checking. \index{view3d!minMaxPolygons} \index{minMaxPolygons view3d} -<>= +\begin{chunk}{view3d} void minMaxPolygons(poly *aPoly) { int *anIndex; int i; @@ -16625,7 +16620,7 @@ void minMaxPolygons(poly *aPoly) { } } /* minMaxPolygons */ -@ +\end{chunk} \subsection{polyCompare} \begin{verbatim} returns -1 if p1 < p2 @@ -16636,26 +16631,26 @@ Note that this is the reverse of what the msort requested. This is so that the list will be sorted from max to min. \index{view3d!polyCompare} \index{polyCompare view3d} -<>= +\begin{chunk}{view3d} int polyCompare(poly *p1,poly *p2) { if (p1->pzmax > p2->pzmax) return(-1); else if (p1->pzmax < p2->pzmax) return(1); else return(0); } -@ +\end{chunk} \subsection{makeTriangle} Sets the global variable eyePoint[] to where the viewer is pointed towards. \index{view3d!makeTriangle} \index{makeTriangle view3d} -<>= +\begin{chunk}{view3d} void calcEyePoint(void) { eyePoint[0] = sinPhi * (sinTheta); eyePoint[1] = sinPhi * (-cosTheta); eyePoint[2] = cosPhi; } -@ +\end{chunk} \subsection{makeTriangle} A general routine for displaying a list of polygons with the proper hidden surfaces removed. Assumes the @@ -16664,7 +16659,7 @@ routine to split intersecting polygons in object space. Calculate the color for the polygon p and draw it. \index{view3d!makeTriangle} \index{makeTriangle view3d} -<>= +\begin{chunk}{view3d} void drawRenderedPolygon(poly *p,int dFlag) { int i,hue,shade, isNaN = 0; float whichSide,H[3],P[3],LN,HN,diff,spec,tempLight,lumens,E[3],N[3]; @@ -16799,11 +16794,11 @@ void drawRenderedPolygon(poly *p,int dFlag) { } /* if not clipped */ } /* drawRenderedPolygon */ -@ +\end{chunk} \subsection{freePointResevoir} \index{view3d!freePointResevoir} \index{freePointResevoir view3d} -<>= +\begin{chunk}{view3d} void freePointResevoir(void) { viewTriple *v; while (splitPoints != NIL(viewTriple)) { @@ -16813,12 +16808,12 @@ void freePointResevoir(void) { } } /* freePointResevoir */ -@ +\end{chunk} \subsection{freeListOfPolygons} Frees up a list of polygons. \index{view3d!freeListOfPolygons} \index{freeListOfPolygons view3d} -<>= +\begin{chunk}{view3d} void freeListOfPolygons(poly *pList) { poly *nextP; for (; pList != NIL(poly); pList=nextP) { @@ -16828,11 +16823,11 @@ void freeListOfPolygons(poly *pList) { } } /* freeListOfPolygons() */ -@ +\end{chunk} \subsection{drawPolygons} \index{view3d!drawPolygons} \index{drawPolygons view3d} -<>= +\begin{chunk}{view3d} void drawPolygons(int dFlag) { poly *p,*head; poly *tempQuick=NULL; @@ -16962,13 +16957,13 @@ void drawPolygons(int dFlag) { } } /* drawPolygons */ -@ +\end{chunk} \subsection{lessThan} Compares two floating point numbers for precision of up to one place in a thousand. Returns 1 if true 0 otherwise. \index{view3d!lessThan} \index{lessThan view3d} -<>= +\begin{chunk}{view3d} int lessThan(float x,float y) { int xI,yI; xI = x*precisionFactor; @@ -16976,13 +16971,13 @@ int lessThan(float x,float y) { return(xI>= +\begin{chunk}{view3d} int greaterThan(float x,float y) { int xI,yI; xI = x*precisionFactor; @@ -16990,29 +16985,29 @@ int greaterThan(float x,float y) { return(xI>yI); } -@ +\end{chunk} \subsection{isNaN} \index{view3d!isNaN} \index{isNaN view3d} -<>= +\begin{chunk}{view3d} int isNaN(float v) { return (v != v); } -@ +\end{chunk} \subsection{isNaNPoint} \index{view3d!isNaNPoint} \index{isNaNPoint view3d} -<>= +\begin{chunk}{view3d} int isNaNPoint(float x,float y,float z) { return (isNaN(x) || isNaN(y) || isNaN(z)); } -@ +\end{chunk} \subsection{equal} \index{view3d!equal} \index{equal view3d} -<>= +\begin{chunk}{view3d} int equal(float x,float y) { int xI,yI; xI = x*precisionFactor; @@ -17020,11 +17015,11 @@ int equal(float x,float y) { return(xI==yI); } -@ +\end{chunk} \subsection{matrixMultiply4x4} \index{view3d!matrixMultiply4x4} \index{matrixMultiply4x4 view3d} -<>= +\begin{chunk}{view3d} void matrixMultiply4x4(float xxA[4][4],float xxB[4][4],float array[4][4]) { array[0][0] = xxA[0][0]*xxB[0][0] + xxA[0][1]*xxB[1][0] + xxA[0][2]*xxB[2][0] + xxA[0][3]*xxB[3][0]; @@ -17060,11 +17055,11 @@ void matrixMultiply4x4(float xxA[4][4],float xxB[4][4],float array[4][4]) { xxA[3][2]*xxB[2][3] + xxA[3][3]*xxB[3][3]; } -@ +\end{chunk} \subsection{vectorMatrix4} \index{view3d!vectorMatrix4} \index{vectorMatrix4 view3d} -<>= +\begin{chunk}{view3d} void vectorMatrix4(float xxD[4],float xxE[4][4],float xxF[4]) { xxF[0]=xxD[0]*xxE[0][0]+xxD[1]*xxE[1][0]+xxD[2]*xxE[2][0]+xxD[3]*xxE[3][0]; xxF[1]=xxD[0]*xxE[0][1]+xxD[1]*xxE[1][1]+xxD[2]*xxE[2][1]+xxD[3]*xxE[3][1]; @@ -17072,11 +17067,11 @@ void vectorMatrix4(float xxD[4],float xxE[4][4],float xxF[4]) { xxF[3]=xxD[0]*xxE[0][3]+xxD[1]*xxE[1][3]+xxD[2]*xxE[2][3]+xxD[3]*xxE[3][3]; } -@ +\end{chunk} \subsection{ROTATE} \index{view3d!ROTATE} \index{ROTATE view3d} -<>= +\begin{chunk}{view3d} void ROTATE(float xxR[4][4]) { xxR[0][0]= -(cosTheta); xxR[0][1]= -(-sinTheta*cosPhi); @@ -17096,11 +17091,11 @@ void ROTATE(float xxR[4][4]) { xxR[3][3]= -(1.0); } -@ +\end{chunk} \subsection{ROTATE1} \index{view3d!ROTATE1} \index{ROTATE1 view3d} -<>= +\begin{chunk}{view3d} void ROTATE1(float xxR[4][4]) { xxR[0][0]= (cosTheta); xxR[0][1]= (-sinTheta*cosPhi); @@ -17120,11 +17115,11 @@ void ROTATE1(float xxR[4][4]) { xxR[3][3]= (1.0); } -@ +\end{chunk} \subsection{SCALE} \index{view3d!SCALE} \index{SCALE view3d} -<>= +\begin{chunk}{view3d} void SCALE(float x,float y,float z,float xxS[4][4]) { xxS[0][0] = x; xxS[0][1] = 0.0; xxS[0][2] = 0.0; xxS[0][3] = 0.0; xxS[1][0] = 0.0; xxS[1][1] = y; xxS[1][2] = 0.0; xxS[1][3] = 0.0; @@ -17132,11 +17127,11 @@ void SCALE(float x,float y,float z,float xxS[4][4]) { xxS[3][0] = 0.0; xxS[3][1] = 0.0; xxS[3][2] = 0.0; xxS[3][3] = 1.0; } -@ +\end{chunk} \subsection{TRANSLATE} \index{view3d!TRANSLATE} \index{TRANSLATE view3d} -<>= +\begin{chunk}{view3d} void TRANSLATE(float x,float y,float z,float xxT[4][4]) { xxT[0][0] = 1.0; xxT[0][1] = 0.0; xxT[0][2] = 0.0; xxT[0][3] = 0.0; xxT[1][0] = 0.0; xxT[1][1] = 1.0; xxT[1][2] = 0.0; xxT[1][3] = 0.0; @@ -17144,7 +17139,7 @@ void TRANSLATE(float x,float y,float z,float xxT[4][4]) { xxT[3][0] = x; xxT[3][1] = y; xxT[3][2] = z; xxT[3][3] = 1.0; } -@ +\end{chunk} \subsection{writeTitle} Definition for the axes and labels - this is the minimun that will be drawn on the window - thus allowing the user some idea of the @@ -17155,7 +17150,7 @@ directions. axisRange defines the range...change the stuff below if that has changed. \index{view3d!writeTitle} \index{writeTitle view3d} -<>= +\begin{chunk}{view3d} void writeTitle(void) { int strlength; XWindowAttributes twInfo; @@ -17172,13 +17167,13 @@ void writeTitle(void) { viewport->title, strlength, Xoption); } -@ +\end{chunk} \subsection{drawPreViewport} Draws the axes and boxes before the actual stuff. All incoming signals should be block and no check for pending X events are made. \index{view3d!drawPreViewport} \index{drawPreViewport view3d} -<>= +\begin{chunk}{view3d} void drawPreViewport(int dFlag) { int i, j, vPx0, vPy0, vPx1, vPy1; /* for drawing the box */ @@ -17445,11 +17440,11 @@ void drawPreViewport(int dFlag) { } } -@ +\end{chunk} \subsection{drawTheViewport} \index{view3d!drawTheViewport} \index{drawTheViewport view3d} -<>= +\begin{chunk}{view3d} void drawTheViewport(int dFlag) { int i,j; XPoint line[2]; @@ -17535,11 +17530,11 @@ void drawTheViewport(int dFlag) { } } /* drawTheViewport */ -@ +\end{chunk} \subsection{makeViewport} \index{view3d!makeViewport} \index{makeViewport view3d} -<>= +\begin{chunk}{view3d} viewPoints *makeViewport(void) { Pixmap spadbits,spadmask; XSetWindowAttributes viewAttrib; @@ -17747,13 +17742,13 @@ viewPoints *makeViewport(void) { return(viewport); } /* makeViewport() */ -@ +\end{chunk} \subsection{postMakeViewport} Post processing when creating a viewport. Assign min,max values for the box volume. \index{view3d!postMakeViewport} \index{postMakeViewport view3d} -<>= +\begin{chunk}{view3d} void postMakeViewport(void) { corners[0].x = viewData.xmin; corners[0].y = viewData.ymin; corners[0].z = viewData.zmin; @@ -17822,11 +17817,11 @@ void postMakeViewport(void) { clipBox[5].pointsPtr[3] = &(clipCorners[1]); } -@ +\end{chunk} \subsection{keepDrawingViewport} \index{view3d!keepDrawingViewport} \index{keepDrawingViewport view3d} -<>= +\begin{chunk}{view3d} int keepDrawingViewport(void) { XEvent peekEvent; int retVal; @@ -17861,11 +17856,11 @@ int keepDrawingViewport(void) { return(retVal); } -@ +\end{chunk} \subsection{initVolumeButtons} \index{view3d!initVolumeButtons} \index{initVolumeButtons view3d} -<>= +\begin{chunk}{view3d} int initVolumeButtons(buttonStruct *volumeButtons) { int ii, num = 0; ii = volumeReturn; @@ -17988,11 +17983,11 @@ int initVolumeButtons(buttonStruct *volumeButtons) { return(num); } -@ +\end{chunk} \subsection{makeVolumePanel} \index{view3d!makeVolumePanel} \index{makeVolumePanel view3d} -<>= +\begin{chunk}{view3d} void makeVolumePanel(void) { int i; XSetWindowAttributes cwAttrib, controlAttrib; @@ -18048,11 +18043,11 @@ void makeVolumePanel(void) { } } /* makeVolumePanel() */ -@ +\end{chunk} \subsection{drawClipXBut} \index{view3d!drawClipXBut} \index{drawClipXBut view3d} -<>= +\begin{chunk}{view3d} void drawClipXBut(void) { XClearArea(dsply,volumeWindow,clipXButX,clipXButY, majorAxis+blank,minorAxis+blank,False); @@ -18110,11 +18105,11 @@ void drawClipXBut(void) { GDrawString(volumeGC,volumeWindow,clipXMessX,clipXMessY,"X",1,Xoption); } -@ +\end{chunk} \subsection{drawClipYBut} \index{view3d!drawClipYBut} \index{drawClipYBut view3d} -<>= +\begin{chunk}{view3d} void drawClipYBut(void) { XClearArea(dsply,volumeWindow,clipYButX,clipYButY, minorAxis+blank,majorAxis+blank,False); @@ -18173,11 +18168,11 @@ void drawClipYBut(void) { GDrawString(volumeGC,volumeWindow,clipYMessX,clipYMessY,"Y",1,Xoption); } -@ +\end{chunk} \subsection{drawClipZBut} \index{view3d!drawClipZBut} \index{drawClipZBut view3d} -<>= +\begin{chunk}{view3d} void drawClipZBut(void) { XClearArea(dsply,volumeWindow,clipZButX,clipZButY, midAxis+blank,midAxis+blank,False); @@ -18205,11 +18200,11 @@ void drawClipZBut(void) { GDrawString(volumeGC,volumeWindow,clipZMessX,clipZMessY,"Z",1,Xoption); } -@ +\end{chunk} \subsection{drawClipVolume} \index{view3d!drawClipVolume} \index{drawClipVolume view3d} -<>= +\begin{chunk}{view3d} void drawClipVolume(void) { float xminL,xmaxL,yminL,ymaxL,zminL,zmaxL; XClearArea(dsply,volumeWindow,backFaceX-1,backFaceY, @@ -18260,11 +18255,11 @@ void drawClipVolume(void) { /* make sure volumeGC is set properly before calling these functions */ } /* drawClipVolume() */ -@ +\end{chunk} \subsection{drawHitherControl} \index{view3d!drawHitherControl} \index{drawHitherControl view3d} -<>= +\begin{chunk}{view3d} void drawHitherControl(void) { float xx,b,slope; int hitherTop, hitherBot; @@ -18310,11 +18305,11 @@ void drawHitherControl(void) { "Hither",6,Xoption); } -@ +\end{chunk} \subsection{drawEyeControl} \index{view3d!drawEyeControl} \index{drawEyeControl view3d} -<>= +\begin{chunk}{view3d} void drawEyeControl(void) { float here; int there; @@ -18353,11 +18348,11 @@ void drawEyeControl(void) { "Eye Distance",strlen("eye distance"),Xoption); } -@ +\end{chunk} \subsection{drawFrustrum} \index{view3d!drawFrustrum} \index{drawFrustrum view3d} -<>= +\begin{chunk}{view3d} void drawFrustrum(void) { float normalizedEyeDistance; XClearArea(dsply,volumeWindow, @@ -18385,11 +18380,11 @@ void drawFrustrum(void) { drawEyeControl(); } /* drawFrustrum() */ -@ +\end{chunk} \subsection{drawVolumePanel} \index{view3d!drawVolumePanel} \index{drawVolumePanel view3d} -<>= +\begin{chunk}{view3d} void drawVolumePanel(void) { int i,strlength; /* Draw some lines for volume panel. */ @@ -18517,11 +18512,11 @@ void drawVolumePanel(void) { drawClipZBut(); } /* drawVolumePanel() */ -@ +\end{chunk} \subsection{writeViewport} \index{view3d!writeViewport} \index{writeViewport view3d} -<>= +\begin{chunk}{view3d} int writeViewport(int thingsToWrite) { int i, j, k, ii, code, *anIndex; LLPoint *anLLPoint; @@ -18664,11 +18659,11 @@ int writeViewport(int thingsToWrite) { } /* else create directory okay */ } -@ +\end{chunk} \subsection{main} \index{view3d!main} \index{main view3d} -<>= +\begin{chunk}{view3d} int main(void) { XGCValues controlGCVals; int i, code; @@ -18950,7 +18945,7 @@ int main(void) { return(0); /* control never gets here but compiler complains */ } /* main() */ -@ +\end{chunk} \chapter{gdraws} \label{gdraws} @@ -19071,7 +19066,6 @@ font can be set in user program. Right now, it uses only 1 font. units on the axes. \end{itemize} -@ \section{gfun.c} Indices for PostScript draw procedures. @@ -19080,7 +19074,7 @@ to create the OUTPUT file. Essentially, PSCreateFile() loops through the index of 0 to psDrawNo and checks if the file/procedure is used. If so, the file is copied to the output file. \index{gfun.c} -<>= +\begin{chunk}{gfun.c} #define output 0 /* output file */ #define headerps 1 /* postscript header file */ @@ -19105,11 +19099,11 @@ the file is copied to the output file. #define endps 20 /* wrap up, close down, procedure */ #define psDrawNo 21 /* for use in createPSfile() */ -@ +\end{chunk} PostScript structures \label{psStruct} \index{psStruct} -<>= +\begin{chunk}{gfun.c} typedef struct _psStruct { /* data structure for ps routines info */ int flag; char filename[200]; @@ -19117,12 +19111,12 @@ typedef struct _psStruct { /* data structure for ps routines info */ psStruct psData[psDrawNo]; /* need psDrawNo of them */ -@ +\end{chunk} \subsection{filecopy} \label{filecopy} \index{gdraws!filecopy} Given 2 file pointers, this function copies file ifp to file ofp -<>= +\begin{chunk}{gfun.c} static void filecopy(FILE * ifp, FILE * ofp) { int c; @@ -19130,7 +19124,7 @@ static void filecopy(FILE * ifp, FILE * ofp) putc(c, ofp); } -@ +\end{chunk} \subsection{PSCreateFile} \label{PSCreateFile} \index{gdraws!PSCreateFile} @@ -19138,7 +19132,7 @@ PSCreateFile generates the output file by using the order of defined variables; they are used to create the OUTPUT file. Essentially, PSCreateFile() loop through the index of 0 to psDrawNo and checks if the file/procedure is used. If so, the file is included into the output file. -<>= +\begin{chunk}{gfun.c} int PSCreateFile( int bWidth, /* border width of picture frame */ @@ -19182,14 +19176,14 @@ int PSCreateFile( return (fclose(ofp)); } -@ +\end{chunk} \subsection{GdrawsDrawFrame} \label{GdrawsDrawFrame} \index{gdraws!GdrawsDrawFrame} This function draws the frame of the picture, which corresponds to the picture frame on the X display. In addition, it draws the title window as well as the title of the picture. -<>= +\begin{chunk}{gfun.c} int GdrawsDrawFrame( int borderW, /* border width */ @@ -19216,12 +19210,12 @@ int GdrawsDrawFrame( return (fclose(fp)); } -@ +\end{chunk} \subsection{GdrawsSetDimension} \label{GdrawsSetDimension} \index{gdraws!GdrawsSetDimension} GdrawsSetDimension sets the dimension of the picture. -<>= +\begin{chunk}{gfun.c} int GdrawsSetDimension(Window viewWindow, Window titleWindow) { FILE *fp; @@ -19256,13 +19250,13 @@ int GdrawsSetDimension(Window viewWindow, Window titleWindow) { return (fclose(fp)); } -@ +\end{chunk} \subsection{GDrawImageString} \label{GDrawImageString} \index{gdraws!GDrawImageString} GDrawImageString draws an image text string See \ref{XDrawImageString} on page~\pageref{XDrawImageString} -<>= +\begin{chunk}{gfun.c} int GDrawImageString( GC gc, /* graphics context */ @@ -19296,13 +19290,13 @@ int GDrawImageString( return (s); } -@ +\end{chunk} \subsection{GDrawArc} \label{GDrawArc} \index{gdraws!GDrawArc} GDrawArc draws an arc. See \ref{XDrawArc} on page~\pageref{XDrawArc} -<>= +\begin{chunk}{gfun.c} int GDrawArc( GC gc, /* graphics context */ @@ -19335,13 +19329,13 @@ int GDrawArc( return (s); } -@ +\end{chunk} \subsection{GDrawLine} \label{GDrawLine} \index{gdraws!GDrawLine} GDrawLine draws a line. See \ref{XDrawLine} on page~\pageref{XDrawLine} -<>= +\begin{chunk}{gfun.c} int GDrawLine( GC gc, /* graphics context */ @@ -19372,12 +19366,12 @@ int GDrawLine( return (s); } -@ +\end{chunk} \subsection{GDrawLines} \label{GDrawLines} \index{gdraws!GDrawLines} GDrawLines draws lines. -<>= +\begin{chunk}{gfun.c} int GDrawLines( GC gc, /* graphics context */ @@ -19417,13 +19411,13 @@ int GDrawLines( return (s); } -@ +\end{chunk} \subsection{GDrawPoint} \label{GDrawPoint} \index{gdraws!GDrawPoint} GDrawPoint draws a point. (See Section \ref{XDrawPoint} on page~\pageref{XDrawPoint}), -<>= +\begin{chunk}{gfun.c} int GDrawPoint( Window wid, /* window id */ @@ -19454,12 +19448,12 @@ int GDrawPoint( return (s); } -@ +\end{chunk} \subsection{GDrawRectangle} \label{GDrawRectangle} \index{gdraws!GDrawRectangle} GDrawRectangle draws a rectangle. -<>= +\begin{chunk}{gfun.c} int GDrawRectangle( GC gc, @@ -19491,12 +19485,12 @@ int GDrawRectangle( return (s); } -@ +\end{chunk} \subsection{GDraw3DButtonIn} \label{GDraw3DButtonIn} \index{gdraws!GDraw3DButtonIn} GDraw3DButtonOut draws a rectangle with 3D shading on rhs and bottom -<>= +\begin{chunk}{gfun.c} int GDraw3DButtonOut( GC gc, @@ -19512,12 +19506,12 @@ int GDraw3DButtonOut( return (s); } -@ +\end{chunk} \subsection{GDraw3DButtonIn} \label{GDraw3DButtonIn} \index{gdraws!GDraw3DButtonIn} GDraw3DButtonIn draws a rectangle with 3D shading on lhs and top -<>= +\begin{chunk}{gfun.c} int GDraw3DButtonIn( GC gc, @@ -19534,12 +19528,12 @@ int GDraw3DButtonIn( return (s); } -@ +\end{chunk} \subsection{GDrawPushButton} \label{GDrawPushButton} \index{gdraws!GDrawPushButton} GDrawPushButton draws a push button whose appearance depends on ``isOn.'' -<>= +\begin{chunk}{gfun.c} int GDrawPushButton( Display * display, @@ -19565,13 +19559,13 @@ int GDrawPushButton( text, len, dFlag); } -@ +\end{chunk} \subsection{GDrawString} \label{GDrawString} \index{gdraws!GDrawString} Draws a string. See \ref{XDrawString} on page~\pageref{XDrawString}. -<>= +\begin{chunk}{gfun.c} int GDrawString( GC gc, /* graphics context */ @@ -19604,13 +19598,13 @@ int GDrawString( return (s); } -@ +\end{chunk} \subsection{GFillArc} \label{GFillArc} \index{gdraws!GFillArc} Draws and fills an arc with foreground color. See \ref{XFillArc} on page~\pageref{XFillArc}. -<>= +\begin{chunk}{gfun.c} int GFillArc( GC gc, /* graphics context */ @@ -19644,13 +19638,13 @@ int GFillArc( return (s); } -@ +\end{chunk} \subsection{PSGlobalInit} \label{PSGlobalInit} \index{gdraws!PSGlobalInit} Initializes the path and files to be used. This needs to be called only once each session. -<>= +\begin{chunk}{gfun.c} int PSGlobalInit(void) { char *tmp; @@ -19745,13 +19739,13 @@ int PSGlobalInit(void) { return (psInit = yes); } -@ +\end{chunk} \subsection{PSInit} \label{PSInit} \index{gdraws!PSInit} This needs to be called for every postscript file generated. It initializes the procedure flags. -<>= +\begin{chunk}{gfun.c} int PSInit(Window vw, Window tw) { if (!psInit) { @@ -19780,7 +19774,7 @@ int PSInit(Window vw, Window tw) { return (GdrawsSetDimension(vw, tw)); } -@ +\end{chunk} \subsection{PSCreateContext} \label{PSCreateContext} \index{gdraws!PSCreateContext} @@ -19790,7 +19784,7 @@ is device-dependent, thus, we'll leave it and use default. Also lineStyle is solid in ps by default, thus we don't need to set it. We'll leave out line style here since we really never used anything other than line solid which is the default line style in postscript. -<>= +\begin{chunk}{gfun.c} int PSCreateContext( GC gc, /* graphics context */ @@ -19828,13 +19822,13 @@ int PSCreateContext( return (fclose(fp)); } -@ +\end{chunk} \subsection{PSfindGC} \label{PSfindGC} \index{gdraws!PSfindGC} Looks into GC linked list with gc (unsigned long) as index to find the character name. -<>= +\begin{chunk}{gfun.c} char *PSfindGC(GC gc) { GCptr curGC; @@ -19849,13 +19843,13 @@ char *PSfindGC(GC gc) { return (curGC->GCchar); } -@ +\end{chunk} \subsection{GSetForeground} \label{GSetForeground} \index{gdraws!GSetForeground} Sets foreground color. See \ref{XSetForeground} on page~\pageref{XSetForeground}. -<>= +\begin{chunk}{gfun.c} int GSetForeground( GC gc, /* graphics context */ @@ -19886,13 +19880,13 @@ int GSetForeground( return (s); } -@ +\end{chunk} \subsection{GSetBackground} \label{GSetBackground} \index{gdraws!GSetBackground} Sets background color. See \ref{XSetBackground} on page~\pageref{XSetBackground}. -<>= +\begin{chunk}{gfun.c} int GSetBackground( GC gc, /* graphics context */ @@ -19923,7 +19917,7 @@ int GSetBackground( return (s); } -@ +\end{chunk} \subsection{GSetLineAttributes} \label{GSetLineAttributes} \index{gdraws!GSetLineAttributes} @@ -19931,7 +19925,7 @@ int GSetBackground( Notice that we'll not setting line style for postscript. This is because solid is the ls in ps and in view3d and 2d, we really don't use anything else than solid. -<>= +\begin{chunk}{gfun.c} int GSetLineAttributes( GC gc, @@ -19997,13 +19991,13 @@ int GSetLineAttributes( return(s); } -@ +\end{chunk} \subsection{PSClose} \label{PSClose} \index{gdraws!PSClose} This procedure frees the data structure used for GC information, and also unlinks the GC dictionary file. -<>= +\begin{chunk}{gfun.c} int PSClose(void) { if (GChead != NULL) { /* free memory used by GC struct */ @@ -20017,11 +20011,11 @@ int PSClose(void) { return (unlink(psData[GCdictps].filename)); /* remove GC dictionary file */ } -@ +\end{chunk} \subsection{centerX} \label{centerX} \index{gdraws!centerX} -<>= +\begin{chunk}{gfun.c} int centerX(GC viewGCx,char * theString,int strlength,int windowWidth) { XFontStruct *fontStruct; @@ -20036,11 +20030,11 @@ int centerX(GC viewGCx,char * theString,int strlength,int windowWidth) return(result); } -@ +\end{chunk} \subsection{centerY} \label{centerY} \index{gdraws!centerY} -<>= +\begin{chunk}{gfun.c} int centerY(GC viewGCy,int windowHeight) { XFontStruct *fontStruct; @@ -20057,13 +20051,13 @@ int centerY(GC viewGCy,int windowHeight) { return(result); } -@ +\end{chunk} \subsection{PSColorPolygon} \label{PSColorPolygon} \index{gdraws!PSColorPolygon} PSColorPolygon draws and fills a polygon given data in XPoint. (See \ref{XFillPolygon} on page~\pageref{XFillPolygon}) -<>= +\begin{chunk}{gfun.c} int PSColorPolygon( float r, float g, float b, /* red, green and blue color @@ -20091,12 +20085,12 @@ int PSColorPolygon( } -@ +\end{chunk} \subsection{PSColorwOutline} \label{PSColorwOutline} \index{gdraws!PSColorwOutline} PSColorwOutline draws and also outlines the colored polygon. -<>= +\begin{chunk}{gfun.c} int PSColorwOutline( float r, float g, float b, /* red, green and blue color @@ -20122,13 +20116,13 @@ int PSColorwOutline( return (fclose(fp)); } -@ +\end{chunk} \subsection{PSDrawColor} \label{PSDrawColor} \index{gdraws!PSDrawColor} This function does what XDraw would do, notice that only a subset of attributes in GC is implemented -- adequate for our purpose now -<>= +\begin{chunk}{gfun.c} int PSDrawColor( float r, float g, float b, /* red, green and blue color components */ @@ -20154,13 +20148,13 @@ int PSDrawColor( return (fclose(fp)); } -@ +\end{chunk} \subsection{PSFillPolygon} \label{PSFillPolygon} \index{gdraws!PSFillPolygon} PSFillPolygon draws and fills a polygon given data in XPoint. (See \ref{XFillPolygon} on page~\pageref{XFillPolygon}). -<>= +\begin{chunk}{gfun.c} int PSFillPolygon( GC gc, /* graphics context */ @@ -20186,12 +20180,12 @@ int PSFillPolygon( return (fclose(fp)); } -@ +\end{chunk} \subsection{PSFillwOutline} \label{PSFillwOutline} \index{gdraws!PSFillwOutline} PSFillwOutline draws and also outlines the filled polygon. -<>= +\begin{chunk}{gfun.c} int PSFillwOutline( GC gc, /* graphics context */ @@ -20215,31 +20209,31 @@ int PSFillwOutline( return (fclose(fp)); } -@ +\end{chunk} \subsection{TrivEqual} \label{TrivEqual} \index{gdraws!TrivEqual} -<>= +\begin{chunk}{gfun.c} static int TrivEqual(Window s1,Window s2) { return ( s1 == s2); } -@ +\end{chunk} \subsection{TrivHashCode} \label{TrivHashCode} \index{gdraws!TrivHashCode} -<>= +\begin{chunk}{gfun.c} static int TrivHashCode(Window s,int size) { return (s % size); } -@ +\end{chunk} \subsection{XCreateAssocTable} \label{XCreateAssocTable} \index{gdraws!XCreateAssocTable} -<>= +\begin{chunk}{gfun.c} HashTable *XCreateAssocTable(int size) { HashTable * table; @@ -20249,37 +20243,37 @@ HashTable *XCreateAssocTable(int size) { return table; } -@ +\end{chunk} \subsection{XMakeAssoc} \label{XMakeAssoc} \index{gdraws!XMakeAssoc} -<>= +\begin{chunk}{gfun.c} void XMakeAssoc(Display * dsp, HashTable *table, Window w, int * p) { hash_insert(table,(char *) p, (char *) w); } -@ +\end{chunk} \subsection{XLookUpAssoc} \label{XLookUpAssoc} \index{gdraws!XLookUpAssoc} -<>= +\begin{chunk}{gfun.c} int *XLookUpAssoc(Display * dsp, HashTable *table,Window w) { return (int *) hash_find(table,(char *)w); } -@ +\end{chunk} \subsection{XDeleteAssoc} \label{XDeleteAssoc} \index{gdraws!XDeleteAssoc} -<>= +\begin{chunk}{gfun.c} void XDeleteAssoc(Display * dsp,HashTable * table, Window w) { hash_delete(table,(char *) w); } -@ +\end{chunk} \section{The postscript command definitions} \subsection{colorpoly} \begin{verbatim} @@ -20297,7 +20291,7 @@ region with foreground color \end{verbatim} \index{psfiles!colorpoly} \index{colorpoly psfiles} -<>= +\begin{chunk}{psfiles/colorpoly} /psColorPoly { gsave newpath @@ -20310,7 +20304,7 @@ region with foreground color grestore } def -@ +\end{chunk} \subsection{colorwol} \begin{verbatim} operand stack configuration in order to use psDrawFilled: @@ -20327,7 +20321,7 @@ region with background color (default: 1, or white). \end{verbatim} \index{psfiles!colorwol} \index{colorwol psfiles} -<>= +\begin{chunk}{psfiles/colorwol} /psColorwOutline { gsave newpath @@ -20340,7 +20334,7 @@ region with background color (default: 1, or white). 0 setgray stroke grestore end } %% outline it with black def -@ +\end{chunk} \subsection{drawarc} \begin{verbatim} operand stack configuration in order to use psDrawArc: @@ -20359,7 +20353,7 @@ This function uses "scale" to make cricles and ellipses. \end{verbatim} \index{psfiles!drawarc} \index{drawarc psfiles} -<>= +\begin{chunk}{psfiles/drawarc} /psDrawArc { gsave newpath @@ -20379,7 +20373,7 @@ This function uses "scale" to make cricles and ellipses. grestore } def -@ +\end{chunk} \subsection{drawcolor} \begin{verbatim} operand stack configuration in order to use psDrawColor: @@ -20395,7 +20389,7 @@ to draw lines connecting points in vlist[0] to vlist[n] \end{verbatim} \index{psfiles!drawcolor} \index{drawcolor psfiles} -<>= +\begin{chunk}{psfiles/drawcolor} /psDrawColor { gsave newpath @@ -20407,7 +20401,7 @@ to draw lines connecting points in vlist[0] to vlist[n] grestore } def -@ +\end{chunk} \subsection{drawIstr} \begin{verbatim} operand stack configuration in order to use psDrawIStr: @@ -20422,7 +20416,7 @@ string, which is in background color. \end{verbatim} \index{psfiles!drawIstr} \index{drawIstr psfiles} -<>= +\begin{chunk}{psfiles/drawIstr} /psDrawIStr { gsave newpath %% for rectangle @@ -20460,7 +20454,7 @@ string, which is in background color. grestore } def -@ +\end{chunk} \subsection{drawline} \begin{verbatim} operand stack configuration in order to use psDrawLine: @@ -20474,7 +20468,7 @@ this draws a line from (x0, y0) to (x1, y1). \end{verbatim} \index{psfiles!drawline} \index{drawline psfiles} -<>= +\begin{chunk}{psfiles/drawline} /psDrawLine { gsave newpath @@ -20484,7 +20478,7 @@ this draws a line from (x0, y0) to (x1, y1). grestore } def -@ +\end{chunk} \subsection{drawlines} \begin{verbatim} operand stack configuration in order to use psDrawLines: @@ -20500,7 +20494,7 @@ this draws lines connecting all the points. \end{verbatim} \index{psfiles!drawlines} \index{drawlines psfiles} -<>= +\begin{chunk}{psfiles/drawlines} /psDrawLines { gsave newpath @@ -20512,7 +20506,7 @@ this draws lines connecting all the points. grestore } def -@ +\end{chunk} \subsection{drawpoint} \begin{verbatim} operand stack configuration in order to use psDrawPoint: @@ -20524,7 +20518,7 @@ this draws a point at (x0, y0). \end{verbatim} \index{psfiles!drawpoint} \index{drawpoint psfiles} -<>= +\begin{chunk}{psfiles/drawpoint} /psDrawPoint { gsave newpath @@ -20534,7 +20528,7 @@ this draws a point at (x0, y0). grestore } def -@ +\end{chunk} \subsection{draw} \begin{verbatim} operand stack configuration in order to use psDraw: @@ -20550,7 +20544,7 @@ to draw lines connecting points in vlist[0] to vlist[n] \end{verbatim} \index{psfiles!draw} \index{draw psfiles} -<>= +\begin{chunk}{psfiles/draw} /psDraw { gsave newpath @@ -20562,7 +20556,7 @@ to draw lines connecting points in vlist[0] to vlist[n] grestore } def -@ +\end{chunk} \subsection{drawrect} \begin{verbatim} operand stack configuration in order to use psDrawRect: @@ -20577,7 +20571,7 @@ this draws an outline of a rectangle whose origin is at (x,y) and is width \end{verbatim} \index{psfiles!drawrect} \index{drawrect psfiles} -<>= +\begin{chunk}{psfiles/drawrect} /psDrawRect { gsave newpath @@ -20586,7 +20580,7 @@ this draws an outline of a rectangle whose origin is at (x,y) and is width grestore } def -@ +\end{chunk} \subsection{drawstr} \begin{verbatim} operand stack configuration in order to use psDrawStr: @@ -20599,7 +20593,7 @@ this function draws a text string at (x,y). \end{verbatim} \index{psfiles!drawstr} \index{drawstr psfiles} -<>= +\begin{chunk}{psfiles/drawstr} /psDrawStr { gsave newpath @@ -20609,7 +20603,7 @@ this function draws a text string at (x,y). grestore } def -@ +\end{chunk} \subsection{drwfilled} \begin{verbatim} operand stack configuration in order to use psDrawFilled: @@ -20626,7 +20620,7 @@ region with background color (default: 1, or white). \end{verbatim} \index{psfiles!drwfilled} \index{drwfilled psfiles} -<>= +\begin{chunk}{psfiles/drwfilled} /psDrawFilled { gsave newpath @@ -20638,11 +20632,11 @@ region with background color (default: 1, or white). grestore } def -@ +\end{chunk} \subsection{end} \index{psfiles!end} \index{end psfiles} -<>= +\begin{chunk}{psfiles/end} cleartomark %% clearing operand stack @@ -20651,7 +20645,7 @@ end %% pops mainDict from dictionary stack showpage %-------------------------- end --------------------------% -@ +\end{chunk} \subsection{fillarc} \begin{verbatim} operand stack configuration in order to use psFillArc: @@ -20672,7 +20666,7 @@ This function uses "scale" to make cricles and ellipses. \end{verbatim} \index{psfiles!fillarc} \index{fillarc psfiles} -<>= +\begin{chunk}{psfiles/fillarc} /psFillArc { gsave yVal moveto @@ -20693,7 +20687,7 @@ This function uses "scale" to make cricles and ellipses. grestore } def -@ +\end{chunk} \subsection{fillpoly} \begin{verbatim} operand stack configuration in order to use psDrawFilled: @@ -20710,7 +20704,7 @@ region with foreground color \end{verbatim} \index{psfiles!fillpoly} \index{fillpoly psfiles} -<>= +\begin{chunk}{psfiles/fillpoly} /psFillPoly { gsave newpath @@ -20723,7 +20717,7 @@ region with foreground color grestore } def -@ +\end{chunk} \subsection{fillwol} \begin{verbatim} operand stack configuration in order to use psDrawFilled: @@ -20740,7 +20734,7 @@ region with background color (default: 1, or white). \end{verbatim} \index{psfiles!fillwol} \index{fillwol psfiles} -<>= +\begin{chunk}{psfiles/fillwol} /psFillwOutline { gsave newpath @@ -20754,13 +20748,13 @@ region with background color (default: 1, or white). 0 setgray stroke grestore end } %% outline it with black def -@ +\end{chunk} \subsection{header} \begin{verbatim} \end{verbatim} \index{psfiles!header} \index{header psfiles} -<>= +\begin{chunk}{psfiles/header} %!PS-Adobe-2.0 %%DocumentFonts: Times-Roman %%Creator: Axiom @@ -20917,18 +20911,18 @@ region with background color (default: 1, or white). {LineWidth setlinewidth} if } %% line width def -@ +\end{chunk} \subsection{setup} \index{psfiles!setup} \index{setup psfiles} -<>= +\begin{chunk}{psfiles/setup} %-------------------------- script --------------------------% % 1 inch 1 inch translate mark %% mark bottom of our stack -@ +\end{chunk} \chapter{The APIs} \label{TheAPIs} \section{Graphics API} @@ -21548,8 +21542,7 @@ information macros or functions. \item XSelectInput(dsply, menu, KeyPressMask|ButtonPressMask|ExposureMask); \end{itemize} \chapter{Makefile} -\label{Makefile} -<<*>>= +\begin{chunk}{*} BOOK=${SPD}/books/bookvol8.pamphlet WORK=${OBJ}/${SYS}/graph OUTLIB= ${MNT}/${SYS}/lib @@ -21557,6 +21550,7 @@ OUTBIN= ${MNT}/${SYS}/bin LIB= ${OBJ}/${SYS}/lib TESTFILE=${MNT}/${SYS}/graph/parabola.view PS= ${MNT}/${SYS}/lib/graph +LISP =${OBJ}/${SYS}/bin/lisp PSFiles= ${PS}/colorpoly.ps ${PS}/colorwol.ps ${PS}/draw.ps \ ${PS}/drawIstr.ps ${PS}/drawarc.ps ${PS}/drawcolor.ps \ @@ -21588,42 +21582,45 @@ dirs: ${OUTLIB}/viewman: ${BOOK} @ echo 2 making ${OUTLIB}/viewman from ${BOOK} @( cd ${WORK} ; \ - ${TANGLE} -R"viewman" ${BOOK} >viewman.c ; \ + echo '(tangle "${BOOK}" "viewman" "viewman.c")' | ${LISP} ; \ ${CC} ${CFLAGS} -c viewman.c ; \ ${CC} ${VLIBS} viewman.o -o ${OUTLIB}/viewman ${LDFLAGS} ) ${OUTLIB}/view2d: ${BOOK} @ echo 3 making ${OUTLIB}/view2d from ${BOOK} @( cd ${WORK} ; \ - ${TANGLE} -R"view2d" ${BOOK} >view2d.c ; \ + echo '(tangle "${BOOK}" "view2d" "view2d.c")' | ${LISP} ; \ ${CC} ${CFLAGS} -c view2d.c ; \ ${CC} ${LIBS} view2d.o -o ${OUTLIB}/view2d ${LDFLAGS} ) ${OUTLIB}/view3d: ${BOOK} @ echo 4 making ${OUTLIB}/view3d from ${BOOK} @( cd ${WORK} ; \ - ${TANGLE} -R"view3d" ${BOOK} >view3d.c ; \ + echo '(tangle "${BOOK}" "view3d" "view3d.c")' | ${LISP} ; \ ${CC} ${CFLAGS} -c view3d.c ; \ ${CC} ${LIBS} view3d.o -o ${OUTLIB}/view3d ${LDFLAGS} ) ${OUTBIN}/viewalone: ${BOOK} @ echo 5 making ${OUTBIN}/viewalone from ${BOOK} @( cd ${WORK} ; \ - ${TANGLE} -R"viewalone" ${BOOK} >viewalone.c ; \ + echo '(tangle "${BOOK}" "viewalone" "viewalone.c")' \ + | ${LISP} ; \ ${CC} ${CFLAGS} -c viewalone.c ; \ ${CC} ${VLIBS} viewalone.o -o ${OUTBIN}/viewalone ${LDFLAGS} ) ${TESTFILE}/data: ${BOOK} @ echo 6 making ${TESTFILE} from ${BOOK} @ (cd ${TESTFILE} ; \ - ${TANGLE} -R"parabola.view/data" ${BOOK} >data ; \ - ${TANGLE} -R"parabola.view/graph0" ${BOOK} >graph0 ) + echo '(tangle "${BOOK}" "parabola.view/data" "data")' \ + | ${LISP} ; \ + echo '(tangle "${BOOK}" "parabola.view/graph0" "graph0")' \ + | ${LISP} ) ${PS}/%.ps: ${BOOK} @ echo 7 ${PS}/$*.ps from ${BOOK} - @ ${TANGLE} -R"psfiles/$*" ${BOOK} >${PS}/$*.ps + echo '(tangle "${BOOK}" "psfiles/$*" "${PS}/$*.ps")' | ${LISP} -@ +\end{chunk} \begin{thebibliography}{99} \bibitem{1} Jenks, R.J. and Sutor, R.S. ``Axiom -- The Scientific Computation System'' diff --git a/changelog b/changelog index bd10b31..a415e22 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20130429 tpd src/axiom-website/patches.html 20130429.01.tpd.patch +20130429 tpd books/bookvol8 convert bookvol8 from noweb to chunks +20130429 tpd src/Makefile convert bookvol8 from noweb to chunks +20130429 tpd books/Makefile convert bookvol8 from noweb to chunks 20130428 tpd src/axiom-website/patches.html 20130428.04.tpd.patch 20130428 tpd src/input/cherry.input annotate the integration routines 20130428 tpd buglist add bug 7241, fix the integration routines diff --git a/src/Makefile.pamphlet b/src/Makefile.pamphlet index fd029d0..b5eb02d 100644 --- a/src/Makefile.pamphlet +++ b/src/Makefile.pamphlet @@ -41,6 +41,7 @@ stanza to this Makefile you should check that list. <>= SETUP=scriptsdir libdir DIRS=${SRCDIRS} +LTANGLE=${OBJ}/${SYS}/bin/lisp @ \subsection{The scripts directory} @@ -113,7 +114,7 @@ smandir: ${SPD}/books/bookvol6.pamphlet @mkdir -p ${MNT}/${SYS}/doc/src/sman @( cd sman ; \ echo '(tangle "${SPD}/books/bookvol6.pamphlet" "*" "Makefile")' \ - | ${OBJ}/${SYS}/bin/lisp ; \ + | ${LTANGLE} ; \ ${ENV} ${MAKE} ) @ @@ -274,7 +275,7 @@ interpdir: ${SRC}/interp/Makefile @cp ${SPD}/books/bookvol10.5.pamphlet interp @(cd ${MNT}/${SYS}/doc ; \ echo '(tangle "${SPD}/books/bookvol7.1.pamphlet" "util.ht" "util.ht")' \ - | ${OBJ}/${SYS}/bin/lisp ) + | ${LTANGLE} ) @(cd interp ; ${ENV} ${MAKE} ) ${SRC}/interp/Makefile: ${SRC}/interp/Makefile.pamphlet @@ -420,12 +421,12 @@ hyperdir: ${SPD}/books/bookvol7.pamphlet ${SPD}/books/bookvol7.1.pamphlet @mkdir -p ${MNT}/${SYS}/doc/src/hyper @(cd ${INT}/hyper ; \ echo '(tangle "${SPD}/books/bookvol7.pamphlet" "*" "Makefile")' \ - | ${OBJ}/${SYS}/bin/lisp ; \ + | ${LTANGLE} ; \ ${ENV} ${MAKE} ) @echo 7.1 making pages from bookvol7.1 ${ENV} @(cd ${INT}/hyper ; \ echo '(tangle "${SPD}/books/bookvol7.1.pamphlet" "*" "Makefile")' \ - | ${OBJ}/${SYS}/bin/lisp ; \ + | ${LTANGLE} ; \ ${ENV} ${MAKE} ) @ @@ -435,7 +436,8 @@ graphdir: ${SPD}/books/bookvol8.pamphlet @echo 8 making graph from bookvol8 @mkdir -p ${OBJ}/${SYS}/graph @(cd ${OBJ}/${SYS}/graph ; \ - ${TANGLE} -t8 ${SPD}/books/bookvol8.pamphlet >Makefile ; \ + echo '(tangle "${SPD}/books/bookvol8.pamphlet" "*" "Makefile")' \ + | ${LTANGLE} ; \ ${ENV} ${MAKE} ) @ diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index ede3762..72483d6 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -4155,6 +4155,8 @@ books/bookheader.tex standardize the book headers books/bookvol* use bookheader.tex 20130428.04.tpd.patch src/input/cherry.input annotate the integration routines +20130429.01.tpd.patch +books/bookvol8 convert bookvol8 from noweb to chunks