]> Pileus Git - grits/blob - src/misc.h
Adding a prefs dialog (which needs a lot more work)
[grits] / src / misc.h
1 #define d2r(deg) (((deg)*M_PI)/180.0)
2 #define r2d(rad) (((rad)*180.0)/M_PI)
3
4 #define RSL_FOREACH_VOL(radar, volume, count, index) \
5         guint count = 0; \
6         for (guint index = 0; index < radar->h.nvolumes; index++) { \
7                 Volume *volume = radar->v[index]; \
8                 if (volume == NULL) continue; \
9                 count++;
10
11 #define RSL_FOREACH_SWEEP(volume, sweep, count, index) \
12         guint count = 0; \
13         for (guint index = 0; index < volume->h.nsweeps; index++) { \
14                 Sweep *sweep = volume->sweep[index]; \
15                 if (sweep == NULL || sweep->h.elev == 0) continue; \
16                 count++;
17
18 #define RSL_FOREACH_RAY(sweep, ray, count, index) \
19         guint count = 0; \
20         for (guint index = 0; index < sweep->h.nrays; index++) { \
21                 Ray *ray = sweep->ray[index]; \
22                 if (ray == NULL) continue; \
23                 count++;
24
25 #define RSL_FOREACH_BIN(ray, bin, count, index) \
26         guint count = 0; \
27         for (guint index = 0; index < ray->h.nbins; index++) { \
28                 Range bin = ray->range[index]; \
29                 count++;
30
31 #define RSL_FOREACH_END }