diff options
Diffstat (limited to 'src/graph/viewAlone')
-rw-r--r-- | src/graph/viewAlone/Makefile.in | 16 | ||||
-rw-r--r--[-rwxr-xr-x] | src/graph/viewAlone/parabola.VIEW/bitmap | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/graph/viewAlone/parabola.VIEW/data | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/graph/viewAlone/parabola.VIEW/graph0 | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | src/graph/viewAlone/parabola.VIEW/pixmap | bin | 156472 -> 156472 bytes | |||
-rw-r--r-- | src/graph/viewAlone/spoon2D.c (renamed from src/graph/viewAlone/spoon2D.c.pamphlet) | 166 | ||||
-rw-r--r-- | src/graph/viewAlone/spoonComp.c (renamed from src/graph/viewAlone/spoonComp.c.pamphlet) | 172 | ||||
-rw-r--r-- | src/graph/viewAlone/viewAlone.c | 120 | ||||
-rw-r--r-- | src/graph/viewAlone/viewAlone.c.pamphlet | 140 | ||||
-rw-r--r--[-rwxr-xr-x] | src/graph/viewAlone/viewAlone.h | 52 |
10 files changed, 300 insertions, 366 deletions
diff --git a/src/graph/viewAlone/Makefile.in b/src/graph/viewAlone/Makefile.in index dc65043a..7cb466fa 100644 --- a/src/graph/viewAlone/Makefile.in +++ b/src/graph/viewAlone/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2007, Gabriel Dos Reis. +# Copyright (C) 2007-2008, Gabriel Dos Reis. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,17 +40,13 @@ build_libdir = $(abs_top_builddir)/src/lib bin_PROGRAMS = viewAlone$(EXEEXT) -viewAlone_sources = viewAlone.c spoonComp.c spoon2D.c +viewAlone_SOURCES = viewAlone.c spoonComp.c spoon2D.c -viewAlone_SOURCES = $(addsuffix .pamphlet, $(viewAlone_sources)) - -viewAlone_objects = $(viewAlone_sources:.c=.lo) +viewAlone_objects = $(viewAlone_SOURCES:.c=.lo) viewAlone_LDADD = $(axiom_target_libdir)/libspad.la viewAlone_DEPENDENCIES = -pamphlets = Makefile.pamphlet $(viewAlone_SOURCES) - subdir = src/graph/viewAlone/ AXIOM_CFLAGS = ${CCF} ${AXIOM_X11_CFLAGS} -I$(srcdir) -I${LINC} -I${GINC} \ @@ -76,20 +72,16 @@ $(axiom_target_bindir)/viewAlone$(EXEEXT): $(viewAlone_objects) \ $(AXIOM_X11_LDFLAGS) .PRECIOUS: %.lo -.PRECIOUS: %.c %.lo: $(HEADERS) %.lo: %.c $(axiom_c_macros_h) $(COMPILE) -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $< -%.c: $(srcdir)/%.c.pamphlet - $(axiom_build_document) --tangle --output=$@ $< - mostlyclean-local: clean-local: mostlyclean-local - @rm -f $(viewAlone_sources) $(viewAlone_objects) + @rm -f $(viewAlone_objects) @rm -f $(axiom_target_bindir)/viewAlone$(EXEEXT) distclean-local: clean-local diff --git a/src/graph/viewAlone/parabola.VIEW/bitmap b/src/graph/viewAlone/parabola.VIEW/bitmap index 1ebff188..1ebff188 100755..100644 --- a/src/graph/viewAlone/parabola.VIEW/bitmap +++ b/src/graph/viewAlone/parabola.VIEW/bitmap diff --git a/src/graph/viewAlone/parabola.VIEW/data b/src/graph/viewAlone/parabola.VIEW/data index 487adba0..487adba0 100755..100644 --- a/src/graph/viewAlone/parabola.VIEW/data +++ b/src/graph/viewAlone/parabola.VIEW/data diff --git a/src/graph/viewAlone/parabola.VIEW/graph0 b/src/graph/viewAlone/parabola.VIEW/graph0 index cc962f2f..cc962f2f 100755..100644 --- a/src/graph/viewAlone/parabola.VIEW/graph0 +++ b/src/graph/viewAlone/parabola.VIEW/graph0 diff --git a/src/graph/viewAlone/parabola.VIEW/pixmap b/src/graph/viewAlone/parabola.VIEW/pixmap Binary files differindex 9e1d5778..9e1d5778 100755..100644 --- a/src/graph/viewAlone/parabola.VIEW/pixmap +++ b/src/graph/viewAlone/parabola.VIEW/pixmap diff --git a/src/graph/viewAlone/spoon2D.c.pamphlet b/src/graph/viewAlone/spoon2D.c index b06da50f..054ed5a3 100644 --- a/src/graph/viewAlone/spoon2D.c.pamphlet +++ b/src/graph/viewAlone/spoon2D.c @@ -1,51 +1,37 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/graph/viewAlone spoon2D.c} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{License} -<<license>>= /* -Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - - Neither the name of The Numerical ALgorithms Group Ltd. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd. + All rights reserved. + Copyright (C) 2007-2008, Gabriel Dos Reis. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@ -<<*>>= -<<license>> #define _SPOON2D_C #include "axiom-c-macros.h" @@ -248,57 +234,57 @@ makeView2DFromFileData(view2DStruct *doView2D) fgets(title,256,viewFile); printf("(spoon2D) title=%s\n",title); if (!(doView2D->title = - (char *)malloc((strlen(title)+1) * sizeof(char)))) { + (char *)malloc((strlen(title)+1) * sizeof(char)))) { fprintf(stderr, - "Ran out of memory (malloc) trying to get the title.\n"); + "Ran out of memory (malloc) trying to get the title.\n"); exit(-1); } sprintf(doView2D->title,"%s",title); /* put in a null terminator over the newline that the fgets reads */ doView2D->title[strlen(doView2D->title)-1] = '\0'; fscanf(viewFile,"%d %d %d %d\n", - &(doView2D->vX), - &(doView2D->vY), - &(doView2D->vW), - &(doView2D->vH)); + &(doView2D->vX), + &(doView2D->vY), + &(doView2D->vW), + &(doView2D->vH)); printf("(spoon2D) X=%d Y=%d W=%d H=%d \n", doView2D->vX,doView2D->vY,doView2D->vW,doView2D->vH); for (i=0; i<maxGraphs; i++) { fscanf(viewFile,"%d\n", - &(graphArray[i].key)); + &(graphArray[i].key)); printf("(spoon2D) i=%d key=%d\n", i,graphArray[i].key); fscanf(viewFile,"%g %g\n", - &(graphStateArray[i].scaleX), - &(graphStateArray[i].scaleY)); + &(graphStateArray[i].scaleX), + &(graphStateArray[i].scaleY)); printf("(spoon2D) scaleX=%g scaleY=%g\n", - graphStateArray[i].scaleX,graphStateArray[i].scaleY); + graphStateArray[i].scaleX,graphStateArray[i].scaleY); fscanf(viewFile,"%g %g\n", - &(graphStateArray[i].deltaX), - &(graphStateArray[i].deltaY)); + &(graphStateArray[i].deltaX), + &(graphStateArray[i].deltaY)); printf("(spoon2D) deltaX=%g deltaY=%g\n", - graphStateArray[i].deltaX,graphStateArray[i].deltaY); + graphStateArray[i].deltaX,graphStateArray[i].deltaY); fscanf(viewFile,"%g %g\n", - &(graphStateArray[i].centerX), - &(graphStateArray[i].centerY)); + &(graphStateArray[i].centerX), + &(graphStateArray[i].centerY)); printf("(spoon2D) centerX=%g centerY=%g\n", - graphStateArray[i].centerX,graphStateArray[i].centerY); + graphStateArray[i].centerX,graphStateArray[i].centerY); fscanf(viewFile,"%d %d %d %d %d %d %d\n", - &(graphStateArray[i].pointsOn), - &(graphStateArray[i].connectOn), - &(graphStateArray[i].splineOn), - &(graphStateArray[i].axesOn), - &(graphStateArray[i].axesColor), - &(graphStateArray[i].unitsOn), - &(graphStateArray[i].unitsColor)); + &(graphStateArray[i].pointsOn), + &(graphStateArray[i].connectOn), + &(graphStateArray[i].splineOn), + &(graphStateArray[i].axesOn), + &(graphStateArray[i].axesColor), + &(graphStateArray[i].unitsOn), + &(graphStateArray[i].unitsColor)); printf("(spoon2D) pointsOn=%d connectOn=%d splineOn=%d axesOn=%d axesColor=%d unitsOn=%d unitsColor=%d\n", graphStateArray[i].pointsOn,graphStateArray[i].connectOn, graphStateArray[i].splineOn,graphStateArray[i].axesOn, graphStateArray[i].axesColor,graphStateArray[i].unitsOn, graphStateArray[i].unitsColor); fscanf(viewFile,"%d %d\n", - &(graphStateArray[i].showing), - &(graphStateArray[i].selected)); + &(graphStateArray[i].showing), + &(graphStateArray[i].selected)); printf("(spoon2D) showing=%d selected=%d\n", graphStateArray[i].showing,graphStateArray[i].selected); } @@ -315,39 +301,39 @@ makeView2DFromFileData(view2DStruct *doView2D) printf("(spoon2d) \n\nGRAPH%i\n",i); fscanf(graphFile,"%g %g %g %g\n", &(graphArray[i].xmin), - &(graphArray[i].ymin), + &(graphArray[i].ymin), &(graphArray[i].xmax), - &(graphArray[i].ymax)); + &(graphArray[i].ymax)); printf("(spoon2d) xmin=%g ymin=%g xmax=%g ymax=%g\n", graphArray[i].xmin,graphArray[i].ymin, graphArray[i].xmax,graphArray[i].ymax); fscanf(graphFile,"%g %g\n", &(graphArray[i].xNorm), - &(graphArray[i].yNorm)); + &(graphArray[i].yNorm)); printf("(spoon2d) xNorm=%g yNorm=%g\n", graphArray[i].xNorm,graphArray[i].yNorm); fscanf(graphFile,"%g %g\n", &(graphArray[i].originX), - &(graphArray[i].originY)); + &(graphArray[i].originY)); printf("(spoon2d) originX=%g originY=%g\n", graphArray[i].originX,graphArray[i].originY); fscanf(graphFile,"%g %g\n", &(graphArray[i].spadUnitX), - &(graphArray[i].spadUnitY)); + &(graphArray[i].spadUnitY)); printf("(spoon2d) spadUnitX=%g spadUnitY=%g\n", graphArray[i].spadUnitX,graphArray[i].spadUnitY); fscanf(graphFile,"%g %g\n", &(graphArray[i].unitX), - &(graphArray[i].unitY)); + &(graphArray[i].unitY)); printf("(spoon2d) unitX=%g unitY=%g\n", graphArray[i].unitX,graphArray[i].unitY); fscanf(graphFile,"%d\n", - &(graphArray[i].numberOfLists)); + &(graphArray[i].numberOfLists)); printf("(spoon2d) numberOfLists=%d\n", - graphArray[i].numberOfLists); + graphArray[i].numberOfLists); if (!(aList = (pointListStruct *)malloc(graphArray[i].numberOfLists * - sizeof(pointListStruct)))) { + sizeof(pointListStruct)))) { fprintf(stderr,"viewAlone: Fatal Error>> Out of memory trying to receive a graph.\n"); exit(-1); } @@ -361,12 +347,12 @@ makeView2DFromFileData(view2DStruct *doView2D) aList->numberOfPoints); fscanf(graphFile,"%d %d %d\n", &(aList->pointColor), - &(aList->lineColor), - &(aList->pointSize)); + &(aList->lineColor), + &(aList->pointSize)); printf("(spoon2d) pointColor=%d lineColor=%d pointSize=%d\n", aList->pointColor,aList->lineColor,aList->pointSize); if (!(aPoint = (pointStruct *)malloc(aList->numberOfPoints * - sizeof(pointStruct)))) { + sizeof(pointStruct)))) { fprintf(stderr,"viewAlone: Fatal Error>> Out of memory trying to receive a graph.\n"); exit(-1); } @@ -375,10 +361,10 @@ makeView2DFromFileData(view2DStruct *doView2D) k<aList->numberOfPoints; k++,aPoint++) { fscanf(graphFile,"%g %g %g %g\n", - &(aPoint->x), - &(aPoint->y), - &(aPoint->hue), - &(aPoint->shade)); + &(aPoint->x), + &(aPoint->y), + &(aPoint->hue), + &(aPoint->shade)); printf("(spoon2d)k=%d x=%g y=%g hue=%g shade=%g\n", k,aPoint->x,aPoint->y,aPoint->hue,aPoint->shade); } @@ -388,9 +374,3 @@ makeView2DFromFileData(view2DStruct *doView2D) } /* if graph.key */ } /* for i */ } /* makeView2DFromFileData */ -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/graph/viewAlone/spoonComp.c.pamphlet b/src/graph/viewAlone/spoonComp.c index d0b72ed5..857c3d5c 100644 --- a/src/graph/viewAlone/spoonComp.c.pamphlet +++ b/src/graph/viewAlone/spoonComp.c @@ -1,51 +1,37 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/graph/viewAlone spoonComp.c} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{License} -<<license>>= /* -Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -All rights reserved. + Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd. + All rights reserved. + Copyright (C) 2007-2008, Gabriel Dos Reis. + All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. - - Neither the name of The Numerical ALgorithms Group Ltd. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@ -<<*>>= -<<license>> #define _SPOONCOMP_C #include "axiom-c-macros.h" @@ -92,7 +78,7 @@ spoonView3D(int type) case 0: /* Child */ sprintf(errorStr,"%s", - "(viewAlone) mapping of pipes to standard I/O for view3D"); + "(viewAlone) mapping of pipes to standard I/O for view3D"); check(dup2(pipe0[0],0)); check(dup2(pipe1[1],1)); close(pipe0[0]); @@ -101,7 +87,7 @@ spoonView3D(int type) close(pipe1[1]); sprintf(errorStr,"%s", - "(viewAlone) execution of the ThreeDimensionalViewport process"); + "(viewAlone) execution of the ThreeDimensionalViewport process"); sprintf(envAXIOM,"%s",getenv("AXIOM")); sprintf(runView,"%s%s",envAXIOM,"/lib/view3D"); check(execl(runView,runView,NULL)); @@ -120,7 +106,7 @@ spoonView3D(int type) if (viewP.viewIn <0) { fprintf(stderr, - "can't set up pipes to viewport process. Try again.\n"); + "can't set up pipes to viewport process. Try again.\n"); return; } else { code = read(viewP.viewIn,&ack,intSize); @@ -138,9 +124,9 @@ spoonView3D(int type) write(viewP.viewOut,&doView3D,sizeof(view3DStruct)); i = strlen(doView3D.title)+1; write(viewP.viewOut,&i,intSize); /* tell the length of - the title to child */ + the title to child */ write(viewP.viewOut,doView3D.title,i); /* tell the title - to the child, child */ + to the child, child */ write(viewP.viewOut,&(doView3D.lightVec[0]),floatSize); write(viewP.viewOut,&(doView3D.lightVec[1]),floatSize); write(viewP.viewOut,&(doView3D.lightVec[2]),floatSize); @@ -203,16 +189,16 @@ makeView3DFromFileData(int type) /* &view3DType already read */ doView3D.typeOf3D = type; fscanf(viewFile,"%f %f %f %f %f %f\n", - &(doView3D.xmin), - &(doView3D.xmax), - &(doView3D.ymin), - &(doView3D.ymax), - &(doView3D.zmin), - &(doView3D.zmax)); + &(doView3D.xmin), + &(doView3D.xmax), + &(doView3D.ymin), + &(doView3D.ymax), + &(doView3D.zmin), + &(doView3D.zmax)); fgets(title,256,viewFile); if (!(doView3D.title = (char *)malloc((strlen(title)+1) * - sizeof(char)))) { + sizeof(char)))) { fprintf(stderr,"Ran out of memory (malloc) trying to get the title.\n"); exit(-1); } @@ -221,67 +207,67 @@ makeView3DFromFileData(int type) doView3D.title[strlen(doView3D.title)-1] = '\0'; fscanf(viewFile,"%f %f %f %f %f %f %f %f\n", - &(doView3D.deltaX), - &(doView3D.deltaY), - &(doView3D.scale), - &(doView3D.scaleX), - &(doView3D.scaleY), - &(doView3D.scaleZ), - &(doView3D.theta), - &(doView3D.phi)); + &(doView3D.deltaX), + &(doView3D.deltaY), + &(doView3D.scale), + &(doView3D.scaleX), + &(doView3D.scaleY), + &(doView3D.scaleZ), + &(doView3D.theta), + &(doView3D.phi)); fscanf(viewFile,"%d %d %d %d\n", - &(doView3D.vX), - &(doView3D.vY), - &(doView3D.vW), - &(doView3D.vH)); + &(doView3D.vX), + &(doView3D.vY), + &(doView3D.vW), + &(doView3D.vH)); fscanf(viewFile,"%d %d %d %d %d %d %d\n", - &(doView3D.showCP), - &(doView3D.style), - &(doView3D.AxesOn), - &(doView3D.hueOff), - &(doView3D.numOfHues), - &(doView3D.diagonals), - &(doView3D.outlineRenderOn)); + &(doView3D.showCP), + &(doView3D.style), + &(doView3D.AxesOn), + &(doView3D.hueOff), + &(doView3D.numOfHues), + &(doView3D.diagonals), + &(doView3D.outlineRenderOn)); fscanf(viewFile,"%f %f %f %f\n", - &(doView3D.lightVec[0]), - &(doView3D.lightVec[1]), - &(doView3D.lightVec[2]), - &(doView3D.translucency)); + &(doView3D.lightVec[0]), + &(doView3D.lightVec[1]), + &(doView3D.lightVec[2]), + &(doView3D.translucency)); fscanf(viewFile,"%d %f\n", - &(doView3D.perspective), - &(doView3D.eyeDistance)); + &(doView3D.perspective), + &(doView3D.eyeDistance)); /* get generalized 3D components */ fscanf(viewFile,"%d\n", - &(doView3D.numOfPoints)); + &(doView3D.numOfPoints)); aPoint = doView3D.points = (viewTriple *)malloc(doView3D.numOfPoints* - sizeof(viewTriple)); + sizeof(viewTriple)); for (i=0; i<doView3D.numOfPoints; i++, aPoint++) fscanf(viewFile,"%g %g %g %g\n", &(aPoint->x), - &(aPoint->y), - &(aPoint->z), - &(aPoint->c)); + &(aPoint->y), + &(aPoint->z), + &(aPoint->c)); fscanf(viewFile,"%d\n", - &(doView3D.lllp.numOfComponents)); + &(doView3D.lllp.numOfComponents)); anLLPoint = doView3D.lllp.llp = (LLPoint *)malloc(doView3D.lllp.numOfComponents*sizeof(LLPoint)); for (i=0; i<doView3D.lllp.numOfComponents; i++,anLLPoint++) { fscanf(viewFile,"%d %d\n", - &(anLLPoint->prop.closed), - &(anLLPoint->prop.solid)); + &(anLLPoint->prop.closed), + &(anLLPoint->prop.solid)); fscanf(viewFile,"%d\n", - &(anLLPoint->numOfLists)); + &(anLLPoint->numOfLists)); anLPoint = anLLPoint->lp = (LPoint *)malloc(anLLPoint->numOfLists*sizeof(LPoint)); for (j=0; j<anLLPoint->numOfLists; j++,anLPoint++) { fscanf(viewFile,"%d %d\n", - &(anLPoint->prop.closed), - &(anLPoint->prop.solid)); + &(anLPoint->prop.closed), + &(anLPoint->prop.solid)); fscanf(viewFile,"%d\n", - &(anLPoint->numOfPoints)); + &(anLPoint->numOfPoints)); anIndex = anLPoint->indices = (int *)malloc(anLPoint->numOfPoints*sizeof(int)); for (k=0; k<anLPoint->numOfPoints; k++,anIndex++) { @@ -294,9 +280,3 @@ makeView3DFromFileData(int type) doView3D.scaleDown = no ; } -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/graph/viewAlone/viewAlone.c b/src/graph/viewAlone/viewAlone.c new file mode 100644 index 00000000..4d18ecc3 --- /dev/null +++ b/src/graph/viewAlone/viewAlone.c @@ -0,0 +1,120 @@ +/* + Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd. + All rights reserved. + Copyright (C) 2007-2008, Gabriel Dos Reis. + all rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#define _VIEWALONE_C +#include "axiom-c-macros.h" + +#include <stdlib.h> +#include "viewAlone.h" + +#include "all_alone.H1" + +/************* global variables **************/ + +viewManager viewP; /* note that in viewman, this is called viewports */ + +/* 3D stuff */ +view3DStruct doView3D; + +/* 2D stuff */ +view2DStruct doView2D; +graphStruct graphArray[maxGraphs]; +graphStateStruct graphStateArray[maxGraphs]; + +/* tube stuff */ +tubeModel doViewTube; + +int viewType; +int filedes,ack; + +char errorStr[80]; + + +int viewOkay = 0; +int viewError = -1; + +FILE *viewFile; +char filename[256]; +char pathname[256]; + +/************* main program **************/ + +#ifdef _NO_PROTO +int main (argc,argv) + int argc; + char *argv[]; +#else +int main (int argc,char *argv[]) +#endif +{ + printf("viewAlone called with argc=%d\n",argc); + printf("viewAlone called with argv[1]=%s\n",argv[0]); + printf("viewAlone called with argv[2]=%s\n",argv[1]); +/******** Open files and Figure out the viewport type ********/ + + sprintf(filename,"%s%s",argv[1],".VIEW/data"); + if((viewFile = fopen(filename,"r")) == NULL ) { + + sprintf(filename,"%s%s",argv[1],"/data"); + if((viewFile = fopen(filename,"r")) == NULL ){ + fprintf(stderr,"Error: Cannot find the file %s%s or %s%s\n", + argv[1],".VIEW/data",argv[1],"/data"); + exit(-1); + } + sprintf(pathname,"%s",argv[1]); + } + else{ + sprintf(pathname,"%s%s",argv[1],".VIEW"); + } + fscanf(viewFile,"%d\n",&viewType); + printf("filename = %s\n",filename); + printf("viewType = %d\n",viewType); + switch (viewType) { + + case view3DType: + case viewTubeType: + printf("calling spoonView3D\n"); + spoonView3D(viewType); + break; + + case view2DType: + printf("calling spoonView2D\n"); + spoonView2D(); + break; + + } /* switch */ + printf("The first number in the file, %d, called the viewType, not a valid value. It must be a number in the range of [1..4]\n",viewType); + return(0); + } diff --git a/src/graph/viewAlone/viewAlone.c.pamphlet b/src/graph/viewAlone/viewAlone.c.pamphlet deleted file mode 100644 index 5d178583..00000000 --- a/src/graph/viewAlone/viewAlone.c.pamphlet +++ /dev/null @@ -1,140 +0,0 @@ -\documentclass{article} -\usepackage{axiom} -\begin{document} -\title{\$SPAD/src/graph/viewAlone viewAlone.c} -\author{The Axiom Team} -\maketitle -\begin{abstract} -\end{abstract} -\eject -\tableofcontents -\eject -\section{License} -<<license>>= -/* -Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - - Neither the name of The Numerical ALgorithms Group Ltd. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -@ -<<*>>= -<<license>> - -#define _VIEWALONE_C -#include "axiom-c-macros.h" - -#include <stdlib.h> -#include "viewAlone.h" - -#include "all_alone.H1" - -/************* global variables **************/ - -viewManager viewP; /* note that in viewman, this is called viewports */ - -/* 3D stuff */ -view3DStruct doView3D; - -/* 2D stuff */ -view2DStruct doView2D; -graphStruct graphArray[maxGraphs]; -graphStateStruct graphStateArray[maxGraphs]; - -/* tube stuff */ -tubeModel doViewTube; - -int viewType; -int filedes,ack; - -char errorStr[80]; - - -int viewOkay = 0; -int viewError = -1; - -FILE *viewFile; -char filename[256]; -char pathname[256]; - -/************* main program **************/ - -#ifdef _NO_PROTO -int main (argc,argv) - int argc; - char *argv[]; -#else -int main (int argc,char *argv[]) -#endif -{ - printf("viewAlone called with argc=%d\n",argc); - printf("viewAlone called with argv[1]=%s\n",argv[0]); - printf("viewAlone called with argv[2]=%s\n",argv[1]); -/******** Open files and Figure out the viewport type ********/ - - sprintf(filename,"%s%s",argv[1],".VIEW/data"); - if((viewFile = fopen(filename,"r")) == NULL ) { - - sprintf(filename,"%s%s",argv[1],"/data"); - if((viewFile = fopen(filename,"r")) == NULL ){ - fprintf(stderr,"Error: Cannot find the file %s%s or %s%s\n", - argv[1],".VIEW/data",argv[1],"/data"); - exit(-1); - } - sprintf(pathname,"%s",argv[1]); - } - else{ - sprintf(pathname,"%s%s",argv[1],".VIEW"); - } - fscanf(viewFile,"%d\n",&viewType); - printf("filename = %s\n",filename); - printf("viewType = %d\n",viewType); - switch (viewType) { - - case view3DType: - case viewTubeType: - printf("calling spoonView3D\n"); - spoonView3D(viewType); - break; - - case view2DType: - printf("calling spoonView2D\n"); - spoonView2D(); - break; - - } /* switch */ - printf("The first number in the file, %d, called the viewType, not a valid value. It must be a number in the range of [1..4]\n",viewType); - return(0); - } -@ -\eject -\begin{thebibliography}{99} -\bibitem{1} nothing -\end{thebibliography} -\end{document} diff --git a/src/graph/viewAlone/viewAlone.h b/src/graph/viewAlone/viewAlone.h index 686f2d55..a2d5d5fe 100755..100644 --- a/src/graph/viewAlone/viewAlone.h +++ b/src/graph/viewAlone/viewAlone.h @@ -1,34 +1,36 @@ /* -Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -All rights reserved. + Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd. + All rights reserved. + Copyright (C) 2007-2008, Gabriel Dos Reis. + All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. - - Neither the name of The Numerical ALgorithms Group Ltd. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + - Neither the name of The Numerical ALgorithms Group Ltd. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <stdio.h> |