本文整理汇总了C++中BBox::extendBy方法的典型用法代码示例。如果您正苦于以下问题:C++ BBox::extendBy方法的具体用法?C++ BBox::extendBy怎么用?C++ BBox::extendBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BBox
的用法示例。
在下文中一共展示了BBox::extendBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wsBounds
BBox SpherePrimitive::wsBounds(Geo::Geometry::CPtr geometry) const
{
assert(geometry != NULL);
assert(geometry->particles() != NULL);
if (!geometry->particles()) {
Log::warning("SpherePrimitive has no particles. "
"Skipping bounds generation.");
return BBox();
}
BBox wsBBox;
AttrVisitor visitor(geometry->particles()->pointAttrs(), m_params);
Attr<V3f> wsCenter("P");
Attr<float> radius("radius");
for (AttrVisitor::const_iterator i = visitor.begin(), end = visitor.end();
i != end; ++i) {
i.update(wsCenter);
i.update(radius);
wsBBox.extendBy(wsCenter.as<Vector>() + radius.as<Vector>());
wsBBox.extendBy(wsCenter.as<Vector>() - radius.as<Vector>());
}
return wsBBox;
}
示例2: wsBounds
BBox PointBase::wsBounds(Geo::Geometry::CPtr geometry) const
{
assert(geometry != NULL);
assert(geometry->particles() != NULL);
if (!geometry->particles()) {
Log::warning("Rasterization primitive has no particles. "
"Skipping bounds generation.");
return BBox();
}
BBox wsBBox;
AttrVisitor visitor(geometry->particles()->pointAttrs(), m_params);
for (AttrVisitor::const_iterator i = visitor.begin(), end = visitor.end();
i != end; ++i) {
BBox pointBounds = pointWsBounds(i);
wsBBox.extendBy(pointBounds);
}
return wsBBox;
}