X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fplugins%2Fradar.h;h=34a260752ab7e7b5c2d9bceef1e6a736bd6b8172;hp=c4b74beab4c85b469a68638788b07f118fa4ad13;hb=7200f71a7275a4ca3faa4d3d8182720fcc0b9496;hpb=a460b41527a09a681bc0ca4e161aec2cc1efab3d diff --git a/src/plugins/radar.h b/src/plugins/radar.h index c4b74be..34a2607 100644 --- a/src/plugins/radar.h +++ b/src/plugins/radar.h @@ -75,4 +75,34 @@ GType gis_plugin_radar_get_type(); /* Methods */ GisPluginRadar *gis_plugin_radar_new(GisWorld *world, GisView *view, GisOpenGL *opengl, GisPrefs *prefs); +/* Misc. RSL helpers */ +#define RSL_FOREACH_VOL(radar, volume, count, index) \ + guint count = 0; \ + for (guint index = 0; index < radar->h.nvolumes; index++) { \ + Volume *volume = radar->v[index]; \ + if (volume == NULL) continue; \ + count++; + +#define RSL_FOREACH_SWEEP(volume, sweep, count, index) \ + guint count = 0; \ + for (guint index = 0; index < volume->h.nsweeps; index++) { \ + Sweep *sweep = volume->sweep[index]; \ + if (sweep == NULL || sweep->h.elev == 0) continue; \ + count++; + +#define RSL_FOREACH_RAY(sweep, ray, count, index) \ + guint count = 0; \ + for (guint index = 0; index < sweep->h.nrays; index++) { \ + Ray *ray = sweep->ray[index]; \ + if (ray == NULL) continue; \ + count++; + +#define RSL_FOREACH_BIN(ray, bin, count, index) \ + guint count = 0; \ + for (guint index = 0; index < ray->h.nbins; index++) { \ + Range bin = ray->range[index]; \ + count++; + +#define RSL_FOREACH_END } + #endif