]> Pileus Git - grits/blobdiff - src/plugins/radar.h
packaging fixes
[grits] / src / plugins / radar.h
index c4b74beab4c85b469a68638788b07f118fa4ad13..34a260752ab7e7b5c2d9bceef1e6a736bd6b8172 100644 (file)
@@ -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