aboutsummaryrefslogtreecommitdiff
path: root/src/reflections.c
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-09-05 00:17:20 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-09-05 00:17:20 +0000
commit33812018c1584e0ccdea764ae971c1dd82e7a5d3 (patch)
tree880aa959290333588223e59430acce60d13038a7 /src/reflections.c
parent0369b6427674594f3ad52f562f90a057c0cdbd7a (diff)
Visualise various things for debugging
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@116 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/reflections.c')
-rw-r--r--src/reflections.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/reflections.c b/src/reflections.c
index a1a8267..ba68baa 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -44,6 +44,37 @@ ReflectionContext *reflection_init() {
}
+void reflection_clear_markers(ReflectionContext *reflectionctx) {
+
+ Reflection *reflection = reflectionctx->reflections;
+ Reflection *prev = NULL;
+ int del = 0;
+
+ do {
+ Reflection *next = reflection->next;
+
+ if ( (reflection->type == REFLECTION_MARKER) || (reflection->type == REFLECTION_GENERATED)
+ || (reflection->type == REFLECTION_VECTOR_MARKER_1) || (reflection->type == REFLECTION_VECTOR_MARKER_2)
+ || (reflection->type == REFLECTION_VECTOR_MARKER_3) ) {
+ free(reflection);
+ del++;
+ if ( prev ) {
+ prev->next = next;
+ } else {
+ reflectionctx->reflections = next;
+ }
+ } else {
+ prev = reflection;
+ }
+
+ reflection = next;
+
+ } while ( reflection );
+
+ reflectionctx->n_reflections -= del;
+ reflectionctx->last_reflection = prev;
+
+}
void reflection_clear(ReflectionContext *reflectionctx) {
Reflection *reflection = reflectionctx->reflections;