You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
518 B
Plaintext

bool PointFilter::check(double* point)
{
// create a new checker chain
if(m_changed) {
createCheckers();
// mark as unchanged to avoid recreation on further calls
m_changed = false;
}
// apply all tests to the point
Checker* checker = m_checker;
while(checker) {
if(checker->test(point)) {
checker = checker->m_next;
} else {
// if even one test fails the point is discarded
return false;
}
}
// point has passed if all tests returned true
return true;
}