...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Indicates the maximal corner (upper right) of a box to be get, set or processed
int const max_corner = 1;
Either
#include <boost/geometry.hpp>
Or
#include <boost/geometry/core/access.hpp>
Note | |
---|---|
min_corner and max_corner are only applicable for boxes and not for, e.g., a segment |
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. |
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