本文整理汇总了C++中BoundingBox::getLb方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::getLb方法的具体用法?C++ BoundingBox::getLb怎么用?C++ BoundingBox::getLb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::getLb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lb
TEST(BoundingBox, Intersection){
Point lb(1,2,0);
Point ub(2,4,0);
BoundingBox bb1(lb, ub);
BoundingBox bb2(lb, ub);
// Intersection should return an bounding box equal to bb2 and bb1,
// they are the same bb
BoundingBox bbIntersection = bb2.intersection(bb1);
EXPECT_TRUE( bbIntersection.getLb().getX() == bb2.getLb().getX() &&
bbIntersection.getLb().getY() == bb2.getLb().getY() &&
bbIntersection.getLb().getZ() == bb2.getLb().getZ());
EXPECT_TRUE( bbIntersection.getUb().getX() == bb2.getUb().getX() &&
bbIntersection.getUb().getY() == bb2.getUb().getY() &&
bbIntersection.getUb().getZ() == bb2.getUb().getZ());
Point lb3(2,3,0);
Point ub3(2,4,0);
BoundingBox bb3(lb3, ub3);
bbIntersection = bb2.intersection(bb3);
// lower bound is the value of of bb3
EXPECT_TRUE( bbIntersection.getLb().getX() == lb3.getX() &&
bbIntersection.getLb().getY() == lb3.getY() &&
bbIntersection.getLb().getZ() == lb3.getZ());
// upper bound should not change
EXPECT_TRUE( bbIntersection.getUb().getX() == bb2.getUb().getX() &&
bbIntersection.getUb().getY() == bb2.getUb().getY() &&
bbIntersection.getUb().getZ() == bb2.getUb().getZ());
}