10 namespace solverBoost {
14 auto sg_ret_ptr = sg_ret.get();
16 std::vector<collision::BoostPolygon *> candidate_polygons_boost;
18 for (
auto obj : sg_polys.
unpack()) {
21 candidate_polygons_boost.push_back(static_cast<collision::BoostPolygon *>(
23 ->getCollisionObject_boost()
26 throw std::invalid_argument(
27 "The shape group for the postprocessing of lane polygons can contain " 28 "only collision::Polygon objects");
32 collision::triangulation::TriangulationQuality qual;
34 qual.bb_only = !triangulate;
36 for (
auto boost_poly_ptr : candidate_polygons_boost) {
37 std::vector<collision::BoostPolygon> output;
39 boost_poly_ptr->extend(output, buf_width);
40 for (
auto poly : output) {
41 sg_ret_ptr->addToGroup(poly.toPolygon(qual));
44 sg_ret_ptr->addToGroup(boost_poly_ptr->toPolygon(qual));
std::vector< ShapeConstPtr > unpack() const
Returns Vector of all shapes contained inside the ShapeGroup.
ShapeGroup can contain simple shapes.
const BoostCollisionObject * get_boost_object_ptr(const CollisionObject *obj)
collision::ShapeGroupPtr lane_polygons_postprocess(collision::ShapeGroup &sg_polys, double buf_width, bool triangulate)
std::shared_ptr< ShapeGroup > ShapeGroupPtr
Polygon contains Triangles and Vertices.