| 10 | TrueDistanceSelector::EdgeCache::EdgeCache() : absDistance(0) { } |
| 11 | |
| 12 | void TrueDistanceSelector::reset(const Point2 &p) { |
| 13 | double delta = DISTANCE_DELTA_FACTOR*(p-this->p).length(); |
| 14 | // Since minDistance.distance is initialized to -DBL_MAX, at first glance this seems like it could make it underflow to -infinity, but in practice delta would have to be extremely high for this to happen (above 9e291) |
| 15 | minDistance.distance += nonZeroSign(minDistance.distance)*delta; |
| 16 | this->p = p; |
| 17 | } |
| 18 | |
| 19 | void TrueDistanceSelector::addEdge(EdgeCache &cache, const EdgeSegment *prevEdge, const EdgeSegment *edge, const EdgeSegment *nextEdge) { |
| 20 | double delta = DISTANCE_DELTA_FACTOR*(p-cache.point).length(); |
no test coverage detected