ENH: Add findSphere to dynamicTreeDataPoint

This commit is contained in:
laurence
2012-02-03 14:33:11 +00:00
parent 10b019f618
commit 7ddba46e36
2 changed files with 29 additions and 0 deletions

View File

@ -75,6 +75,27 @@ bool Foam::dynamicTreeDataPoint::overlaps
}
// Check if any point on shape is inside sphere.
bool Foam::dynamicTreeDataPoint::overlaps
(
const label index,
const point& centre,
const scalar radiusSqr
) const
{
const point& p = points_[index];
const scalar distSqr = magSqr(p - centre);
if (distSqr <= radiusSqr)
{
return true;
}
return false;
}
// Calculate nearest point to sample. Updates (if any) nearestDistSqr, minIndex,
// nearestPoint.
void Foam::dynamicTreeDataPoint::findNearest