00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 static char *id="@(#) $Id: shpln.c,v 1.2 2006/08/17 19:28:17 mhender Exp $";
00018
00019 #include <shInternal.h>
00020
00033 void shpln(int *i,float *ox,float *oy,float *oz,float *nx,float *ny,float *nz,int *iside)
00034 {
00035 int ip;
00036
00037 ip=(*i)-1;
00038
00039
00040
00041 if(*i>=sh_mplns)
00042 {
00043 if(sh_mplns==0)
00044 {
00045 sh_mplns=10;
00046 sh_plno=(float*)malloc(3*sh_mplns*sizeof(float));
00047 sh_plnn=(float*)malloc(3*sh_mplns*sizeof(float));
00048 sh_ipln=(int*)malloc(sh_mplns*sizeof(int));
00049 sh_oper=(int*)malloc(sh_mplns*sizeof(int));
00050 }else{
00051 sh_mplns+=10;
00052 sh_plno=(float*)realloc((void*)sh_plno,3*sh_mplns*sizeof(float));
00053 sh_plnn=(float*)realloc((void*)sh_plnn,3*sh_mplns*sizeof(float));
00054 sh_ipln=(int*)realloc((void*)sh_ipln,sh_mplns*sizeof(int));
00055 sh_oper=(int*)realloc((void*)sh_oper,sh_mplns*sizeof(int));
00056 }
00057 }
00058
00059 sh_plno[ 3*ip]=*ox;
00060 sh_plno[1+3*ip]=*oy;
00061 sh_plno[2+3*ip]=*oz;
00062
00063 sh_plnn[ 3*ip]=*nx;
00064 sh_plnn[1+3*ip]=*ny;
00065 sh_plnn[2+3*ip]=*nz;
00066
00067 sh_ipln[ip]=*iside;
00068 sh_oper[ip]=0;
00069
00070
00071
00072
00073 return;
00074 }