Changeset 20936 for trunk/Ohana/src/opihi/dvo/imdense.c
- Timestamp:
- Dec 7, 2008, 3:31:01 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/imdense.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/imdense.c
r19823 r20936 30 30 srand48(B); 31 31 32 N = 0; 32 33 NPTS = 200; 33 ALLOCATE (Xvec.elements, float, NPTS);34 ALLOCATE (Yvec.elements, float, NPTS);35 N = 0; 34 SetVector (&Xvec, OPIHI_FLT, NPTS); 35 SetVector (&Yvec, OPIHI_FLT, NPTS); 36 36 37 for (i = 0; i < Nimage; i++) { 37 38 /* choose a position for point within image box */ … … 45 46 while (r < Rmin) r += 360.0; 46 47 while (r > Rmax) r -= 360.0; 47 status |= fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, d, &graphmode.coords);48 if ((Xvec.elements [N] >= graphmode.xmin) &&49 (Xvec.elements [N] <= graphmode.xmax) &&50 (Yvec.elements [N] >= graphmode.ymin) &&51 (Yvec.elements [N] <= graphmode.ymax) && status) {48 status |= RD_to_XY (&Xvec.elements.Flt[N], &Yvec.elements.Flt[N], r, d, &graphmode.coords); 49 if ((Xvec.elements.Flt[N] >= graphmode.xmin) && 50 (Xvec.elements.Flt[N] <= graphmode.xmax) && 51 (Yvec.elements.Flt[N] >= graphmode.ymin) && 52 (Yvec.elements.Flt[N] <= graphmode.ymax) && status) { 52 53 N++; 53 54 if (N > NPTS - 1) { 54 55 NPTS += 200; 55 REALLOCATE (Xvec.elements , float, NPTS);56 REALLOCATE (Yvec.elements , float, NPTS);56 REALLOCATE (Xvec.elements.Flt, opihi_flt, NPTS); 57 REALLOCATE (Yvec.elements.Flt, opihi_flt, NPTS); 57 58 } 58 59 } 59 60 } 60 61 61 Xvec.Nelements = Xvec.Nelements = N;62 Xvec.Nelements = Yvec.Nelements = N; 62 63 if (N > 0) { 63 64 graphmode.style = 2; /* points */ 64 65 graphmode.etype = 0; 65 PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);66 PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode); 66 67 } 67 68 68 free (Xvec.elements );69 free (Yvec.elements );69 free (Xvec.elements.Flt); 70 free (Yvec.elements.Flt); 70 71 free (image); 71 72 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
