3dpcp/.svn/pristine/f0/f0ccf574ae04de76fcf34854dcab0455d973ea55.svn-base

23 lines
518 B
Text
Raw Normal View History

2012-09-16 12:33:11 +00:00
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;
}