// Simulate the tracing of a path with the accumulator void simulate(Accumulator &accum, const char **events, int testno) { accum.begin(); accum.pushState(); // for each ray stop in the path (see test cases) ... while (*events) { const char *e = *events; // for each label in this hit while (*e) { ustring sym(e, 1); // advance our state with the label accum.move(sym); e++; } // always finish the hit with a stop label accum.move(Labels::STOP); events++; } // Here is were we have reached a light, accumulate color accum.accum(Color3(1, 1, 1)); // Restore state and flush accum.popState(); accum.end((void *)(long int)testno); }