src/objects2d_to_objects3d/src/objects2d_to_objects3d.cpp
/** \brief Compute bounding rectangle for a non-empty polygon. */
\brief Compute bounding rectangle for a non-empty polygon.
\ brief Compute bounding rectangle for a non - empty polygon .
inline Rectangle computePolygonBoundingRect(const Polygon& polygon)
{
  Rectangle rec {
    polygon.points[0].x,
    polygon.points[0].x,
    polygon.points[0].y,
    polygon.points[0].y
  };
  for_each(polygon.points.begin(), polygon.points.end(),
           [&rec](const Point32& p){
           rec.x_min = min(rec.x_min, p.x);
           rec.x_max = max(rec.x_max, p.x);
           rec.y_min = min(rec.y_min, p.y);
           rec.y_max = max(rec.y_max, p.y);
           });
  return rec;
}
inline Rectangle computePolygonBoundingRect ( const Polygon & polygon ) { Rectangle rec { polygon . points [ 0 ] . x , polygon . points [ 0 ] . x , polygon . points [ 0 ] . y , polygon . points [ 0 ] . y } ; for_each ( polygon . points . begin ( ) , polygon . points . end ( ) , [ & rec ] ( const Point32 & p ) { rec . x_min = min ( rec . x_min , p . x ) ; rec . x_max = max ( rec . x_max , p . x ) ; rec . y_min = min ( rec . y_min , p . y ) ; rec . y_max = max ( rec . y_max , p . y ) ; } ) ; return rec ; }
\brief Compute bounding rectangle for a non-empty polygon.
\ brief Compute bounding rectangle for a non - empty polygon .