本文介绍了Boost几何/空间查询形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用boost几何/空间索引库,以便对3d边界框执行范围查询。例如,我能够得到所有边界框的列表,它们与查询边界框重叠。

I am currently using the boost geometry/spatial index library, in order to perform range queries on 3d bounding boxes. For example I am able to get a list of all bounding boxes, that overlap a query bounding box.

文档()显示,至少在2d中 - 可以使用多边形代替边界框作为查询对象。是否可以在3d中使用更高级的查询形状?我正在考虑像定向包围盒,金字塔或相机平截头体这样的对象。

The documentation (http://www.boost.org/doc/libs/1_54_0_beta1/libs/geometry/doc/html/geometry/spatial_indexes/queries.html) shows, that -- at least in 2d -- polygons can be used instead of the bounding box as a query object. Is it possible to use more advanced query shapes in 3d as well? I am thinking of objects like oriented bounding boxes, pyramids, or camera frustums. If so: how can I do that/where can I find an example for that?

感谢

推荐答案

总之:不支持它,因为现在在Boost.Geometry OOB中,Pyramid和Frustum概念不可用/支持。

In short: it's not supported because for now in Boost.Geometry OOB, Pyramid and Frustum concepts are not available/supported.

,理论上应该可以执行这样的查询。在查询期间,bgi :: rtree调用在命名空间几何中定义的足够的布尔算法,例如。如果调用

But, theoretically it should be possible to perform such a query. During the query, the bgi::rtree calls adequate boolean algorithm defined in the namespace geometry, e.g. if you call

rtree.query(bgi::intersects(my_geometry), out_it);

内部

bg::intersects(xxx, my_geometry);

,其中xxx是节点的边界框或值的可索引(例如也是一个框)。所以如果你实现例如。

is called, where xxx is node's bounding box or value's indexable (e.g. also a box). So if you implemented e.g.

namespace boost { namespace geometry {

template <typename Box> inline
bool intersects(Box const& b, MyFrustum const& f)
{
    // your implementation
}

}}

理论上它应该工作。

此外,如果您想直接与开发人员联络,您可以考虑订阅Boost.Geometry邮寄清单:

Also if you'd like to contact the developers directly you might consider subscribing to the Boost.Geometry mailing list: http://lists.boost.org/mailman/listinfo.cgi/geometry

这篇关于Boost几何/空间查询形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 17:14