From 33812018c1584e0ccdea764ae971c1dd82e7a5d3 Mon Sep 17 00:00:00 2001 From: taw27 Date: Wed, 5 Sep 2007 00:17:20 +0000 Subject: Visualise various things for debugging git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@116 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/reflections.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/reflections.c') 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; -- cgit v1.2.3