13 #include <boost/graph/graph_traits.hpp>
14 #include <boost/graph/properties.hpp>
34 template<
typename PropertyGraph,
39 const PropertyGraph &g,
41 typename boost::property_traits< PointMap >::value_type &min_aabb,
42 typename boost::property_traits< PointMap >::value_type &max_aabb,
43 const GeometryTraits >)
45 typedef typename boost::property_traits< PointMap >::value_type
Point;
49 auto vi = iterator_pair.first;
50 auto vi_end = iterator_pair.second;
54 min_aabb =
Point(gt.get_x(p), gt.get_y(p), gt.get_z(p));
55 max_aabb =
Point(gt.get_x(p), gt.get_y(p), gt.get_z(p));
57 for(; vi != vi_end; ++vi)
60 min_aabb =
Point(std::min(gt.get_x(p), gt.get_x(min_aabb)),
61 std::min(gt.get_y(p), gt.get_y(min_aabb)),
62 std::min(gt.get_z(p), gt.get_z(min_aabb)));
64 max_aabb =
Point(std::max(gt.get_x(p), gt.get_x(max_aabb)),
65 std::max(gt.get_y(p), gt.get_y(max_aabb)),
66 std::max(gt.get_z(p), gt.get_z(max_aabb)));