00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef lint
00042 static const char RCSid[] = "@(#)$Header: /cvsroot/brlcad/brlcad/src/libbn/list.c,v 14.11 2006/09/05 04:19:55 lbutler Exp $ (BRL)";
00043 #endif
00044
00045 #include "common.h"
00046
00047
00048
00049 #include <stdio.h>
00050 #include "machine.h"
00051 #include "vmath.h"
00052 #include "plot3.h"
00053
00054
00055 #define TP_MARK 1
00056 #define TP_LINE 2
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 void
00067 tp_i2list(register FILE *fp, register int *x, register int *y, register int npoints)
00068
00069
00070
00071
00072 {
00073 if( npoints <= 0 )
00074 return;
00075
00076 pl_move( fp, *x++, *y++ );
00077 while( --npoints > 0 )
00078 pl_cont( fp, *x++, *y++ );
00079 }
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 void
00090 tp_2list(register FILE *fp, register double *x, register double *y, register int npoints)
00091
00092
00093
00094
00095 {
00096 if( npoints <= 0 )
00097 return;
00098
00099 pd_move( fp, *x++, *y++ );
00100 while( --npoints > 0 )
00101 pd_cont( fp, *x++, *y++ );
00102 }
00103
00104 void
00105 PL_FORTRAN(f2list, F2LIST)( fpp, x, y, n )
00106 FILE **fpp;
00107 register float *x;
00108 register float *y;
00109 int *n;
00110 {
00111 register int npoints = *n-1;
00112 register FILE *fp = *fpp;
00113
00114 if( npoints <= 0 )
00115 return;
00116
00117 pd_move( fp, *x++, *y++ );
00118 while( --npoints > 0 )
00119 pd_cont( fp, *x++, *y++ );
00120 }
00121
00122
00123
00124
00125 void
00126 tp_3list(FILE *fp, register double *x, register double *y, register double *z, register int npoints)
00127 {
00128 if( npoints <= 0 )
00129 return;
00130
00131 pd_3move( fp, *x++, *y++, *z++ );
00132 while( --npoints > 0 )
00133 pd_3cont( fp, *x++, *y++, *z++ );
00134 }
00135
00136 void
00137 PL_FORTRAN(f3list, F3LIST)( fpp, x, y, z, n )
00138 FILE **fpp;
00139 register float *x;
00140 register float *y;
00141 register float *z;
00142 int *n;
00143 {
00144 register int npoints = *n-1;
00145 register FILE *fp = *fpp;
00146
00147 if( npoints <= 0 )
00148 return;
00149
00150 pd_3move( fp, *x++, *y++, *z++ );
00151 while( --npoints > 0 )
00152 pd_3cont( fp, *x++, *y++, *z++ );
00153 }
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 void
00178 tp_2mlist(FILE *fp, register double *x, register double *y, int npoints, int flag, int mark, int interval, double size)
00179
00180
00181
00182
00183
00184
00185
00186
00187 {
00188 register int i;
00189 register int counter;
00190
00191 if( npoints <= 0 )
00192 return;
00193
00194 if( flag & TP_LINE )
00195 tp_2list( fp, x, y, npoints );
00196 if( flag & TP_MARK ) {
00197 tp_2marker( fp, mark, *x++, *y++, size );
00198 counter = 1;
00199 for( i=1; i<npoints; i++ ) {
00200 if( counter >= interval ) {
00201 tp_2marker( fp, mark, *x, *y, size );
00202 counter = 0;
00203 }
00204 x++; y++;
00205 counter++;
00206 }
00207 }
00208 }
00209
00210
00211
00212
00213 void
00214 PL_FORTRAN(f2mlst, F2MLST)( fp, x, y, np, flag, mark, interval, size )
00215 FILE **fp;
00216 float *x;
00217 float *y;
00218 int *np;
00219 int *flag;
00220 int *mark;
00221 int *interval;
00222 float *size;
00223 {
00224 register int i;
00225 register int counter;
00226 register int npoints = *np-1;
00227
00228 if( npoints <= 0 )
00229 return;
00230
00231 if( *flag & TP_LINE )
00232 PL_FORTRAN(f2list,F2LIST)( fp, x, y, np );
00233 if( *flag & TP_MARK ) {
00234 tp_2marker( *fp, *mark, *x++, *y++, *size );
00235 counter = 1;
00236 for( i=1; i<npoints; i++ ) {
00237 if( counter >= *interval ) {
00238 tp_2marker( *fp, *mark, *x, *y, *size );
00239 counter = 0;
00240 }
00241 x++; y++;
00242 counter++;
00243 }
00244 }
00245 }
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255