本文整理汇总了C++中treeBoundBox::calcExtremities方法的典型用法代码示例。如果您正苦于以下问题:C++ treeBoundBox::calcExtremities方法的具体用法?C++ treeBoundBox::calcExtremities怎么用?C++ treeBoundBox::calcExtremities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类treeBoundBox
的用法示例。
在下文中一共展示了treeBoundBox::calcExtremities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mag
bool Foam::octreeDataBoundBox::findTightest
(
const label index,
const point& sample,
treeBoundBox& tightest
) const
{
// Get furthest away vertex
point myNear, myFar;
allBb_[index].calcExtremities(sample, myNear, myFar);
const point dist = myFar - sample;
scalar myFarDist = mag(dist);
point tightestNear, tightestFar;
tightest.calcExtremities(sample, tightestNear, tightestFar);
scalar tightestFarDist = mag(tightestFar - sample);
if (tightestFarDist < myFarDist)
{
// Keep current tightest.
return false;
}
else
{
// Construct bb around sample and myFar
const point dist2(fabs(dist.x()), fabs(dist.y()), fabs(dist.z()));
tightest.min() = sample - dist2;
tightest.max() = sample + dist2;
return true;
}
}