Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

min_corner

Indicates the minimal corner (lower left) of a box to be get, set or processed

Synopsis

int const min_corner = 0;

Header

Either

#include <boost/geometry.hpp>

Or

#include <boost/geometry/core/access.hpp>

[Note] Note

min_corner and max_corner are only applicable for boxes and not for, e.g., a segment

[Note] Note

min_corner should be the minimal corner of a box, but that is not guaranteed. Use correct to make min_corner the minimal corner. The same applies for max_corner.

Example

Get the coordinate of a box

#include <iostream>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>

namespace bg = boost::geometry;

int main()
{
    bg::model::box<bg::model::d2::point_xy<double> > box;

    bg::assign_values(box, 1, 3, 5, 6);

    std::cout << "Box:"
        << " " << bg::get<bg::min_corner, 0>(box)
        << " " << bg::get<bg::min_corner, 1>(box)
        << " " << bg::get<bg::max_corner, 0>(box)
        << " " << bg::get<bg::max_corner, 1>(box)
        << std::endl;

    return 0;
}

Output:

Box: 1 3 5 6
See also

PrevUpHomeNext